summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-06-23 01:09:30 -0300
committerJesusaves <cpntb1@ymail.com>2020-06-23 01:09:30 -0300
commitc287943f22b294bb074411ae3e3d04ce02726841 (patch)
tree8c93db35addd1761a24e92a7a7be9131c3f27379 /npc/functions
parent9701df54795ff74f23391a259edb29196d0fbd4f (diff)
downloadserverdata-c287943f22b294bb074411ae3e3d04ce02726841.tar.gz
serverdata-c287943f22b294bb074411ae3e3d04ce02726841.tar.bz2
serverdata-c287943f22b294bb074411ae3e3d04ce02726841.tar.xz
serverdata-c287943f22b294bb074411ae3e3d04ce02726841.zip
Fix a few tiny bugs
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/filters.txt20
-rw-r--r--npc/functions/mobpoint.txt9
2 files changed, 17 insertions, 12 deletions
diff --git a/npc/functions/filters.txt b/npc/functions/filters.txt
index f47c16beb..945ab8bce 100644
--- a/npc/functions/filters.txt
+++ b/npc/functions/filters.txt
@@ -64,37 +64,35 @@ function script filter_sameguildorpartynotyou {
// filter_hostile( id )
function script filter_hostile {
- debugmes "filter_hostile %d", getarg(0);
- .@type=getunitdata(getarg(0), UDT_TYPE);
+ //.@type=getunitdata(getarg(0), UDT_TYPE);
+ .@type=getunittype(getarg(0));
.@chkid=getarg(0);
- debugmes "filter_hostile: Checking %d (BL %d)", getarg(0), .@type;
-
// Monsters
- if (.@type == BL_MOB)
+ if (.@type == UNITTYPE_MOB)
return true;
// NPCs
- if (.@type == BL_NPC)
+ if (.@type == UNITTYPE_NPC)
return false;
// Homunculus
- if (.@type == BL_HOM)
+ if (.@type == UNITTYPE_HOM)
.@chkid=charid2rid(getunitdata(getarg(0), UDT_MASTERCID));
// Pets
- if (.@type == BL_PET)
+ if (.@type == UNITTYPE_PET)
.@chkid=getunitdata(getarg(0), UDT_MASTERAID);
// Mercenaries
- if (.@type == BL_MER)
+ if (.@type == UNITTYPE_MER)
.@chkid=charid2rid(getunitdata(getarg(0), UDT_MASTERCID));
// Elementals
- if (.@type == BL_ELEM)
+ if (.@type == UNITTYPE_ELEM)
.@chkid=charid2rid(getunitdata(getarg(0), UDT_MASTERCID));
- debugmes "filter_hostile: Filtering %d (original %d) (BL %d)", .@chkid, getarg(0), .@type;
+ //debugmes "filter_hostile: Filtering %d (original %d) (BL %d)", .@chkid, getarg(0), .@type;
// Players (and slaves)
return !(filter_sameguildorparty(.@chkid));
}
diff --git a/npc/functions/mobpoint.txt b/npc/functions/mobpoint.txt
index b069dbe27..49d742298 100644
--- a/npc/functions/mobpoint.txt
+++ b/npc/functions/mobpoint.txt
@@ -13,7 +13,8 @@ function script fix_mobkill {
function script mobpoint {
if (!MPQUEST)
return;
- //if (killedrid < 1002) goto L_Return;
+ if (!killedrid) // A bug!
+ return;
.@moblv=strmobinfo(3,killedrid);
// You get MobLv + 20% as MobPoints.
@@ -62,6 +63,10 @@ OnNPCKillEvent:
JobExp-=1;
}
+ // killedrid was not set, so we skip
+ if (!killedrid)
+ return;
+
// call functions
callfunc "mobpoint";
callfunc "mobhunter";
@@ -71,6 +76,8 @@ OnNPCKillEvent:
callfunc "Guardhouse_RandQuestCheck";
callfunc "AuroraMobkill";
+ // Unset killedrid. This affects multiple calls of this function
+ // But it is in overall more reliable imao
killedrid=0;
end;