diff options
Diffstat (limited to 'npc/functions')
-rw-r--r-- | npc/functions/banker.txt | 17 | ||||
-rw-r--r-- | npc/functions/ghost.txt | 36 | ||||
-rw-r--r-- | npc/functions/global_event_handler.txt | 1 | ||||
-rw-r--r-- | npc/functions/main.txt | 3 | ||||
-rw-r--r-- | npc/functions/miriam.txt | 17 | ||||
-rw-r--r-- | npc/functions/travelers.txt | 8 |
6 files changed, 75 insertions, 7 deletions
diff --git a/npc/functions/banker.txt b/npc/functions/banker.txt index 254b4822..4bfe9f9a 100644 --- a/npc/functions/banker.txt +++ b/npc/functions/banker.txt @@ -210,9 +210,26 @@ L_Balance: mes "[" + @npcname$ + "]"; mes "\"Your current bank balance is:"; mes #BankAccount + " GP\""; + if (!(#BankOptions & OPT_BANK_CLOSE) || (#BankAccount >= 10000000 && + BaseLevel >= 85 && !(#BankOptions & OPT_BANK_GOTSHADE))) next; + if (#BankAccount >= 10000000 && BaseLevel >= 85 && !(#BankOptions & OPT_BANK_GOTSHADE)) + goto L_GiveShade; if (#BankOptions & OPT_BANK_CLOSE) goto L_Return; goto L_Start; +L_GiveShade: + mes "\"Oh\""; + next; + mes "\"It seems you managed to amass quite a fortune!\""; + next; + mes "\"Thank you for using our services. Please accept this little gift.\""; + #BankOptions = #BankOptions | OPT_BANK_GOTSHADE; + getitem "CashiersShade", 1; + if (#BankOptions & OPT_BANK_CLOSE) goto L_Return; + next; + npcaction 9; // clear npc dialog + goto L_Start; + L_Nev: mes "[" + @npcname$ + "]"; mes "\"Goodbye then.\""; diff --git a/npc/functions/ghost.txt b/npc/functions/ghost.txt new file mode 100644 index 00000000..1325525b --- /dev/null +++ b/npc/functions/ghost.txt @@ -0,0 +1,36 @@ +function script SpawnGhost { + if ($GHOSTS_DISABLED) + goto L_Return; + + if (BaseLevel >= 40 && + (getmapname() == "026-1" || + getmapname() == "027-1" || + getmapname() == "027-2" || + getmapname() == "027-3" || + getmapname() == "027-4" || + getmapname() == "027-5")) + goto L_Spawn; + return; + +L_Spawn: + .@x = POS_X; + .@y = POS_Y; + + if (!(iscollision(getmapname(), .@x, .@y - 1))) set .@y, .@y - 1; // up + else if (!(iscollision(getmapname(), .@x, .@y + 1))) set .@y, .@y + 1; // down + else if (!(iscollision(getmapname(), .@x - 1, .@y))) set .@x, .@x - 1; // left + 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); + + @GHOST_MAP$ = getmapname(); + specialeffect(39, SELF, getcharid(3)); + monster getmapname(), .@x, .@y, strcharinfo(0), 1136, 1, "~GH~" + getcharid(0); + return; + +L_Return: + return; +} diff --git a/npc/functions/global_event_handler.txt b/npc/functions/global_event_handler.txt index 8e1116dc..33723786 100644 --- a/npc/functions/global_event_handler.txt +++ b/npc/functions/global_event_handler.txt @@ -22,6 +22,7 @@ OnMobKillEvent: OnPCDieEvent: @necromancer = 0; + callfunc "SpawnGhost"; set @killerrid, 0; // reset killer rid end; diff --git a/npc/functions/main.txt b/npc/functions/main.txt index 1bc4c37b..450d7a39 100644 --- a/npc/functions/main.txt +++ b/npc/functions/main.txt @@ -507,6 +507,9 @@ function script destroy { function script npcaction { debugmes "Deprecated unitaction (did you mean npcsit; or whatever?)"; + .@a=getarg(0, 0); + if (.@a == 9) + clear; return; } diff --git a/npc/functions/miriam.txt b/npc/functions/miriam.txt new file mode 100644 index 00000000..e59b736b --- /dev/null +++ b/npc/functions/miriam.txt @@ -0,0 +1,17 @@ +function script MiriamGoal { + if (QUEST_MIRIAM_run > 0) + QUEST_MIRIAM_run = 0 - (gettimetick(2) - QUEST_MIRIAM_run); + return; +} + +function script MiriamExpire { + if (QUEST_MIRIAM_run > 0) + set QUEST_MIRIAM_run, 0 - 2; // force failute (expired) + return; +} + +function script MiriamCheat { + if (QUEST_MIRIAM_run > 0) + set QUEST_MIRIAM_run, 0 - 1; // force failure (cheating) + return; +} diff --git a/npc/functions/travelers.txt b/npc/functions/travelers.txt index d7bd7ba7..e76d2130 100644 --- a/npc/functions/travelers.txt +++ b/npc/functions/travelers.txt @@ -172,13 +172,7 @@ L_TravelPachua: @NextLocationMap$ = "006-1"; @NextLocationX = 28; @NextLocationY = 97; - if(QUEST_MIRIAM_start != 0) goto L_Cheat; - goto L_TravelChecks; - -L_Cheat: - QUEST_MIRIAM_cheat = 1; - QUEST_MIRIAM_run = gettimetick(2) - QUEST_MIRIAM_start; - QUEST_MIRIAM_start = 0; + callfunc "MiriamCheat"; goto L_TravelChecks; L_TravelBarbarians: |