summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-03 17:15:09 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-03 17:15:09 +0000
commit9d73a996d9edba1da1f36461f3838d5571a781a3 (patch)
treee6475b9724879a8375e46a1269611b004b4eaf3c /src/map
parentd214e16b4875f2be40c817f609d940a6ff5ef088 (diff)
downloadhercules-9d73a996d9edba1da1f36461f3838d5571a781a3.tar.gz
hercules-9d73a996d9edba1da1f36461f3838d5571a781a3.tar.bz2
hercules-9d73a996d9edba1da1f36461f3838d5571a781a3.tar.xz
hercules-9d73a996d9edba1da1f36461f3838d5571a781a3.zip
- Added event 8 for mobspawns that should spawn with special ai set.
- Modified battle_check_target so that mobs with special ai's default enemy are mobs with no special ai. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5448 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c6
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/npc.c4
-rw-r--r--src/map/skill.c2
4 files changed, 9 insertions, 5 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index f985f69f2..f1d03c062 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3387,8 +3387,10 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
state |= BCT_PARTY; //Normal mobs with no ai are friends.
else
state |= BCT_ENEMY; //However, all else are enemies.
- } else if (t_bl->type != BL_PC)
- state |= BCT_ENEMY; //Natural enemy for AI mobs are nonplayers.
+ } else {
+ if (t_bl->type == BL_MOB && !((struct mob_data*)t_bl)->special_state.ai)
+ state |= BCT_ENEMY; //Natural enemy for AI mobs are normal mobs.
+ }
if (md->master_id && (s_bl = map_id2bl(md->master_id)) == NULL)
s_bl = &md->bl; //Fallback on the mob itself, otherwise consider this a "from master" scenario.
break;
diff --git a/src/map/clif.c b/src/map/clif.c
index 227e42049..376f15c6d 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -3449,7 +3449,7 @@ int clif_arrow_create_list(struct map_session_data *sd)
nullpo_retr(0, sd);
fd = sd->fd;
- WFIFOHEAD(fd, MAX_SKILL_ARROW_DB*2+4);
+ WFIFOHEAD(fd, MAX_SKILL_ARROW_DB*2+4);
WFIFOW(fd,0) = 0x1ad;
for (i = 0, c = 0; i < MAX_SKILL_ARROW_DB; i++) {
diff --git a/src/map/npc.c b/src/map/npc.c
index c511c8de4..3c3967762 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -2313,12 +2313,14 @@ int npc_parse_mob2 (struct mob_list *mob, int cached)
if (strlen(mob->eventname) >= 4) {
memcpy(md->npc_event, mob->eventname, NAME_LENGTH-1);
- } else if (strlen(mob->eventname) == 1) { //Portable monster big/small implementation. [Skotlex]
+ } else if (strlen(mob->eventname) <= 2) { //Portable monster big/small implementation. [Skotlex]
int size = atoi(mob->eventname);
if (size & 2)
md->special_state.size=1;
else if (size & 4)
md->special_state.size=2;
+ if (size & 8)
+ md->special_state.ai=1;
}
md->bl.type = BL_MOB;
diff --git a/src/map/skill.c b/src/map/skill.c
index e552eb657..1d536b8ed 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5118,7 +5118,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
}
if(su->group->unit_id == UNT_ANKLESNARE && su->group->val2){
struct block_list *target=map_id2bl(su->group->val2);
- if(target && (target->type == BL_PC || target->type == BL_MOB))
+ if(target)
status_change_end(target,SC_ANKLE,-1);
}
skill_delunit(su);