summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-18 13:25:21 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-18 13:25:21 +0000
commitff6317b65b37c6439076afd810193baf893b3611 (patch)
tree90117e8581813a31fd9ffefa858fc1a0543debe0 /src/map/unit.c
parent625630e64fe10dd9d46b87c742efbf47bff497da (diff)
downloadhercules-ff6317b65b37c6439076afd810193baf893b3611.tar.gz
hercules-ff6317b65b37c6439076afd810193baf893b3611.tar.bz2
hercules-ff6317b65b37c6439076afd810193baf893b3611.tar.xz
hercules-ff6317b65b37c6439076afd810193baf893b3611.zip
- Added a proper check to make aggressive mobs never override homun targets regardless of distance.
- Removed a bunch of homun-related variables that are not needed at all. The alive condition is removed, now the code checks for the hp value to know if the homun is alive or not. - Cleaned up a bit the skill-id function, homun skill checks (such as delay and skill-lv learned) should be correct now. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7727 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 9dd7b33fc..bf2091ff6 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -102,7 +102,6 @@ static int unit_walktoxy_timer(int tid,unsigned int tick,int id,int data)
struct block_list *bl;
struct map_session_data *sd = NULL;
struct mob_data *md = NULL;
- struct homun_data *hd = NULL; //[orn]
struct unit_data *ud = NULL;
bl=map_id2bl(id);
@@ -112,8 +111,6 @@ static int unit_walktoxy_timer(int tid,unsigned int tick,int id,int data)
ud = &sd->ud;
} else if( BL_CAST( BL_MOB, bl, md ) ) {
ud = &md->ud;
- } else if( BL_CAST( BL_HOMUNCULUS, bl, hd ) ) { //[orn]
- ud = &hd->ud;
} else
ud = unit_bl2ud(bl);
@@ -715,7 +712,6 @@ int unit_skilluse_id2(struct block_list *src, int target_id, int skill_num, int
struct status_data *tstatus;
struct status_change *sc;
struct map_session_data *sd = NULL;
- struct homun_data *hd = NULL; //[orn]
struct block_list * target = NULL;
unsigned int tick = gettick();
int temp;
@@ -726,8 +722,6 @@ int unit_skilluse_id2(struct block_list *src, int target_id, int skill_num, int
if( BL_CAST( BL_PC, src, sd ) ) {
ud = &sd->ud;
- } else if( BL_CAST( BL_HOMUNCULUS, src, hd ) ) { //[orn]
- ud = &hd->ud;
} else
ud = unit_bl2ud(src);
@@ -770,6 +764,15 @@ int unit_skilluse_id2(struct block_list *src, int target_id, int skill_num, int
return 0;
}
break;
+ //TODO: here we should place and correct skills that should target homun automatically. However some work still needs be done as "dead homuns" are deleted from memory, and as such, you can't really target them. [Skotlex]
+ case AM_REST:
+// case AM_RESURRECTHOMUN:
+ target = sd->hd;
+ if (!target) {
+ clif_skill_fail(sd,skill_num,0,0);
+ return 0;
+ }
+ break;
}
if (target)
target_id = target->id;
@@ -1195,7 +1198,6 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int t
struct status_data *sstatus;
struct map_session_data *sd = NULL;
struct mob_data *md = NULL;
- struct homun_data *hd = NULL; //[orn]
int range;
if((ud=unit_bl2ud(src))==NULL)
@@ -1207,7 +1209,6 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int t
}
BL_CAST( BL_PC , src, sd);
BL_CAST( BL_MOB, src, md);
- BL_CAST( BL_HOMUNCULUS, src, hd); //[orn]
ud->attacktimer=-1;
target=map_id2bl(ud->target);