[10834] Cleanup shapeshift form code.

This commit is contained in:
VladimirMangos 2010-12-07 14:01:12 +03:00
parent c3254c88ca
commit 4c02094737
10 changed files with 56 additions and 53 deletions

View file

@ -2563,7 +2563,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
{
if (apply)
{
if (target->m_form != FORM_CAT)
if (target->GetShapeshiftForm() != FORM_CAT)
return;
target->CastSpell(target, 62071, true);
@ -2648,7 +2648,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
if (apply)
{
if (target->m_form != FORM_MOONKIN)
if (target->GetShapeshiftForm() != FORM_MOONKIN)
return;
target->CastSpell(target, spell_id, true);
@ -2966,10 +2966,7 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
if(apply)
{
// remove other shapeshift before applying a new one
if(target->m_ShapeShiftFormSpellId)
target->RemoveAurasDueToSpell(target->m_ShapeShiftFormSpellId, GetHolder());
target->SetByteValue(UNIT_FIELD_BYTES_2, 3, form);
target->RemoveSpellsCausingAura(SPELL_AURA_MOD_SHAPESHIFT, GetHolder());
if(modelid > 0)
target->SetDisplayId(modelid);
@ -3043,8 +3040,7 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
}
}
target->m_ShapeShiftFormSpellId = GetId();
target->m_form = form;
target->SetShapeshiftForm(form);
// a form can give the player a new castbar with some spells.. this is a clientside process..
// serverside just needs to register the new spells so that player isn't kicked as cheater
@ -3058,11 +3054,9 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
{
if(modelid > 0)
target->SetDisplayId(target->GetNativeDisplayId());
target->SetByteValue(UNIT_FIELD_BYTES_2, 3, FORM_NONE);
if(target->getClass() == CLASS_DRUID)
target->setPowerType(POWER_MANA);
target->m_ShapeShiftFormSpellId = 0;
target->m_form = FORM_NONE;
target->SetShapeshiftForm(FORM_NONE);
switch(form)
{