Selaa lähdekoodia

* Fixed pets derived from immobile monsters not being able to walk (bugreport:3377, since r13789).
- This also fixes pets using original monster walk speed, instead of the one defined in pet db.
- Fixed pets not being able to attack (pet_attack_support and pet_damage_support) when derived from a monster, which is not able to attack.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14512 54d463be-8e91-2dee-dedb-b68131a5f0ec

ai4rei 14 vuotta sitten
vanhempi
commit
97f148678c
3 muutettua tiedostoa jossa 14 lisäystä ja 1 poistoa
  1. 4 0
      Changelog-Trunk.txt
  2. 1 0
      doc/mob_db_mode_list.txt
  3. 9 1
      src/map/status.c

+ 4 - 0
Changelog-Trunk.txt

@@ -1,5 +1,9 @@
 Date	Added
 
+2010/11/28
+	* Fixed pets derived from immobile monsters not being able to walk (bugreport:3377, since r13789). [Ai4rei]
+	- This also fixes pets using original monster walk speed, instead of the one defined in pet db.
+	- Fixed pets not being able to attack (pet_attack_support and pet_damage_support) when derived from a monster, which is not able to attack.
 2010/11/27
 	* Fixed a crash uncovered with r14501, caused by outdated local variables when a script is about to suspend or terminate (bugreport:4577). [Ai4rei]
 	* Fixed a crash when using food status bonuses with cash food status bonuses (bugreport:4582, since r14437). [Ai4rei]

+ 1 - 0
doc/mob_db_mode_list.txt

@@ -104,6 +104,7 @@ Aegis/eA (description)
 19: 0x3095 (aggro, change-target melee/chase, cast sensor idle)
 20: 0x3295 (aggro, change-target melee/chase, cast sensor idle/chase)
 21: 0x3695 (aggro, change-target melee/chase, cast sensor idle/chase, chase-change target)
+25: 0x0001 (passive, can't attack) [Pet]
 26: 0xB695 (aggro, change-target melee/chase, cast sensor idle/chase, chase-change target, random target)
 27: 0x8084 (aggro, immobile, random target)
 

+ 9 - 1
src/map/status.c

@@ -1546,8 +1546,13 @@ int status_calc_pet_(struct pet_data *pd, bool first)
 
 	if (first) {
 		memcpy(&pd->status, &pd->db->status, sizeof(struct status_data));
-		pd->status.mode|= MD_CANMOVE; //so they can chase their master!
+		pd->status.mode = MD_CANMOVE; // pets discard all modes, except walking
 		pd->status.speed = pd->petDB->speed;
+
+		if(battle_config.pet_attack_support || battle_config.pet_damage_support)
+		{// attack support requires the pet to be able to attack
+			pd->status.mode|= MD_CANATTACK;
+		}
 	}
 
 	if (battle_config.pet_lv_rate && pd->msd)
@@ -3091,6 +3096,9 @@ void status_calc_bl_(struct block_list* bl, enum scb_flag flag, bool first)
 		}
 	}
 
+	if( bl->type == BL_PET )
+		return; // pets are not affected by statuses
+
 	if( first && bl->type == BL_MOB )
 		return; // assume there will be no statuses active