summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-11-07 00:25:17 -0300
committerJesusaves <cpntb1@ymail.com>2022-11-07 00:25:17 -0300
commit1ce45e518bec34cbefe1efa56b776a08ba4e68be (patch)
treecc8c080c7c9bada782d0ff6531cdc684e0549d00
parent5c65874cc82bc7e33b86cad89619470bb40073be (diff)
downloadserverdata-1ce45e518bec34cbefe1efa56b776a08ba4e68be.tar.gz
serverdata-1ce45e518bec34cbefe1efa56b776a08ba4e68be.tar.bz2
serverdata-1ce45e518bec34cbefe1efa56b776a08ba4e68be.tar.xz
serverdata-1ce45e518bec34cbefe1efa56b776a08ba4e68be.zip
Some minor changes to make sure dead people will run only the correct timers
-rw-r--r--npc/003-0-1/professor.txt1
-rw-r--r--npc/017-10/airship.txt1
-rw-r--r--npc/commands/event.txt2
-rw-r--r--npc/commands/python.txt3
-rw-r--r--npc/commands/welcome.txt1
-rw-r--r--npc/functions/fishing.txt1
-rw-r--r--npc/functions/timer.txt40
7 files changed, 41 insertions, 8 deletions
diff --git a/npc/003-0-1/professor.txt b/npc/003-0-1/professor.txt
index dff4fa9aa..025b11568 100644
--- a/npc/003-0-1/professor.txt
+++ b/npc/003-0-1/professor.txt
@@ -47,6 +47,7 @@ OnTimer3100:
end;
OnSpeeching:
+ if (ispcdead()) end;
deltimer(.name$+"::OnSpeeching"); // safeguard
// Max AFK time is determined as 30 minutes + 1 second every 10 minutes AFKed
// Capped at 2 hours (you've AFK'ed 37 days and 12 hours - 900 hours)
diff --git a/npc/017-10/airship.txt b/npc/017-10/airship.txt
index 48851f47e..f4ef4fd1c 100644
--- a/npc/017-10/airship.txt
+++ b/npc/017-10/airship.txt
@@ -46,6 +46,7 @@ OnNotif:
OnWarper:
removespecialeffect(FX_CIRCLE, SELF, getcharid(3));
+ if (ispcdead()) end;
if (getmap() != "017-10")
end;
if (!FORT_1ST_VISIT)
diff --git a/npc/commands/event.txt b/npc/commands/event.txt
index 8b1dc023c..504ca4e50 100644
--- a/npc/commands/event.txt
+++ b/npc/commands/event.txt
@@ -426,7 +426,7 @@ OnEffect:
dispbottom l("You must not be using mana to do this trip.");
atcommand "@refresh";
end;
- } else if (readparam(Hp) < @toeventval1) {
+ } else if (readparam(Hp) < @toeventval1 || ispcdead()) {
dispbottom l("You cannot be fighting to do this trip.");
atcommand "@refresh";
end;
diff --git a/npc/commands/python.txt b/npc/commands/python.txt
index 5273731c3..81753b368 100644
--- a/npc/commands/python.txt
+++ b/npc/commands/python.txt
@@ -9,7 +9,7 @@
OnCall:
specialeffect(34, AREA, playerattached());
- .@zone$=getmapinfo(MAPINFO_ZONE, .@mapa$);
+ .@zone$=getmapinfo(MAPINFO_ZONE, getmap());
if (.@zone$ == "MMO")
end;
sc_start SC_CASH_DEATHPENALTY, 1000, 1;
@@ -17,6 +17,7 @@ OnCall:
end;
OnKill:
+ if (ispcdead()) end;
percentheal -100, -100;
//dispbottom l("Oh look, it is Cupid!");
end;
diff --git a/npc/commands/welcome.txt b/npc/commands/welcome.txt
index 00304472d..a49e5c6a8 100644
--- a/npc/commands/welcome.txt
+++ b/npc/commands/welcome.txt
@@ -20,6 +20,7 @@ OnCall:
OnEffect:
@toeventchk=0;
removespecialeffect(FX_CIRCLE, SELF, getcharid(3));
+ if (ispcdead()) end;
// Reversions (warp back)
// Not in Candor: Resave your @welcome reversion snippet
if (getmap() != "005-1") {
diff --git a/npc/functions/fishing.txt b/npc/functions/fishing.txt
index 103784c5e..bac766f98 100644
--- a/npc/functions/fishing.txt
+++ b/npc/functions/fishing.txt
@@ -35,6 +35,7 @@ function script fishing_cleanup {
end;
OnBite:
+ if (ispcdead()) end;
if (getnpcdir(@fishing_spot$) != UP)
end;
diff --git a/npc/functions/timer.txt b/npc/functions/timer.txt
index ee96b2191..79a33a851 100644
--- a/npc/functions/timer.txt
+++ b/npc/functions/timer.txt
@@ -1,10 +1,15 @@
// Evol Script
// Authors: Gumi, Jesusalva
-// areatimer("<map>", <x1>, <y1>, <x2>, <y2>, <tick>, "<npc>::<event>")
+// areatimer("<map>", <x1>, <y1>, <x2>, <y2>, <tick>, "<npc>::<event>", dead=False)
function script areatimer {
.@c = getunits(BL_PC, .@players, false, getarg(0), getarg(1), getarg(2), getarg(3), getarg(4));
for (.@i = 0; .@i < .@c; .@i++) {
+ if (!getarg(7, false)) {
+ if (ispcdead(strcharinfo(0, "", .@players[.@i]))) {
+ continue;
+ }
+ }
addtimer(getarg(5), getarg(6), .@players[.@i]);
}
return .@i;
@@ -19,39 +24,57 @@ function script areadeltimer {
return .@i;
}
-// areatimer2("<map>", <x1>, <y1>, <x2>, <y2>, <tick>, "<npc>::<event>")
+// areatimer2("<map>", <x1>, <y1>, <x2>, <y2>, <tick>, "<npc>::<event>", dead=False)
function script areatimer2 {
.@c = getunits(BL_PC, .@players, false, getarg(0), getarg(1), getarg(2), getarg(3), getarg(4));
for (.@i = 0; .@i < .@c; .@i++) {
deltimer(getarg(6), .@players[.@i]);
+ if (!getarg(7, false)) {
+ if (ispcdead(strcharinfo(0, "", .@players[.@i]))) {
+ continue;
+ }
+ }
addtimer(getarg(5), getarg(6), .@players[.@i]);
}
return .@i;
}
-// addtimer2(<tick>, "<npc>::<event>")
+// addtimer2(<tick>, "<npc>::<event>", dead=False)
function script addtimer2 {
deltimer(getarg(1));
+ if (!getarg(2, false)) {
+ if (ispcdead()) return;
+ }
addtimer(getarg(0), getarg(1));
return;
}
-// maptimer("<map>", <tick>, "<npc>::<event>")
+// maptimer("<map>", <tick>, "<npc>::<event>", dead=False)
function script maptimer {
.@c = getunits(BL_PC, .@players, false, getarg(0));
for (.@i = 0; .@i < .@c; .@i++) {
+ if (!getarg(3, false)) {
+ if (ispcdead(strcharinfo(0, "", .@players[.@i]))) {
+ continue;
+ }
+ }
addtimer(getarg(1), getarg(2), .@players[.@i]);
}
return .@i;
}
// Same as maptimer() but deletes any previously running timer
-// maptimer2("<map>", <tick>, "<npc>::<event>")
+// maptimer2("<map>", <tick>, "<npc>::<event>", dead=False)
function script maptimer2 {
.@c = getunits(BL_PC, .@players, false, getarg(0));
for (.@i = 0; .@i < .@c; .@i++) {
deltimer(getarg(2), .@players[.@i]);
+ if (!getarg(3, false)) {
+ if (ispcdead(strcharinfo(0, "", .@players[.@i]))) {
+ continue;
+ }
+ }
addtimer(getarg(1), getarg(2), .@players[.@i]);
}
return .@i;
@@ -66,10 +89,15 @@ function script mapdeltimer {
return .@i;
}
-// partytimer("<map>", <tick>, "<npc>::<event>", partyid)
+// partytimer("<map>", <tick>, "<npc>::<event>", partyid, dead=False)
function script partytimer {
.@c = getunits(BL_PC, .@players, false, getarg(0));
for (.@i = 0; .@i < .@c; .@i++) {
+ if (!getarg(4, false)) {
+ if (ispcdead(strcharinfo(0, "", .@players[.@i]))) {
+ continue;
+ }
+ }
if (getcharid(1, strcharinfo(0,"",.@players[.@i]) ) == getarg(3))
addtimer(getarg(1), getarg(2), .@players[.@i]);
}