summaryrefslogtreecommitdiff
path: root/npc/functions/ghost.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/ghost.txt')
-rw-r--r--npc/functions/ghost.txt14
1 files changed, 5 insertions, 9 deletions
diff --git a/npc/functions/ghost.txt b/npc/functions/ghost.txt
index 3e1a9724..4c3b825a 100644
--- a/npc/functions/ghost.txt
+++ b/npc/functions/ghost.txt
@@ -1,6 +1,6 @@
function script SpawnGhost {
if ($GHOSTS_DISABLED)
- goto L_Return;
+ return;
if (BaseLevel >= 40 &&
(getmapname() == "026-1" ||
@@ -22,15 +22,11 @@ L_Spawn:
else if (!(iscollision(getmapname(), .@x + 1, .@y))) set .@x, .@x + 1; // right
// else on the player
- // FIXME (Is this a valid event label??)
- if (@GHOST_MAP$ != "")
- killmonster @GHOST_MAP$, "~GH~" + getcharid(0);
+ // FIXME - verify if ghost GID is still alive, maybe add it an event label
+ if (@GHOST_GID)
+ unitkill(@GHOST_GID);
- @GHOST_MAP$ = getmapname();
specialeffect(39, SELF, getcharid(3));
- monster getmapname(), .@x, .@y, strcharinfo(0), 1136, 1, "~GH~" + getcharid(0);
- return;
-
-L_Return:
+ @GHOST_GID = monster(getmapname(), .@x, .@y, strcharinfo(0), LesserGhost, 1);
return;
}