Core: Use new SpellInfo class in core. Sadly, this commit is not compatibile with some of the custom code. To make your code work again you may need to change:
*SpellEntry is now SpellInfo *GetSpellProto is now GetSpellInfo *SpellEntry::Effect*[effIndex] is now avalible under SpellInfo.Effects[effIndex].* *sSpellStore.LookupEntry is no longer valid, use sSpellMgr->GetSpellInfo() *SpellFunctions from SpellMgr.h like DoSpellStuff(spellId) are now: spellInfo->DoStuff() *SpellMgr::CalculateEffectValue and similar functions are now avalible in SpellEffectInfo class. *GET_SPELL macro is removed, code which used it is moved to SpellMgr::LoadDbcDataCorrections *code which affected dbc data in SpellMgr::LoadSpellCustomAttr is now moved to LoadDbcDataCorrections
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -30,7 +30,7 @@ typedef void(AuraEffect::*pAuraEffectHandler)(AuraApplication const* aurApp, uin
|
||||
class AuraEffect
|
||||
{
|
||||
friend void Aura::_InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount);
|
||||
friend Aura * Unit::_TryStackingOrRefreshingExistingAura(SpellEntry const* newAura, uint8 effMask, Unit* caster, int32* baseAmount, Item* castItem, uint64 casterGUID);
|
||||
friend Aura * Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount, Item* castItem, uint64 casterGUID);
|
||||
friend Aura::~Aura();
|
||||
private:
|
||||
~AuraEffect();
|
||||
@@ -43,15 +43,15 @@ class AuraEffect
|
||||
void GetApplicationList(std::list<AuraApplication*> & applicationList) const;
|
||||
SpellModifier* GetSpellModifier() const { return m_spellmod; }
|
||||
|
||||
SpellEntry const* GetSpellProto() const { return m_spellProto; }
|
||||
uint32 GetId() const { return m_spellProto->Id; }
|
||||
SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
|
||||
uint32 GetId() const { return m_spellInfo->Id; }
|
||||
uint32 GetEffIndex() const { return m_effIndex; }
|
||||
int32 GetBaseAmount() const { return m_baseAmount; }
|
||||
int32 GetAmplitude() const { return m_amplitude; }
|
||||
|
||||
int32 GetMiscValueB() const { return m_spellProto->EffectMiscValueB[m_effIndex]; }
|
||||
int32 GetMiscValue() const { return m_spellProto->EffectMiscValue[m_effIndex]; }
|
||||
AuraType GetAuraType() const { return (AuraType)m_spellProto->EffectApplyAuraName[m_effIndex]; }
|
||||
int32 GetMiscValueB() const { return m_spellInfo->Effects[m_effIndex].MiscValueB; }
|
||||
int32 GetMiscValue() const { return m_spellInfo->Effects[m_effIndex].MiscValue; }
|
||||
AuraType GetAuraType() const { return (AuraType)m_spellInfo->Effects[m_effIndex].ApplyAuraName; }
|
||||
int32 GetAmount() const { return m_amount; }
|
||||
void SetAmount(int32 amount) { m_amount = amount; m_canBeRecalculated = false;}
|
||||
|
||||
@@ -79,7 +79,7 @@ class AuraEffect
|
||||
|
||||
bool IsPeriodic() const { return m_isPeriodic; }
|
||||
void SetPeriodic(bool isPeriodic) { m_isPeriodic = isPeriodic; }
|
||||
bool IsAffectedOnSpell(SpellEntry const *spell) const;
|
||||
bool IsAffectedOnSpell(SpellInfo const *spell) const;
|
||||
|
||||
void SendTickImmune(Unit* target, Unit *caster) const;
|
||||
void PeriodicTick(AuraApplication * aurApp, Unit* caster) const;
|
||||
@@ -93,7 +93,7 @@ class AuraEffect
|
||||
private:
|
||||
Aura * const m_base;
|
||||
|
||||
SpellEntry const* const m_spellProto;
|
||||
SpellInfo const* const m_spellInfo;
|
||||
uint8 const m_effIndex;
|
||||
int32 const m_baseAmount;
|
||||
|
||||
@@ -308,8 +308,8 @@ namespace Trinity
|
||||
AbsorbAuraOrderPred() { }
|
||||
bool operator() (AuraEffect * aurEffA, AuraEffect * aurEffB) const
|
||||
{
|
||||
SpellEntry const* spellProtoA = aurEffA->GetSpellProto();
|
||||
SpellEntry const* spellProtoB = aurEffB->GetSpellProto();
|
||||
SpellInfo const* spellProtoA = aurEffA->GetSpellInfo();
|
||||
SpellInfo const* spellProtoB = aurEffB->GetSpellInfo();
|
||||
|
||||
// Wards
|
||||
if ((spellProtoA->SpellFamilyName == SPELLFAMILY_MAGE) ||
|
||||
|
||||
@@ -123,7 +123,7 @@ void AuraApplication::_InitFlags(Unit* caster, uint8 effMask)
|
||||
bool negativeFound = false;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (((1<<i) & effMask) && !IsPositiveEffect(GetBase()->GetId(), i))
|
||||
if (((1<<i) & effMask) && !GetBase()->GetSpellInfo()->IsPositiveEffect(i))
|
||||
{
|
||||
negativeFound = true;
|
||||
break;
|
||||
@@ -138,7 +138,7 @@ void AuraApplication::_InitFlags(Unit* caster, uint8 effMask)
|
||||
bool positiveFound = false;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (((1<<i) & effMask) && IsPositiveEffect(GetBase()->GetId(), i))
|
||||
if (((1<<i) & effMask) && GetBase()->GetSpellInfo()->IsPositiveEffect(i))
|
||||
{
|
||||
positiveFound = true;
|
||||
break;
|
||||
@@ -189,13 +189,13 @@ void AuraApplication::BuildUpdatePacket(ByteBuffer& data, bool remove) const
|
||||
Aura const* aura = GetBase();
|
||||
data << uint32(aura->GetId());
|
||||
uint32 flags = m_flags;
|
||||
if (aura->GetMaxDuration() > 0 && !(aura->GetSpellProto()->AttributesEx5 & SPELL_ATTR5_HIDE_DURATION))
|
||||
if (aura->GetMaxDuration() > 0 && !(aura->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_HIDE_DURATION))
|
||||
flags |= AFLAG_DURATION;
|
||||
data << uint8(flags);
|
||||
data << uint8(aura->GetCasterLevel());
|
||||
// send stack amount for aura which could be stacked (never 0 - causes incorrect display) or charges
|
||||
// stack amount has priority over charges (checked on retail with spell 50262)
|
||||
data << uint8(aura->GetSpellProto()->StackAmount ? aura->GetStackAmount() : aura->GetCharges());
|
||||
data << uint8(aura->GetSpellInfo()->StackAmount ? aura->GetStackAmount() : aura->GetCharges());
|
||||
|
||||
if (!(flags & AFLAG_CASTER))
|
||||
data.appendPackGUID(aura->GetCasterGUID());
|
||||
@@ -218,7 +218,7 @@ void AuraApplication::ClientUpdate(bool remove)
|
||||
m_target->SendMessageToSet(&data, true);
|
||||
}
|
||||
|
||||
uint8 Aura::BuildEffectMaskForOwner(SpellEntry const* spellProto, uint8 avalibleEffectMask, WorldObject* owner)
|
||||
uint8 Aura::BuildEffectMaskForOwner(SpellInfo const* spellProto, uint8 avalibleEffectMask, WorldObject* owner)
|
||||
{
|
||||
ASSERT(spellProto);
|
||||
ASSERT(owner);
|
||||
@@ -229,14 +229,14 @@ uint8 Aura::BuildEffectMaskForOwner(SpellEntry const* spellProto, uint8 avalible
|
||||
case TYPEID_PLAYER:
|
||||
for (uint8 i = 0; i< MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (IsUnitOwnedAuraEffect(spellProto->Effect[i]))
|
||||
if (spellProto->Effects[i].IsUnitOwnedAuraEffect())
|
||||
effMask |= 1 << i;
|
||||
}
|
||||
break;
|
||||
case TYPEID_DYNAMICOBJECT:
|
||||
for (uint8 i = 0; i< MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (spellProto->Effect[i] == SPELL_EFFECT_PERSISTENT_AREA_AURA)
|
||||
if (spellProto->Effects[i].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA)
|
||||
effMask |= 1 << i;
|
||||
}
|
||||
break;
|
||||
@@ -246,7 +246,7 @@ uint8 Aura::BuildEffectMaskForOwner(SpellEntry const* spellProto, uint8 avalible
|
||||
return effMask & avalibleEffectMask;
|
||||
}
|
||||
|
||||
Aura* Aura::TryRefreshStackOrCreate(SpellEntry const* spellproto, uint8 tryEffMask, WorldObject* owner, Unit* caster, int32* baseAmount /*= NULL*/, Item* castItem /*= NULL*/, uint64 casterGUID /*= 0*/, bool* refresh /*= NULL*/)
|
||||
Aura* Aura::TryRefreshStackOrCreate(SpellInfo const* spellproto, uint8 tryEffMask, WorldObject* owner, Unit* caster, int32* baseAmount /*= NULL*/, Item* castItem /*= NULL*/, uint64 casterGUID /*= 0*/, bool* refresh /*= NULL*/)
|
||||
{
|
||||
ASSERT(spellproto);
|
||||
ASSERT(owner);
|
||||
@@ -272,7 +272,7 @@ Aura* Aura::TryRefreshStackOrCreate(SpellEntry const* spellproto, uint8 tryEffMa
|
||||
return Create(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID);
|
||||
}
|
||||
|
||||
Aura* Aura::TryCreate(SpellEntry const* spellproto, uint8 tryEffMask, WorldObject* owner, Unit* caster, int32* baseAmount /*= NULL*/, Item* castItem /*= NULL*/, uint64 casterGUID /*= 0*/)
|
||||
Aura* Aura::TryCreate(SpellInfo const* spellproto, uint8 tryEffMask, WorldObject* owner, Unit* caster, int32* baseAmount /*= NULL*/, Item* castItem /*= NULL*/, uint64 casterGUID /*= 0*/)
|
||||
{
|
||||
ASSERT(spellproto);
|
||||
ASSERT(owner);
|
||||
@@ -284,7 +284,7 @@ Aura* Aura::TryCreate(SpellEntry const* spellproto, uint8 tryEffMask, WorldObjec
|
||||
return Create(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID);
|
||||
}
|
||||
|
||||
Aura* Aura::Create(SpellEntry const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32* baseAmount, Item* castItem, uint64 casterGUID)
|
||||
Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32* baseAmount, Item* castItem, uint64 casterGUID)
|
||||
{
|
||||
ASSERT(effMask);
|
||||
ASSERT(spellproto);
|
||||
@@ -306,7 +306,7 @@ Aura* Aura::Create(SpellEntry const* spellproto, uint8 effMask, WorldObject* own
|
||||
if (owner->isType(TYPEMASK_UNIT))
|
||||
if (!owner->IsInWorld() || ((Unit*)owner)->IsDuringRemoveFromWorld())
|
||||
// owner not in world so don't allow to own not self casted single target auras
|
||||
if (casterGUID != owner->GetGUID() && IsSingleTargetSpell(spellproto))
|
||||
if (casterGUID != owner->GetGUID() && spellproto->IsSingleTarget())
|
||||
return NULL;
|
||||
|
||||
Aura* aura = NULL;
|
||||
@@ -329,14 +329,14 @@ Aura* Aura::Create(SpellEntry const* spellproto, uint8 effMask, WorldObject* own
|
||||
return aura;
|
||||
}
|
||||
|
||||
Aura::Aura(SpellEntry const* spellproto, WorldObject * owner, Unit* caster, Item* castItem, uint64 casterGUID) :
|
||||
m_spellProto(spellproto), m_casterGuid(casterGUID ? casterGUID : caster->GetGUID()),
|
||||
Aura::Aura(SpellInfo const* spellproto, WorldObject * owner, Unit* caster, Item* castItem, uint64 casterGUID) :
|
||||
m_spellInfo(spellproto), m_casterGuid(casterGUID ? casterGUID : caster->GetGUID()),
|
||||
m_castItemGuid(castItem ? castItem->GetGUID() : 0), m_applyTime(time(NULL)),
|
||||
m_owner(owner), m_timeCla(0), m_updateTargetMapInterval(0),
|
||||
m_casterLevel(caster ? caster->getLevel() : m_spellProto->spellLevel), m_procCharges(0), m_stackAmount(1),
|
||||
m_casterLevel(caster ? caster->getLevel() : m_spellInfo->SpellLevel), m_procCharges(0), m_stackAmount(1),
|
||||
m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false)
|
||||
{
|
||||
if (m_spellProto->manaPerSecond || m_spellProto->manaPerSecondPerLevel)
|
||||
if (m_spellInfo->ManaPerSecond || m_spellInfo->ManaPerSecondPerLevel)
|
||||
m_timeCla = 1 * IN_MILLISECONDS;
|
||||
|
||||
m_maxDuration = CalcMaxDuration(caster);
|
||||
@@ -404,10 +404,10 @@ void Aura::_ApplyForTarget(Unit* target, Unit* caster, AuraApplication * auraApp
|
||||
// set infinity cooldown state for spells
|
||||
if (caster && caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (m_spellProto->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE)
|
||||
if (m_spellInfo->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE)
|
||||
{
|
||||
Item* castItem = m_castItemGuid ? caster->ToPlayer()->GetItemByGuid(m_castItemGuid) : NULL;
|
||||
caster->ToPlayer()->AddSpellAndCategoryCooldowns(m_spellProto, castItem ? castItem->GetEntry() : 0, NULL, true);
|
||||
caster->ToPlayer()->AddSpellAndCategoryCooldowns(m_spellInfo, castItem ? castItem->GetEntry() : 0, NULL, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -424,7 +424,7 @@ void Aura::_UnapplyForTarget(Unit* target, Unit* caster, AuraApplication * auraA
|
||||
if (itr == m_applications.end())
|
||||
{
|
||||
sLog->outError("Aura::_UnapplyForTarget, target:%u, caster:%u, spell:%u was not found in owners application map!",
|
||||
target->GetGUIDLow(), caster->GetGUIDLow(), auraApp->GetBase()->GetSpellProto()->Id);
|
||||
target->GetGUIDLow(), caster->GetGUIDLow(), auraApp->GetBase()->GetSpellInfo()->Id);
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
@@ -437,9 +437,9 @@ void Aura::_UnapplyForTarget(Unit* target, Unit* caster, AuraApplication * auraA
|
||||
// reset cooldown state for spells
|
||||
if (caster && caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (GetSpellProto()->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE)
|
||||
if (GetSpellInfo()->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE)
|
||||
// note: item based cooldowns and cooldown spell mods with charges ignored (unknown existed cases)
|
||||
caster->ToPlayer()->SendCooldownEvent(GetSpellProto());
|
||||
caster->ToPlayer()->SendCooldownEvent(GetSpellInfo());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -519,7 +519,7 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
|
||||
|
||||
bool addUnit = true;
|
||||
// check target immunities
|
||||
if (itr->first->IsImmunedToSpell(GetSpellProto())
|
||||
if (itr->first->IsImmunedToSpell(GetSpellInfo())
|
||||
|| !CanBeAppliedOn(itr->first))
|
||||
addUnit = false;
|
||||
|
||||
@@ -542,7 +542,7 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
|
||||
for (Unit::AuraApplicationMap::iterator iter = itr->first->GetAppliedAuras().begin(); iter != itr->first->GetAppliedAuras().end(); ++iter)
|
||||
{
|
||||
Aura const* aura = iter->second->GetBase();
|
||||
if (!sSpellMgr->CanAurasStack(this, aura, aura->GetCasterGUID() == GetCasterGUID()))
|
||||
if (!CanStackWith(aura))
|
||||
{
|
||||
addUnit = false;
|
||||
break;
|
||||
@@ -658,11 +658,11 @@ void Aura::Update(uint32 diff, Unit* caster)
|
||||
m_timeCla -= diff;
|
||||
else if (caster)
|
||||
{
|
||||
if (int32 manaPerSecond = m_spellProto->manaPerSecond + m_spellProto->manaPerSecondPerLevel * caster->getLevel())
|
||||
if (int32 manaPerSecond = m_spellInfo->ManaPerSecond + m_spellInfo->ManaPerSecondPerLevel * caster->getLevel())
|
||||
{
|
||||
m_timeCla += 1000 - diff;
|
||||
|
||||
Powers powertype = Powers(m_spellProto->powerType);
|
||||
Powers powertype = Powers(m_spellInfo->PowerType);
|
||||
if (powertype == POWER_HEALTH)
|
||||
{
|
||||
if (int32(caster->GetHealth()) > manaPerSecond)
|
||||
@@ -697,12 +697,12 @@ int32 Aura::CalcMaxDuration(Unit* caster) const
|
||||
if (caster)
|
||||
{
|
||||
modOwner = caster->GetSpellModOwner();
|
||||
maxDuration = caster->CalcSpellDuration(m_spellProto);
|
||||
maxDuration = caster->CalcSpellDuration(m_spellInfo);
|
||||
}
|
||||
else
|
||||
maxDuration = GetSpellDuration(m_spellProto);
|
||||
maxDuration = m_spellInfo->GetDuration();
|
||||
|
||||
if (IsPassive() && m_spellProto->DurationIndex == 0)
|
||||
if (IsPassive() && !m_spellInfo->DurationEntry)
|
||||
maxDuration = -1;
|
||||
|
||||
if (!IsPermanent() && modOwner)
|
||||
@@ -726,7 +726,7 @@ void Aura::RefreshDuration()
|
||||
{
|
||||
SetDuration(GetMaxDuration());
|
||||
|
||||
if (m_spellProto->manaPerSecond || m_spellProto->manaPerSecondPerLevel)
|
||||
if (m_spellInfo->ManaPerSecond || m_spellInfo->ManaPerSecondPerLevel)
|
||||
m_timeCla = 1 * IN_MILLISECONDS;
|
||||
}
|
||||
|
||||
@@ -751,7 +751,7 @@ void Aura::SetCharges(uint8 charges)
|
||||
|
||||
uint8 Aura::CalcMaxCharges(Unit* caster) const
|
||||
{
|
||||
uint8 maxProcCharges = m_spellProto->procCharges;
|
||||
uint8 maxProcCharges = m_spellInfo->ProcCharges;
|
||||
if (SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetId()))
|
||||
maxProcCharges = procEntry->charges;
|
||||
|
||||
@@ -811,13 +811,13 @@ bool Aura::ModStackAmount(int32 num, AuraRemoveMode removeMode)
|
||||
int32 stackAmount = m_stackAmount + num;
|
||||
|
||||
// limit the stack amount (only on stack increase, stack amount may be changed manually)
|
||||
if ((num > 0) && (stackAmount > int32(m_spellProto->StackAmount)))
|
||||
if ((num > 0) && (stackAmount > int32(m_spellInfo->StackAmount)))
|
||||
{
|
||||
// not stackable aura - set stack amount to 1
|
||||
if (!m_spellProto->StackAmount)
|
||||
if (!m_spellInfo->StackAmount)
|
||||
stackAmount = 1;
|
||||
else
|
||||
stackAmount = m_spellProto->StackAmount;
|
||||
stackAmount = m_spellInfo->StackAmount;
|
||||
}
|
||||
// we're out of stacks, remove
|
||||
else if (stackAmount <= 0)
|
||||
@@ -858,12 +858,12 @@ void Aura::RefreshSpellMods()
|
||||
|
||||
bool Aura::IsPassive() const
|
||||
{
|
||||
return IsPassiveSpell(GetSpellProto());
|
||||
return GetSpellInfo()->IsPassive();
|
||||
}
|
||||
|
||||
bool Aura::IsDeathPersistent() const
|
||||
{
|
||||
return IsDeathPersistentSpell(GetSpellProto());
|
||||
return GetSpellInfo()->IsDeathPersistent();
|
||||
}
|
||||
|
||||
bool Aura::CanBeSaved() const
|
||||
@@ -872,7 +872,7 @@ bool Aura::CanBeSaved() const
|
||||
return false;
|
||||
|
||||
if (GetCasterGUID() != GetOwner()->GetGUID())
|
||||
if (IsSingleTargetSpell(GetSpellProto()))
|
||||
if (GetSpellInfo()->IsSingleTarget())
|
||||
return false;
|
||||
|
||||
// Can't be saved - aura handler relies on calculated amount and changes it
|
||||
@@ -897,7 +897,7 @@ bool Aura::CanBeSaved() const
|
||||
|
||||
bool Aura::CanBeSentToClient() const
|
||||
{
|
||||
return !IsPassive() || HasAreaAuraEffect(GetSpellProto()) || HasEffectType(SPELL_AURA_ABILITY_IGNORE_AURASTATE);
|
||||
return !IsPassive() || GetSpellInfo()->HasAreaAuraEffect() || HasEffectType(SPELL_AURA_ABILITY_IGNORE_AURASTATE);
|
||||
}
|
||||
|
||||
void Aura::UnregisterSingleTarget()
|
||||
@@ -912,6 +912,27 @@ void Aura::UnregisterSingleTarget()
|
||||
SetIsSingleTarget(false);
|
||||
}
|
||||
|
||||
int32 Aura::CalcDispelChance(Unit* auraTarget, bool offensive) const
|
||||
{
|
||||
// we assume that aura dispel chance is 100% on start
|
||||
// need formula for level difference based chance
|
||||
int32 resistChance = 0;
|
||||
|
||||
// Apply dispel mod from aura caster
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Player* modOwner = caster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(GetId(), SPELLMOD_RESIST_DISPEL_CHANCE, resistChance);
|
||||
|
||||
// Dispel resistance from target SPELL_AURA_MOD_DISPEL_RESIST
|
||||
// Only affects offensive dispels
|
||||
if (offensive && auraTarget)
|
||||
resistChance += auraTarget->GetTotalAuraModifier(SPELL_AURA_MOD_DISPEL_RESIST);
|
||||
|
||||
resistChance = resistChance < 0 ? 0 : resistChance;
|
||||
resistChance = resistChance > 100 ? 100 : resistChance;
|
||||
return 100 - resistChance;
|
||||
}
|
||||
|
||||
void Aura::SetLoadedState(int32 maxduration, int32 duration, int32 charges, uint8 stackamount, uint8 recalculateMask, int32 * amount)
|
||||
{
|
||||
m_maxDuration = maxduration;
|
||||
@@ -1000,15 +1021,13 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
}
|
||||
|
||||
// handle spell_linked_spell table
|
||||
uint32 customAttr = sSpellMgr->GetSpellCustomAttr(GetId());
|
||||
if (!onReapply)
|
||||
{
|
||||
// apply linked auras
|
||||
if (apply)
|
||||
{
|
||||
if (customAttr & SPELL_ATTR0_CU_LINK_AURA)
|
||||
if (std::vector<int32> const* spellTriggered = sSpellMgr->GetSpellLinked(GetId() + SPELL_LINK_AURA))
|
||||
{
|
||||
std::vector<int32> const* spellTriggered = sSpellMgr->GetSpellLinked(GetId() + SPELL_LINK_AURA);
|
||||
for (std::vector<int32>::const_iterator itr = spellTriggered->begin(); itr != spellTriggered->end(); ++itr)
|
||||
{
|
||||
if (*itr < 0)
|
||||
@@ -1021,9 +1040,8 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
else
|
||||
{
|
||||
// remove linked auras
|
||||
if (customAttr & SPELL_ATTR0_CU_LINK_REMOVE)
|
||||
if (std::vector<int32> const* spellTriggered = sSpellMgr->GetSpellLinked(-(int32)GetId()))
|
||||
{
|
||||
std::vector<int32> const* spellTriggered = sSpellMgr->GetSpellLinked(-(int32)GetId());
|
||||
for (std::vector<int32>::const_iterator itr = spellTriggered->begin(); itr != spellTriggered->end(); ++itr)
|
||||
{
|
||||
if (*itr < 0)
|
||||
@@ -1032,9 +1050,8 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
target->CastSpell(target, *itr, true, NULL, NULL, GetCasterGUID());
|
||||
}
|
||||
}
|
||||
if (customAttr & SPELL_ATTR0_CU_LINK_AURA)
|
||||
if (std::vector<int32> const* spellTriggered = sSpellMgr->GetSpellLinked(GetId() + SPELL_LINK_AURA))
|
||||
{
|
||||
std::vector<int32> const* spellTriggered = sSpellMgr->GetSpellLinked(GetId() + SPELL_LINK_AURA);
|
||||
for (std::vector<int32>::const_iterator itr = spellTriggered->begin(); itr != spellTriggered->end(); ++itr)
|
||||
{
|
||||
if (*itr < 0)
|
||||
@@ -1048,9 +1065,8 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
else if (apply)
|
||||
{
|
||||
// modify stack amount of linked auras
|
||||
if (customAttr & SPELL_ATTR0_CU_LINK_AURA)
|
||||
if (std::vector<int32> const* spellTriggered = sSpellMgr->GetSpellLinked(GetId() + SPELL_LINK_AURA))
|
||||
{
|
||||
std::vector<int32> const* spellTriggered = sSpellMgr->GetSpellLinked(GetId() + SPELL_LINK_AURA);
|
||||
for (std::vector<int32>::const_iterator itr = spellTriggered->begin(); itr != spellTriggered->end(); ++itr)
|
||||
if (*itr > 0)
|
||||
if (Aura* triggeredAura = target->GetAura(*itr, GetCasterGUID()))
|
||||
@@ -1061,7 +1077,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
// mods at aura apply
|
||||
if (apply)
|
||||
{
|
||||
switch (GetSpellProto()->SpellFamilyName)
|
||||
switch (GetSpellInfo()->SpellFamilyName)
|
||||
{
|
||||
case SPELLFAMILY_GENERIC:
|
||||
switch(GetId())
|
||||
@@ -1088,7 +1104,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
if (!caster)
|
||||
break;
|
||||
// Rejuvenation
|
||||
if (GetSpellProto()->SpellFamilyFlags[0] & 0x10 && GetEffect(EFFECT_0))
|
||||
if (GetSpellInfo()->SpellFamilyFlags[0] & 0x10 && GetEffect(EFFECT_0))
|
||||
{
|
||||
// Druid T8 Restoration 4P Bonus
|
||||
if (caster->HasAura(64760))
|
||||
@@ -1101,23 +1117,23 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
case SPELLFAMILY_MAGE:
|
||||
if (!caster)
|
||||
break;
|
||||
if (GetSpellProto()->SpellFamilyFlags[0] & 0x00000001 && GetSpellProto()->SpellFamilyFlags[2] & 0x00000008)
|
||||
if (GetSpellInfo()->SpellFamilyFlags[0] & 0x00000001 && GetSpellInfo()->SpellFamilyFlags[2] & 0x00000008)
|
||||
{
|
||||
// Glyph of Fireball
|
||||
if (caster->HasAura(56368))
|
||||
SetDuration(0);
|
||||
}
|
||||
else if (GetSpellProto()->SpellFamilyFlags[0] & 0x00000020 && GetSpellProto()->SpellVisual[0] == 13)
|
||||
else if (GetSpellInfo()->SpellFamilyFlags[0] & 0x00000020 && GetSpellInfo()->SpellVisual[0] == 13)
|
||||
{
|
||||
// Glyph of Frostbolt
|
||||
if (caster->HasAura(56370))
|
||||
SetDuration(0);
|
||||
}
|
||||
// Todo: This should be moved to similar function in spell::hit
|
||||
else if (GetSpellProto()->SpellFamilyFlags[0] & 0x01000000)
|
||||
else if (GetSpellInfo()->SpellFamilyFlags[0] & 0x01000000)
|
||||
{
|
||||
// Polymorph Sound - Sheep && Penguin
|
||||
if (GetSpellProto()->SpellIconID == 82 && GetSpellProto()->SpellVisual[0] == 12978)
|
||||
if (GetSpellInfo()->SpellIconID == 82 && GetSpellInfo()->SpellVisual[0] == 12978)
|
||||
{
|
||||
// Glyph of the Penguin
|
||||
if (caster->HasAura(52648))
|
||||
@@ -1179,29 +1195,29 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
if (!caster)
|
||||
break;
|
||||
// Devouring Plague
|
||||
if (GetSpellProto()->SpellFamilyFlags[0] & 0x02000000 && GetEffect(0))
|
||||
if (GetSpellInfo()->SpellFamilyFlags[0] & 0x02000000 && GetEffect(0))
|
||||
{
|
||||
// Improved Devouring Plague
|
||||
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 3790, 1))
|
||||
{
|
||||
int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * caster->SpellDamageBonus(target, GetSpellProto(), GetEffect(0)->GetAmount(), DOT) / 100;
|
||||
int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * caster->SpellDamageBonus(target, GetSpellInfo(), GetEffect(0)->GetAmount(), DOT) / 100;
|
||||
int32 heal = int32(CalculatePctN(basepoints0, 15));
|
||||
caster->CastCustomSpell(target, 63675, &basepoints0, NULL, NULL, true, NULL, GetEffect(0));
|
||||
caster->CastCustomSpell(caster, 75999, &heal, NULL, NULL, true, NULL, GetEffect(0));
|
||||
}
|
||||
}
|
||||
// Renew
|
||||
else if (GetSpellProto()->SpellFamilyFlags[0] & 0x00000040 && GetEffect(0))
|
||||
else if (GetSpellInfo()->SpellFamilyFlags[0] & 0x00000040 && GetEffect(0))
|
||||
{
|
||||
// Empowered Renew
|
||||
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 3021, 1))
|
||||
{
|
||||
int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * caster->SpellHealingBonus(target, GetSpellProto(), GetEffect(0)->GetAmount(), HEAL) / 100;
|
||||
int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * caster->SpellHealingBonus(target, GetSpellInfo(), GetEffect(0)->GetAmount(), HEAL) / 100;
|
||||
caster->CastCustomSpell(target, 63544, &basepoints0, NULL, NULL, true, NULL, GetEffect(0));
|
||||
}
|
||||
}
|
||||
// Power Word: Shield
|
||||
else if (m_spellProto->SpellFamilyFlags[0] & 0x1 && m_spellProto->SpellFamilyFlags[2] & 0x400 && GetEffect(0))
|
||||
else if (m_spellInfo->SpellFamilyFlags[0] & 0x1 && m_spellInfo->SpellFamilyFlags[2] & 0x400 && GetEffect(0))
|
||||
{
|
||||
// Glyph of Power Word: Shield
|
||||
if (AuraEffect* glyph = caster->GetAuraEffect(55672, 0))
|
||||
@@ -1214,7 +1230,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
break;
|
||||
case SPELLFAMILY_ROGUE:
|
||||
// Sprint (skip non player casted spells by category)
|
||||
if (GetSpellProto()->SpellFamilyFlags[0] & 0x40 && GetSpellProto()->Category == 44)
|
||||
if (GetSpellInfo()->SpellFamilyFlags[0] & 0x40 && GetSpellInfo()->Category == 44)
|
||||
// in official maybe there is only one icon?
|
||||
if (target->HasAura(58039)) // Glyph of Blurred Speed
|
||||
target->CastSpell(target, 61922, true); // Sprint (waterwalk)
|
||||
@@ -1223,7 +1239,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
if (!caster)
|
||||
break;
|
||||
// Frost Fever and Blood Plague
|
||||
if (GetSpellProto()->SpellFamilyFlags[2] & 0x2)
|
||||
if (GetSpellInfo()->SpellFamilyFlags[2] & 0x2)
|
||||
{
|
||||
// Can't proc on self
|
||||
if (GetCasterGUID() == target->GetGUID())
|
||||
@@ -1238,7 +1254,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
{
|
||||
aurEff = *itr;
|
||||
// Ebon Plaguebringer - end search if found
|
||||
if ((*itr)->GetSpellProto()->SpellIconID == 1766)
|
||||
if ((*itr)->GetSpellInfo()->SpellIconID == 1766)
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1267,7 +1283,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
// mods at aura remove
|
||||
else
|
||||
{
|
||||
switch(GetSpellProto()->SpellFamilyName)
|
||||
switch(GetSpellInfo()->SpellFamilyName)
|
||||
{
|
||||
case SPELLFAMILY_GENERIC:
|
||||
switch(GetId())
|
||||
@@ -1317,7 +1333,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
if (!caster)
|
||||
break;
|
||||
// Ice barrier - dispel/absorb remove
|
||||
if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && GetSpellProto()->SpellFamilyFlags[1] & 0x1)
|
||||
if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && GetSpellInfo()->SpellFamilyFlags[1] & 0x1)
|
||||
{
|
||||
// Shattered Barrier
|
||||
if (caster->GetDummyAuraEffect(SPELLFAMILY_MAGE, 2945, 0))
|
||||
@@ -1328,7 +1344,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
if (!caster)
|
||||
break;
|
||||
// Spell Reflection
|
||||
if (GetSpellProto()->SpellFamilyFlags[1] & 0x2)
|
||||
if (GetSpellInfo()->SpellFamilyFlags[1] & 0x2)
|
||||
{
|
||||
if (removeMode != AURA_REMOVE_BY_DEFAULT)
|
||||
{
|
||||
@@ -1351,7 +1367,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
if (!caster)
|
||||
break;
|
||||
// Curse of Doom
|
||||
if (GetSpellProto()->SpellFamilyFlags[1] & 0x02)
|
||||
if (GetSpellInfo()->SpellFamilyFlags[1] & 0x02)
|
||||
{
|
||||
if (removeMode == AURA_REMOVE_BY_DEATH)
|
||||
{
|
||||
@@ -1360,7 +1376,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
}
|
||||
}
|
||||
// Improved Fear
|
||||
else if (GetSpellProto()->SpellFamilyFlags[1] & 0x00000400)
|
||||
else if (GetSpellInfo()->SpellFamilyFlags[1] & 0x00000400)
|
||||
{
|
||||
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_WARLOCK, 98, 0))
|
||||
{
|
||||
@@ -1392,7 +1408,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
if (!caster)
|
||||
break;
|
||||
// Shadow word: Pain // Vampiric Touch
|
||||
if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && (GetSpellProto()->SpellFamilyFlags[0] & 0x00008000 || GetSpellProto()->SpellFamilyFlags[1] & 0x00000400))
|
||||
if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && (GetSpellInfo()->SpellFamilyFlags[0] & 0x00008000 || GetSpellInfo()->SpellFamilyFlags[1] & 0x00000400))
|
||||
{
|
||||
// Shadow Affinity
|
||||
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 178, 1))
|
||||
@@ -1402,7 +1418,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
}
|
||||
}
|
||||
// Power word: shield
|
||||
else if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && GetSpellProto()->SpellFamilyFlags[0] & 0x00000001)
|
||||
else if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && GetSpellInfo()->SpellFamilyFlags[0] & 0x00000001)
|
||||
{
|
||||
// Rapture
|
||||
if (Aura const* aura = caster->GetAuraOfRankedSpell(47535))
|
||||
@@ -1468,13 +1484,13 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
if (!player->HasSpellCooldown(47788))
|
||||
break;
|
||||
|
||||
player->RemoveSpellCooldown(GetSpellProto()->Id, true);
|
||||
player->AddSpellCooldown(GetSpellProto()->Id, 0, uint32(time(NULL) + aurEff->GetAmount()));
|
||||
player->RemoveSpellCooldown(GetSpellInfo()->Id, true);
|
||||
player->AddSpellCooldown(GetSpellInfo()->Id, 0, uint32(time(NULL) + aurEff->GetAmount()));
|
||||
|
||||
WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4+4);
|
||||
data << uint64(player->GetGUID());
|
||||
data << uint8(0x0); // flags (0x1, 0x2)
|
||||
data << uint32(GetSpellProto()->Id);
|
||||
data << uint32(GetSpellInfo()->Id);
|
||||
data << uint32(aurEff->GetAmount()*IN_MILLISECONDS);
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
@@ -1495,7 +1511,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
// Blood of the North
|
||||
// Reaping
|
||||
// Death Rune Mastery
|
||||
if (GetSpellProto()->SpellIconID == 3041 || GetSpellProto()->SpellIconID == 22 || GetSpellProto()->SpellIconID == 2622)
|
||||
if (GetSpellInfo()->SpellIconID == 3041 || GetSpellInfo()->SpellIconID == 22 || GetSpellInfo()->SpellIconID == 2622)
|
||||
{
|
||||
if (!GetEffect(0) || GetEffect(0)->GetAuraType() != SPELL_AURA_PERIODIC_DUMMY)
|
||||
break;
|
||||
@@ -1510,7 +1526,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
break;
|
||||
case SPELLFAMILY_HUNTER:
|
||||
// Glyph of Freezing Trap
|
||||
if (GetSpellProto()->SpellFamilyFlags[0] & 0x00000008)
|
||||
if (GetSpellInfo()->SpellFamilyFlags[0] & 0x00000008)
|
||||
if (caster && caster->HasAura(56845))
|
||||
target->CastSpell(target, 61394, true);
|
||||
break;
|
||||
@@ -1518,7 +1534,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
}
|
||||
|
||||
// mods at aura apply or remove
|
||||
switch (GetSpellProto()->SpellFamilyName)
|
||||
switch (GetSpellInfo()->SpellFamilyName)
|
||||
{
|
||||
case SPELLFAMILY_GENERIC:
|
||||
switch (GetId())
|
||||
@@ -1533,7 +1549,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
break;
|
||||
case SPELLFAMILY_ROGUE:
|
||||
// Stealth
|
||||
if (GetSpellProto()->SpellFamilyFlags[0] & 0x00400000)
|
||||
if (GetSpellInfo()->SpellFamilyFlags[0] & 0x00400000)
|
||||
{
|
||||
// Master of subtlety
|
||||
if (AuraEffect const* aurEff = target->GetAuraEffectOfRankedSpell(31221, 0))
|
||||
@@ -1590,7 +1606,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
break;
|
||||
if (apply)
|
||||
{
|
||||
if ((GetSpellProto()->Id == 31821 && target->HasAura(19746, GetCasterGUID())) || (GetSpellProto()->Id == 19746 && target->HasAura(31821)))
|
||||
if ((GetSpellInfo()->Id == 31821 && target->HasAura(19746, GetCasterGUID())) || (GetSpellInfo()->Id == 19746 && target->HasAura(31821)))
|
||||
target->CastSpell(target, 64364, true);
|
||||
}
|
||||
else
|
||||
@@ -1609,7 +1625,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
}
|
||||
break;
|
||||
case SPELLFAMILY_DEATHKNIGHT:
|
||||
if (GetSpellSpecific(GetSpellProto()) == SPELL_SPECIFIC_PRESENCE)
|
||||
if (GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_PRESENCE)
|
||||
{
|
||||
AuraEffect *bloodPresenceAura=0; // healing by damage done
|
||||
AuraEffect *frostPresenceAura=0; // increased health
|
||||
@@ -1670,7 +1686,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
if (unholyPresenceAura)
|
||||
{
|
||||
// Not listed as any effect, only base points set
|
||||
int32 basePoints0 = SpellMgr::CalculateSpellEffectAmount(unholyPresenceAura->GetSpellProto(), 1);
|
||||
int32 basePoints0 = unholyPresenceAura->GetSpellInfo()->Effects[EFFECT_1].CalcValue();
|
||||
target->CastCustomSpell(target, 63622, &basePoints0 , &basePoints0, &basePoints0, true, 0, unholyPresenceAura);
|
||||
}
|
||||
target->CastSpell(target, 49772, true);
|
||||
@@ -1699,7 +1715,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
break;
|
||||
case SPELLFAMILY_WARLOCK:
|
||||
// Drain Soul - If the target is at or below 25% health, Drain Soul causes four times the normal damage
|
||||
if (GetSpellProto()->SpellFamilyFlags[0] & 0x00004000)
|
||||
if (GetSpellInfo()->SpellFamilyFlags[0] & 0x00004000)
|
||||
{
|
||||
if (!caster)
|
||||
break;
|
||||
@@ -1729,7 +1745,7 @@ bool Aura::CanBeAppliedOn(Unit* target)
|
||||
if (GetOwner() != target)
|
||||
return false;
|
||||
// not selfcasted single target auras mustn't be applied
|
||||
if (GetCasterGUID() != GetOwner()->GetGUID() && IsSingleTargetSpell(GetSpellProto()))
|
||||
if (GetCasterGUID() != GetOwner()->GetGUID() && GetSpellInfo()->IsSingleTarget())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -1742,6 +1758,125 @@ bool Aura::CheckAreaTarget(Unit* target)
|
||||
return CallScriptCheckAreaTargetHandlers(target);
|
||||
}
|
||||
|
||||
bool Aura::CanStackWith(Aura const* existingAura) const
|
||||
{
|
||||
// Can stack with self
|
||||
if (this == existingAura)
|
||||
return true;
|
||||
|
||||
// Dynobj auras always stack
|
||||
if (existingAura->GetType() == DYNOBJ_AURA_TYPE)
|
||||
return true;
|
||||
|
||||
SpellInfo const* existingSpellInfo = existingAura->GetSpellInfo();
|
||||
bool sameCaster = GetCasterGUID() == existingAura->GetCasterGUID();
|
||||
|
||||
// passive auras don't stack when cast by different casters, or with another rank of the spell
|
||||
if (IsPassive() && (!sameCaster || !m_spellInfo->IsDifferentRankOf(existingSpellInfo)))
|
||||
return false;
|
||||
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
// prevent remove triggering aura by triggered aura
|
||||
if (existingSpellInfo->Effects[i].TriggerSpell == GetId()
|
||||
// prevent remove triggered aura by triggering aura refresh
|
||||
|| m_spellInfo->Effects[i].TriggerSpell == existingAura->GetId())
|
||||
return true;
|
||||
}
|
||||
|
||||
// check spell specific stack rules
|
||||
if (m_spellInfo->IsAuraExclusiveBySpecificWith(existingSpellInfo)
|
||||
|| (sameCaster && m_spellInfo->IsAuraExclusiveBySpecificPerCasterWith(existingSpellInfo)))
|
||||
return false;
|
||||
|
||||
// check spell group stack rules
|
||||
SpellGroupStackRule stackRule = sSpellMgr->CheckSpellGroupStackRules(m_spellInfo, existingSpellInfo);
|
||||
if (stackRule)
|
||||
{
|
||||
if (stackRule == SPELL_GROUP_STACK_RULE_EXCLUSIVE)
|
||||
return false;
|
||||
if (sameCaster && stackRule == SPELL_GROUP_STACK_RULE_EXCLUSIVE_FROM_SAME_CASTER)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_spellInfo->SpellFamilyName != existingSpellInfo->SpellFamilyName)
|
||||
return true;
|
||||
|
||||
if (!sameCaster)
|
||||
{
|
||||
if (m_spellInfo->AttributesEx3 & SPELL_ATTR3_STACK_FOR_DIFF_CASTERS)
|
||||
return true;
|
||||
|
||||
// check same periodic auras
|
||||
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
switch (m_spellInfo->Effects[i].ApplyAuraName)
|
||||
{
|
||||
// DOT or HOT from different casters will stack
|
||||
case SPELL_AURA_PERIODIC_DAMAGE:
|
||||
case SPELL_AURA_PERIODIC_DUMMY:
|
||||
case SPELL_AURA_PERIODIC_HEAL:
|
||||
case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
|
||||
case SPELL_AURA_PERIODIC_ENERGIZE:
|
||||
case SPELL_AURA_PERIODIC_MANA_LEECH:
|
||||
case SPELL_AURA_PERIODIC_LEECH:
|
||||
case SPELL_AURA_POWER_BURN_MANA:
|
||||
case SPELL_AURA_OBS_MOD_POWER:
|
||||
case SPELL_AURA_OBS_MOD_HEALTH:
|
||||
case SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE:
|
||||
// periodic auras which target areas are not allowed to stack this way (replenishment for example)
|
||||
if (m_spellInfo->Effects[i].IsArea() || existingSpellInfo->Effects[i].IsArea())
|
||||
break;
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool isVehicleAura1 = false;
|
||||
bool isVehicleAura2 = false;
|
||||
uint8 i = 0;
|
||||
while (i < MAX_SPELL_EFFECTS && !(isVehicleAura1 && isVehicleAura2))
|
||||
{
|
||||
if (m_spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_CONTROL_VEHICLE)
|
||||
isVehicleAura1 = true;
|
||||
if (existingSpellInfo->Effects[i].ApplyAuraName == SPELL_AURA_CONTROL_VEHICLE)
|
||||
isVehicleAura2 = true;
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
if (isVehicleAura1 && isVehicleAura2)
|
||||
{
|
||||
Vehicle* veh = NULL;
|
||||
if (GetOwner()->ToUnit())
|
||||
veh = GetOwner()->ToUnit()->GetVehicleKit();
|
||||
|
||||
if (!veh) // We should probably just let it stack. Vehicle system will prevent undefined behaviour later
|
||||
return true;
|
||||
|
||||
if (!veh->GetAvailableSeatCount())
|
||||
return false; // No empty seat available
|
||||
|
||||
return true; // Empty seat available (skip rest)
|
||||
}
|
||||
|
||||
// spell of same spell rank chain
|
||||
if (m_spellInfo->IsRankOf(existingSpellInfo))
|
||||
{
|
||||
if (m_spellInfo->IsMultiSlotAura())
|
||||
return true;
|
||||
if (GetCastItemGUID() && existingAura->GetCastItemGUID())
|
||||
if (GetCastItemGUID() != existingAura->GetCastItemGUID() && (m_spellInfo->AttributesCu & SPELL_ATTR0_CU_ENCHANT_PROC))
|
||||
return true;
|
||||
// same spell with same caster should not stack
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Aura::IsProcOnCooldown() const
|
||||
{
|
||||
/*if (m_procCooldown)
|
||||
@@ -1803,7 +1938,7 @@ bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventI
|
||||
Unit* target = aurApp->GetTarget();
|
||||
if (IsPassive() && target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (GetSpellProto()->EquippedItemClass == ITEM_CLASS_WEAPON)
|
||||
if (GetSpellInfo()->EquippedItemClass == ITEM_CLASS_WEAPON)
|
||||
{
|
||||
if (target->ToPlayer()->IsInFeralForm())
|
||||
return false;
|
||||
@@ -1819,15 +1954,15 @@ bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventI
|
||||
else
|
||||
item = target->ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED);
|
||||
|
||||
if (!item || item->IsBroken() || item->GetTemplate()->Class != ITEM_CLASS_WEAPON || !((1<<item->GetTemplate()->SubClass) & GetSpellProto()->EquippedItemSubClassMask))
|
||||
if (!item || item->IsBroken() || item->GetTemplate()->Class != ITEM_CLASS_WEAPON || !((1<<item->GetTemplate()->SubClass) & GetSpellInfo()->EquippedItemSubClassMask))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (GetSpellProto()->EquippedItemClass == ITEM_CLASS_ARMOR)
|
||||
else if (GetSpellInfo()->EquippedItemClass == ITEM_CLASS_ARMOR)
|
||||
{
|
||||
// Check if player is wearing shield
|
||||
Item *item = target->ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
|
||||
if (!item || item->IsBroken() || item->GetTemplate()->Class != ITEM_CLASS_ARMOR || !((1<<item->GetTemplate()->SubClass) & GetSpellProto()->EquippedItemSubClassMask))
|
||||
if (!item || item->IsBroken() || item->GetTemplate()->Class != ITEM_CLASS_ARMOR || !((1<<item->GetTemplate()->SubClass) & GetSpellInfo()->EquippedItemSubClassMask))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1846,7 +1981,7 @@ float Aura::CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& event
|
||||
if (eventInfo.GetDamageInfo() && procEntry.ratePerMinute != 0)
|
||||
{
|
||||
uint32 WeaponSpeed = caster->GetAttackTime(eventInfo.GetDamageInfo()->GetAttackType());
|
||||
chance = caster->GetPPMProcChance(WeaponSpeed, procEntry.ratePerMinute, GetSpellProto());
|
||||
chance = caster->GetPPMProcChance(WeaponSpeed, procEntry.ratePerMinute, GetSpellInfo());
|
||||
}
|
||||
// apply chance modifer aura, applies also to ppm chance (see improved judgement of light spell)
|
||||
if (Player* modOwner = caster->GetSpellModOwner())
|
||||
@@ -1880,7 +2015,7 @@ void Aura::_DeleteRemovedApplications()
|
||||
void Aura::LoadScripts()
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura::LoadScripts");
|
||||
sScriptMgr->CreateAuraScripts(m_spellProto->Id, m_loadedScripts);
|
||||
sScriptMgr->CreateAuraScripts(m_spellInfo->Id, m_loadedScripts);
|
||||
for (std::list<AuraScript *>::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;)
|
||||
{
|
||||
if (!(*itr)->_Load(this))
|
||||
@@ -1918,7 +2053,7 @@ bool Aura::CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplicati
|
||||
std::list<AuraScript::EffectApplyHandler>::iterator effEndItr = (*scritr)->OnEffectApply.end(), effItr = (*scritr)->OnEffectApply.begin();
|
||||
for (; effItr != effEndItr ; ++effItr)
|
||||
{
|
||||
if ((*effItr).IsEffectAffected(m_spellProto, aurEff->GetEffIndex()))
|
||||
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
|
||||
(*effItr).Call(*scritr, aurEff, mode);
|
||||
}
|
||||
if (!preventDefault)
|
||||
@@ -1937,7 +2072,7 @@ bool Aura::CallScriptEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplicat
|
||||
std::list<AuraScript::EffectApplyHandler>::iterator effEndItr = (*scritr)->OnEffectRemove.end(), effItr = (*scritr)->OnEffectRemove.begin();
|
||||
for (; effItr != effEndItr ; ++effItr)
|
||||
{
|
||||
if ((*effItr).IsEffectAffected(m_spellProto, aurEff->GetEffIndex()))
|
||||
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
|
||||
(*effItr).Call(*scritr, aurEff, mode);
|
||||
}
|
||||
if (!preventDefault)
|
||||
@@ -1955,7 +2090,7 @@ void Aura::CallScriptAfterEffectApplyHandlers(AuraEffect const* aurEff, AuraAppl
|
||||
std::list<AuraScript::EffectApplyHandler>::iterator effEndItr = (*scritr)->AfterEffectApply.end(), effItr = (*scritr)->AfterEffectApply.begin();
|
||||
for (; effItr != effEndItr ; ++effItr)
|
||||
{
|
||||
if ((*effItr).IsEffectAffected(m_spellProto, aurEff->GetEffIndex()))
|
||||
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
|
||||
(*effItr).Call(*scritr, aurEff, mode);
|
||||
}
|
||||
(*scritr)->_FinishScriptCall();
|
||||
@@ -1970,7 +2105,7 @@ void Aura::CallScriptAfterEffectRemoveHandlers(AuraEffect const* aurEff, AuraApp
|
||||
std::list<AuraScript::EffectApplyHandler>::iterator effEndItr = (*scritr)->AfterEffectRemove.end(), effItr = (*scritr)->AfterEffectRemove.begin();
|
||||
for (; effItr != effEndItr ; ++effItr)
|
||||
{
|
||||
if ((*effItr).IsEffectAffected(m_spellProto, aurEff->GetEffIndex()))
|
||||
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
|
||||
(*effItr).Call(*scritr, aurEff, mode);
|
||||
}
|
||||
(*scritr)->_FinishScriptCall();
|
||||
@@ -1986,7 +2121,7 @@ bool Aura::CallScriptEffectPeriodicHandlers(AuraEffect const* aurEff, AuraApplic
|
||||
std::list<AuraScript::EffectPeriodicHandler>::iterator effEndItr = (*scritr)->OnEffectPeriodic.end(), effItr = (*scritr)->OnEffectPeriodic.begin();
|
||||
for (; effItr != effEndItr ; ++effItr)
|
||||
{
|
||||
if ((*effItr).IsEffectAffected(m_spellProto, aurEff->GetEffIndex()))
|
||||
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
|
||||
(*effItr).Call(*scritr, aurEff);
|
||||
}
|
||||
if (!preventDefault)
|
||||
@@ -2004,7 +2139,7 @@ void Aura::CallScriptEffectUpdatePeriodicHandlers(AuraEffect * aurEff)
|
||||
std::list<AuraScript::EffectUpdatePeriodicHandler>::iterator effEndItr = (*scritr)->OnEffectUpdatePeriodic.end(), effItr = (*scritr)->OnEffectUpdatePeriodic.begin();
|
||||
for (; effItr != effEndItr ; ++effItr)
|
||||
{
|
||||
if ((*effItr).IsEffectAffected(m_spellProto, aurEff->GetEffIndex()))
|
||||
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
|
||||
(*effItr).Call(*scritr, aurEff);
|
||||
}
|
||||
(*scritr)->_FinishScriptCall();
|
||||
@@ -2019,7 +2154,7 @@ void Aura::CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32 &
|
||||
std::list<AuraScript::EffectCalcAmountHandler>::iterator effEndItr = (*scritr)->DoEffectCalcAmount.end(), effItr = (*scritr)->DoEffectCalcAmount.begin();
|
||||
for (; effItr != effEndItr ; ++effItr)
|
||||
{
|
||||
if ((*effItr).IsEffectAffected(m_spellProto, aurEff->GetEffIndex()))
|
||||
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
|
||||
(*effItr).Call(*scritr, aurEff, amount, canBeRecalculated);
|
||||
}
|
||||
(*scritr)->_FinishScriptCall();
|
||||
@@ -2034,7 +2169,7 @@ void Aura::CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool &
|
||||
std::list<AuraScript::EffectCalcPeriodicHandler>::iterator effEndItr = (*scritr)->DoEffectCalcPeriodic.end(), effItr = (*scritr)->DoEffectCalcPeriodic.begin();
|
||||
for (; effItr != effEndItr ; ++effItr)
|
||||
{
|
||||
if ((*effItr).IsEffectAffected(m_spellProto, aurEff->GetEffIndex()))
|
||||
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
|
||||
(*effItr).Call(*scritr, aurEff, isPeriodic, amplitude);
|
||||
}
|
||||
(*scritr)->_FinishScriptCall();
|
||||
@@ -2049,7 +2184,7 @@ void Aura::CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellM
|
||||
std::list<AuraScript::EffectCalcSpellModHandler>::iterator effEndItr = (*scritr)->DoEffectCalcSpellMod.end(), effItr = (*scritr)->DoEffectCalcSpellMod.begin();
|
||||
for (; effItr != effEndItr ; ++effItr)
|
||||
{
|
||||
if ((*effItr).IsEffectAffected(m_spellProto, aurEff->GetEffIndex()))
|
||||
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
|
||||
(*effItr).Call(*scritr, aurEff, spellMod);
|
||||
}
|
||||
(*scritr)->_FinishScriptCall();
|
||||
@@ -2064,7 +2199,7 @@ void Aura::CallScriptEffectAbsorbHandlers(AuraEffect * aurEff, AuraApplication c
|
||||
std::list<AuraScript::EffectAbsorbHandler>::iterator effEndItr = (*scritr)->OnEffectAbsorb.end(), effItr = (*scritr)->OnEffectAbsorb.begin();
|
||||
for (; effItr != effEndItr ; ++effItr)
|
||||
{
|
||||
if ((*effItr).IsEffectAffected(m_spellProto, aurEff->GetEffIndex()))
|
||||
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
|
||||
(*effItr).Call(*scritr, aurEff, dmgInfo, absorbAmount);
|
||||
}
|
||||
(*scritr)->_FinishScriptCall();
|
||||
@@ -2079,7 +2214,7 @@ void Aura::CallScriptEffectAfterAbsorbHandlers(AuraEffect * aurEff, AuraApplicat
|
||||
std::list<AuraScript::EffectAbsorbHandler>::iterator effEndItr = (*scritr)->AfterEffectAbsorb.end(), effItr = (*scritr)->AfterEffectAbsorb.begin();
|
||||
for (; effItr != effEndItr ; ++effItr)
|
||||
{
|
||||
if ((*effItr).IsEffectAffected(m_spellProto, aurEff->GetEffIndex()))
|
||||
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
|
||||
(*effItr).Call(*scritr, aurEff, dmgInfo, absorbAmount);
|
||||
}
|
||||
(*scritr)->_FinishScriptCall();
|
||||
@@ -2094,7 +2229,7 @@ void Aura::CallScriptEffectManaShieldHandlers(AuraEffect * aurEff, AuraApplicati
|
||||
std::list<AuraScript::EffectManaShieldHandler>::iterator effEndItr = (*scritr)->OnEffectManaShield.end(), effItr = (*scritr)->OnEffectManaShield.begin();
|
||||
for (; effItr != effEndItr ; ++effItr)
|
||||
{
|
||||
if ((*effItr).IsEffectAffected(m_spellProto, aurEff->GetEffIndex()))
|
||||
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
|
||||
(*effItr).Call(*scritr, aurEff, dmgInfo, absorbAmount);
|
||||
}
|
||||
(*scritr)->_FinishScriptCall();
|
||||
@@ -2109,14 +2244,14 @@ void Aura::CallScriptEffectAfterManaShieldHandlers(AuraEffect * aurEff, AuraAppl
|
||||
std::list<AuraScript::EffectManaShieldHandler>::iterator effEndItr = (*scritr)->AfterEffectManaShield.end(), effItr = (*scritr)->AfterEffectManaShield.begin();
|
||||
for (; effItr != effEndItr ; ++effItr)
|
||||
{
|
||||
if ((*effItr).IsEffectAffected(m_spellProto, aurEff->GetEffIndex()))
|
||||
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
|
||||
(*effItr).Call(*scritr, aurEff, dmgInfo, absorbAmount);
|
||||
}
|
||||
(*scritr)->_FinishScriptCall();
|
||||
}
|
||||
}
|
||||
|
||||
UnitAura::UnitAura(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID)
|
||||
UnitAura::UnitAura(SpellInfo const* spellproto, uint8 effMask, WorldObject * owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID)
|
||||
: Aura(spellproto, owner, caster, castItem, casterGUID)
|
||||
{
|
||||
m_AuraDRGroup = DIMINISHING_NONE;
|
||||
@@ -2162,24 +2297,17 @@ void UnitAura::FillTargetMap(std::map<Unit *, uint8> & targets, Unit* caster)
|
||||
continue;
|
||||
UnitList targetList;
|
||||
// non-area aura
|
||||
if (GetSpellProto()->Effect[effIndex] == SPELL_EFFECT_APPLY_AURA)
|
||||
if (GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_APPLY_AURA)
|
||||
{
|
||||
targetList.push_back(GetUnitOwner());
|
||||
}
|
||||
else
|
||||
{
|
||||
float radius;
|
||||
if (GetSpellProto()->Effect[effIndex] == SPELL_EFFECT_APPLY_AREA_AURA_ENEMY)
|
||||
radius = GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(GetSpellProto()->EffectRadiusIndex[effIndex]));
|
||||
else
|
||||
radius = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(GetSpellProto()->EffectRadiusIndex[effIndex]));
|
||||
|
||||
if (modOwner)
|
||||
modOwner->ApplySpellMod(GetId(), SPELLMOD_RADIUS, radius);
|
||||
float radius = GetSpellInfo()->Effects[effIndex].CalcRadius(caster);
|
||||
|
||||
if (!GetUnitOwner()->HasUnitState(UNIT_STAT_ISOLATED))
|
||||
{
|
||||
switch(GetSpellProto()->Effect[effIndex])
|
||||
switch(GetSpellInfo()->Effects[effIndex].Effect)
|
||||
{
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_PARTY:
|
||||
targetList.push_back(GetUnitOwner());
|
||||
@@ -2228,7 +2356,7 @@ void UnitAura::FillTargetMap(std::map<Unit *, uint8> & targets, Unit* caster)
|
||||
}
|
||||
}
|
||||
|
||||
DynObjAura::DynObjAura(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID)
|
||||
DynObjAura::DynObjAura(SpellInfo const* spellproto, uint8 effMask, WorldObject * owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID)
|
||||
: Aura(spellproto, owner, caster, castItem, casterGUID)
|
||||
{
|
||||
LoadScripts();
|
||||
@@ -2256,8 +2384,8 @@ void DynObjAura::FillTargetMap(std::map<Unit *, uint8> & targets, Unit* /*caster
|
||||
if (!HasEffect(effIndex))
|
||||
continue;
|
||||
UnitList targetList;
|
||||
if (GetSpellProto()->EffectImplicitTargetB[effIndex] == TARGET_DEST_DYNOBJ_ALLY
|
||||
|| GetSpellProto()->EffectImplicitTargetB[effIndex] == TARGET_UNIT_AREA_ALLY_DST)
|
||||
if (GetSpellInfo()->Effects[effIndex].TargetB == TARGET_DEST_DYNOBJ_ALLY
|
||||
|| GetSpellInfo()->Effects[effIndex].TargetB == TARGET_UNIT_AREA_ALLY_DST)
|
||||
{
|
||||
Trinity::AnyFriendlyUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
|
||||
Trinity::UnitListSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(GetDynobjOwner(), targetList, u_check);
|
||||
|
||||
@@ -20,9 +20,10 @@
|
||||
#define TRINITY_SPELLAURAS_H
|
||||
|
||||
#include "SpellAuraDefines.h"
|
||||
#include "SpellInfo.h"
|
||||
|
||||
class Unit;
|
||||
struct SpellEntry;
|
||||
class SpellInfo;
|
||||
struct SpellModifier;
|
||||
struct ProcTriggerSpell;
|
||||
struct SpellProcEntry;
|
||||
@@ -82,20 +83,20 @@ class AuraApplication
|
||||
|
||||
class Aura
|
||||
{
|
||||
friend Aura * Unit::_TryStackingOrRefreshingExistingAura(SpellEntry const* newAura, uint8 effMask, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID);
|
||||
friend Aura * Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID);
|
||||
public:
|
||||
typedef std::map<uint64, AuraApplication *> ApplicationMap;
|
||||
|
||||
static uint8 BuildEffectMaskForOwner(SpellEntry const* spellProto, uint8 avalibleEffectMask, WorldObject* owner);
|
||||
static Aura* TryRefreshStackOrCreate(SpellEntry const* spellproto, uint8 tryEffMask, WorldObject* owner, Unit* caster, int32* baseAmount = NULL, Item* castItem = NULL, uint64 casterGUID = 0, bool* refresh = NULL);
|
||||
static Aura* TryCreate(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit* caster, int32 *baseAmount = NULL, Item* castItem = NULL, uint64 casterGUID = 0);
|
||||
static Aura* Create(SpellEntry const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32* baseAmount, Item* castItem, uint64 casterGUID);
|
||||
explicit Aura(SpellEntry const* spellproto, WorldObject * owner, Unit* caster, Item* castItem, uint64 casterGUID);
|
||||
static uint8 BuildEffectMaskForOwner(SpellInfo const* spellProto, uint8 avalibleEffectMask, WorldObject* owner);
|
||||
static Aura* TryRefreshStackOrCreate(SpellInfo const* spellproto, uint8 tryEffMask, WorldObject* owner, Unit* caster, int32* baseAmount = NULL, Item* castItem = NULL, uint64 casterGUID = 0, bool* refresh = NULL);
|
||||
static Aura* TryCreate(SpellInfo const* spellproto, uint8 effMask, WorldObject * owner, Unit* caster, int32 *baseAmount = NULL, Item* castItem = NULL, uint64 casterGUID = 0);
|
||||
static Aura* Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32* baseAmount, Item* castItem, uint64 casterGUID);
|
||||
explicit Aura(SpellInfo const* spellproto, WorldObject * owner, Unit* caster, Item* castItem, uint64 casterGUID);
|
||||
void _InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount);
|
||||
virtual ~Aura();
|
||||
|
||||
SpellEntry const* GetSpellProto() const { return m_spellProto; }
|
||||
uint32 GetId() const{ return GetSpellProto()->Id; }
|
||||
SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
|
||||
uint32 GetId() const{ return GetSpellInfo()->Id; }
|
||||
|
||||
uint64 GetCastItemGUID() const { return m_castItemGuid; }
|
||||
uint64 const& GetCasterGUID() const { return m_casterGuid; }
|
||||
@@ -150,7 +151,7 @@ class Aura
|
||||
|
||||
bool IsPassive() const;
|
||||
bool IsDeathPersistent() const;
|
||||
bool IsRemovedOnShapeLost(Unit* target) const { return (GetCasterGUID() == target->GetGUID() && m_spellProto->Stances && !(m_spellProto->AttributesEx2 & SPELL_ATTR2_NOT_NEED_SHAPESHIFT) && !(m_spellProto->Attributes & SPELL_ATTR0_NOT_SHAPESHIFT)); }
|
||||
bool IsRemovedOnShapeLost(Unit* target) const { return (GetCasterGUID() == target->GetGUID() && m_spellInfo->Stances && !(m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_NEED_SHAPESHIFT) && !(m_spellInfo->Attributes & SPELL_ATTR0_NOT_SHAPESHIFT)); }
|
||||
bool CanBeSaved() const;
|
||||
bool IsRemoved() const { return m_isRemoved; }
|
||||
bool CanBeSentToClient() const;
|
||||
@@ -158,6 +159,7 @@ class Aura
|
||||
bool IsSingleTarget() const {return m_isSingleTarget;}
|
||||
void SetIsSingleTarget(bool val) { m_isSingleTarget = val;}
|
||||
void UnregisterSingleTarget();
|
||||
int32 CalcDispelChance(Unit* auraTarget, bool offensive) const;
|
||||
|
||||
void SetLoadedState(int32 maxduration, int32 duration, int32 charges, uint8 stackamount, uint8 recalculateMask, int32 * amount);
|
||||
|
||||
@@ -180,6 +182,7 @@ class Aura
|
||||
void HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, bool apply, bool onReapply);
|
||||
bool CanBeAppliedOn(Unit* target);
|
||||
bool CheckAreaTarget(Unit* target);
|
||||
bool CanStackWith(Aura const* existingAura) const;
|
||||
|
||||
// Proc system
|
||||
bool IsProcOnCooldown() const;
|
||||
@@ -191,7 +194,6 @@ class Aura
|
||||
float CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const;
|
||||
void TriggerProcOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
|
||||
|
||||
// AuraScript
|
||||
void LoadScripts();
|
||||
bool CallScriptCheckAreaTargetHandlers(Unit* target);
|
||||
@@ -212,7 +214,7 @@ class Aura
|
||||
private:
|
||||
void _DeleteRemovedApplications();
|
||||
protected:
|
||||
SpellEntry const* const m_spellProto;
|
||||
SpellInfo const* const m_spellInfo;
|
||||
uint64 const m_casterGuid;
|
||||
uint64 const m_castItemGuid; // it is NOT safe to keep a pointer to the item because it may get deleted
|
||||
time_t const m_applyTime;
|
||||
@@ -240,9 +242,9 @@ class Aura
|
||||
|
||||
class UnitAura : public Aura
|
||||
{
|
||||
friend Aura * Aura::Create(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID);
|
||||
friend Aura * Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject * owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID);
|
||||
protected:
|
||||
explicit UnitAura(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID);
|
||||
explicit UnitAura(SpellInfo const* spellproto, uint8 effMask, WorldObject * owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID);
|
||||
public:
|
||||
void _ApplyForTarget(Unit* target, Unit* caster, AuraApplication * aurApp);
|
||||
void _UnapplyForTarget(Unit* target, Unit* caster, AuraApplication * aurApp);
|
||||
@@ -261,9 +263,9 @@ class UnitAura : public Aura
|
||||
|
||||
class DynObjAura : public Aura
|
||||
{
|
||||
friend Aura * Aura::Create(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID);
|
||||
friend Aura * Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject * owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID);
|
||||
protected:
|
||||
explicit DynObjAura(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID);
|
||||
explicit DynObjAura(SpellInfo const* spellproto, uint8 effMask, WorldObject * owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID);
|
||||
public:
|
||||
void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
|
||||
|
||||
+286
-279
File diff suppressed because it is too large
Load Diff
@@ -31,8 +31,8 @@ class WorldObject;
|
||||
class Aura;
|
||||
class SpellScript;
|
||||
class ByteBuffer;
|
||||
|
||||
struct SpellEntry;
|
||||
class SpellInfo;
|
||||
class SpellImplicitTargetInfo;
|
||||
|
||||
#define SPELL_CHANNEL_UPDATE_INTERVAL (1 * IN_MILLISECONDS)
|
||||
|
||||
@@ -211,14 +211,7 @@ class SpellCastTargets
|
||||
|
||||
struct SpellValue
|
||||
{
|
||||
explicit SpellValue(SpellEntry const* proto)
|
||||
{
|
||||
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
EffectBasePoints[i] = proto->EffectBasePoints[i];
|
||||
MaxAffectedTargets = proto->MaxAffectedTargets;
|
||||
RadiusMod = 1.0f;
|
||||
AuraStackAmount = 1;
|
||||
}
|
||||
explicit SpellValue(SpellInfo const* proto);
|
||||
int32 EffectBasePoints[MAX_SPELL_EFFECTS];
|
||||
uint32 MaxAffectedTargets;
|
||||
float RadiusMod;
|
||||
@@ -387,7 +380,7 @@ class Spell
|
||||
|
||||
typedef std::set<Aura*> UsedSpellMods;
|
||||
|
||||
Spell(Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID = 0, bool skipCheck = false, bool castedClientside = false);
|
||||
Spell(Unit* Caster, SpellInfo const *info, bool triggered, uint64 originalCasterGUID = 0, bool skipCheck = false, bool castedClientside = false);
|
||||
~Spell();
|
||||
|
||||
void prepare(SpellCastTargets const* targets, AuraEffect const* triggeredByAura = NULL);
|
||||
@@ -431,7 +424,7 @@ class Spell
|
||||
void WriteAmmoToPacket(WorldPacket * data);
|
||||
|
||||
void SelectSpellTargets();
|
||||
void SelectEffectTargets(uint32 i, uint32 cur);
|
||||
void SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur);
|
||||
void SelectTrajTargets();
|
||||
|
||||
template<typename T> WorldObject* FindCorpseUsing();
|
||||
@@ -441,7 +434,7 @@ class Spell
|
||||
void CheckSrc() { if (!m_targets.HasSrc()) m_targets.SetSrc(*m_caster); }
|
||||
void CheckDst() { if (!m_targets.HasDst()) m_targets.SetDst(*m_caster); }
|
||||
|
||||
static void SendCastResult(Player* caster, SpellEntry const* spellInfo, uint8 cast_count, SpellCastResult result, SpellCustomErrors customError = SPELL_CUSTOM_ERROR_NONE);
|
||||
static void SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cast_count, SpellCastResult result, SpellCustomErrors customError = SPELL_CUSTOM_ERROR_NONE);
|
||||
void SendCastResult(SpellCastResult result);
|
||||
void SendSpellStart();
|
||||
void SendSpellGo();
|
||||
@@ -463,9 +456,9 @@ class Spell
|
||||
void SendResurrectRequest(Player* target);
|
||||
|
||||
void HandleEffects(Unit *pUnitTarget, Item *pItemTarget, GameObject *pGOTarget, uint32 i);
|
||||
void HandleThreatSpells(uint32 spellId);
|
||||
void HandleThreatSpells();
|
||||
|
||||
const SpellEntry * const m_spellInfo;
|
||||
SpellInfo const* const m_spellInfo;
|
||||
Item* m_CastItem;
|
||||
uint64 m_castItemGUID;
|
||||
uint8 m_cast_count;
|
||||
@@ -477,17 +470,14 @@ class Spell
|
||||
|
||||
UsedSpellMods m_appliedMods;
|
||||
|
||||
int32 GetCastTime() const { return m_casttime; }
|
||||
int32 CalcCastTime() const { return m_casttime; }
|
||||
bool IsAutoRepeat() const { return m_autoRepeat; }
|
||||
void SetAutoRepeat(bool rep) { m_autoRepeat = rep; }
|
||||
void ReSetTimer() { m_timer = m_casttime > 0 ? m_casttime : 0; }
|
||||
bool IsNextMeleeSwingSpell() const
|
||||
{
|
||||
return m_spellInfo->Attributes & SPELL_ATTR0_ON_NEXT_SWING;
|
||||
}
|
||||
bool IsNextMeleeSwingSpell() const;
|
||||
bool IsTriggered() const {return m_IsTriggeredSpell;};
|
||||
bool IsChannelActive() const { return m_caster->GetUInt32Value(UNIT_CHANNEL_SPELL) != 0; }
|
||||
bool IsAutoActionResetSpell() const { return !m_IsTriggeredSpell && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_AUTOATTACK); }
|
||||
bool IsAutoActionResetSpell() const;
|
||||
|
||||
bool IsDeletable() const { return !m_referencedFromCurrentSpell && !m_executedCurrently; }
|
||||
void SetReferencedFromCurrent(bool yes) { m_referencedFromCurrentSpell = yes; }
|
||||
@@ -503,7 +493,7 @@ class Spell
|
||||
|
||||
Unit* GetCaster() const { return m_caster; }
|
||||
Unit* GetOriginalCaster() const { return m_originalCaster; }
|
||||
SpellEntry const* GetSpellInfo() const { return m_spellInfo; }
|
||||
SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
|
||||
int32 GetPowerCost() const { return m_powerCost; }
|
||||
|
||||
void UpdatePointers(); // must be used at call Spell code after time delay (non triggered spell cast/update spell call/etc)
|
||||
@@ -669,7 +659,7 @@ class Spell
|
||||
|
||||
bool CanExecuteTriggersOnHit(uint8 effMask) const;
|
||||
void PrepareTriggersExecutedOnHit();
|
||||
typedef std::list< std::pair<SpellEntry const*, int32> > HitTriggerSpells;
|
||||
typedef std::list< std::pair<SpellInfo const*, int32> > HitTriggerSpells;
|
||||
HitTriggerSpells m_hitTriggerSpells;
|
||||
|
||||
// effect helpers
|
||||
@@ -689,9 +679,8 @@ class Spell
|
||||
// if need this can be replaced by Aura copy
|
||||
// we can't store original aura link to prevent access to deleted auras
|
||||
// and in same time need aura data and after aura deleting.
|
||||
SpellEntry const* m_triggeredByAuraSpell;
|
||||
SpellInfo const* m_triggeredByAuraSpell;
|
||||
|
||||
uint32 m_customAttr;
|
||||
bool m_skipCheck;
|
||||
uint32 m_effectMask;
|
||||
uint8 m_auraScaleMask;
|
||||
@@ -719,10 +708,10 @@ namespace Trinity
|
||||
uint32 i_entry;
|
||||
const Position * const i_pos;
|
||||
bool i_requireDeadTarget;
|
||||
SpellEntry const* i_spellProto;
|
||||
SpellInfo const* i_spellProto;
|
||||
|
||||
SpellNotifierCreatureAndPlayer(Unit *source, std::list<Unit*> &data, float radius, SpellNotifyPushType type,
|
||||
SpellTargets TargetType = SPELL_TARGETS_ENEMY, const Position *pos = NULL, uint32 entry = 0, SpellEntry const* spellProto = NULL)
|
||||
SpellTargets TargetType = SPELL_TARGETS_ENEMY, const Position *pos = NULL, uint32 entry = 0, SpellInfo const* spellProto = NULL)
|
||||
: i_data(&data), i_push_type(type), i_radius(radius), i_TargetType(TargetType),
|
||||
i_source(source), i_entry(entry), i_pos(pos), i_spellProto(spellProto)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+1785
-3072
File diff suppressed because it is too large
Load Diff
+155
-1070
File diff suppressed because it is too large
Load Diff
@@ -21,7 +21,7 @@
|
||||
#include "SpellScript.h"
|
||||
#include "SpellMgr.h"
|
||||
|
||||
bool _SpellScript::_Validate(SpellEntry const* entry)
|
||||
bool _SpellScript::_Validate(SpellInfo const* entry)
|
||||
{
|
||||
if (!Validate(entry))
|
||||
{
|
||||
@@ -59,7 +59,7 @@ _SpellScript::EffectHook::EffectHook(uint8 _effIndex)
|
||||
effIndex = _effIndex;
|
||||
}
|
||||
|
||||
uint8 _SpellScript::EffectHook::GetAffectedEffectsMask(SpellEntry const* spellEntry)
|
||||
uint8 _SpellScript::EffectHook::GetAffectedEffectsMask(SpellInfo const* spellEntry)
|
||||
{
|
||||
uint8 mask = 0;
|
||||
if ((effIndex == EFFECT_ALL) || (effIndex == EFFECT_FIRST_FOUND))
|
||||
@@ -80,7 +80,7 @@ uint8 _SpellScript::EffectHook::GetAffectedEffectsMask(SpellEntry const* spellEn
|
||||
return mask;
|
||||
}
|
||||
|
||||
bool _SpellScript::EffectHook::IsEffectAffected(SpellEntry const* spellEntry, uint8 effIndex)
|
||||
bool _SpellScript::EffectHook::IsEffectAffected(SpellInfo const* spellEntry, uint8 effIndex)
|
||||
{
|
||||
return GetAffectedEffectsMask(spellEntry) & 1<<effIndex;
|
||||
}
|
||||
@@ -103,13 +103,13 @@ std::string _SpellScript::EffectHook::EffIndexToString()
|
||||
return "Invalid Value";
|
||||
}
|
||||
|
||||
bool _SpellScript::EffectNameCheck::Check(SpellEntry const* spellEntry, uint8 effIndex)
|
||||
bool _SpellScript::EffectNameCheck::Check(SpellInfo const* spellEntry, uint8 effIndex)
|
||||
{
|
||||
if (!spellEntry->Effect[effIndex] && !effName)
|
||||
if (!spellEntry->Effects[effIndex].Effect && !effName)
|
||||
return true;
|
||||
if (!spellEntry->Effect[effIndex])
|
||||
if (!spellEntry->Effects[effIndex].Effect)
|
||||
return false;
|
||||
return (effName == SPELL_EFFECT_ANY) || (spellEntry->Effect[effIndex] == effName);
|
||||
return (effName == SPELL_EFFECT_ANY) || (spellEntry->Effects[effIndex].Effect == effName);
|
||||
}
|
||||
|
||||
std::string _SpellScript::EffectNameCheck::ToString()
|
||||
@@ -125,13 +125,13 @@ std::string _SpellScript::EffectNameCheck::ToString()
|
||||
}
|
||||
}
|
||||
|
||||
bool _SpellScript::EffectAuraNameCheck::Check(SpellEntry const* spellEntry, uint8 effIndex)
|
||||
bool _SpellScript::EffectAuraNameCheck::Check(SpellInfo const* spellEntry, uint8 effIndex)
|
||||
{
|
||||
if (!spellEntry->EffectApplyAuraName[effIndex] && !effAurName)
|
||||
if (!spellEntry->Effects[effIndex].ApplyAuraName && !effAurName)
|
||||
return true;
|
||||
if (!spellEntry->EffectApplyAuraName[effIndex])
|
||||
if (!spellEntry->Effects[effIndex].ApplyAuraName)
|
||||
return false;
|
||||
return (effAurName == SPELL_EFFECT_ANY) || (spellEntry->EffectApplyAuraName[effIndex] == effAurName);
|
||||
return (effAurName == SPELL_EFFECT_ANY) || (spellEntry->Effects[effIndex].ApplyAuraName == effAurName);
|
||||
}
|
||||
|
||||
std::string _SpellScript::EffectAuraNameCheck::ToString()
|
||||
@@ -168,7 +168,7 @@ std::string SpellScript::EffectHandler::ToString()
|
||||
return "Index: " + EffIndexToString() + " Name: " +_SpellScript::EffectNameCheck::ToString();
|
||||
}
|
||||
|
||||
bool SpellScript::EffectHandler::CheckEffect(SpellEntry const* spellEntry, uint8 effIndex)
|
||||
bool SpellScript::EffectHandler::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex)
|
||||
{
|
||||
return _SpellScript::EffectNameCheck::Check(spellEntry, effIndex);
|
||||
}
|
||||
@@ -201,11 +201,11 @@ std::string SpellScript::UnitTargetHandler::ToString()
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
bool SpellScript::UnitTargetHandler::CheckEffect(SpellEntry const* spellEntry, uint8 effIndex)
|
||||
bool SpellScript::UnitTargetHandler::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex)
|
||||
{
|
||||
if (!targetType)
|
||||
return false;
|
||||
return (effIndex == EFFECT_ALL) || (spellEntry->EffectImplicitTargetA[effIndex] == targetType || spellEntry->EffectImplicitTargetB[effIndex] == targetType);
|
||||
return (effIndex == EFFECT_ALL) || (spellEntry->Effects[effIndex].TargetA == targetType || spellEntry->Effects[effIndex].TargetB == targetType);
|
||||
}
|
||||
|
||||
void SpellScript::UnitTargetHandler::Call(SpellScript* spellScript, std::list<Unit*>& unitTargets)
|
||||
@@ -213,7 +213,7 @@ void SpellScript::UnitTargetHandler::Call(SpellScript* spellScript, std::list<Un
|
||||
(spellScript->*pUnitTargetHandlerScript)(unitTargets);
|
||||
}
|
||||
|
||||
bool SpellScript::_Validate(SpellEntry const* entry)
|
||||
bool SpellScript::_Validate(SpellInfo const* entry)
|
||||
{
|
||||
for (std::list<EffectHandler>::iterator itr = OnEffect.begin(); itr != OnEffect.end(); ++itr)
|
||||
if (!(*itr).GetAffectedEffectsMask(entry))
|
||||
@@ -261,7 +261,7 @@ Unit* SpellScript::GetOriginalCaster()
|
||||
return m_spell->GetOriginalCaster();
|
||||
}
|
||||
|
||||
SpellEntry const* SpellScript::GetSpellInfo()
|
||||
SpellInfo const* SpellScript::GetSpellInfo()
|
||||
{
|
||||
return m_spell->GetSpellInfo();
|
||||
}
|
||||
@@ -472,10 +472,10 @@ void SpellScript::SetCustomCastResultMessage(SpellCustomErrors result)
|
||||
m_spell->m_customError = result;
|
||||
}
|
||||
|
||||
bool AuraScript::_Validate(SpellEntry const* entry)
|
||||
bool AuraScript::_Validate(SpellInfo const* entry)
|
||||
{
|
||||
for (std::list<CheckAreaTargetHandler>::iterator itr = DoCheckAreaTarget.begin(); itr != DoCheckAreaTarget.end(); ++itr)
|
||||
if (!HasAreaAuraEffect(entry))
|
||||
if (!entry->HasAreaAuraEffect())
|
||||
sLog->outError("TSCR: Spell `%u` of script `%s` does not have area aura effect - handler bound to hook `DoCheckAreaTarget` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
|
||||
|
||||
for (std::list<EffectApplyHandler>::iterator itr = OnEffectApply.begin(); itr != OnEffectApply.end(); ++itr)
|
||||
@@ -548,7 +548,7 @@ AuraScript::EffectBase::EffectBase(uint8 _effIndex, uint16 _effName)
|
||||
{
|
||||
}
|
||||
|
||||
bool AuraScript::EffectBase::CheckEffect(SpellEntry const* spellEntry, uint8 effIndex)
|
||||
bool AuraScript::EffectBase::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex)
|
||||
{
|
||||
return _SpellScript::EffectAuraNameCheck::Check(spellEntry, effIndex);
|
||||
}
|
||||
@@ -703,9 +703,9 @@ void AuraScript::PreventDefaultAction()
|
||||
}
|
||||
}
|
||||
|
||||
SpellEntry const* AuraScript::GetSpellProto() const
|
||||
SpellInfo const* AuraScript::GetSpellInfo() const
|
||||
{
|
||||
return m_aura->GetSpellProto();
|
||||
return m_aura->GetSpellInfo();
|
||||
}
|
||||
|
||||
uint32 AuraScript::GetId() const
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <stack>
|
||||
|
||||
class Unit;
|
||||
struct SpellEntry;
|
||||
class SpellInfo;
|
||||
class SpellScript;
|
||||
class Spell;
|
||||
class Aura;
|
||||
@@ -56,7 +56,7 @@ class _SpellScript
|
||||
// internal use classes & functions
|
||||
// DO NOT OVERRIDE THESE IN SCRIPTS
|
||||
protected:
|
||||
virtual bool _Validate(SpellEntry const* entry);
|
||||
virtual bool _Validate(SpellInfo const* entry);
|
||||
|
||||
public:
|
||||
_SpellScript() : m_currentScriptState(SPELL_SCRIPT_STATE_NONE) {}
|
||||
@@ -70,9 +70,9 @@ class _SpellScript
|
||||
{
|
||||
public:
|
||||
EffectHook(uint8 _effIndex);
|
||||
uint8 GetAffectedEffectsMask(SpellEntry const* spellEntry);
|
||||
bool IsEffectAffected(SpellEntry const* spellEntry, uint8 effIndex);
|
||||
virtual bool CheckEffect(SpellEntry const* spellEntry, uint8 effIndex) = 0;
|
||||
uint8 GetAffectedEffectsMask(SpellInfo const* spellEntry);
|
||||
bool IsEffectAffected(SpellInfo const* spellEntry, uint8 effIndex);
|
||||
virtual bool CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) = 0;
|
||||
std::string EffIndexToString();
|
||||
protected:
|
||||
uint8 effIndex;
|
||||
@@ -82,7 +82,7 @@ class _SpellScript
|
||||
{
|
||||
public:
|
||||
EffectNameCheck(uint16 _effName) {effName = _effName;};
|
||||
bool Check(SpellEntry const* spellEntry, uint8 effIndex);
|
||||
bool Check(SpellInfo const* spellEntry, uint8 effIndex);
|
||||
std::string ToString();
|
||||
private:
|
||||
uint16 effName;
|
||||
@@ -92,7 +92,7 @@ class _SpellScript
|
||||
{
|
||||
public:
|
||||
EffectAuraNameCheck(uint16 _effAurName) { effAurName = _effAurName; }
|
||||
bool Check(SpellEntry const* spellEntry, uint8 effIndex);
|
||||
bool Check(SpellInfo const* spellEntry, uint8 effIndex);
|
||||
std::string ToString();
|
||||
private:
|
||||
uint16 effAurName;
|
||||
@@ -110,7 +110,7 @@ class _SpellScript
|
||||
virtual void Register() = 0;
|
||||
// Function called on server startup, if returns false script won't be used in core
|
||||
// use for: dbc/template data presence/correctness checks
|
||||
virtual bool Validate(SpellEntry const* /*spellEntry*/) { return true; }
|
||||
virtual bool Validate(SpellInfo const* /*spellEntry*/) { return true; }
|
||||
// Function called when script is created, if returns false script will be unloaded afterwards
|
||||
// use for: initializing local script variables (DO NOT USE CONSTRUCTOR FOR THIS PURPOSE!)
|
||||
virtual bool Load() { return true; }
|
||||
@@ -163,7 +163,7 @@ class SpellScript : public _SpellScript
|
||||
public:
|
||||
EffectHandler(SpellEffectFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName);
|
||||
std::string ToString();
|
||||
bool CheckEffect(SpellEntry const* spellEntry, uint8 effIndex);
|
||||
bool CheckEffect(SpellInfo const* spellEntry, uint8 effIndex);
|
||||
void Call(SpellScript* spellScript, SpellEffIndex effIndex);
|
||||
private:
|
||||
SpellEffectFnType pEffectHandlerScript;
|
||||
@@ -183,7 +183,7 @@ class SpellScript : public _SpellScript
|
||||
public:
|
||||
UnitTargetHandler(SpellUnitTargetFnType _pUnitTargetHandlerScript, uint8 _effIndex, uint16 _targetType);
|
||||
std::string ToString();
|
||||
bool CheckEffect(SpellEntry const* spellEntry, uint8 targetType);
|
||||
bool CheckEffect(SpellInfo const* spellEntry, uint8 targetType);
|
||||
void Call(SpellScript* spellScript, std::list<Unit*>& unitTargets);
|
||||
private:
|
||||
SpellUnitTargetFnType pUnitTargetHandlerScript;
|
||||
@@ -198,7 +198,7 @@ class SpellScript : public _SpellScript
|
||||
|
||||
#define PrepareSpellScript(CLASSNAME) SPELLSCRIPT_FUNCTION_TYPE_DEFINES(CLASSNAME) SPELLSCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME)
|
||||
public:
|
||||
bool _Validate(SpellEntry const* entry);
|
||||
bool _Validate(SpellInfo const* entry);
|
||||
bool _Load(Spell* spell);
|
||||
void _InitHit();
|
||||
bool _IsEffectPrevented(SpellEffIndex effIndex) { return m_hitPreventEffectMask & (1<<effIndex); }
|
||||
@@ -255,7 +255,7 @@ class SpellScript : public _SpellScript
|
||||
// methods useable during all spell handling phases
|
||||
Unit* GetCaster();
|
||||
Unit* GetOriginalCaster();
|
||||
SpellEntry const* GetSpellInfo();
|
||||
SpellInfo const* GetSpellInfo();
|
||||
|
||||
// methods useable after spell targets are set
|
||||
// accessors to the "focus" targets of the spell
|
||||
@@ -381,7 +381,7 @@ class AuraScript : public _SpellScript
|
||||
public:
|
||||
EffectBase(uint8 _effIndex, uint16 _effName);
|
||||
std::string ToString();
|
||||
bool CheckEffect(SpellEntry const* spellEntry, uint8 effIndex);
|
||||
bool CheckEffect(SpellInfo const* spellEntry, uint8 effIndex);
|
||||
};
|
||||
class EffectPeriodicHandler : public EffectBase
|
||||
{
|
||||
@@ -465,7 +465,7 @@ class AuraScript : public _SpellScript
|
||||
public:
|
||||
AuraScript() : _SpellScript(), m_aura(NULL), m_auraApplication(NULL), m_defaultActionPrevented(false)
|
||||
{}
|
||||
bool _Validate(SpellEntry const* entry);
|
||||
bool _Validate(SpellInfo const* entry);
|
||||
bool _Load(Aura * aura);
|
||||
void _PrepareScriptCall(AuraScriptHookType hookType, AuraApplication const* aurApp = NULL);
|
||||
void _FinishScriptCall();
|
||||
@@ -580,7 +580,7 @@ class AuraScript : public _SpellScript
|
||||
// AuraScript interface - functions which are redirecting to Aura class
|
||||
|
||||
// returns proto of the spell
|
||||
SpellEntry const* GetSpellProto() const;
|
||||
SpellInfo const* GetSpellInfo() const;
|
||||
// returns spellid of the spell
|
||||
uint32 GetId() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user