summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-08 16:17:30 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-08 16:17:30 +0000
commit7c8e1245438b395d5742b936372fb55e3150b53c (patch)
treef7bb1598c829f199fba3240632c88af2aacc4ff5 /src/map/mob.c
parentab522d194a3ee70758bab2113d2b34f34706f24f (diff)
downloadhercules-7c8e1245438b395d5742b936372fb55e3150b53c.tar.gz
hercules-7c8e1245438b395d5742b936372fb55e3150b53c.tar.bz2
hercules-7c8e1245438b395d5742b936372fb55e3150b53c.tar.xz
hercules-7c8e1245438b395d5742b936372fb55e3150b53c.zip
- Moved the duel functions to pc.c since they are so totally out of place in atcommand.c
- Fixed Spider Web not ending when hit by a fireelemental attack. - Cast-time reductions from status changes will not be executed until right before casting, to prevent status changes from ending when attempting to cast and the attempt fails (invalid cells, not enough sp, wrong target, etc, etc) - Added check to prevent Wand of Hermod from seeking for a partner to encore, since the partner is supposed to be the warp. - Moved the duel auto-reject on logout from map_quit to unit_free - Corrected the mob spawn reading code so that the event-name can be up to 50 characters long (which is the actual event length) and so that it can read spaces within them, it will also strip the leading/trailing quotes if you use them so that the event is actually found on mob-death (so you can do stuff like "My NPC::OnDead" as a valid event). - Moved the homunc inherit speed from the master from status_calc_pc to LoadEndAck, since the hom's speed matches that of the master each time the master changes maps. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9173 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index f19bd292b..ae742b617 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -159,20 +159,28 @@ int mob_parse_dataset(struct spawn_data *data) {
return 0;
//better safe than sorry, current md->npc_event has a size of 50
- if (strlen(data->eventname) >= 50)
+ if ((i=strlen(data->eventname)) >= 50)
return 0;
- if (data->eventname[0] && strlen(data->eventname) <= 2)
- { //Portable monster big/small implementation. [Skotlex]
- i = atoi(data->eventname);
- if (i) {
- if (i&2)
- data->state.size=1;
- else if (i&4)
- data->state.size=2;
- if (i&8)
- data->state.ai=1;
- data->eventname[0] = '\0'; //Clear event as it is not used.
+ if (data->eventname[0])
+ {
+ if(i <= 2)
+ { //Portable monster big/small implementation. [Skotlex]
+ i = atoi(data->eventname);
+ if (i) {
+ if (i&2)
+ data->state.size=1;
+ else if (i&4)
+ data->state.size=2;
+ if (i&8)
+ data->state.ai=1;
+ data->eventname[0] = '\0'; //Clear event as it is not used.
+ }
+ } else {
+ if (data->eventname[i-1] == '"');
+ data->eventname[i-1] = '\0'; //Remove trailing quote.
+ if (data->eventname[0] == '"') //Strip leading quotes
+ memmove(data->eventname, data->eventname+1, i-1);
}
}
if (!data->level)
@@ -2784,7 +2792,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event)
}
md->skillidx = i;
flag = unit_skilluse_pos2(&md->bl, x, y, ms[i].skill_id, ms[i].skill_lv,
- skill_castfix_sc(&md->bl, ms[i].casttime), ms[i].cancel);
+ ms[i].casttime, ms[i].cancel);
if (!flag) md->skillidx = -1; //Skill failed.
return flag;
} else {
@@ -2814,7 +2822,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event)
}
md->skillidx = i;
flag = (bl && unit_skilluse_id2(&md->bl, bl->id, ms[i].skill_id, ms[i].skill_lv,
- skill_castfix_sc(&md->bl,ms[i].casttime), ms[i].cancel));
+ ms[i].casttime, ms[i].cancel));
if (!flag) md->skillidx = -1;
return flag;
} else {