Jump to content

Pink Buddha

  • Posts

  • Joined

  • Last visited

Profile Information

Pink Buddha's Achievements


Newbie (1/14)

  • Week One Done Rare
  • One Month Later Rare
  • One Year In Rare

Recent Badges



  1. @Patskie thank you for the reply. I was testing out things and most of the time I dont have any idea how to optimize the things I made. It really helped. Thank you.
  2. Fix and modified based on this forum post:
  3. After a week of trial and mostly errors, and trying to optimize the code. I could say I was finally happy with these results. This is my take on creating a healing/regenerative fountain on main towns, and since I haven't dabbled in map editing yet I decided to create an NPC Goddess and a Bard instead. Currently I only added this feature on Payon. What I want is, If there are other ways I could optimize the code, i.e. variable types and usage, redundant code blocks or such, I am open to any opinions and criticism. It's been a week since I started relearning coding so I'd be happy if I could have your opinions and such. // Goddess NPC and Bard NPC(on the leftside) should have atleast 3 cells difference in x-axis and with the same y-axis for the regen area to exactly merge payon,131,232,4 script Goddess Elia 624,{ OnInit: callfunc "regenHigh"; } payon,128,232,4 script Bard Mikhael 647,{ OnInit: callfunc "regenLow"; } function script regenLow { getmapxy( .mapn$, .mapx, .mapy, BL_NPC, strnpcinfo(0)); set .hrange, 20; freeloop(1); while (1) { specialeffect 793; if (getareaunits(BL_PC, .mapn$, (.mapx-.hrange+3), (.mapy-.hrange), (.mapx+.hrange+3), (.mapy+.hrange)) >=1) { areapercentheal .mapn$ , (.mapx-.hrange+3), (.mapy-.hrange), (.mapx+.hrange+3), (.mapy+.hrange), 1, 1; addrid(4, 0, (.mapx-.hrange+3), (.mapy-.hrange), (.mapx+.hrange+3), (.mapy+.hrange)); if ( Hp > 0 ) { if (Hp != MaxHp) { specialeffect2 793; } } detachrid; } sleep 1600; } end; freeloop(0); } function script regenHigh { getmapxy( .mapn$, .mapx, .mapy, BL_NPC, strnpcinfo(0)); set .hrange, 20; freeloop(1); while (1) { specialeffect 514; specialeffect 796; specialeffect 800; if (getareaunits(BL_PC, .mapn$, (.mapx-.hrange), (.mapy-.hrange), (.mapx+.hrange), (.mapy+.hrange)) >=1) { areapercentheal .mapn$ , (.mapx-.hrange), (.mapy-.hrange), (.mapx+.hrange), (.mapy+.hrange), 8, 8; addrid(4, 0, (.mapx-.hrange), (.mapy-.hrange), (.mapx+.hrange), (.mapy+.hrange)); if ( Hp > 0 ) { if (Hp != MaxHp) { specialeffect2 572; } } detachrid; } sleep 20000; } end; freeloop(0); } // specialeffect 408; // <- overkill effect // specialeffect2 332; // <- it had an audio // specialeffect2 310; // <- green bubbles // specialeffect2 800; // <- Red Pillar What it does: It heals players that are not dead near the NPCs. For two different ticks, one being every 1.6s and the other being every 20 seconds. I thought it is a good alternative to Healer NPC for lowrate servers(as I plan to make a Healer which is count based that resets daily, and you need to pay if counter is 0). I'm just gonna add it in a few main towns to encourage player interaction. Features I plan to add to this is that the NPCs will take up donations(zeny or etc items) to increase the healing rate per second, or probably reduced the tick rate of healing. (yay, more variables that I'm having trouble on what to use best, based on what situations) The donations can come from multiple players and stacks accordingly. The increased healing rate or tick rate only persists on the donated NPC, and not on all the fountains( goddess duplicates in my case) server wide. This increase would probably last for a whole day. Another is to add a healing constant(I'm planning on changing the renewal health formula, average players at max level would probably have 400k health), the lower health you have, the lesser the time it needs for you to heal fully. It would be nice if you guys could give me your opinions on where should I go from here.
  4. @Haruka Mayumi im just currently learning the workaround of git and tortoise svn, and I managed to the add the line of codes of this patch (foreach.diff) without errors(im not 100% sure) by just simply adding them to the source. Now with my limited knowledge of scripting/codes. Im curious as to what data does this foreach returns? Im trying to implement/use foreachinarea to heal a group of players centered around the npc(hence im using the foreachinarea) every x amount of seconds. Note that this group of players changes every x seconds. This uses an infinite loop yet I dont know how to implement the foreachinarea inside the infinite loop.
  5. i applied the diff file without knowing the consequences if its outdated or not. Is there a way to fix this?
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.