summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-27 10:33:48 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-27 10:33:48 +0000
commit249b427c3ce9b90cbec7aa50e3b04100f3f95d1c (patch)
tree71372c22f4745fe8f6c9acc3f422dc5856e72c20 /src/map/battle.c
parent7047b7ca337bdeca6c8a24c58ee2abe0e840ccd9 (diff)
downloadhercules-249b427c3ce9b90cbec7aa50e3b04100f3f95d1c.tar.gz
hercules-249b427c3ce9b90cbec7aa50e3b04100f3f95d1c.tar.bz2
hercules-249b427c3ce9b90cbec7aa50e3b04100f3f95d1c.tar.xz
hercules-249b427c3ce9b90cbec7aa50e3b04100f3f95d1c.zip
* Moved guardian hostility checking and monster_ignore_gm check to battle.c
* Fixed the 'show_mob_hp' option not updating when a monster is healed git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1306 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 9caa111b2..9e8f6b578 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3785,10 +3785,33 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
return -1;
}
}
- // Mobでmaster_idがあってspecial_mob_aiなら、召喚主を求める
+
if( src->type==BL_MOB ){
struct mob_data *md=(struct mob_data *)src;
- if(md && md->master_id>0){
+ nullpo_retr (-1, md);
+
+ if(target->type == BL_PC) {
+ struct map_session_data *sd = (struct map_session_data *)target;
+ nullpo_retr (-1, sd);
+
+ if(md->class_ >= 1285 && md->class_ <= 1287){
+ struct guild_castle *gc = guild_mapname2gc (map[target->m].name);
+ if(gc && agit_flag==0) // Guardians will not attack during non-woe time [Valaris]
+ return 1; // end addition [Valaris]
+ if(gc && sd->status.guild_id > 0) {
+ struct guild *g=guild_search(sd->status.guild_id); // don't attack guild members [Valaris]
+ if(g && g->guild_id == gc->guild_id)
+ return 1;
+ if(g && guild_isallied(g,gc))
+ return 1;
+ }
+ }
+ // option to have monsters ignore GMs [Valaris]
+ if (battle_config.monsters_ignore_gm > 0 && pc_isGM(sd) >= battle_config.monsters_ignore_gm)
+ return 1;
+ }
+ // Mobでmaster_idがあってspecial_mob_aiなら、召喚主を求める
+ if(md->master_id>0){
if(md->master_id==target->id) // 主なら肯定
return 1;
if(md->state.special_mob_ai){