summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-24 15:31:28 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-24 15:31:28 +0000
commit85fdcfa5c7831dc87a2b6810b3e2ebd5e3ec49c7 (patch)
tree3954f54f4adce21db6566710b1b02555b4d241a3 /src/map/mob.c
parent0e67259ca839671dac06dd804d6867ebe33df74a (diff)
downloadhercules-85fdcfa5c7831dc87a2b6810b3e2ebd5e3ec49c7.tar.gz
hercules-85fdcfa5c7831dc87a2b6810b3e2ebd5e3ec49c7.tar.bz2
hercules-85fdcfa5c7831dc87a2b6810b3e2ebd5e3ec49c7.tar.xz
hercules-85fdcfa5c7831dc87a2b6810b3e2ebd5e3ec49c7.zip
* Added 'map_charid2id'
* Changed monster damage logging to save char ID's * Implemented 'event_script_type' * Set Emsolute Develop as a learnable skill * Updated 'require_glory_guild' * Allow monsters to cast skills near themselves even when monster_nofootset is set to 'yes' * Print number of online users in online.txt/.html even if there's only 1 user git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1282 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index cae0eddf3..002a37fb7 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2248,7 +2248,8 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
if(!(type&2)) {
if(sd!=NULL){
for(i=0,minpos=0,mindmg=0x7fffffff;i<DAMAGELOG_SIZE;i++){
- if(md->dmglog[i].id==sd->bl.id)
+ //if(md->dmglog[i].id==sd->bl.id)
+ if(md->dmglog[i].id==sd->status.char_id)
break;
if(md->dmglog[i].id==0){
minpos=i;
@@ -2262,7 +2263,8 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
if(i<DAMAGELOG_SIZE)
md->dmglog[i].dmg+=damage;
else {
- md->dmglog[minpos].id=sd->bl.id;
+ //md->dmglog[minpos].id=sd->bl.id;
+ md->dmglog[minpos].id=sd->status.char_id;
md->dmglog[minpos].dmg=damage;
}
@@ -2273,7 +2275,8 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
struct pet_data *pd = (struct pet_data *)src;
nullpo_retr(0, pd);
for(i=0,minpos=0,mindmg=0x7fffffff;i<DAMAGELOG_SIZE;i++){
- if(md->dmglog[i].id==pd->msd->bl.id)
+ //if(md->dmglog[i].id==pd->msd->bl.id)
+ if(md->dmglog[i].id==pd->msd->status.char_id)
break;
if(md->dmglog[i].id==0){
minpos=i;
@@ -2287,7 +2290,8 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
if(i<DAMAGELOG_SIZE)
md->dmglog[i].dmg+=(damage*battle_config.pet_attack_exp_rate)/100;
else {
- md->dmglog[minpos].id=pd->msd->bl.id;
+ //md->dmglog[minpos].id=pd->msd->bl.id;
+ md->dmglog[minpos].id=pd->msd->status.char_id;
md->dmglog[minpos].dmg=(damage*battle_config.pet_attack_exp_rate)/100;
}
}
@@ -2454,7 +2458,12 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
for(i=0,count=0,mvp_damage=0;i<DAMAGELOG_SIZE;i++){
if(md->dmglog[i].id==0)
continue;
- tmpsd[i] = map_id2sd(md->dmglog[i].id);
+ // Will this slow things down too much?
+ tmpsd[i] = map_charid2sd(md->dmglog[i].id);
+ // try finding again
+ if(tmpsd[i] == NULL)
+ tmpsd[i] = map_id2sd(md->dmglog[i].id);
+ // if we still can't find the player
if(tmpsd[i] == NULL)
continue;
count++;
@@ -3289,13 +3298,13 @@ int mobskill_castend_pos( int tid, unsigned int tick, int id,int data )
}
if (!battle_config.monster_skill_reiteration &&
- skill_get_unit_flag(md->skillid)&UF_NOREITERATION &&
- skill_check_unit_range(md->bl.m,md->skillx,md->skilly,md->skillid,md->skilllv))
+ skill_get_unit_flag (md->skillid) & UF_NOREITERATION &&
+ skill_check_unit_range (md->bl.m, md->skillx, md->skilly, md->skillid, md->skilllv))
return 0;
if(battle_config.monster_skill_nofootset &&
- skill_get_unit_flag(md->skillid)&UF_NOFOOTSET &&
- skill_check_unit_range2(md->bl.m,md->skillx,md->skilly,md->skillid,md->skilllv))
+ skill_get_unit_flag (md->skillid) & UF_NOFOOTSET &&
+ skill_check_unit_range2(&md->bl, md->bl.m, md->skillx, md->skilly, md->skillid, md->skilllv))
return 0;