feat(Core/Unit): New helpers for UnitFlag and UnitFlag2 (#11227)

This commit is contained in:
Kitzunu
2022-03-30 12:59:42 +02:00
committed by GitHub
parent 54c06eb72e
commit 856aed6fc6
243 changed files with 1205 additions and 1191 deletions

View File

@@ -2414,7 +2414,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
summon->SelectLevel(); // some summoned creaters have different from 1 DB data for level/hp
summon->SetUInt32Value(UNIT_NPC_FLAGS, summon->GetCreatureTemplate()->npcflag);
summon->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
summon->ReplaceAllUnitFlags(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
summon->SetReactState(REACT_PASSIVE);
// Xinef: Pet can have some auras in creature_addon or in scripts, do not remove them instantly
@@ -4894,7 +4894,7 @@ void Spell::EffectSkinning(SpellEffIndex /*effIndex*/)
uint32 skill = creature->GetCreatureTemplate()->GetRequiredLootSkill();
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
creature->RemoveUnitFlag(UNIT_FLAG_SKINNABLE);
creature->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
m_caster->ToPlayer()->SendLoot(creature->GetGUID(), LOOT_SKINNING);
@@ -5246,7 +5246,7 @@ void Spell::EffectResurrectPet(SpellEffIndex /*effIndex*/)
pet->NearTeleportTo(x, y, z, player->GetOrientation());
pet->Relocate(x, y, z, player->GetOrientation()); // This is needed so SaveStayPosition() will get the proper coords.
pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE);
pet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
pet->RemoveUnitFlag(UNIT_FLAG_SKINNABLE);
pet->setDeathState(ALIVE);
pet->ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~(UNIT_STATE_POSSESSED))); // xinef: just in case
pet->SetHealth(pet->CountPctFromMaxHealth(damage));