diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/atcommand.c | 28 | ||||
-rw-r--r-- | src/map/battle.c | 6 | ||||
-rw-r--r-- | src/map/elemental.c | 10 | ||||
-rw-r--r-- | src/map/elemental.h | 3 | ||||
-rw-r--r-- | src/map/homunculus.c | 2 | ||||
-rw-r--r-- | src/map/homunculus.h | 2 | ||||
-rw-r--r-- | src/map/mail.c | 1 | ||||
-rw-r--r-- | src/map/mercenary.c | 10 | ||||
-rw-r--r-- | src/map/mercenary.h | 3 | ||||
-rw-r--r-- | src/map/mob.h | 2 | ||||
-rw-r--r-- | src/map/skill.c | 4 | ||||
-rw-r--r-- | src/map/status.c | 10 |
12 files changed, 25 insertions, 56 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 45f14be6f..b7b59940e 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -2179,12 +2179,11 @@ static int atkillmonster_sub(struct block_list *bl, va_list ap) return 1; } -void atcommand_killmonster_sub(const int fd, struct map_session_data* sd, const char* message, const int drop) +ACMD_FUNC(killmonster) { - int map_id; + int map_id, drop_flag; char map_name[MAP_NAME_LENGTH_EXT]; - - if (!sd) return; + nullpo_retr(-1, sd); memset(map_name, '\0', sizeof(map_name)); @@ -2194,26 +2193,13 @@ void atcommand_killmonster_sub(const int fd, struct map_session_data* sd, const if ((map_id = map_mapname2mapid(map_name)) < 0) map_id = sd->bl.m; } + + drop_flag = strcmp(command+1, "killmonster2"); - map_foreachinmap(atkillmonster_sub, map_id, BL_MOB, drop); + map_foreachinmap(atkillmonster_sub, map_id, BL_MOB, -drop_flag); clif_displaymessage(fd, msg_txt(165)); // All monsters killed! - return; -} - -ACMD_FUNC(killmonster) -{ - atcommand_killmonster_sub(fd, sd, message, 1); - return 0; -} - -/*========================================== - * - *------------------------------------------*/ -ACMD_FUNC(killmonster2) -{ - atcommand_killmonster_sub(fd, sd, message, 0); return 0; } @@ -8866,7 +8852,7 @@ void atcommand_basecommands(void) { ACMD_DEF2("monstersmall", monster), ACMD_DEF2("monsterbig", monster), ACMD_DEF(killmonster), - ACMD_DEF(killmonster2), + ACMD_DEF2("killmonster2", killmonster), ACMD_DEF(refine), ACMD_DEF(produce), ACMD_DEF(memo), diff --git a/src/map/battle.c b/src/map/battle.c index 47f18e881..18aadf0ac 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -5230,8 +5230,10 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f if( !md->special_state.ai ) { //Normal mobs - if( (target->type == BL_MOB && t_bl->type == BL_PC && ((TBL_MOB*)target)->special_state.ai < 4) || - ( t_bl->type == BL_MOB && !((TBL_MOB*)t_bl)->special_state.ai ) ) + if( + ( target->type == BL_MOB && t_bl->type == BL_PC && ( ((TBL_MOB*)target)->special_state.ai != 4 && ((TBL_MOB*)target)->special_state.ai != 1 ) ) || + ( t_bl->type == BL_MOB && !((TBL_MOB*)t_bl)->special_state.ai ) + ) state |= BCT_PARTY; //Normal mobs with no ai are friends. else state |= BCT_ENEMY; //However, all else are enemies. diff --git a/src/map/elemental.c b/src/map/elemental.c index 3abab157f..1157e851e 100644 --- a/src/map/elemental.c +++ b/src/map/elemental.c @@ -457,13 +457,6 @@ int elemental_change_mode(struct elemental_data *ed, int mode) { return 1; } -void elemental_damage(struct elemental_data *ed, int hp, int sp) { - if( hp ) - clif_elemental_updatestatus(ed->master, SP_HP); - if( sp ) - clif_elemental_updatestatus(ed->master, SP_SP); -} - void elemental_heal(struct elemental_data *ed, int hp, int sp) { if( hp ) clif_elemental_updatestatus(ed->master, SP_HP); @@ -471,7 +464,7 @@ void elemental_heal(struct elemental_data *ed, int hp, int sp) { clif_elemental_updatestatus(ed->master, SP_SP); } -int elemental_dead(struct elemental_data *ed, struct block_list *src) { +int elemental_dead(struct elemental_data *ed) { elemental_delete(ed, 1); return 0; } @@ -645,7 +638,6 @@ static int elemental_ai_sub_foreachclient(struct map_session_data *sd, va_list a static int elemental_ai_timer(int tid, unsigned int tick, int id, intptr_t data) { map_foreachpc(elemental_ai_sub_foreachclient,tick); - return 0; } diff --git a/src/map/elemental.h b/src/map/elemental.h index 124c7ff83..698cf6fb9 100644 --- a/src/map/elemental.h +++ b/src/map/elemental.h @@ -67,9 +67,8 @@ int elemental_save(struct elemental_data *ed); int elemental_change_mode_ack(struct elemental_data *ed, int mode); int elemental_change_mode(struct elemental_data *ed, int mode); -void elemental_damage(struct elemental_data *ed, int hp, int sp); void elemental_heal(struct elemental_data *ed, int hp, int sp); -int elemental_dead(struct elemental_data *ed, struct block_list *src); +int elemental_dead(struct elemental_data *ed); int elemental_delete(struct elemental_data *ed, int reply); void elemental_summon_stop(struct elemental_data *ed); diff --git a/src/map/homunculus.c b/src/map/homunculus.c index 46da045a4..081e7078e 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -85,7 +85,7 @@ void merc_damage(struct homun_data *hd) { clif_hominfo(hd->master,hd,0); } -int merc_hom_dead(struct homun_data *hd, struct block_list *src) +int merc_hom_dead(struct homun_data *hd) { //There's no intimacy penalties on death (from Tharis) struct map_session_data *sd = hd->master; diff --git a/src/map/homunculus.h b/src/map/homunculus.h index 3470cd5f5..7ad9268b2 100644 --- a/src/map/homunculus.h +++ b/src/map/homunculus.h @@ -80,7 +80,7 @@ int merc_hom_recv_data(int account_id, struct s_homunculus *sh, int flag); //alb struct view_data* merc_get_hom_viewdata(int class_); int hom_class2mapid(int hom_class); void merc_damage(struct homun_data *hd); -int merc_hom_dead(struct homun_data *hd, struct block_list *src); +int merc_hom_dead(struct homun_data *hd); void merc_hom_skillup(struct homun_data *hd,int skillnum); int merc_hom_calc_skilltree(struct homun_data *hd); int merc_hom_checkskill(struct homun_data *hd,int skill_id); diff --git a/src/map/mail.c b/src/map/mail.c index ce099d0a1..70c73c0a4 100644 --- a/src/map/mail.c +++ b/src/map/mail.c @@ -20,7 +20,6 @@ void mail_clear(struct map_session_data *sd) sd->mail.index = 0; sd->mail.amount = 0; sd->mail.zeny = 0; - sd->auction.amount = 0; return; } diff --git a/src/map/mercenary.c b/src/map/mercenary.c index 45e8e04ce..832cc835b 100644 --- a/src/map/mercenary.c +++ b/src/map/mercenary.c @@ -344,14 +344,6 @@ int merc_data_received(struct s_mercenary *merc, bool flag) return 1; } -void mercenary_damage(struct mercenary_data *md, int hp, int sp) -{ - if( hp ) - clif_mercenary_updatestatus(md->master, SP_HP); - if( sp ) - clif_mercenary_updatestatus(md->master, SP_SP); -} - void mercenary_heal(struct mercenary_data *md, int hp, int sp) { if( hp ) @@ -360,7 +352,7 @@ void mercenary_heal(struct mercenary_data *md, int hp, int sp) clif_mercenary_updatestatus(md->master, SP_SP); } -int mercenary_dead(struct mercenary_data *md, struct block_list *src) +int mercenary_dead(struct mercenary_data *md) { merc_delete(md, 1); return 0; diff --git a/src/map/mercenary.h b/src/map/mercenary.h index 340ab1462..014bd8937 100644 --- a/src/map/mercenary.h +++ b/src/map/mercenary.h @@ -56,9 +56,8 @@ int merc_create(struct map_session_data *sd, int class_, unsigned int lifetime); int merc_data_received(struct s_mercenary *merc, bool flag); int mercenary_save(struct mercenary_data *md); -void mercenary_damage(struct mercenary_data *md, int hp, int sp); void mercenary_heal(struct mercenary_data *md, int hp, int sp); -int mercenary_dead(struct mercenary_data *md, struct block_list *src); +int mercenary_dead(struct mercenary_data *md); int merc_delete(struct mercenary_data *md, int reply); void merc_contract_stop(struct mercenary_data *md); diff --git a/src/map/mob.h b/src/map/mob.h index 797d2484b..d45962163 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -121,7 +121,7 @@ struct mob_data { char name[NAME_LENGTH]; struct { unsigned int size : 2; //Small/Big monsters. - unsigned int ai : 3; //Special ai for summoned monsters. + unsigned int ai : 4; //Special ai for summoned monsters. //0: Normal mob. //1: Standard summon, attacks mobs. //2: Alchemist Marine Sphere diff --git a/src/map/skill.c b/src/map/skill.c index 86516e337..7dcfa2552 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -11902,8 +11902,8 @@ static int skill_unit_effect (struct block_list* bl, va_list ap) skill_id = group->skill_id; //Target-type check. - if( !(group->bl_flag&bl->type && battle_check_target(&unit->bl,bl,group->target_flag)>0) && (flag&4) ) { - if( group->state.song_dance&0x1 || (group->src_id == bl->id && group->state.song_dance&0x2) ) + if( !(group->bl_flag&bl->type && battle_check_target(&unit->bl,bl,group->target_flag)>0) ) { + if( flag&4 && ((group->src_id == bl->id && group->state.song_dance&0x2) || skill_get_inf2(skill_id)&INF2_SONG_DANCE) ) skill_unit_onleft(skill_id, bl, tick);//Ensemble check to terminate it. } else { if( flag&1 ) diff --git a/src/map/status.c b/src/map/status.c index eff787956..e097dcdb1 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1224,8 +1224,8 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s case BL_PC: pc_damage((TBL_PC*)target,src,hp,sp); break; case BL_MOB: mob_damage((TBL_MOB*)target, src, hp); break; case BL_HOM: merc_damage((TBL_HOM*)target); break; - case BL_MER: mercenary_damage((TBL_MER*)target,hp,sp); break; - case BL_ELEM: elemental_damage((TBL_ELEM*)target,hp,sp); break; + case BL_MER: mercenary_heal((TBL_MER*)target,hp,sp); break; + case BL_ELEM: elemental_heal((TBL_ELEM*)target,hp,sp); break; } if( src && target->type == BL_PC && ((TBL_PC*)target)->disguise ) {// stop walking when attacked in disguise to prevent walk-delay bug @@ -1248,9 +1248,9 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s switch (target->type) { case BL_PC: flag = pc_dead((TBL_PC*)target,src); break; case BL_MOB: flag = mob_dead((TBL_MOB*)target, src, flag&4?3:0); break; - case BL_HOM: flag = merc_hom_dead((TBL_HOM*)target,src); break; - case BL_MER: flag = mercenary_dead((TBL_MER*)target,src); break; - case BL_ELEM: flag = elemental_dead((TBL_ELEM*)target,src); break; + case BL_HOM: flag = merc_hom_dead((TBL_HOM*)target); break; + case BL_MER: flag = mercenary_dead((TBL_MER*)target); break; + case BL_ELEM: flag = elemental_dead((TBL_ELEM*)target); break; default: //Unhandled case, do nothing to object. flag = 0; break; |