Core/Players: Worgen will now transform into their altered form at engage instead of at dealing or taking damage
This commit is contained in:
1 parent
a5caf1af95
commit
7ac3d6fca9
3 files changed
+15
-14
No files matched your search
@@ -25117,6 +25117,19 @@ void Player::ProcessTerrainStatusUpdate(ZLiquidStatus status, Optional<LiquidDat
|
||||
|
||||
}
|
||||
|
||||
void Player::AtEngage(Unit* target)
|
||||
{
|
||||
Unit::AtEngage(target);
|
||||
|
||||
// Worgen do turn into their altered form when engaged
|
||||
if (getRace() != RACE_WORGEN || HasAuraType(SPELL_AURA_WORGEN_ALTERED_FORM))
|
||||
return;
|
||||
|
||||
// Only transform at engage when the player has access to the racial Two Forms ability (obtained while progressing through the Gilneas starting area)
|
||||
if (HasSpell(SPELL_TWO_FORMS_RACIAL))
|
||||
CastSpell(nullptr, SPELL_ALTERED_FORM_RACIAL, true);
|
||||
}
|
||||
|
||||
void Player::AtExitCombat()
|
||||
{
|
||||
Unit::AtExitCombat();
|
||||
|
||||
@@ -1860,6 +1860,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
bool UpdatePosition(float x, float y, float z, float orientation, bool teleport = false) override;
|
||||
bool UpdatePosition(Position const& pos, bool teleport = false) override { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); }
|
||||
void ProcessTerrainStatusUpdate(ZLiquidStatus status, Optional<LiquidData> const& liquidData) override;
|
||||
|
||||
void AtEngage(Unit* target) override;
|
||||
void AtExitCombat() override;
|
||||
|
||||
void SendMessageToSet(WorldPacket const* data, bool self) const override { SendMessageToSetInRange(data, GetVisibilityRange(), self); }
|
||||
|
||||
@@ -775,20 +775,6 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
|
||||
}
|
||||
}
|
||||
|
||||
if (victim->getRace() == RACE_WORGEN && victim->ToPlayer())
|
||||
{
|
||||
if (Player* worgenVictm = victim->ToPlayer())
|
||||
if (worgenVictm->HasSpell(SPELL_TWO_FORMS_RACIAL) && !worgenVictm->HasAura(SPELL_ALTERED_FORM_RACIAL))
|
||||
worgenVictm->CastSpell(worgenVictm, SPELL_ALTERED_FORM_RACIAL, true);
|
||||
}
|
||||
|
||||
if (getRace() == RACE_WORGEN && ToPlayer())
|
||||
{
|
||||
if (Player* worgenPlayer = ToPlayer())
|
||||
if (worgenPlayer->HasSpell(SPELL_TWO_FORMS_RACIAL) && !HasAura(SPELL_ALTERED_FORM_RACIAL))
|
||||
CastSpell(worgenPlayer, SPELL_ALTERED_FORM_RACIAL, true);
|
||||
}
|
||||
|
||||
if (victim->IsAIEnabled)
|
||||
victim->GetAI()->DamageTaken(this, damage);
|
||||
|
||||
|
||||
Reference in new issue
Block a user