Implement AURA_STATE_FROZEN

Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
DiSlord 2009-01-13 01:15:41 +03:00
parent aff0fa1489
commit ba25093ef2
3 changed files with 12 additions and 10 deletions

View file

@ -686,7 +686,7 @@ enum AuraState
AURA_STATE_DEFENSE = 1, // C | AURA_STATE_DEFENSE = 1, // C |
AURA_STATE_HEALTHLESS_20_PERCENT = 2, // CcT | AURA_STATE_HEALTHLESS_20_PERCENT = 2, // CcT |
AURA_STATE_BERSERKING = 3, // C T | AURA_STATE_BERSERKING = 3, // C T |
//AURA_STATE_UNKNOWN4 = 4, // c t| some limitation to charge spells (?) and target test spells AURA_STATE_FROZEN = 4, // c t| frozen target
AURA_STATE_JUDGEMENT = 5, // C | AURA_STATE_JUDGEMENT = 5, // C |
//AURA_STATE_UNKNOWN6 = 6, // | not used //AURA_STATE_UNKNOWN6 = 6, // | not used
AURA_STATE_HUNTER_PARRY = 7, // C | AURA_STATE_HUNTER_PARRY = 7, // C |

View file

@ -3560,13 +3560,18 @@ void Aura::HandleAuraModRoot(bool apply, bool Real)
if(!Real) if(!Real)
return; return;
// Frost root aura -> freeze/unfreeze target
if (GetSpellSchoolMask(m_spellProto) & SPELL_SCHOOL_MASK_FROST)
m_target->ModifyAuraState(AURA_STATE_FROZEN, apply);
uint32 apply_stat = UNIT_STAT_ROOT; uint32 apply_stat = UNIT_STAT_ROOT;
if (apply) if (apply)
{ {
m_target->addUnitState(UNIT_STAT_ROOT); m_target->addUnitState(UNIT_STAT_ROOT);
m_target->SetUInt64Value (UNIT_FIELD_TARGET, 0); m_target->SetUInt64Value (UNIT_FIELD_TARGET, 0);
// probably wrong // probably wrong (this add skinable flag)
m_target->SetFlag(UNIT_FIELD_FLAGS,(apply_stat<<16)); // TODO: find correct flag
// m_target->SetFlag(UNIT_FIELD_FLAGS,(apply_stat<<16));
//Save last orientation //Save last orientation
if( m_target->getVictim() ) if( m_target->getVictim() )
@ -3592,8 +3597,9 @@ void Aura::HandleAuraModRoot(bool apply, bool Real)
return; return;
m_target->clearUnitState(UNIT_STAT_ROOT); m_target->clearUnitState(UNIT_STAT_ROOT);
// probably wrong // probably wrong (this add skinable flag)
m_target->RemoveFlag(UNIT_FIELD_FLAGS,(apply_stat<<16)); // TODO: find correct flag
// m_target->RemoveFlag(UNIT_FIELD_FLAGS,(apply_stat<<16));
if(!m_target->hasUnitState(UNIT_STAT_STUNNED)) // prevent allow move if have also stun effect if(!m_target->hasUnitState(UNIT_STAT_STUNNED)) // prevent allow move if have also stun effect
{ {

View file

@ -9881,11 +9881,7 @@ void CharmInfo::SetPetNumber(uint32 petnumber, bool statwindow)
bool Unit::isFrozen() const bool Unit::isFrozen() const
{ {
AuraList const& mRoot = GetAurasByType(SPELL_AURA_MOD_ROOT); return HasAuraState(AURA_STATE_FROZEN);
for(AuraList::const_iterator i = mRoot.begin(); i != mRoot.end(); ++i)
if( GetSpellSchoolMask((*i)->GetSpellProto()) & SPELL_SCHOOL_MASK_FROST)
return true;
return false;
} }
struct ProcTriggeredData struct ProcTriggeredData