summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/fishing.txt3
-rw-r--r--npc/functions/global_event_handler.txt56
-rw-r--r--npc/functions/skills.txt13
-rw-r--r--npc/functions/spotlight.txt14
4 files changed, 72 insertions, 14 deletions
diff --git a/npc/functions/fishing.txt b/npc/functions/fishing.txt
index dcf4ac02..fee0acb7 100644
--- a/npc/functions/fishing.txt
+++ b/npc/functions/fishing.txt
@@ -44,8 +44,7 @@ OnBite:
OnCleanUp:
dispbottom l("You waited too long and lost the bait...");
specialeffect(getvariableofnpc(.failure_fx, @fishing_spot$), SELF, playerattached()); // event fail
-OnPCLogoutEvent:
- fishing_cleanup @fishing_spot$;
+ fishing_cleanup(@fishing_spot$);
@fishing_spot$ = ""; // unbind fishing npc
end;
}
diff --git a/npc/functions/global_event_handler.txt b/npc/functions/global_event_handler.txt
new file mode 100644
index 00000000..70bf6bbb
--- /dev/null
+++ b/npc/functions/global_event_handler.txt
@@ -0,0 +1,56 @@
+// The Mana World scripts.
+// Author:
+// The Mana World Team
+// Description:
+// Controls most, if not all, global events on this server.
+// Please only use callfunc("") here; This script is loaded
+// early on and direct function assignment will cause fails.
+// TODO: Move "new quest" notification here. (Or deprecate)
+
+// Helper function for scripted Monster Kills.
+function script fix_mobkill {
+ killedrid=getarg(0);
+ doevent "#GlobalHandler::OnNPCKillEvent";
+ return;
+}
+
+- script #GlobalHandler NPC_HIDDEN,{
+ end;
+
+
+OnPCLoginEvent:
+ callfunc("updateSpotlight");
+ callfunc("ReceiveMOTD");
+ callfunc("ReceiveScheduledBroadcast");
+ callfunc("FixBankVault");
+ callfunc("GrantSuperSkill");
+ end;
+
+OnPCLogoutEvent:
+ callfunc("UnequipCookie");
+ callfunc("MundaneLogout");
+ callfunc("fishing_cleanup", @fishing_spot$);
+
+ // Variable cleanup
+ @fishing_spot$ = "";
+ end;
+
+OnPCDieEvent:
+ callfunc("ForcedUnmount");
+ callfunc("MundaneDeath");
+ end;
+
+OnPCBaseLvUpEvent:
+ //callfunc("newquestwarning");
+ end;
+
+OnNPCKillEvent:
+ callfunc("EnoraKills");
+ end;
+
+OnSkillInvoke:
+ callfunc("SkillInvoked");
+ end;
+
+}
+
diff --git a/npc/functions/skills.txt b/npc/functions/skills.txt
new file mode 100644
index 00000000..568c97d9
--- /dev/null
+++ b/npc/functions/skills.txt
@@ -0,0 +1,13 @@
+// The Mana World scripts.
+// Author:
+// The Mana World Team
+// Description:
+// Controls script-based skills (which are rare);
+
+function script SkillInvoked {
+ // Record to database that you used the skill
+ skillInvoke[@skillId] = skillInvoke[@skillId] + 1;
+
+ return;
+}
+
diff --git a/npc/functions/spotlight.txt b/npc/functions/spotlight.txt
index c4fb9c6b..11ca565a 100644
--- a/npc/functions/spotlight.txt
+++ b/npc/functions/spotlight.txt
@@ -17,26 +17,17 @@ function script updateSpotlight {
// It will be cast twice when switching caves. This sleep prevents obscure bugs.
sleep2(80);
- // Maps which this system
- setarray .@mapz$,
- "001-3-0", "001-3-1", "001-3-2",
- "008-3-0", "008-3-1", "008-4-1";
-
getmapxy(.@m$, .@x, .@y, 0);
- //debugmes "Begin";
// Is your map valid (or is the check skipped)
- /*
if (!getarg(0,false))
{
- if (array_find(.@mapz$, .@m$) < 0)
+ if (strpos(getmapname(), "-3-") < 0)
return;
}
- */
// Retrieve default map masks
.@ms=getmapmask(.@m$);
- //debugmes "Default: %d", .@ms;
// Which equipments provide bonuses?
setarray .@b_head, CandleHelmet;
@@ -60,7 +51,6 @@ function script updateSpotlight {
// Calculate and send new map mask
.@ms=.@ms|(2**.@score);
sendmapmask(.@ms);
- //debugmes "Data sent: %d", .@ms;
return;
}
@@ -68,7 +58,7 @@ function script updateSpotlight {
// Every NPC will be duplicating this one
001-3-0,0,0,0 script #SpotlightMaster NPC_HIDDEN,0,0,{
OnTouch:
- updateSpotlight();
+ updateSpotlight(true);
end;
}