Skip to content

Commit

Permalink
Implement UNIT_FLAG2_HIDE_BODY and use it for DK death zone
Browse files Browse the repository at this point in the history
For both this and previous, TC is credited with the unitflag name
Closes cmangos/issues#808
  • Loading branch information
killerwife committed Feb 7, 2022
1 parent e1d10db commit 248374d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
(56835,'spell_death_rune_dk'),
(50452,'spell_bloodworm'),
(50453,'spell_health_leech_passive'),
(51052,'spell_anti_magic_zone'),
(55090,'spell_scourge_strike'),
(55265,'spell_scourge_strike'),
(55270,'spell_scourge_strike'),
Expand Down
2 changes: 1 addition & 1 deletion src/game/Entities/Totem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ bool Totem::Create(uint32 guidlow, CreatureCreatePos& cPos, CreatureInfo const*
return false;

// special model selection case for totems
if (owner->GetTypeId() == TYPEID_PLAYER)
if (owner->GetTypeId() == TYPEID_PLAYER && owner->getClass() != CLASS_DEATH_KNIGHT)
if (uint32 modelid_race = sObjectMgr.GetModelForRace(GetNativeDisplayId(), owner->getRaceMask()))
SetDisplayId(modelid_race);

Expand Down
2 changes: 1 addition & 1 deletion src/game/Entities/Unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ enum UnitFlags
enum UnitFlags2
{
UNIT_FLAG2_FEIGN_DEATH = 0x00000001,
UNIT_FLAG2_UNK1 = 0x00000002, // Hides body and body armor. Weapons and shoulder and head armor still visible
UNIT_FLAG2_HIDE_BODY = 0x00000002, // Hides body and body armor. Weapons and shoulder and head armor still visible
UNIT_FLAG2_IGNORE_REPUTATION = 0x00000004,
UNIT_FLAG2_COMPREHEND_LANG = 0x00000008,
UNIT_FLAG2_CLONED = 0x00000010, // Used in SPELL_AURA_MIRROR_IMAGE
Expand Down
10 changes: 10 additions & 0 deletions src/game/Spells/Scripts/Scripting/ClassScripts/DeathKnight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@ struct HealthLeechPassive : public AuraScript
}
};

struct AntiMagicZone : public SpellScript
{
void OnSummon(Spell* /*spell*/, Creature* summon) const override
{
summon->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_HIDE_BODY);
summon->CastSpell(nullptr, 40031, TRIGGERED_OLD_TRIGGERED);
}
};

void LoadDeathKnightScripts()
{
RegisterSpellScript<ScourgeStrike>("spell_scourge_strike");
Expand All @@ -213,4 +222,5 @@ void LoadDeathKnightScripts()
RegisterAuraScript<DeathRuneDK>("spell_death_rune_dk");
RegisterSpellScript<Bloodworm>("spell_bloodworm");
RegisterAuraScript<HealthLeechPassive>("spell_health_leech_passive");
RegisterSpellScript<AntiMagicZone>("spell_anti_magic_zone");
}

0 comments on commit 248374d

Please sign in to comment.