diff options
author | gumi <git@gumi.ca> | 2018-02-17 11:56:12 -0500 |
---|---|---|
committer | gumi <git@gumi.ca> | 2018-02-17 11:56:12 -0500 |
commit | dc55c5f61922628494c2698abac0719fec7aa9f4 (patch) | |
tree | a84299053023833a0e6b9df14c544f4c6b8866dc | |
parent | 8ca42e79e5f117546cb9197c0c673f44bf3e47da (diff) | |
download | serverdata-dc55c5f61922628494c2698abac0719fec7aa9f4.tar.gz serverdata-dc55c5f61922628494c2698abac0719fec7aa9f4.tar.bz2 serverdata-dc55c5f61922628494c2698abac0719fec7aa9f4.tar.xz serverdata-dc55c5f61922628494c2698abac0719fec7aa9f4.zip |
spawn a ghost when players die in the graveyard
-rw-r--r-- | world/map/npc/functions/ghost.txt | 26 | ||||
-rw-r--r-- | world/map/npc/functions/global_event_handler.txt | 1 | ||||
-rw-r--r-- | world/map/npc/scripts.conf | 1 |
3 files changed, 28 insertions, 0 deletions
diff --git a/world/map/npc/functions/ghost.txt b/world/map/npc/functions/ghost.txt new file mode 100644 index 00000000..1439d543 --- /dev/null +++ b/world/map/npc/functions/ghost.txt @@ -0,0 +1,26 @@ +function|script|SpawnGhost +{ + if (BaseLevel >= 40 && + (getmap() == "026-1" || + getmap() == "027-1")) + goto L_Spawn; + return; + +L_Spawn: + set .@x, POS_X; + set .@y, POS_Y; + + if (!(iscollision(getmap(), .@x, .@y - 1))) set .@y, .@y - 1; // up + elif (!(iscollision(getmap(), .@x, .@y + 1))) set .@y, .@y + 1; // down + elif (!(iscollision(getmap(), .@x - 1, .@y))) set .@x, .@x - 1; // left + elif (!(iscollision(getmap(), .@x + 1, .@y))) set .@x, .@x + 1; // right + // else on the player + + if (@GHOST_MAP$ != "") + killmonster @GHOST_MAP$, "~GH~" + getcharid(0); + + set @GHOST_MAP$, getmap(); + specialeffect2 39; + monster getmap(), .@x, .@y, strcharinfo(0), 1125, 1, "~GH~" + getcharid(0); + return; +} diff --git a/world/map/npc/functions/global_event_handler.txt b/world/map/npc/functions/global_event_handler.txt index 610fc42b..9e0b495d 100644 --- a/world/map/npc/functions/global_event_handler.txt +++ b/world/map/npc/functions/global_event_handler.txt @@ -29,6 +29,7 @@ OnMobKillEvent: OnPCDieEvent: set @necromancer, 0; addtimer 0, "Magic Timer::OnClear"; // reset magic block on death + callfunc "SpawnGhost"; set @killerrid, 0; // reset killer rid end; diff --git a/world/map/npc/scripts.conf b/world/map/npc/scripts.conf index 25fba83b..ba48049d 100644 --- a/world/map/npc/scripts.conf +++ b/world/map/npc/scripts.conf @@ -29,6 +29,7 @@ npc: npc/functions/dynamic_menu.txt npc: npc/functions/DyeConfig.txt npc: npc/functions/motd.txt npc: npc/functions/motdconfig.txt +npc: npc/functions/ghost.txt // Item Functions npc: npc/items/purification_potion.txt |