diff options
author | gumi <mekolat@users.noreply.github.com> | 2017-04-13 13:02:59 -0400 |
---|---|---|
committer | Micksha <Micksha@users.noreply.github.com> | 2018-11-05 21:34:37 +0100 |
commit | 7330d282726f62cdb63dcca5b49c4607cbbdc199 (patch) | |
tree | 8d46ba4a0a43f08403ad8456c60ff22b16dac189 /npc/placeholder/soul-menhir.txt | |
parent | e34d012804b9a10283c3b2ced98c73542833a731 (diff) | |
download | serverdata-7330d282726f62cdb63dcca5b49c4607cbbdc199.tar.gz serverdata-7330d282726f62cdb63dcca5b49c4607cbbdc199.tar.bz2 serverdata-7330d282726f62cdb63dcca5b49c4607cbbdc199.tar.xz serverdata-7330d282726f62cdb63dcca5b49c4607cbbdc199.zip |
Hurnscald mega-commit
Diffstat (limited to 'npc/placeholder/soul-menhir.txt')
-rw-r--r-- | npc/placeholder/soul-menhir.txt | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/npc/placeholder/soul-menhir.txt b/npc/placeholder/soul-menhir.txt new file mode 100644 index 00000000..0b2d177d --- /dev/null +++ b/npc/placeholder/soul-menhir.txt @@ -0,0 +1,58 @@ +// Evol scripts. +// Author: +// gumi +// Description: +// place of power, mana refills faster when sitting nearby + +008-1,253,112,0 script Soul Menhir#hurnscald NPC_HUMAN_M_ARTIS,{ + + end; + +OnRefill: + @menhir_lock = false; + getmapxy(.@map$, .@x, .@y, UNITTYPE_PC); + + if (.@map$ != .map$ || distance(.x, .y, .@x, .@y) > .refill_distance || + !(issit())) + end; + + heal(0, .refill_rate); + end; + + +OnTimer500: + .@count = getunits(BL_PC, .@units[0], false, .map$, (.x - .refill_distance), + (.y - .refill_distance), (.x + .refill_distance), (.y + .refill_distance)); + + for (.@i = 0; .@i < .@count; ++.@i) + { + if (.@units[.@i] < 0) continue; // pre-check, just in case + deltimer(.name$ + "::OnRefill", .@units[.@i]); + if (gettimer(TIMER_COUNT, .@units[.@i], .name$ + "::OnRefill") > 0 || + getvariableofpc(@menhir_lock, .@units[.@i])) { + continue; + } + set(getvariableofpc(@menhir_lock, .@units[.@i]), true); + addtimer(rand(.refill_timer), .name$ + "::OnRefill", .@units[.@i]); + } + + initnpctimer(); + end; + +OnInit: + + .refill_rate = 1; // number of SP to give every refill + .refill_distance = 7; // max distance + .refill_timer = 200; // wait rand(X) ms before refill + initnpctimer(); + +////////// UNFINISHED ////////// +//////////////////////////////// +// REMOVE THIS CODE WHEN THIS // +// NPC IS NO LONGER A WIP ////// +//////////////////////////////// +if (!debug) disablenpc(.name$); +///////// UNFINISHED /////////// + + end; +} |