diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index b3a1c9ad1..b1e85d522 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -1489,13 +1489,12 @@ void Creature::SetDeathState(DeathState s) if (s == JUST_ALIVED) { + CreatureInfo const *cinfo = GetCreatureInfo(); + SetHealth(GetMaxHealth()); SetLootRecipient(NULL); - CreatureInfo const *cinfo = GetCreatureInfo(); - SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); - RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); + AddSplineFlag(SPLINEFLAG_WALKMODE); - SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); if (GetTemporaryFactionFlags() & TEMPFACTION_RESTORE_RESPAWN) ClearTemporaryFaction(); @@ -1504,8 +1503,18 @@ void Creature::SetDeathState(DeathState s) clearUnitState(UNIT_STAT_ALL_STATE); i_motionMaster.Clear(); + SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool)); + + // Dynamic flags may be adjusted by spells. Clear them + // first and let spell from *addon apply where needed. + SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE); LoadCreatureAddon(true); + + // Flags after LoadCreatureAddon. Any spell in *addon + // will not be able to adjust these. + SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); + RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); } } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 982af317a..8569b7bde 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11355" + #define REVISION_NR "11356" #endif // __REVISION_NR_H__