mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 13:46:24 +00:00
converted all tabs to 4 spaces
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -53,8 +53,8 @@ class AuraEffect
|
||||
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_isAuraEnabled ? m_amount : 0; }
|
||||
int32 GetForcedAmount() const { return m_amount; }
|
||||
int32 GetAmount() const { return m_isAuraEnabled ? m_amount : 0; }
|
||||
int32 GetForcedAmount() const { return m_amount; }
|
||||
void SetAmount(int32 amount) { m_amount = amount; m_canBeRecalculated = false;}
|
||||
|
||||
int32 GetPeriodicTimer() const { return m_periodicTimer; }
|
||||
@@ -62,7 +62,7 @@ class AuraEffect
|
||||
|
||||
int32 CalculateAmount(Unit* caster);
|
||||
void CalculatePeriodic(Unit* caster, bool create = false, bool load = false);
|
||||
void CalculatePeriodicData();
|
||||
void CalculatePeriodicData();
|
||||
void CalculateSpellMod();
|
||||
void ChangeAmount(int32 newAmount, bool mark = true, bool onStackOrReapply = false);
|
||||
void RecalculateAmount() { if (!CanBeRecalculated()) return; ChangeAmount(CalculateAmount(GetCaster()), false); }
|
||||
@@ -95,18 +95,18 @@ class AuraEffect
|
||||
// add/remove SPELL_AURA_MOD_SHAPESHIFT (36) linked auras
|
||||
void HandleShapeshiftBoosts(Unit* target, bool apply) const;
|
||||
|
||||
// xinef: storing initial crit chance
|
||||
float GetCritChance() const { return m_critChance; }
|
||||
void SetCritChance(float crit) { m_critChance = crit; }
|
||||
uint8 GetCasterLevel() const { return m_casterLevel; }
|
||||
bool CanApplyResilience() const { return m_applyResilience; }
|
||||
float GetPctMods() const { return m_pctMods; }
|
||||
// xinef: storing initial crit chance
|
||||
float GetCritChance() const { return m_critChance; }
|
||||
void SetCritChance(float crit) { m_critChance = crit; }
|
||||
uint8 GetCasterLevel() const { return m_casterLevel; }
|
||||
bool CanApplyResilience() const { return m_applyResilience; }
|
||||
float GetPctMods() const { return m_pctMods; }
|
||||
|
||||
// xinef: stacking
|
||||
uint32 GetAuraGroup() const { return m_auraGroup; }
|
||||
int32 GetOldAmount() const { return m_oldAmount; }
|
||||
void SetOldAmount(int32 amount) { m_oldAmount = amount; }
|
||||
void SetEnabled(bool enabled) { m_isAuraEnabled = enabled; }
|
||||
// xinef: stacking
|
||||
uint32 GetAuraGroup() const { return m_auraGroup; }
|
||||
int32 GetOldAmount() const { return m_oldAmount; }
|
||||
void SetOldAmount(int32 amount) { m_oldAmount = amount; }
|
||||
void SetEnabled(bool enabled) { m_isAuraEnabled = enabled; }
|
||||
|
||||
private:
|
||||
Aura* const m_base;
|
||||
@@ -114,18 +114,18 @@ class AuraEffect
|
||||
SpellInfo const* const m_spellInfo;
|
||||
int32 const m_baseAmount;
|
||||
|
||||
bool m_applyResilience;
|
||||
uint8 m_casterLevel;
|
||||
bool m_applyResilience;
|
||||
uint8 m_casterLevel;
|
||||
int32 m_amount;
|
||||
float m_critChance;
|
||||
float m_pctMods;
|
||||
float m_critChance;
|
||||
float m_pctMods;
|
||||
|
||||
// xinef: stacking
|
||||
uint32 m_auraGroup;
|
||||
int32 m_oldAmount;
|
||||
bool m_isAuraEnabled;
|
||||
// xinef: channel information for channel triggering
|
||||
ChannelTargetData* m_channelData;
|
||||
// xinef: stacking
|
||||
uint32 m_auraGroup;
|
||||
int32 m_oldAmount;
|
||||
bool m_isAuraEnabled;
|
||||
// xinef: channel information for channel triggering
|
||||
ChannelTargetData* m_channelData;
|
||||
|
||||
|
||||
SpellModifier* m_spellmod;
|
||||
|
||||
@@ -174,66 +174,66 @@ void AuraApplication::_HandleEffect(uint8 effIndex, bool apply)
|
||||
aurEff->CleanupTriggeredSpells(GetTarget());
|
||||
}
|
||||
|
||||
// Stacking!
|
||||
if (uint32 groupId = aurEff->GetAuraGroup())
|
||||
{
|
||||
SpellGroupStackFlags sFlag = sSpellMgr->GetGroupStackFlags(groupId);
|
||||
if (!aurEff->IsPeriodic() && (sFlag & SPELL_GROUP_STACK_FLAG_EFFECT_EXCLUSIVE))
|
||||
{
|
||||
AuraApplication* strongestApp = apply ? this : NULL;
|
||||
AuraEffect* strongestEff = apply ? aurEff : NULL;
|
||||
int32 amount = apply ? abs(aurEff->GetAmount()) : 0;
|
||||
Unit* target = GetTarget();
|
||||
Unit::AuraEffectList const& auraList = target->GetAuraEffectsByType(aurEff->GetAuraType());
|
||||
for (Unit::AuraEffectList::const_iterator iter = auraList.begin(); iter != auraList.end(); ++iter)
|
||||
{
|
||||
if ((*iter)->GetAuraGroup() != groupId || (*iter) == strongestEff || (*iter)->GetBase()->IsRemoved())
|
||||
continue;
|
||||
// Stacking!
|
||||
if (uint32 groupId = aurEff->GetAuraGroup())
|
||||
{
|
||||
SpellGroupStackFlags sFlag = sSpellMgr->GetGroupStackFlags(groupId);
|
||||
if (!aurEff->IsPeriodic() && (sFlag & SPELL_GROUP_STACK_FLAG_EFFECT_EXCLUSIVE))
|
||||
{
|
||||
AuraApplication* strongestApp = apply ? this : NULL;
|
||||
AuraEffect* strongestEff = apply ? aurEff : NULL;
|
||||
int32 amount = apply ? abs(aurEff->GetAmount()) : 0;
|
||||
Unit* target = GetTarget();
|
||||
Unit::AuraEffectList const& auraList = target->GetAuraEffectsByType(aurEff->GetAuraType());
|
||||
for (Unit::AuraEffectList::const_iterator iter = auraList.begin(); iter != auraList.end(); ++iter)
|
||||
{
|
||||
if ((*iter)->GetAuraGroup() != groupId || (*iter) == strongestEff || (*iter)->GetBase()->IsRemoved())
|
||||
continue;
|
||||
|
||||
// xinef: skip different misc values
|
||||
if (aurEff->GetAuraType() != SPELL_AURA_230 /*SPELL_AURA_MOD_INCREASE_HEALTH_2*/ && aurEff->GetAuraType() != SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK &&
|
||||
aurEff->GetMiscValue() != (*iter)->GetMiscValue())
|
||||
continue;
|
||||
// xinef: skip different misc values
|
||||
if (aurEff->GetAuraType() != SPELL_AURA_230 /*SPELL_AURA_MOD_INCREASE_HEALTH_2*/ && aurEff->GetAuraType() != SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK &&
|
||||
aurEff->GetMiscValue() != (*iter)->GetMiscValue())
|
||||
continue;
|
||||
|
||||
// xinef: should not happen
|
||||
AuraApplication* aurApp = (*iter)->GetBase()->GetApplicationOfTarget(target->GetGUID());
|
||||
if (!aurApp)
|
||||
continue;
|
||||
// xinef: should not happen
|
||||
AuraApplication* aurApp = (*iter)->GetBase()->GetApplicationOfTarget(target->GetGUID());
|
||||
if (!aurApp)
|
||||
continue;
|
||||
|
||||
if (amount < abs((*iter)->GetForcedAmount()))
|
||||
{
|
||||
// xinef: if we have strongest aura and it is active, turn it off
|
||||
// xinef: otherwise just save new aura;
|
||||
if (strongestApp && strongestEff && strongestApp->IsActive(strongestEff->GetEffIndex()))
|
||||
{
|
||||
strongestEff->HandleEffect(strongestApp, AURA_EFFECT_HANDLE_CHANGE_AMOUNT, false);
|
||||
if (!strongestEff->GetSpellInfo()->HasAreaAuraEffect())
|
||||
strongestEff->SetEnabled(false);
|
||||
strongestApp->SetDisableMask(strongestEff->GetEffIndex());
|
||||
}
|
||||
strongestApp = aurApp;
|
||||
strongestEff = (*iter);
|
||||
amount = abs((*iter)->GetAmount());
|
||||
}
|
||||
// xinef: itered aura is weaker, deactivate if active
|
||||
else if (aurApp->IsActive((*iter)->GetEffIndex()))
|
||||
{
|
||||
(*iter)->HandleEffect(aurApp, AURA_EFFECT_HANDLE_CHANGE_AMOUNT, false);
|
||||
if (!(*iter)->GetSpellInfo()->HasAreaAuraEffect())
|
||||
(*iter)->SetEnabled(false);
|
||||
aurApp->SetDisableMask((*iter)->GetEffIndex());
|
||||
}
|
||||
}
|
||||
if (amount < abs((*iter)->GetForcedAmount()))
|
||||
{
|
||||
// xinef: if we have strongest aura and it is active, turn it off
|
||||
// xinef: otherwise just save new aura;
|
||||
if (strongestApp && strongestEff && strongestApp->IsActive(strongestEff->GetEffIndex()))
|
||||
{
|
||||
strongestEff->HandleEffect(strongestApp, AURA_EFFECT_HANDLE_CHANGE_AMOUNT, false);
|
||||
if (!strongestEff->GetSpellInfo()->HasAreaAuraEffect())
|
||||
strongestEff->SetEnabled(false);
|
||||
strongestApp->SetDisableMask(strongestEff->GetEffIndex());
|
||||
}
|
||||
strongestApp = aurApp;
|
||||
strongestEff = (*iter);
|
||||
amount = abs((*iter)->GetAmount());
|
||||
}
|
||||
// xinef: itered aura is weaker, deactivate if active
|
||||
else if (aurApp->IsActive((*iter)->GetEffIndex()))
|
||||
{
|
||||
(*iter)->HandleEffect(aurApp, AURA_EFFECT_HANDLE_CHANGE_AMOUNT, false);
|
||||
if (!(*iter)->GetSpellInfo()->HasAreaAuraEffect())
|
||||
(*iter)->SetEnabled(false);
|
||||
aurApp->SetDisableMask((*iter)->GetEffIndex());
|
||||
}
|
||||
}
|
||||
|
||||
// xinef: if we have new strongest aura, and it is not active
|
||||
if (strongestApp && strongestEff && !strongestApp->IsActive(strongestEff->GetEffIndex()))
|
||||
{
|
||||
strongestApp->RemoveDisableMask(strongestEff->GetEffIndex());
|
||||
strongestEff->SetEnabled(true);
|
||||
strongestEff->HandleEffect(strongestApp, AURA_EFFECT_HANDLE_CHANGE_AMOUNT, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
// xinef: if we have new strongest aura, and it is not active
|
||||
if (strongestApp && strongestEff && !strongestApp->IsActive(strongestEff->GetEffIndex()))
|
||||
{
|
||||
strongestApp->RemoveDisableMask(strongestEff->GetEffIndex());
|
||||
strongestEff->SetEnabled(true);
|
||||
strongestEff->HandleEffect(strongestApp, AURA_EFFECT_HANDLE_CHANGE_AMOUNT, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
SetNeedClientUpdate();
|
||||
}
|
||||
|
||||
@@ -278,11 +278,11 @@ void AuraApplication::ClientUpdate(bool remove)
|
||||
data.append(GetTarget()->GetPackGUID());
|
||||
BuildUpdatePacket(data, remove);
|
||||
|
||||
if (GetSlot() < MAX_AURAS)
|
||||
if (const Player* plr = GetTarget()->ToPlayer())
|
||||
if (Aura* aura = GetBase())
|
||||
if (plr->NeedSendSpectatorData() && ArenaSpectator::ShouldSendAura(aura, GetEffectMask(), GetTarget()->GetGUID(), remove))
|
||||
ArenaSpectator::SendCommand_Aura(plr->FindMap(), plr->GetGUID(), "AUR", aura->GetCasterGUID(), aura->GetSpellInfo()->Id, aura->GetSpellInfo()->IsPositive(), aura->GetSpellInfo()->Dispel, aura->GetDuration(), aura->GetMaxDuration(), (aura->GetCharges() > 1 ? aura->GetCharges() : aura->GetStackAmount()), remove);
|
||||
if (GetSlot() < MAX_AURAS)
|
||||
if (const Player* plr = GetTarget()->ToPlayer())
|
||||
if (Aura* aura = GetBase())
|
||||
if (plr->NeedSendSpectatorData() && ArenaSpectator::ShouldSendAura(aura, GetEffectMask(), GetTarget()->GetGUID(), remove))
|
||||
ArenaSpectator::SendCommand_Aura(plr->FindMap(), plr->GetGUID(), "AUR", aura->GetCasterGUID(), aura->GetSpellInfo()->Id, aura->GetSpellInfo()->IsPositive(), aura->GetSpellInfo()->Dispel, aura->GetDuration(), aura->GetMaxDuration(), (aura->GetCharges() > 1 ? aura->GetCharges() : aura->GetStackAmount()), remove);
|
||||
|
||||
_target->SendMessageToSet(&data, true);
|
||||
}
|
||||
@@ -561,13 +561,13 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
|
||||
targetsToRemove.push_back(appIter->second->GetTarget());
|
||||
else
|
||||
{
|
||||
// xinef: check immunities here, so aura wont get removed on every tick and then reapplied
|
||||
if (IsArea())
|
||||
for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex)
|
||||
{
|
||||
if ((existing->second & (1 << effIndex)) && existing->first->IsImmunedToSpellEffect(GetSpellInfo(), effIndex))
|
||||
existing->second &= ~(1 << effIndex);
|
||||
}
|
||||
// xinef: check immunities here, so aura wont get removed on every tick and then reapplied
|
||||
if (IsArea())
|
||||
for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex)
|
||||
{
|
||||
if ((existing->second & (1 << effIndex)) && existing->first->IsImmunedToSpellEffect(GetSpellInfo(), effIndex))
|
||||
existing->second &= ~(1 << effIndex);
|
||||
}
|
||||
|
||||
// needs readding - remove now, will be applied in next update cycle
|
||||
// (dbcs do not have auras which apply on same type of targets but have different radius, so this is not really needed)
|
||||
@@ -623,18 +623,18 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
|
||||
if (itr->first->IsInFlight())
|
||||
addUnit = false;
|
||||
|
||||
switch( GetId() )
|
||||
{
|
||||
case 62821: // Ulduar, Hodir, Toasty Fire
|
||||
case 62807: // Ulduar, Hodir, Starlight
|
||||
case 51103: // Oculus, Mage-Lord Urom, Frostbomb
|
||||
case 69146: case 70823: case 70824: case 70825: // Icecrown Citadel, Lord Marrowgar, Coldflame
|
||||
{
|
||||
if( itr->first->HasAura(GetId()) )
|
||||
addUnit = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
switch( GetId() )
|
||||
{
|
||||
case 62821: // Ulduar, Hodir, Toasty Fire
|
||||
case 62807: // Ulduar, Hodir, Starlight
|
||||
case 51103: // Oculus, Mage-Lord Urom, Frostbomb
|
||||
case 69146: case 70823: case 70824: case 70825: // Icecrown Citadel, Lord Marrowgar, Coldflame
|
||||
{
|
||||
if( itr->first->HasAura(GetId()) )
|
||||
addUnit = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
// unit auras can not stack with each other
|
||||
else // (GetType() == UNIT_AURA_TYPE)
|
||||
@@ -719,9 +719,9 @@ void Aura::_ApplyEffectForTargets(uint8 effIndex)
|
||||
void Aura::UpdateOwner(uint32 diff, WorldObject* owner)
|
||||
{
|
||||
if (owner != m_owner)
|
||||
{
|
||||
ASSERT(false);
|
||||
}
|
||||
{
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
Unit* caster = GetCaster();
|
||||
// Apply spellmods for channeled auras
|
||||
@@ -853,22 +853,22 @@ void Aura::RefreshTimers(bool periodicReset /*= false*/)
|
||||
Unit* caster = GetCaster();
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (HasEffect(i))
|
||||
{
|
||||
{
|
||||
GetEffect(i)->CalculatePeriodic(caster, periodicReset, false);
|
||||
GetEffect(i)->CalculatePeriodicData();
|
||||
}
|
||||
GetEffect(i)->CalculatePeriodicData();
|
||||
}
|
||||
}
|
||||
|
||||
// xinef: dot's rolling function
|
||||
void Aura::RefreshTimersWithMods()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
Unit* caster = GetCaster();
|
||||
m_maxDuration = CalcMaxDuration();
|
||||
if (caster && caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo) || m_spellInfo->HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION))
|
||||
if (caster && caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo) || m_spellInfo->HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION))
|
||||
m_maxDuration = int32(m_maxDuration * caster->GetFloatValue(UNIT_MOD_CAST_SPEED));
|
||||
|
||||
// xinef: we should take ModSpellDuration into account, but none of the spells using this function is affected by contents of ModSpellDuration
|
||||
RefreshDuration();
|
||||
// xinef: we should take ModSpellDuration into account, but none of the spells using this function is affected by contents of ModSpellDuration
|
||||
RefreshDuration();
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (HasEffect(i))
|
||||
GetEffect(i)->CalculatePeriodic(caster, false, false);
|
||||
@@ -978,7 +978,7 @@ bool Aura::ModStackAmount(int32 num, AuraRemoveMode removeMode, bool periodicRes
|
||||
mod->charges = GetCharges();
|
||||
}
|
||||
|
||||
SetStackAmount(stackAmount);
|
||||
SetStackAmount(stackAmount);
|
||||
|
||||
SetNeedClientUpdateForTargets();
|
||||
return false;
|
||||
@@ -1013,21 +1013,21 @@ bool Aura::IsDeathPersistent() const
|
||||
|
||||
bool Aura::CanBeSaved() const
|
||||
{
|
||||
if (IsPassive() || (GetSpellInfo()->HasAttribute(SPELL_ATTR0_HIDDEN_CLIENTSIDE) && GetSpellInfo()->Stances))
|
||||
if (IsPassive() || (GetSpellInfo()->HasAttribute(SPELL_ATTR0_HIDDEN_CLIENTSIDE) && GetSpellInfo()->Stances))
|
||||
return false;
|
||||
|
||||
// Xinef: do not save channel auras
|
||||
if (GetSpellInfo()->IsChanneled())
|
||||
return false;
|
||||
// Xinef: do not save channel auras
|
||||
if (GetSpellInfo()->IsChanneled())
|
||||
return false;
|
||||
|
||||
// Xinef: Check if aura is single target, not only spell info
|
||||
// Xinef: Check if aura is single target, not only spell info
|
||||
if (GetCasterGUID() != GetOwner()->GetGUID())
|
||||
if (GetSpellInfo()->IsSingleTarget() || IsSingleTarget())
|
||||
if (GetSpellInfo()->IsSingleTarget() || IsSingleTarget())
|
||||
return false;
|
||||
|
||||
// Xinef: Dont save control vehicle auras - caster may not exist
|
||||
if (HasEffectType(SPELL_AURA_CONTROL_VEHICLE))
|
||||
return false;
|
||||
// Xinef: Dont save control vehicle auras - caster may not exist
|
||||
if (HasEffectType(SPELL_AURA_CONTROL_VEHICLE))
|
||||
return false;
|
||||
|
||||
// Can't be saved - aura handler relies on calculated amount and changes it
|
||||
if (HasEffectType(SPELL_AURA_CONVERT_RUNE))
|
||||
@@ -1037,21 +1037,21 @@ bool Aura::CanBeSaved() const
|
||||
if (HasEffectType(SPELL_AURA_OPEN_STABLE))
|
||||
return false;
|
||||
|
||||
// xinef: do not save bind sight auras!
|
||||
if (HasEffectType(SPELL_AURA_BIND_SIGHT))
|
||||
return false;
|
||||
// xinef: do not save bind sight auras!
|
||||
if (HasEffectType(SPELL_AURA_BIND_SIGHT))
|
||||
return false;
|
||||
|
||||
// xinef: no charming auras (taking direct control)
|
||||
if (HasEffectType(SPELL_AURA_MOD_POSSESS) || HasEffectType(SPELL_AURA_MOD_POSSESS_PET))
|
||||
return false;
|
||||
// xinef: no charming auras (taking direct control)
|
||||
if (HasEffectType(SPELL_AURA_MOD_POSSESS) || HasEffectType(SPELL_AURA_MOD_POSSESS_PET))
|
||||
return false;
|
||||
|
||||
// xinef: no charming auras can be saved
|
||||
if (HasEffectType(SPELL_AURA_MOD_CHARM) || HasEffectType(SPELL_AURA_AOE_CHARM))
|
||||
return false;
|
||||
// xinef: no charming auras can be saved
|
||||
if (HasEffectType(SPELL_AURA_MOD_CHARM) || HasEffectType(SPELL_AURA_AOE_CHARM))
|
||||
return false;
|
||||
|
||||
// Xinef: Raise Ally control aura
|
||||
if (GetId() == 46619)
|
||||
return false;
|
||||
// Xinef: Raise Ally control aura
|
||||
if (GetId() == 46619)
|
||||
return false;
|
||||
|
||||
// don't save auras removed by proc system
|
||||
if (IsUsingCharges() && !GetCharges())
|
||||
@@ -1097,13 +1097,13 @@ void Aura::UnregisterSingleTarget()
|
||||
// TODO: find a better way to do this.
|
||||
if (!caster)
|
||||
caster = ObjectAccessor::GetObjectInOrOutOfWorld(GetCasterGUID(), (Unit*)NULL);
|
||||
if (!caster)
|
||||
{
|
||||
sLog->outMisc("Aura::UnregisterSingleTarget (A1) - %u, %u, %u, %s", GetId(), GetOwner()->GetTypeId(), GetOwner()->GetEntry(), GetOwner()->GetName().c_str());
|
||||
//ASSERT(caster);
|
||||
}
|
||||
else
|
||||
caster->GetSingleCastAuras().remove(this);
|
||||
if (!caster)
|
||||
{
|
||||
sLog->outMisc("Aura::UnregisterSingleTarget (A1) - %u, %u, %u, %s", GetId(), GetOwner()->GetTypeId(), GetOwner()->GetEntry(), GetOwner()->GetName().c_str());
|
||||
//ASSERT(caster);
|
||||
}
|
||||
else
|
||||
caster->GetSingleCastAuras().remove(this);
|
||||
|
||||
SetIsSingleTarget(false);
|
||||
}
|
||||
@@ -1360,23 +1360,23 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case SPELLFAMILY_DRUID:
|
||||
if (!caster)
|
||||
case SPELLFAMILY_DRUID:
|
||||
if (!caster)
|
||||
break;
|
||||
// Rejuvenation
|
||||
// Rejuvenation
|
||||
if (GetSpellInfo()->SpellFamilyFlags[0] & 0x10 && GetEffect(0))
|
||||
{
|
||||
// Druid T8 Restoration 4P Bonus
|
||||
if (AuraEffect const * aurEff = caster->GetAuraEffectDummy(64760))
|
||||
{
|
||||
uint32 damage = GetEffect(0)->GetAmount();
|
||||
uint32 damage = GetEffect(0)->GetAmount();
|
||||
damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT);
|
||||
|
||||
int32 basepoints0 = damage;
|
||||
caster->CastCustomSpell(target, 64801, &basepoints0, NULL, NULL, true, NULL, GetEffect(0));
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case SPELLFAMILY_PRIEST:
|
||||
if (!caster)
|
||||
break;
|
||||
@@ -1391,7 +1391,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * int32(damage) / 100;
|
||||
int32 heal = int32(CalculatePct(basepoints0, 15));
|
||||
|
||||
caster->CastCustomSpell(target, 63675, &basepoints0, NULL, NULL, true, NULL, GetEffect(0));
|
||||
caster->CastCustomSpell(target, 63675, &basepoints0, NULL, NULL, true, NULL, GetEffect(0));
|
||||
caster->CastCustomSpell(caster, 75999, &heal, NULL, NULL, true, NULL, GetEffect(0));
|
||||
}
|
||||
}
|
||||
@@ -1456,41 +1456,41 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
caster->CastSpell(target, spellId, true, 0, GetEffect(0));
|
||||
}
|
||||
}
|
||||
// Unholy blight
|
||||
if (GetId() == 50536)
|
||||
{
|
||||
if (caster->IsFriendlyTo(target))
|
||||
SetDuration(0);
|
||||
}
|
||||
// Unholy blight
|
||||
if (GetId() == 50536)
|
||||
{
|
||||
if (caster->IsFriendlyTo(target))
|
||||
SetDuration(0);
|
||||
}
|
||||
break;
|
||||
case SPELLFAMILY_POTION:
|
||||
// Alchemy: Mixology
|
||||
if (caster && caster->HasAura(53042) && caster->GetTypeId() == TYPEID_PLAYER && !caster->ToPlayer()->GetSession()->PlayerLoading())
|
||||
{
|
||||
if (sSpellMgr->GetSpellGroup(GetId()) == 1) /*Elixirs*/
|
||||
{
|
||||
if (caster->HasSpell(GetSpellInfo()->Effects[EFFECT_0].TriggerSpell))
|
||||
{
|
||||
for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (GetEffect(i))
|
||||
GetEffect(i)->SetAmount(CalculatePct(GetEffect(i)->GetAmount(), 100+sSpellMgr->GetSpellMixologyBonus(GetId())));
|
||||
case SPELLFAMILY_POTION:
|
||||
// Alchemy: Mixology
|
||||
if (caster && caster->HasAura(53042) && caster->GetTypeId() == TYPEID_PLAYER && !caster->ToPlayer()->GetSession()->PlayerLoading())
|
||||
{
|
||||
if (sSpellMgr->GetSpellGroup(GetId()) == 1) /*Elixirs*/
|
||||
{
|
||||
if (caster->HasSpell(GetSpellInfo()->Effects[EFFECT_0].TriggerSpell))
|
||||
{
|
||||
for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (GetEffect(i))
|
||||
GetEffect(i)->SetAmount(CalculatePct(GetEffect(i)->GetAmount(), 100+sSpellMgr->GetSpellMixologyBonus(GetId())));
|
||||
|
||||
SetMaxDuration(caster->CalcSpellDuration(GetSpellInfo())*2);
|
||||
SetDuration(GetMaxDuration());
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
SetMaxDuration(caster->CalcSpellDuration(GetSpellInfo())*2);
|
||||
SetDuration(GetMaxDuration());
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
// mods at aura remove
|
||||
else
|
||||
{
|
||||
switch (GetSpellInfo()->SpellFamilyName)
|
||||
{
|
||||
{
|
||||
case SPELLFAMILY_GENERIC:
|
||||
if (!caster)
|
||||
if (!caster)
|
||||
break;
|
||||
switch(GetId())
|
||||
{
|
||||
@@ -1507,7 +1507,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
if (remainingDamage > 0)
|
||||
caster->CastCustomSpell(caster, 72373, NULL, &remainingDamage, NULL, true);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case SPELLFAMILY_MAGE:
|
||||
@@ -1540,11 +1540,11 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && GetSpellInfo()->SpellFamilyFlags[1] & 0x1)
|
||||
{
|
||||
// Shattered Barrier
|
||||
if (AuraEffect* absorb = GetEffect(EFFECT_0))
|
||||
if (absorb->GetAmount() <= 0) // removed by damage, not dispel
|
||||
if (AuraEffect* dummy = caster->GetDummyAuraEffect(SPELLFAMILY_MAGE, 2945, 0))
|
||||
if (roll_chance_i(dummy->GetSpellInfo()->ProcChance))
|
||||
caster->CastSpell(target, 55080, true, NULL, GetEffect(0));
|
||||
if (AuraEffect* absorb = GetEffect(EFFECT_0))
|
||||
if (absorb->GetAmount() <= 0) // removed by damage, not dispel
|
||||
if (AuraEffect* dummy = caster->GetDummyAuraEffect(SPELLFAMILY_MAGE, 2945, 0))
|
||||
if (roll_chance_i(dummy->GetSpellInfo()->ProcChance))
|
||||
caster->CastSpell(target, 55080, true, NULL, GetEffect(0));
|
||||
}
|
||||
break;
|
||||
case SPELLFAMILY_WARRIOR:
|
||||
@@ -1667,22 +1667,22 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case SPELLFAMILY_ROGUE:
|
||||
{
|
||||
// Overkill, Master of Subtlety
|
||||
if (caster && GetSpellInfo()->SpellIconID == 250)
|
||||
{
|
||||
if (caster->GetDummyAuraEffect(SPELLFAMILY_ROGUE, 2114, 0))
|
||||
caster->CastSpell(caster, 31666, true);
|
||||
case SPELLFAMILY_ROGUE:
|
||||
{
|
||||
// Overkill, Master of Subtlety
|
||||
if (caster && GetSpellInfo()->SpellIconID == 250)
|
||||
{
|
||||
if (caster->GetDummyAuraEffect(SPELLFAMILY_ROGUE, 2114, 0))
|
||||
caster->CastSpell(caster, 31666, true);
|
||||
|
||||
if (caster->GetAuraEffectDummy(58426))
|
||||
caster->CastSpell(caster, 58428, true);
|
||||
}
|
||||
// Remove Vanish on stealth remove
|
||||
if (GetId() == 1784)
|
||||
target->RemoveAurasWithFamily(SPELLFAMILY_ROGUE, 0x800, 0, 0, 0);
|
||||
break;
|
||||
}
|
||||
if (caster->GetAuraEffectDummy(58426))
|
||||
caster->CastSpell(caster, 58428, true);
|
||||
}
|
||||
// Remove Vanish on stealth remove
|
||||
if (GetId() == 1784)
|
||||
target->RemoveAurasWithFamily(SPELLFAMILY_ROGUE, 0x800, 0, 0, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
case SPELLFAMILY_DEATHKNIGHT:
|
||||
// Blood of the North
|
||||
@@ -1701,13 +1701,13 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
target->ToPlayer()->RemoveRunesByAuraEffect(GetEffect(0));
|
||||
}
|
||||
break;
|
||||
case SPELLFAMILY_PALADIN:
|
||||
case SPELLFAMILY_PALADIN:
|
||||
// Remove the immunity shield marker on Forbearance removal if AW marker is not present
|
||||
if (GetId() == 25771 && target->HasAura(61988) && !target->HasAura(61987))
|
||||
target->RemoveAura(61988);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// mods at aura apply or remove
|
||||
switch (GetSpellInfo()->SpellFamilyName)
|
||||
@@ -1751,7 +1751,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
else
|
||||
target->RemoveAurasDueToSpell(64364, GetCasterGUID());
|
||||
break;
|
||||
case 31842:
|
||||
case 31842:
|
||||
if (caster && caster->HasAura(70755))
|
||||
{
|
||||
if (apply)
|
||||
@@ -1762,39 +1762,39 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
break;
|
||||
}
|
||||
|
||||
// Sanctified Retribution, Improved Devotion Aura, Swift Retribution, Improved Concentration Aura
|
||||
if (caster == target && GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_AURA)
|
||||
// Sanctified Retribution, Improved Devotion Aura, Swift Retribution, Improved Concentration Aura
|
||||
if (caster == target && GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_AURA)
|
||||
{
|
||||
if (apply)
|
||||
{
|
||||
target->CastSpell(target, 63510, true);
|
||||
target->CastSpell(target, 63514, true);
|
||||
target->CastSpell(target, 63531, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
target->RemoveAura(63510);
|
||||
target->RemoveAura(63514);
|
||||
target->RemoveAura(63531);
|
||||
}
|
||||
}
|
||||
if (apply)
|
||||
{
|
||||
target->CastSpell(target, 63510, true);
|
||||
target->CastSpell(target, 63514, true);
|
||||
target->CastSpell(target, 63531, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
target->RemoveAura(63510);
|
||||
target->RemoveAura(63514);
|
||||
target->RemoveAura(63531);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case SPELLFAMILY_DRUID:
|
||||
if (!caster)
|
||||
break;
|
||||
// Reduce base armor of bear form and dire bear form
|
||||
if (GetId() == 5229)
|
||||
{
|
||||
if (target->HasAura(70726)) // Item - Druid T10 Feral 4P Bonus
|
||||
{
|
||||
if (apply)
|
||||
target->CastSpell(target, 70725, true);
|
||||
}
|
||||
else if (AuraEffect *aurEff = caster->GetAuraEffect(SPELL_AURA_MOD_BASE_RESISTANCE_PCT, SPELLFAMILY_DRUID, 107, 0))
|
||||
aurEff->RecalculateAmount();
|
||||
}
|
||||
break;
|
||||
case SPELLFAMILY_DRUID:
|
||||
if (!caster)
|
||||
break;
|
||||
// Reduce base armor of bear form and dire bear form
|
||||
if (GetId() == 5229)
|
||||
{
|
||||
if (target->HasAura(70726)) // Item - Druid T10 Feral 4P Bonus
|
||||
{
|
||||
if (apply)
|
||||
target->CastSpell(target, 70725, true);
|
||||
}
|
||||
else if (AuraEffect *aurEff = caster->GetAuraEffect(SPELL_AURA_MOD_BASE_RESISTANCE_PCT, SPELLFAMILY_DRUID, 107, 0))
|
||||
aurEff->RecalculateAmount();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1822,31 +1822,31 @@ bool Aura::CheckAreaTarget(Unit* target)
|
||||
|
||||
bool Aura::IsAuraStronger(Aura const* newAura) const
|
||||
{
|
||||
for (uint8 i = EFFECT_0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
AuraEffect* thisEffect = GetEffect(i);
|
||||
if (!thisEffect)
|
||||
continue;
|
||||
for (uint8 i = EFFECT_0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
AuraEffect* thisEffect = GetEffect(i);
|
||||
if (!thisEffect)
|
||||
continue;
|
||||
|
||||
AuraEffect* newEffect = NULL;
|
||||
for (uint8 j = EFFECT_0; j < MAX_SPELL_EFFECTS; ++j)
|
||||
{
|
||||
newEffect = newAura->GetEffect(j);
|
||||
if (!newEffect || thisEffect->GetAuraType() != newEffect->GetAuraType() || thisEffect->GetMiscValue() != newEffect->GetMiscValue())
|
||||
continue;
|
||||
AuraEffect* newEffect = NULL;
|
||||
for (uint8 j = EFFECT_0; j < MAX_SPELL_EFFECTS; ++j)
|
||||
{
|
||||
newEffect = newAura->GetEffect(j);
|
||||
if (!newEffect || thisEffect->GetAuraType() != newEffect->GetAuraType() || thisEffect->GetMiscValue() != newEffect->GetMiscValue())
|
||||
continue;
|
||||
|
||||
// xinef: assume that all spells are either positive or negative, otherwise they should not be in one group
|
||||
int32 curValue = abs(thisEffect->GetAmount());
|
||||
if (curValue < abs(newEffect->GetAmount()))
|
||||
return true;
|
||||
// xinef: assume that all spells are either positive or negative, otherwise they should not be in one group
|
||||
int32 curValue = abs(thisEffect->GetAmount());
|
||||
if (curValue < abs(newEffect->GetAmount()))
|
||||
return true;
|
||||
|
||||
if (curValue == abs(newEffect->GetAmount()))
|
||||
if(!IsPassive() && !IsPermanent() && GetDuration() < newAura->GetDuration())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (curValue == abs(newEffect->GetAmount()))
|
||||
if(!IsPassive() && !IsPermanent() && GetDuration() < newAura->GetDuration())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Aura::CanStackWith(Aura const* existingAura, bool remove) const
|
||||
@@ -1858,15 +1858,15 @@ bool Aura::CanStackWith(Aura const* existingAura, bool remove) const
|
||||
SpellInfo const* existingSpellInfo = existingAura->GetSpellInfo();
|
||||
bool sameCaster = GetCasterGUID() == existingAura->GetCasterGUID();
|
||||
|
||||
// Dynobj auras always stack
|
||||
// xinef: dont allow different ranks (or the same rank) of same spell to stack (many flamestrikes for example)
|
||||
// Dynobj auras always stack
|
||||
// xinef: dont allow different ranks (or the same rank) of same spell to stack (many flamestrikes for example)
|
||||
if (existingAura->GetType() == DYNOBJ_AURA_TYPE)
|
||||
{
|
||||
// xinef: desecration lag fix - bound this condition to periodics
|
||||
if (sameCaster && GetSpellInfo()->Id == existingSpellInfo->Id && GetSpellInfo()->HasAura(SPELL_AURA_PERIODIC_DAMAGE))
|
||||
return false;
|
||||
{
|
||||
// xinef: desecration lag fix - bound this condition to periodics
|
||||
if (sameCaster && GetSpellInfo()->Id == existingSpellInfo->Id && GetSpellInfo()->HasAura(SPELL_AURA_PERIODIC_DAMAGE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// passive auras don't stack with another rank of the spell cast by same caster
|
||||
if (IsPassive() && sameCaster && m_spellInfo->IsDifferentRankOf(existingSpellInfo))
|
||||
@@ -1887,42 +1887,42 @@ bool Aura::CanStackWith(Aura const* existingAura, bool remove) const
|
||||
return false;
|
||||
|
||||
// check spell group stack rules
|
||||
// xinef: this assures us that both spells are in same group!
|
||||
SpellGroupStackFlags stackFlags = sSpellMgr->CheckSpellGroupStackRules(m_spellInfo, existingSpellInfo, remove, IsArea());
|
||||
// xinef: this assures us that both spells are in same group!
|
||||
SpellGroupStackFlags stackFlags = sSpellMgr->CheckSpellGroupStackRules(m_spellInfo, existingSpellInfo, remove, IsArea());
|
||||
if (stackFlags)
|
||||
{
|
||||
// xinef: same caster rule is bounded by spellfamily
|
||||
if (sameCaster && m_spellInfo->SpellFamilyName == existingSpellInfo->SpellFamilyName &&
|
||||
(stackFlags & SPELL_GROUP_STACK_FLAG_NOT_SAME_CASTER))
|
||||
return false;
|
||||
// xinef: same caster rule is bounded by spellfamily
|
||||
if (sameCaster && m_spellInfo->SpellFamilyName == existingSpellInfo->SpellFamilyName &&
|
||||
(stackFlags & SPELL_GROUP_STACK_FLAG_NOT_SAME_CASTER))
|
||||
return false;
|
||||
|
||||
// xinef: normal exclusive stacking, remove if auras are equal by effects
|
||||
// xinef: normal exclusive stacking, remove if auras are equal by effects
|
||||
if (stackFlags & SPELL_GROUP_STACK_FLAG_EXCLUSIVE)
|
||||
{
|
||||
if (GetSpellInfo()->IsAuraEffectEqual(existingSpellInfo) || GetSpellInfo()->IsRankOf(existingSpellInfo))
|
||||
{
|
||||
if (remove)
|
||||
return IsAuraStronger(existingAura);
|
||||
else
|
||||
return existingAura->IsAuraStronger(this);
|
||||
}
|
||||
}
|
||||
{
|
||||
if (GetSpellInfo()->IsAuraEffectEqual(existingSpellInfo) || GetSpellInfo()->IsRankOf(existingSpellInfo))
|
||||
{
|
||||
if (remove)
|
||||
return IsAuraStronger(existingAura);
|
||||
else
|
||||
return existingAura->IsAuraStronger(this);
|
||||
}
|
||||
}
|
||||
|
||||
// xinef: check priority before effect mask
|
||||
SpellGroupSpecialFlags thisAuraFlag = sSpellMgr->GetSpellGroupSpecialFlags(GetId());
|
||||
SpellGroupSpecialFlags existingAuraFlag = sSpellMgr->GetSpellGroupSpecialFlags(existingSpellInfo->Id);
|
||||
if (thisAuraFlag >= SPELL_GROUP_SPECIAL_FLAG_PRIORITY1 && existingAuraFlag >= SPELL_GROUP_SPECIAL_FLAG_PRIORITY1)
|
||||
if (thisAuraFlag < existingAuraFlag)
|
||||
return false;
|
||||
// xinef: check priority before effect mask
|
||||
SpellGroupSpecialFlags thisAuraFlag = sSpellMgr->GetSpellGroupSpecialFlags(GetId());
|
||||
SpellGroupSpecialFlags existingAuraFlag = sSpellMgr->GetSpellGroupSpecialFlags(existingSpellInfo->Id);
|
||||
if (thisAuraFlag >= SPELL_GROUP_SPECIAL_FLAG_PRIORITY1 && existingAuraFlag >= SPELL_GROUP_SPECIAL_FLAG_PRIORITY1)
|
||||
if (thisAuraFlag < existingAuraFlag)
|
||||
return false;
|
||||
|
||||
// xinef: forced strongest aura in group by flag
|
||||
if (stackFlags & SPELL_GROUP_STACK_FLAG_FORCED_STRONGEST)
|
||||
return !remove;
|
||||
if (stackFlags & SPELL_GROUP_STACK_FLAG_FORCED_WEAKEST)
|
||||
return remove;
|
||||
// xinef: forced strongest aura in group by flag
|
||||
if (stackFlags & SPELL_GROUP_STACK_FLAG_FORCED_STRONGEST)
|
||||
return !remove;
|
||||
if (stackFlags & SPELL_GROUP_STACK_FLAG_FORCED_WEAKEST)
|
||||
return remove;
|
||||
|
||||
// xinef: forced return, handle all cases using available flags!
|
||||
return !(stackFlags & SPELL_GROUP_STACK_FLAG_NEVER_STACK);
|
||||
// xinef: forced return, handle all cases using available flags!
|
||||
return !(stackFlags & SPELL_GROUP_STACK_FLAG_NEVER_STACK);
|
||||
}
|
||||
|
||||
if (m_spellInfo->SpellFamilyName != existingSpellInfo->SpellFamilyName)
|
||||
@@ -1986,11 +1986,11 @@ bool Aura::CanStackWith(Aura const* existingAura, bool remove) const
|
||||
if (!veh) // We should probably just let it stack. Vehicle system will prevent undefined behaviour later
|
||||
return true;
|
||||
|
||||
// xinef: allow direct auras to stack if there is no passenger in this slot
|
||||
if (AuraEffect* aurEff = GetEffect(VehicleAura1-1))
|
||||
if (aurEff->GetAmount() > 0)
|
||||
if (!veh->GetPassenger(aurEff->GetAmount()-1))
|
||||
return true;
|
||||
// xinef: allow direct auras to stack if there is no passenger in this slot
|
||||
if (AuraEffect* aurEff = GetEffect(VehicleAura1-1))
|
||||
if (aurEff->GetAmount() > 0)
|
||||
if (!veh->GetPassenger(aurEff->GetAmount()-1))
|
||||
return true;
|
||||
|
||||
if (!veh->GetAvailableSeatCount())
|
||||
return false; // No empty seat available
|
||||
@@ -2683,14 +2683,14 @@ void DynObjAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* /*caster*
|
||||
Trinity::UnitListSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(GetDynobjOwner(), targetList, u_check);
|
||||
GetDynobjOwner()->VisitNearbyObject(radius, searcher);
|
||||
}
|
||||
// pussywizard: TARGET_DEST_DYNOBJ_NONE is supposed to search for both friendly and unfriendly targets, so for any unit
|
||||
// what about EffectImplicitTargetA?
|
||||
else if (GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == TARGET_DEST_DYNOBJ_NONE)
|
||||
{
|
||||
Trinity::AnyAttackableUnitExceptForOriginalCasterInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
|
||||
// pussywizard: TARGET_DEST_DYNOBJ_NONE is supposed to search for both friendly and unfriendly targets, so for any unit
|
||||
// what about EffectImplicitTargetA?
|
||||
else if (GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == TARGET_DEST_DYNOBJ_NONE)
|
||||
{
|
||||
Trinity::AnyAttackableUnitExceptForOriginalCasterInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
|
||||
Trinity::UnitListSearcher<Trinity::AnyAttackableUnitExceptForOriginalCasterInObjectRangeCheck> searcher(GetDynobjOwner(), targetList, u_check);
|
||||
GetDynobjOwner()->VisitNearbyObject(radius, searcher);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
|
||||
@@ -2700,12 +2700,12 @@ void DynObjAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* /*caster*
|
||||
|
||||
for (UnitList::iterator itr = targetList.begin(); itr!= targetList.end();++itr)
|
||||
{
|
||||
// xinef: check z level and los dependence
|
||||
Unit* target = *itr;
|
||||
float zLevel = GetDynobjOwner()->GetPositionZ();
|
||||
if (target->GetPositionZ()+3.0f < zLevel || target->GetPositionZ()-5.0f > zLevel)
|
||||
if (!target->IsWithinLOSInMap(GetDynobjOwner()))
|
||||
continue;
|
||||
// xinef: check z level and los dependence
|
||||
Unit* target = *itr;
|
||||
float zLevel = GetDynobjOwner()->GetPositionZ();
|
||||
if (target->GetPositionZ()+3.0f < zLevel || target->GetPositionZ()-5.0f > zLevel)
|
||||
if (!target->IsWithinLOSInMap(GetDynobjOwner()))
|
||||
continue;
|
||||
|
||||
std::map<Unit*, uint8>::iterator existing = targets.find(*itr);
|
||||
if (existing != targets.end())
|
||||
|
||||
@@ -55,8 +55,8 @@ class AuraApplication
|
||||
uint8 _effectsToApply; // Used only at spell hit to determine which effect should be applied
|
||||
bool _needClientUpdate:1;
|
||||
|
||||
// xinef: stacking
|
||||
uint8 _disableMask;
|
||||
// xinef: stacking
|
||||
uint8 _disableMask;
|
||||
|
||||
explicit AuraApplication(Unit* target, Unit* caster, Aura* base, uint8 effMask);
|
||||
void _Remove();
|
||||
@@ -84,10 +84,10 @@ class AuraApplication
|
||||
void BuildUpdatePacket(ByteBuffer& data, bool remove) const;
|
||||
void ClientUpdate(bool remove = false);
|
||||
|
||||
// xinef: stacking
|
||||
bool IsActive(uint8 effIdx) { return ((1 << effIdx) & _disableMask) == 0; }
|
||||
void SetDisableMask(uint8 effIdx) { _disableMask |= 1 << effIdx; }
|
||||
void RemoveDisableMask(uint8 effIdx) { _disableMask &= ~(1 << effIdx); }
|
||||
// xinef: stacking
|
||||
bool IsActive(uint8 effIdx) { return ((1 << effIdx) & _disableMask) == 0; }
|
||||
void SetDisableMask(uint8 effIdx) { _disableMask |= 1 << effIdx; }
|
||||
void RemoveDisableMask(uint8 effIdx) { _disableMask &= ~(1 << effIdx); }
|
||||
};
|
||||
|
||||
class Aura
|
||||
@@ -140,7 +140,7 @@ class Aura
|
||||
void SetDuration(int32 duration, bool withMods = false);
|
||||
void RefreshDuration();
|
||||
void RefreshTimers(bool periodicReset = false);
|
||||
void RefreshTimersWithMods();
|
||||
void RefreshTimersWithMods();
|
||||
bool IsExpired() const { return !GetDuration();}
|
||||
bool IsPermanent() const { return GetMaxDuration() == -1; }
|
||||
|
||||
@@ -195,7 +195,7 @@ class Aura
|
||||
bool CanBeAppliedOn(Unit* target);
|
||||
bool CheckAreaTarget(Unit* target);
|
||||
bool CanStackWith(Aura const* checkAura, bool remove) const;
|
||||
bool IsAuraStronger(Aura const* newAura) const;
|
||||
bool IsAuraStronger(Aura const* newAura) const;
|
||||
|
||||
// Proc system
|
||||
// this subsystem is not yet in use - the core of it is functional, but still some research has to be done
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -166,12 +166,12 @@ class SpellCastTargets
|
||||
void Update(Unit* caster);
|
||||
void OutDebug() const;
|
||||
|
||||
// Xinef: Channel data
|
||||
void SetObjectTargetChannel(uint64 targetGUID);
|
||||
void SetDstChannel(SpellDestination const& spellDest);
|
||||
WorldObject* GetObjectTargetChannel(Unit* caster) const;
|
||||
bool HasDstChannel() const;
|
||||
SpellDestination const* GetDstChannel() const;
|
||||
// Xinef: Channel data
|
||||
void SetObjectTargetChannel(uint64 targetGUID);
|
||||
void SetDstChannel(SpellDestination const& spellDest);
|
||||
WorldObject* GetObjectTargetChannel(Unit* caster) const;
|
||||
bool HasDstChannel() const;
|
||||
SpellDestination const* GetDstChannel() const;
|
||||
|
||||
private:
|
||||
uint32 m_targetMask;
|
||||
@@ -191,9 +191,9 @@ class SpellCastTargets
|
||||
float m_elevation, m_speed;
|
||||
std::string m_strTarget;
|
||||
|
||||
// Xinef: Save channel data
|
||||
SpellDestination m_dstChannel;
|
||||
uint64 m_objectTargetGUIDChannel;
|
||||
// Xinef: Save channel data
|
||||
SpellDestination m_dstChannel;
|
||||
uint64 m_objectTargetGUIDChannel;
|
||||
};
|
||||
|
||||
struct SpellValue
|
||||
@@ -203,7 +203,7 @@ struct SpellValue
|
||||
uint32 MaxAffectedTargets;
|
||||
float RadiusMod;
|
||||
uint8 AuraStackAmount;
|
||||
bool ForcedCritResult;
|
||||
bool ForcedCritResult;
|
||||
};
|
||||
|
||||
enum SpellState
|
||||
@@ -227,14 +227,14 @@ enum SpellEffectHandleMode
|
||||
// Xinef: special structure containing data for channel target spells
|
||||
struct ChannelTargetData
|
||||
{
|
||||
ChannelTargetData(uint64 cguid, const SpellDestination* dst) : channelGUID(cguid)
|
||||
{
|
||||
if (dst)
|
||||
spellDst = *dst;
|
||||
}
|
||||
ChannelTargetData(uint64 cguid, const SpellDestination* dst) : channelGUID(cguid)
|
||||
{
|
||||
if (dst)
|
||||
spellDst = *dst;
|
||||
}
|
||||
|
||||
uint64 channelGUID;
|
||||
SpellDestination spellDst;
|
||||
uint64 channelGUID;
|
||||
SpellDestination spellDst;
|
||||
};
|
||||
|
||||
class Spell
|
||||
@@ -404,7 +404,7 @@ class Spell
|
||||
void cancel(bool bySelf = false);
|
||||
void update(uint32 difftime);
|
||||
void cast(bool skipCheck = false);
|
||||
void _cast(bool skipCheck);
|
||||
void _cast(bool skipCheck);
|
||||
void finish(bool ok = true);
|
||||
void TakePower();
|
||||
void TakeAmmo();
|
||||
@@ -424,7 +424,7 @@ class Spell
|
||||
void _handle_finish_phase();
|
||||
|
||||
SpellCastResult CheckItems();
|
||||
SpellCastResult CheckSpellFocus();
|
||||
SpellCastResult CheckSpellFocus();
|
||||
SpellCastResult CheckRange(bool strict);
|
||||
SpellCastResult CheckPower();
|
||||
SpellCastResult CheckRuneCost(uint32 runeCostID);
|
||||
@@ -502,7 +502,7 @@ class Spell
|
||||
uint64 GetDelayStart() const { return m_delayStart; }
|
||||
void SetDelayStart(uint64 m_time) { m_delayStart = m_time; }
|
||||
uint64 GetDelayMoment() const { return m_delayMoment; }
|
||||
uint64 GetDelayTrajectory() const { return m_delayTrajectory; }
|
||||
uint64 GetDelayTrajectory() const { return m_delayTrajectory; }
|
||||
|
||||
bool IsNeedSendToClient(bool go) const;
|
||||
|
||||
@@ -518,12 +518,12 @@ class Spell
|
||||
void CleanupTargetList();
|
||||
|
||||
void SetSpellValue(SpellValueMod mod, int32 value);
|
||||
SpellValue const* const GetSpellValue() { return m_spellValue; }
|
||||
SpellValue const* const GetSpellValue() { return m_spellValue; }
|
||||
|
||||
// xinef: moved to public
|
||||
// xinef: moved to public
|
||||
void LoadScripts();
|
||||
|
||||
// Targets store structures and data
|
||||
// Targets store structures and data
|
||||
struct TargetInfo
|
||||
{
|
||||
uint64 targetGUID;
|
||||
@@ -537,7 +537,7 @@ class Spell
|
||||
bool scaleAura:1;
|
||||
int32 damage;
|
||||
};
|
||||
std::list<TargetInfo>* GetUniqueTargetInfo() { return &m_UniqueTargetInfo; }
|
||||
std::list<TargetInfo>* GetUniqueTargetInfo() { return &m_UniqueTargetInfo; }
|
||||
protected:
|
||||
bool HasGlobalCooldown() const;
|
||||
void TriggerGlobalCooldown();
|
||||
@@ -578,7 +578,7 @@ class Spell
|
||||
// Delayed spells system
|
||||
uint64 m_delayStart; // time of spell delay start, filled by event handler, zero = just started
|
||||
uint64 m_delayMoment; // moment of next delay call, used internally
|
||||
uint64 m_delayTrajectory; // Xinef: Trajectory delay
|
||||
uint64 m_delayTrajectory; // Xinef: Trajectory delay
|
||||
bool m_immediateHandled; // were immediate actions handled? (used by delayed spells only)
|
||||
|
||||
// These vars are used in both delayed spell system and modified immediate spell system
|
||||
@@ -664,7 +664,7 @@ class Spell
|
||||
void CheckEffectExecuteData();
|
||||
|
||||
// Scripting system
|
||||
bool _scriptsLoaded;
|
||||
bool _scriptsLoaded;
|
||||
//void LoadScripts();
|
||||
void CallScriptBeforeCastHandlers();
|
||||
void CallScriptOnCastHandlers();
|
||||
@@ -714,8 +714,8 @@ class Spell
|
||||
bool m_skipCheck;
|
||||
uint8 m_auraScaleMask;
|
||||
|
||||
// xinef:
|
||||
bool _spellTargetsSelected;
|
||||
// xinef:
|
||||
bool _spellTargetsSelected;
|
||||
|
||||
ByteBuffer * m_effectExecuteData[MAX_SPELL_EFFECTS];
|
||||
|
||||
@@ -774,7 +774,7 @@ namespace Trinity
|
||||
struct WorldObjectSpellTrajTargetCheck : public WorldObjectSpellAreaTargetCheck
|
||||
{
|
||||
WorldObjectSpellTrajTargetCheck(float range, Position const* position, Unit* caster,
|
||||
SpellInfo const* spellInfo, SpellTargetCheckTypes selectionType, ConditionList* condList);
|
||||
SpellInfo const* spellInfo, SpellTargetCheckTypes selectionType, ConditionList* condList);
|
||||
bool operator()(WorldObject* target);
|
||||
};
|
||||
}
|
||||
@@ -796,14 +796,14 @@ class SpellEvent : public BasicEvent
|
||||
|
||||
class ReflectEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
ReflectEvent(uint64 casterGUID, uint64 targetGUID, const SpellInfo* spellInfo) : _casterGUID(casterGUID), _targetGUID(targetGUID), _spellInfo(spellInfo) { }
|
||||
virtual bool Execute(uint64 e_time, uint32 p_time);
|
||||
public:
|
||||
ReflectEvent(uint64 casterGUID, uint64 targetGUID, const SpellInfo* spellInfo) : _casterGUID(casterGUID), _targetGUID(targetGUID), _spellInfo(spellInfo) { }
|
||||
virtual bool Execute(uint64 e_time, uint32 p_time);
|
||||
|
||||
protected:
|
||||
uint64 _casterGUID;
|
||||
uint64 _targetGUID;
|
||||
const SpellInfo* _spellInfo;
|
||||
protected:
|
||||
uint64 _casterGUID;
|
||||
uint64 _targetGUID;
|
||||
const SpellInfo* _spellInfo;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -411,7 +411,7 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const
|
||||
int32 randomPoints = int32(DieSides);
|
||||
|
||||
// base amount modification based on spell lvl vs caster lvl
|
||||
// xinef: added basePointsPerLevel check
|
||||
// xinef: added basePointsPerLevel check
|
||||
if (caster && basePointsPerLevel != 0.0f)
|
||||
{
|
||||
int32 level = int32(caster->getLevel());
|
||||
@@ -420,8 +420,8 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const
|
||||
else if (level < int32(_spellInfo->BaseLevel))
|
||||
level = int32(_spellInfo->BaseLevel);
|
||||
|
||||
// xinef: if base level is greater than spell level, reduce by base level (eg. pilgrims foods)
|
||||
level -= int32(std::max(_spellInfo->BaseLevel, _spellInfo->SpellLevel));
|
||||
// xinef: if base level is greater than spell level, reduce by base level (eg. pilgrims foods)
|
||||
level -= int32(std::max(_spellInfo->BaseLevel, _spellInfo->SpellLevel));
|
||||
basePoints += int32(level * basePointsPerLevel);
|
||||
}
|
||||
|
||||
@@ -850,11 +850,11 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry)
|
||||
ExplicitTargetMask = _GetExplicitTargetMask();
|
||||
ChainEntry = NULL;
|
||||
|
||||
// Mine
|
||||
_isStackableWithRanks = false;
|
||||
_isSpellValid = true;
|
||||
_isCritCapable = false;
|
||||
_requireCooldownInfo = false;
|
||||
// Mine
|
||||
_isStackableWithRanks = false;
|
||||
_isSpellValid = true;
|
||||
_isCritCapable = false;
|
||||
_requireCooldownInfo = false;
|
||||
}
|
||||
|
||||
SpellInfo::~SpellInfo()
|
||||
@@ -1025,17 +1025,17 @@ bool SpellInfo::NeedsToBeTriggeredByCaster(SpellInfo const* triggeringSpell, uin
|
||||
if (NeedsExplicitUnitTarget())
|
||||
return true;
|
||||
|
||||
// pussywizard:
|
||||
if (effIndex < MAX_SPELL_EFFECTS && (triggeringSpell->Effects[effIndex].TargetA.GetCheckType() == TARGET_CHECK_ENTRY || triggeringSpell->Effects[effIndex].TargetB.GetCheckType() == TARGET_CHECK_ENTRY))
|
||||
{
|
||||
// xinef:
|
||||
if (Id == 60563)
|
||||
return true;
|
||||
// pussywizard:
|
||||
if (effIndex < MAX_SPELL_EFFECTS && (triggeringSpell->Effects[effIndex].TargetA.GetCheckType() == TARGET_CHECK_ENTRY || triggeringSpell->Effects[effIndex].TargetB.GetCheckType() == TARGET_CHECK_ENTRY))
|
||||
{
|
||||
// xinef:
|
||||
if (Id == 60563)
|
||||
return true;
|
||||
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (Effects[i].IsEffect() && (Effects[i].TargetA.GetCheckType() == TARGET_CHECK_ENTRY || Effects[i].TargetB.GetCheckType() == TARGET_CHECK_ENTRY))
|
||||
return true;
|
||||
}
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (Effects[i].IsEffect() && (Effects[i].TargetA.GetCheckType() == TARGET_CHECK_ENTRY || Effects[i].TargetB.GetCheckType() == TARGET_CHECK_ENTRY))
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
@@ -1067,17 +1067,17 @@ bool SpellInfo::NeedsToBeTriggeredByCaster(SpellInfo const* triggeringSpell, uin
|
||||
|
||||
bool SpellInfo::IsChannelCategorySpell() const
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (Effects[i].TargetA.GetSelectionCategory() == TARGET_SELECT_CATEGORY_CHANNEL || Effects[i].TargetB.GetSelectionCategory() == TARGET_SELECT_CATEGORY_CHANNEL)
|
||||
return true;
|
||||
return false;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (Effects[i].TargetA.GetSelectionCategory() == TARGET_SELECT_CATEGORY_CHANNEL || Effects[i].TargetB.GetSelectionCategory() == TARGET_SELECT_CATEGORY_CHANNEL)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
bool SpellInfo::IsSelfCast() const
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (Effects[i].Effect && Effects[i].TargetA.GetTarget() != TARGET_UNIT_CASTER)
|
||||
return false;
|
||||
return true;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (Effects[i].Effect && Effects[i].TargetA.GetTarget() != TARGET_UNIT_CASTER)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SpellInfo::IsPassive() const
|
||||
@@ -1129,59 +1129,59 @@ bool SpellInfo::ComputeIsStackableWithRanks() const
|
||||
|
||||
bool SpellInfo::IsStackableWithRanks() const
|
||||
{
|
||||
return _isStackableWithRanks;
|
||||
return _isStackableWithRanks;
|
||||
}
|
||||
|
||||
void SpellInfo::SetStackableWithRanks(bool val)
|
||||
{
|
||||
_isStackableWithRanks = val;
|
||||
_isStackableWithRanks = val;
|
||||
}
|
||||
|
||||
bool SpellInfo::ComputeIsCritCapable() const
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
switch (Effects[i].Effect)
|
||||
{
|
||||
case SPELL_EFFECT_SCHOOL_DAMAGE:
|
||||
case SPELL_EFFECT_HEALTH_LEECH:
|
||||
case SPELL_EFFECT_HEAL:
|
||||
case SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL:
|
||||
case SPELL_EFFECT_WEAPON_PERCENT_DAMAGE:
|
||||
case SPELL_EFFECT_WEAPON_DAMAGE:
|
||||
case SPELL_EFFECT_POWER_BURN:
|
||||
case SPELL_EFFECT_HEAL_MECHANICAL:
|
||||
case SPELL_EFFECT_NORMALIZED_WEAPON_DMG:
|
||||
case SPELL_EFFECT_HEAL_PCT:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
switch (Effects[i].Effect)
|
||||
{
|
||||
case SPELL_EFFECT_SCHOOL_DAMAGE:
|
||||
case SPELL_EFFECT_HEALTH_LEECH:
|
||||
case SPELL_EFFECT_HEAL:
|
||||
case SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL:
|
||||
case SPELL_EFFECT_WEAPON_PERCENT_DAMAGE:
|
||||
case SPELL_EFFECT_WEAPON_DAMAGE:
|
||||
case SPELL_EFFECT_POWER_BURN:
|
||||
case SPELL_EFFECT_HEAL_MECHANICAL:
|
||||
case SPELL_EFFECT_NORMALIZED_WEAPON_DMG:
|
||||
case SPELL_EFFECT_HEAL_PCT:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SpellInfo::IsCritCapable() const
|
||||
{
|
||||
return _isCritCapable;
|
||||
return _isCritCapable;
|
||||
}
|
||||
|
||||
bool SpellInfo::RequireCooldownInfo() const
|
||||
{
|
||||
return _requireCooldownInfo;
|
||||
return _requireCooldownInfo;
|
||||
}
|
||||
|
||||
void SpellInfo::SetCritCapable(bool val)
|
||||
{
|
||||
_isCritCapable = val;
|
||||
_isCritCapable = val;
|
||||
}
|
||||
|
||||
bool SpellInfo::IsSpellValid() const
|
||||
{
|
||||
return _isSpellValid;
|
||||
return _isSpellValid;
|
||||
}
|
||||
|
||||
void SpellInfo::SetSpellValid(bool val)
|
||||
{
|
||||
_isSpellValid = val;
|
||||
_isSpellValid = val;
|
||||
}
|
||||
|
||||
bool SpellInfo::IsPassiveStackableWithRanks() const
|
||||
@@ -1257,7 +1257,7 @@ bool SpellInfo::IsRangedWeaponSpell() const
|
||||
{
|
||||
return (SpellFamilyName == SPELLFAMILY_HUNTER && !(SpellFamilyFlags[1] & 0x10000000)) // for 53352, cannot find better way
|
||||
|| (EquippedItemSubClassMask & ITEM_SUBCLASS_MASK_WEAPON_RANGED)
|
||||
|| (Attributes & SPELL_ATTR0_REQ_AMMO); // Xinef: added
|
||||
|| (Attributes & SPELL_ATTR0_REQ_AMMO); // Xinef: added
|
||||
}
|
||||
|
||||
bool SpellInfo::IsAutoRepeatRangedSpell() const
|
||||
@@ -1297,8 +1297,8 @@ bool SpellInfo::CanPierceImmuneAura(SpellInfo const* aura) const
|
||||
|
||||
// these spells (Cyclone for example) can pierce all...
|
||||
if ((AttributesEx & SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE)
|
||||
// ...but not these (Divine shield for example) // xinef: banish exception, banish can override banish to cancel itself
|
||||
&& !(aura && (aura->Mechanic == MECHANIC_IMMUNE_SHIELD || aura->Mechanic == MECHANIC_INVULNERABILITY || (aura->Mechanic == MECHANIC_BANISH && (Mechanic != MECHANIC_BANISH || !(AttributesEx2 & SPELL_ATTR2_CANT_TARGET_TAPPED))))))
|
||||
// ...but not these (Divine shield for example) // xinef: banish exception, banish can override banish to cancel itself
|
||||
&& !(aura && (aura->Mechanic == MECHANIC_IMMUNE_SHIELD || aura->Mechanic == MECHANIC_INVULNERABILITY || (aura->Mechanic == MECHANIC_BANISH && (Mechanic != MECHANIC_BANISH || !(AttributesEx2 & SPELL_ATTR2_CANT_TARGET_TAPPED))))))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -1306,9 +1306,9 @@ bool SpellInfo::CanPierceImmuneAura(SpellInfo const* aura) const
|
||||
|
||||
bool SpellInfo::CanDispelAura(SpellInfo const* aura) const
|
||||
{
|
||||
// Xinef: Passive auras cannot be dispelled
|
||||
if (aura->IsPassive())
|
||||
return false;
|
||||
// Xinef: Passive auras cannot be dispelled
|
||||
if (aura->IsPassive())
|
||||
return false;
|
||||
|
||||
// Xinef: At frist we check non-player auras, that should be never dispellable
|
||||
// Xinef: Eg. Mark of the Fallen Champion
|
||||
@@ -1564,171 +1564,171 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a
|
||||
|
||||
bool SpellInfo::IsStrongerAuraActive(Unit const* caster, Unit const* target) const
|
||||
{
|
||||
if (!target)
|
||||
return false;
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
// xinef: check spell group
|
||||
uint32 groupId = sSpellMgr->GetSpellGroup(Id);
|
||||
if (!groupId)
|
||||
return false;
|
||||
// xinef: check spell group
|
||||
uint32 groupId = sSpellMgr->GetSpellGroup(Id);
|
||||
if (!groupId)
|
||||
return false;
|
||||
|
||||
SpellGroupSpecialFlags sFlag = sSpellMgr->GetSpellGroupSpecialFlags(Id);
|
||||
if (sFlag & SPELL_GROUP_SPECIAL_FLAG_SKIP_STRONGER_CHECK)
|
||||
return false;
|
||||
SpellGroupSpecialFlags sFlag = sSpellMgr->GetSpellGroupSpecialFlags(Id);
|
||||
if (sFlag & SPELL_GROUP_SPECIAL_FLAG_SKIP_STRONGER_CHECK)
|
||||
return false;
|
||||
|
||||
for (uint8 i = EFFECT_0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
// xinef: Skip Empty effects
|
||||
if (!Effects[i].IsEffect())
|
||||
continue;
|
||||
for (uint8 i = EFFECT_0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
// xinef: Skip Empty effects
|
||||
if (!Effects[i].IsEffect())
|
||||
continue;
|
||||
|
||||
// xinef: if non-aura effect is preset - return false
|
||||
if (!Effects[i].IsAura())
|
||||
return false;
|
||||
// xinef: if non-aura effect is preset - return false
|
||||
if (!Effects[i].IsAura())
|
||||
return false;
|
||||
|
||||
// xinef: aura is periodic - return false
|
||||
if (Effects[i].Amplitude)
|
||||
return false;
|
||||
// xinef: aura is periodic - return false
|
||||
if (Effects[i].Amplitude)
|
||||
return false;
|
||||
|
||||
// xinef: exclude dummy auras
|
||||
if (Effects[i].ApplyAuraName == SPELL_AURA_DUMMY)
|
||||
return false;
|
||||
}
|
||||
// xinef: exclude dummy auras
|
||||
if (Effects[i].ApplyAuraName == SPELL_AURA_DUMMY)
|
||||
return false;
|
||||
}
|
||||
|
||||
for (uint8 i = EFFECT_0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
// xinef: skip non-aura efects
|
||||
if (!Effects[i].IsAura())
|
||||
return false;
|
||||
for (uint8 i = EFFECT_0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
// xinef: skip non-aura efects
|
||||
if (!Effects[i].IsAura())
|
||||
return false;
|
||||
|
||||
Unit::AuraEffectList const& auraList = target->GetAuraEffectsByType((AuraType)Effects[i].ApplyAuraName);
|
||||
for (Unit::AuraEffectList::const_iterator iter = auraList.begin(); iter != auraList.end(); ++iter)
|
||||
{
|
||||
// xinef: aura is not groupped or in different group
|
||||
uint32 auraGroup = (*iter)->GetAuraGroup();
|
||||
if (!auraGroup || auraGroup != groupId)
|
||||
continue;
|
||||
Unit::AuraEffectList const& auraList = target->GetAuraEffectsByType((AuraType)Effects[i].ApplyAuraName);
|
||||
for (Unit::AuraEffectList::const_iterator iter = auraList.begin(); iter != auraList.end(); ++iter)
|
||||
{
|
||||
// xinef: aura is not groupped or in different group
|
||||
uint32 auraGroup = (*iter)->GetAuraGroup();
|
||||
if (!auraGroup || auraGroup != groupId)
|
||||
continue;
|
||||
|
||||
// xinef: check priority before effect mask
|
||||
if (sFlag >= SPELL_GROUP_SPECIAL_FLAG_PRIORITY1)
|
||||
{
|
||||
SpellGroupSpecialFlags sFlagCurr = sSpellMgr->GetSpellGroupSpecialFlags((*iter)->GetId());
|
||||
if (sFlagCurr >= SPELL_GROUP_SPECIAL_FLAG_PRIORITY1 && sFlagCurr < sFlag)
|
||||
return true;
|
||||
}
|
||||
// xinef: check priority before effect mask
|
||||
if (sFlag >= SPELL_GROUP_SPECIAL_FLAG_PRIORITY1)
|
||||
{
|
||||
SpellGroupSpecialFlags sFlagCurr = sSpellMgr->GetSpellGroupSpecialFlags((*iter)->GetId());
|
||||
if (sFlagCurr >= SPELL_GROUP_SPECIAL_FLAG_PRIORITY1 && sFlagCurr < sFlag)
|
||||
return true;
|
||||
}
|
||||
|
||||
// xinef: check aura effect equal auras only, some auras have different effects on different ranks - check rank also
|
||||
if (!IsAuraEffectEqual((*iter)->GetSpellInfo()) && !IsRankOf((*iter)->GetSpellInfo()))
|
||||
continue;
|
||||
// xinef: check aura effect equal auras only, some auras have different effects on different ranks - check rank also
|
||||
if (!IsAuraEffectEqual((*iter)->GetSpellInfo()) && !IsRankOf((*iter)->GetSpellInfo()))
|
||||
continue;
|
||||
|
||||
// xinef: misc value mismatches
|
||||
// xinef: commented, checked above
|
||||
//if (Effects[i].MiscValue != (*iter)->GetMiscValue())
|
||||
// continue;
|
||||
// xinef: misc value mismatches
|
||||
// xinef: commented, checked above
|
||||
//if (Effects[i].MiscValue != (*iter)->GetMiscValue())
|
||||
// continue;
|
||||
|
||||
// xinef: should not happen, or effect is not active - stronger one is present
|
||||
AuraApplication* aurApp = (*iter)->GetBase()->GetApplicationOfTarget(target->GetGUID());
|
||||
if (!aurApp || !aurApp->IsActive((*iter)->GetEffIndex()))
|
||||
continue;
|
||||
// xinef: should not happen, or effect is not active - stronger one is present
|
||||
AuraApplication* aurApp = (*iter)->GetBase()->GetApplicationOfTarget(target->GetGUID());
|
||||
if (!aurApp || !aurApp->IsActive((*iter)->GetEffIndex()))
|
||||
continue;
|
||||
|
||||
// xinef: assume that all spells are either positive or negative, otherwise they should not be in one group
|
||||
// xinef: take custom values into account
|
||||
// xinef: assume that all spells are either positive or negative, otherwise they should not be in one group
|
||||
// xinef: take custom values into account
|
||||
|
||||
int32 basePoints = Effects[i].BasePoints;
|
||||
int32 duration = GetMaxDuration();
|
||||
int32 basePoints = Effects[i].BasePoints;
|
||||
int32 duration = GetMaxDuration();
|
||||
|
||||
// xinef: should have the same id, can be different if spell is triggered
|
||||
// xinef: have to fix spell mods for triggered spell, turn off current spellmodtakingspell for preparing and restore after
|
||||
if (Player const* player = caster->GetSpellModOwner())
|
||||
if (player->m_spellModTakingSpell && player->m_spellModTakingSpell->m_spellInfo->Id == Id)
|
||||
basePoints = player->m_spellModTakingSpell->GetSpellValue()->EffectBasePoints[i];
|
||||
// xinef: should have the same id, can be different if spell is triggered
|
||||
// xinef: have to fix spell mods for triggered spell, turn off current spellmodtakingspell for preparing and restore after
|
||||
if (Player const* player = caster->GetSpellModOwner())
|
||||
if (player->m_spellModTakingSpell && player->m_spellModTakingSpell->m_spellInfo->Id == Id)
|
||||
basePoints = player->m_spellModTakingSpell->GetSpellValue()->EffectBasePoints[i];
|
||||
|
||||
int32 curValue = abs(Effects[i].CalcValue(caster, &basePoints));
|
||||
int32 auraValue = (sFlag & SPELL_GROUP_SPECIAL_FLAG_BASE_AMOUNT_CHECK) ?
|
||||
abs((*iter)->GetSpellInfo()->Effects[(*iter)->GetEffIndex()].CalcValue((*iter)->GetCaster())) :
|
||||
abs((*iter)->GetAmount());
|
||||
int32 curValue = abs(Effects[i].CalcValue(caster, &basePoints));
|
||||
int32 auraValue = (sFlag & SPELL_GROUP_SPECIAL_FLAG_BASE_AMOUNT_CHECK) ?
|
||||
abs((*iter)->GetSpellInfo()->Effects[(*iter)->GetEffIndex()].CalcValue((*iter)->GetCaster())) :
|
||||
abs((*iter)->GetAmount());
|
||||
|
||||
// xinef: for same spells, divide amount by stack amount
|
||||
if (Id == (*iter)->GetId())
|
||||
auraValue /= (*iter)->GetBase()->GetStackAmount();
|
||||
// xinef: for same spells, divide amount by stack amount
|
||||
if (Id == (*iter)->GetId())
|
||||
auraValue /= (*iter)->GetBase()->GetStackAmount();
|
||||
|
||||
if (curValue < auraValue)
|
||||
return true;
|
||||
if (curValue < auraValue)
|
||||
return true;
|
||||
|
||||
// xinef: little hack, if current spell is the same as aura spell, asume it is not stronger
|
||||
// xinef: if values are the same, duration mods should be taken into account but they are almost always passive
|
||||
if (curValue == auraValue)
|
||||
{
|
||||
if (Id == (*iter)->GetId())
|
||||
continue;
|
||||
if (!(*iter)->GetBase()->IsPassive() && duration < (*iter)->GetBase()->GetDuration())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// xinef: little hack, if current spell is the same as aura spell, asume it is not stronger
|
||||
// xinef: if values are the same, duration mods should be taken into account but they are almost always passive
|
||||
if (curValue == auraValue)
|
||||
{
|
||||
if (Id == (*iter)->GetId())
|
||||
continue;
|
||||
if (!(*iter)->GetBase()->IsPassive() && duration < (*iter)->GetBase()->GetDuration())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SpellInfo::IsAuraEffectEqual(SpellInfo const* otherSpellInfo) const
|
||||
{
|
||||
uint8 matchCount = 0;
|
||||
uint8 auraCount = 0;
|
||||
for (uint8 i = EFFECT_0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
// xinef: skip non-aura efects
|
||||
if (!Effects[i].IsAura())
|
||||
continue;
|
||||
uint8 matchCount = 0;
|
||||
uint8 auraCount = 0;
|
||||
for (uint8 i = EFFECT_0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
// xinef: skip non-aura efects
|
||||
if (!Effects[i].IsAura())
|
||||
continue;
|
||||
|
||||
bool effectFound = false;
|
||||
for (uint8 j = EFFECT_0; j < MAX_SPELL_EFFECTS; ++j)
|
||||
{
|
||||
if (!otherSpellInfo->Effects[j].IsAura())
|
||||
continue;
|
||||
|
||||
if (Effects[i].ApplyAuraName != otherSpellInfo->Effects[j].ApplyAuraName || Effects[i].MiscValue != otherSpellInfo->Effects[j].MiscValue)
|
||||
continue;
|
||||
bool effectFound = false;
|
||||
for (uint8 j = EFFECT_0; j < MAX_SPELL_EFFECTS; ++j)
|
||||
{
|
||||
if (!otherSpellInfo->Effects[j].IsAura())
|
||||
continue;
|
||||
|
||||
if (Effects[i].ApplyAuraName != otherSpellInfo->Effects[j].ApplyAuraName || Effects[i].MiscValue != otherSpellInfo->Effects[j].MiscValue)
|
||||
continue;
|
||||
|
||||
effectFound = true;
|
||||
break;
|
||||
}
|
||||
effectFound = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!effectFound)
|
||||
return false;
|
||||
++matchCount;
|
||||
}
|
||||
if (!effectFound)
|
||||
return false;
|
||||
++matchCount;
|
||||
}
|
||||
|
||||
for (uint8 i = EFFECT_0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (Effects[i].IsAura())
|
||||
++auraCount;
|
||||
if (otherSpellInfo->Effects[i].IsAura())
|
||||
++auraCount;
|
||||
}
|
||||
for (uint8 i = EFFECT_0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (Effects[i].IsAura())
|
||||
++auraCount;
|
||||
if (otherSpellInfo->Effects[i].IsAura())
|
||||
++auraCount;
|
||||
}
|
||||
|
||||
return matchCount*2 == auraCount;
|
||||
return matchCount*2 == auraCount;
|
||||
}
|
||||
|
||||
|
||||
bool SpellInfo::ValidateAttribute6SpellDamageMods(const Unit* caster, const AuraEffect* auraEffect, bool isDot) const
|
||||
{
|
||||
// Xinef: no attribute
|
||||
if (!(AttributesEx6 & SPELL_ATTR6_LIMIT_PCT_DAMAGE_MODS))
|
||||
return true;
|
||||
// Xinef: no attribute
|
||||
if (!(AttributesEx6 & SPELL_ATTR6_LIMIT_PCT_DAMAGE_MODS))
|
||||
return true;
|
||||
|
||||
// Xinef we have a hook to decide which auras should profit to the spell, by default no profits
|
||||
// Xinef: Scourge Strike - Trigger
|
||||
if (Id == 70890 && auraEffect)
|
||||
{
|
||||
const SpellInfo* auraInfo = auraEffect->GetSpellInfo();
|
||||
return auraInfo->SpellIconID == 3086 ||
|
||||
(auraInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && (auraInfo->SpellFamilyFlags & flag96(8388608, 64, 16) || auraInfo->SpellIconID == 235 || auraInfo->SpellIconID == 154));
|
||||
}
|
||||
// Xinef: Necrosis, no profits for done and taken
|
||||
else if (Id == 51460)
|
||||
return false;
|
||||
// Xinef we have a hook to decide which auras should profit to the spell, by default no profits
|
||||
// Xinef: Scourge Strike - Trigger
|
||||
if (Id == 70890 && auraEffect)
|
||||
{
|
||||
const SpellInfo* auraInfo = auraEffect->GetSpellInfo();
|
||||
return auraInfo->SpellIconID == 3086 ||
|
||||
(auraInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && (auraInfo->SpellFamilyFlags & flag96(8388608, 64, 16) || auraInfo->SpellIconID == 235 || auraInfo->SpellIconID == 154));
|
||||
}
|
||||
// Xinef: Necrosis, no profits for done and taken
|
||||
else if (Id == 51460)
|
||||
return false;
|
||||
|
||||
// Xinef: Do not affect dots and auras obtained from items, only affected by self casted auras
|
||||
return !isDot && auraEffect && (auraEffect->GetAmount() < 0 || (auraEffect->GetCasterGUID() == caster->GetGUID() && auraEffect->GetSpellInfo()->SpellFamilyName == SpellFamilyName)) && !auraEffect->GetBase()->GetCastItemGUID();
|
||||
// Xinef: Do not affect dots and auras obtained from items, only affected by self casted auras
|
||||
return !isDot && auraEffect && (auraEffect->GetAmount() < 0 || (auraEffect->GetCasterGUID() == caster->GetGUID() && auraEffect->GetSpellInfo()->SpellFamilyName == SpellFamilyName)) && !auraEffect->GetBase()->GetCastItemGUID();
|
||||
}
|
||||
|
||||
SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* target, bool implicit) const
|
||||
@@ -1745,7 +1745,7 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta
|
||||
// creature/player specific target checks
|
||||
if (unitTarget)
|
||||
{
|
||||
// xinef: spells cannot be cast if player is in fake combat also
|
||||
// xinef: spells cannot be cast if player is in fake combat also
|
||||
if (AttributesEx & SPELL_ATTR1_CANT_TARGET_IN_COMBAT && (unitTarget->IsInCombat() || unitTarget->IsPetInCombat()))
|
||||
return SPELL_FAILED_TARGET_AFFECTING_COMBAT;
|
||||
|
||||
@@ -1872,9 +1872,9 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta
|
||||
if (HasEffect(SPELL_EFFECT_SELF_RESURRECT) || HasEffect(SPELL_EFFECT_RESURRECT) || HasEffect(SPELL_EFFECT_RESURRECT_NEW))
|
||||
return SPELL_FAILED_TARGET_CANNOT_BE_RESURRECTED;
|
||||
|
||||
// xinef: check if stronger aura is active
|
||||
if (IsStrongerAuraActive(caster, unitTarget))
|
||||
return SPELL_FAILED_AURA_BOUNCED;
|
||||
// xinef: check if stronger aura is active
|
||||
if (IsStrongerAuraActive(caster, unitTarget))
|
||||
return SPELL_FAILED_AURA_BOUNCED;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
@@ -2004,7 +2004,7 @@ uint32 SpellInfo::GetExplicitTargetMask() const
|
||||
|
||||
AuraStateType SpellInfo::GetAuraState() const
|
||||
{
|
||||
return _auraState;
|
||||
return _auraState;
|
||||
}
|
||||
|
||||
AuraStateType SpellInfo::LoadAuraState() const
|
||||
@@ -2058,7 +2058,7 @@ AuraStateType SpellInfo::LoadAuraState() const
|
||||
switch (Id)
|
||||
{
|
||||
case 71465: // Divine Surge
|
||||
case 50241: // Oculus, Drake spell Evasive Maneuvers
|
||||
case 50241: // Oculus, Drake spell Evasive Maneuvers
|
||||
return AURA_STATE_UNKNOWN22;
|
||||
default:
|
||||
break;
|
||||
@@ -2069,7 +2069,7 @@ AuraStateType SpellInfo::LoadAuraState() const
|
||||
|
||||
SpellSpecificType SpellInfo::GetSpellSpecific() const
|
||||
{
|
||||
return _spellSpecific;
|
||||
return _spellSpecific;
|
||||
}
|
||||
|
||||
SpellSpecificType SpellInfo::LoadSpellSpecific() const
|
||||
@@ -2196,9 +2196,9 @@ SpellSpecificType SpellInfo::LoadSpellSpecific() const
|
||||
if (SpellFamilyFlags[2] & 0x00000020)
|
||||
return SPELL_SPECIFIC_AURA;
|
||||
|
||||
// Illidari Council Paladin (Gathios the Shatterer)
|
||||
if (Id == 41459 || Id == 41469)
|
||||
return SPELL_SPECIFIC_SEAL;
|
||||
// Illidari Council Paladin (Gathios the Shatterer)
|
||||
if (Id == 41459 || Id == 41469)
|
||||
return SPELL_SPECIFIC_SEAL;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -2288,7 +2288,7 @@ uint32 SpellInfo::CalcCastTime(Unit* caster, Spell* spell) const
|
||||
return 0;
|
||||
|
||||
int32 castTime = CastTimeEntry->CastTime;
|
||||
if (Attributes & SPELL_ATTR0_REQ_AMMO && (!IsAutoRepeatRangedSpell()))
|
||||
if (Attributes & SPELL_ATTR0_REQ_AMMO && (!IsAutoRepeatRangedSpell()))
|
||||
castTime += 500;
|
||||
|
||||
if (caster)
|
||||
@@ -2552,17 +2552,17 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
|
||||
case SPELLFAMILY_GENERIC:
|
||||
switch (Id)
|
||||
{
|
||||
case 11196: // Recently bandaged
|
||||
case 11196: // Recently bandaged
|
||||
case 29214: // Wrath of the Plaguebringer
|
||||
case 34700: // Allergic Reaction
|
||||
case 34709: // Shadow Sight (arena stealth detection)
|
||||
case 34709: // Shadow Sight (arena stealth detection)
|
||||
case 54836: // Wrath of the Plaguebringer
|
||||
case 58867: // Shaman's Spirit Wolf leap
|
||||
case 58867: // Shaman's Spirit Wolf leap
|
||||
case 61987: // Avenging Wrath Marker
|
||||
case 61988: // Divine Shield exclude aura
|
||||
case 72998: // Shadow Prison (Blood Prince Council, ICC Encounter)
|
||||
case 72998: // Shadow Prison (Blood Prince Council, ICC Encounter)
|
||||
return false;
|
||||
case 30877: // Tag Murloc
|
||||
case 30877: // Tag Murloc
|
||||
case 61716: // Rabbit Costume
|
||||
case 61734: // Noblegarden Bunny
|
||||
case 62344: // Fists of Stone
|
||||
@@ -2579,7 +2579,7 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
|
||||
return true;
|
||||
if (SpellIconID == 242)
|
||||
return true;
|
||||
// Ignite
|
||||
// Ignite
|
||||
if (SpellIconID == 45)
|
||||
return true;
|
||||
break;
|
||||
@@ -2593,9 +2593,9 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// Mind Flay
|
||||
if (SpellFamilyFlags[0] & 0x800000)
|
||||
return false;
|
||||
// Mind Flay
|
||||
if (SpellFamilyFlags[0] & 0x800000)
|
||||
return false;
|
||||
break;
|
||||
case SPELLFAMILY_HUNTER:
|
||||
// Aspect of the Viper
|
||||
@@ -2603,30 +2603,30 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
|
||||
return true;
|
||||
break;
|
||||
case SPELLFAMILY_ROGUE:
|
||||
// Envenom
|
||||
// Envenom
|
||||
if (SpellIconID == 2237)
|
||||
return true;
|
||||
// Slice and Dice
|
||||
return true;
|
||||
// Slice and Dice
|
||||
else if (SpellFamilyFlags[0] & 0x40000)
|
||||
return true;
|
||||
// Distract
|
||||
else if (Id == 1725)
|
||||
return true;
|
||||
// Distract
|
||||
else if (Id == 1725)
|
||||
return true;
|
||||
break;
|
||||
case SPELLFAMILY_SHAMAN:
|
||||
if (Id == 30708)
|
||||
return false;
|
||||
break;
|
||||
case SPELLFAMILY_PALADIN:
|
||||
// Forberance
|
||||
if (Id == 25771)
|
||||
return false;
|
||||
break;
|
||||
case SPELLFAMILY_WARRIOR:
|
||||
// Intervene, Warrior, considered negative due to triggered spell with threat
|
||||
if (Id == 3411)
|
||||
return true;
|
||||
break;
|
||||
case SPELLFAMILY_PALADIN:
|
||||
// Forberance
|
||||
if (Id == 25771)
|
||||
return false;
|
||||
break;
|
||||
case SPELLFAMILY_WARRIOR:
|
||||
// Intervene, Warrior, considered negative due to triggered spell with threat
|
||||
if (Id == 3411)
|
||||
return true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -2668,32 +2668,32 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_ENEMY:
|
||||
return false;
|
||||
|
||||
case SPELL_EFFECT_GAMEOBJECT_DAMAGE:
|
||||
return false;
|
||||
case SPELL_EFFECT_GAMEOBJECT_DAMAGE:
|
||||
return false;
|
||||
|
||||
case SPELL_EFFECT_SCHOOL_DAMAGE:
|
||||
{
|
||||
bool only = true;
|
||||
for (int i = EFFECT_0; i <= EFFECT_2; ++i)
|
||||
{
|
||||
if (Effects[effIndex].Effect > 0 && Effects[effIndex].Effect != SPELL_EFFECT_SCHOOL_DAMAGE)
|
||||
only = false;
|
||||
if (Effects[effIndex].Effect == SPELL_EFFECT_GAMEOBJECT_DAMAGE)
|
||||
return false;
|
||||
}
|
||||
// effects with school damage only cannot be positive...
|
||||
if (only)
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_KNOCK_BACK:
|
||||
case SPELL_EFFECT_KNOCK_BACK_DEST:
|
||||
{
|
||||
for (int i = EFFECT_0; i <= EFFECT_2; ++i)
|
||||
if (Effects[effIndex].Effect == SPELL_EFFECT_GAMEOBJECT_DAMAGE)
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_SCHOOL_DAMAGE:
|
||||
{
|
||||
bool only = true;
|
||||
for (int i = EFFECT_0; i <= EFFECT_2; ++i)
|
||||
{
|
||||
if (Effects[effIndex].Effect > 0 && Effects[effIndex].Effect != SPELL_EFFECT_SCHOOL_DAMAGE)
|
||||
only = false;
|
||||
if (Effects[effIndex].Effect == SPELL_EFFECT_GAMEOBJECT_DAMAGE)
|
||||
return false;
|
||||
}
|
||||
// effects with school damage only cannot be positive...
|
||||
if (only)
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_KNOCK_BACK:
|
||||
case SPELL_EFFECT_KNOCK_BACK_DEST:
|
||||
{
|
||||
for (int i = EFFECT_0; i <= EFFECT_2; ++i)
|
||||
if (Effects[effIndex].Effect == SPELL_EFFECT_GAMEOBJECT_DAMAGE)
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
// non-positive aura use
|
||||
case SPELL_EFFECT_APPLY_AURA:
|
||||
|
||||
@@ -78,7 +78,7 @@ enum SpellTargetSelectionCategories
|
||||
TARGET_SELECT_CATEGORY_NEARBY,
|
||||
TARGET_SELECT_CATEGORY_CONE,
|
||||
TARGET_SELECT_CATEGORY_AREA,
|
||||
TARGET_SELECT_CATEGORY_TRAJ,
|
||||
TARGET_SELECT_CATEGORY_TRAJ,
|
||||
};
|
||||
|
||||
enum SpellTargetReferenceTypes
|
||||
@@ -117,7 +117,7 @@ enum SpellTargetCheckTypes
|
||||
TARGET_CHECK_RAID,
|
||||
TARGET_CHECK_RAID_CLASS,
|
||||
TARGET_CHECK_PASSENGER,
|
||||
TARGET_CHECK_CORPSE,
|
||||
TARGET_CHECK_CORPSE,
|
||||
};
|
||||
|
||||
enum SpellTargetDirectionTypes
|
||||
@@ -191,8 +191,8 @@ enum SpellCustomAttributes
|
||||
SPELL_ATTR0_CU_REQ_CASTER_BEHIND_TARGET = 0x00020000,
|
||||
SPELL_ATTR0_CU_ALLOW_INFLIGHT_TARGET = 0x00040000,
|
||||
SPELL_ATTR0_CU_NONE6 = 0x00080000, // UNUSED
|
||||
SPELL_ATTR0_CU_BINARY_SPELL = 0x00100000,
|
||||
SPELL_ATTR0_CU_NO_POSITIVE_TAKEN_BONUS = 0x00200000,
|
||||
SPELL_ATTR0_CU_BINARY_SPELL = 0x00100000,
|
||||
SPELL_ATTR0_CU_NO_POSITIVE_TAKEN_BONUS = 0x00200000,
|
||||
SPELL_ATTR0_CU_SINGLE_AURA_STACK = 0x00400000, // pussywizard
|
||||
SPELL_ATTR0_CU_SCHOOLMASK_NORMAL_WITH_MAGIC = 0x00800000,
|
||||
SPELL_ATTR0_CU_ENCOUNTER_REWARD = 0x01000000, // pussywizard
|
||||
@@ -378,13 +378,13 @@ public:
|
||||
uint32 ExplicitTargetMask;
|
||||
SpellChainNode const* ChainEntry;
|
||||
|
||||
// Mine
|
||||
AuraStateType _auraState;
|
||||
SpellSpecificType _spellSpecific;
|
||||
bool _isStackableWithRanks;
|
||||
bool _isSpellValid;
|
||||
bool _isCritCapable;
|
||||
bool _requireCooldownInfo;
|
||||
// Mine
|
||||
AuraStateType _auraState;
|
||||
SpellSpecificType _spellSpecific;
|
||||
bool _isStackableWithRanks;
|
||||
bool _isSpellValid;
|
||||
bool _isCritCapable;
|
||||
bool _requireCooldownInfo;
|
||||
|
||||
SpellInfo(SpellEntry const* spellEntry);
|
||||
~SpellInfo();
|
||||
@@ -419,20 +419,20 @@ public:
|
||||
bool IsTargetingArea() const;
|
||||
bool NeedsExplicitUnitTarget() const;
|
||||
bool NeedsToBeTriggeredByCaster(SpellInfo const* triggeringSpell, uint8 effIndex = MAX_SPELL_EFFECTS) const;
|
||||
bool IsChannelCategorySpell() const;
|
||||
bool IsSelfCast() const;
|
||||
bool IsChannelCategorySpell() const;
|
||||
bool IsSelfCast() const;
|
||||
|
||||
bool IsPassive() const;
|
||||
bool IsAutocastable() const;
|
||||
bool ComputeIsCritCapable() const;
|
||||
bool IsCritCapable() const;
|
||||
bool RequireCooldownInfo() const;
|
||||
void SetCritCapable(bool val);
|
||||
bool ComputeIsCritCapable() const;
|
||||
bool IsCritCapable() const;
|
||||
bool RequireCooldownInfo() const;
|
||||
void SetCritCapable(bool val);
|
||||
bool ComputeIsStackableWithRanks() const;
|
||||
bool IsStackableWithRanks() const;
|
||||
void SetStackableWithRanks(bool val);
|
||||
bool IsSpellValid() const;
|
||||
void SetSpellValid(bool val);
|
||||
bool IsStackableWithRanks() const;
|
||||
void SetStackableWithRanks(bool val);
|
||||
bool IsSpellValid() const;
|
||||
void SetSpellValid(bool val);
|
||||
bool IsPassiveStackableWithRanks() const;
|
||||
bool IsMultiSlotAura() const;
|
||||
bool IsCooldownStartedOnEvent() const;
|
||||
@@ -464,10 +464,10 @@ public:
|
||||
SpellCastResult CheckExplicitTarget(Unit const* caster, WorldObject const* target, Item const* itemTarget = NULL) const;
|
||||
bool CheckTargetCreatureType(Unit const* target) const;
|
||||
|
||||
// xinef: aura stacking
|
||||
bool IsStrongerAuraActive(Unit const* caster, Unit const* target) const;
|
||||
bool IsAuraEffectEqual(SpellInfo const* otherSpellInfo) const;
|
||||
bool ValidateAttribute6SpellDamageMods(const Unit* caster, const AuraEffect* auraEffect, bool isDot) const;
|
||||
// xinef: aura stacking
|
||||
bool IsStrongerAuraActive(Unit const* caster, Unit const* target) const;
|
||||
bool IsAuraEffectEqual(SpellInfo const* otherSpellInfo) const;
|
||||
bool ValidateAttribute6SpellDamageMods(const Unit* caster, const AuraEffect* auraEffect, bool isDot) const;
|
||||
|
||||
SpellSchoolMask GetSchoolMask() const;
|
||||
uint32 GetAllEffectsMechanicMask() const;
|
||||
@@ -488,7 +488,7 @@ public:
|
||||
int32 GetDuration() const;
|
||||
int32 GetMaxDuration() const;
|
||||
|
||||
uint32 GetMaxTicks() const;
|
||||
uint32 GetMaxTicks() const;
|
||||
|
||||
uint32 CalcCastTime(Unit* caster = NULL, Spell* spell = NULL) const;
|
||||
uint32 GetRecoveryTime() const;
|
||||
@@ -511,8 +511,8 @@ public:
|
||||
bool _IsPositiveEffect(uint8 effIndex, bool deep) const;
|
||||
bool _IsPositiveSpell() const;
|
||||
static bool _IsPositiveTarget(uint32 targetA, uint32 targetB);
|
||||
AuraStateType LoadAuraState() const;
|
||||
SpellSpecificType LoadSpellSpecific() const;
|
||||
AuraStateType LoadAuraState() const;
|
||||
SpellSpecificType LoadSpellSpecific() const;
|
||||
// unloading helpers
|
||||
void _UnloadImplicitTargetConditionLists();
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -213,8 +213,8 @@ enum ProcFlagsExLegacy
|
||||
PROC_EX_EX_TRIGGER_ALWAYS = 0x0010000, // If set trigger always no matter of hit result
|
||||
PROC_EX_EX_ONE_TIME_TRIGGER = 0x0020000, // If set trigger always but only one time (not implemented yet)
|
||||
PROC_EX_ONLY_ACTIVE_SPELL = 0x0040000, // Spell has to do damage/heal to proc
|
||||
PROC_EX_NO_OVERHEAL = 0x0080000, // Proc if heal did some work
|
||||
PROC_EX_NO_AURA_REFRESH = 0x0100000, // Proc if aura was not refreshed
|
||||
PROC_EX_NO_OVERHEAL = 0x0080000, // Proc if heal did some work
|
||||
PROC_EX_NO_AURA_REFRESH = 0x0100000, // Proc if aura was not refreshed
|
||||
|
||||
// Flags for internal use - do not use these in db!
|
||||
PROC_EX_INTERNAL_CANT_PROC = 0x0800000,
|
||||
@@ -326,41 +326,41 @@ typedef UNORDERED_MAP<uint32, SpellBonusEntry> SpellBonusMap;
|
||||
|
||||
enum SpellGroupSpecialFlags
|
||||
{
|
||||
SPELL_GROUP_SPECIAL_FLAG_NONE = 0x000,
|
||||
SPELL_GROUP_SPECIAL_FLAG_ELIXIR_BATTLE = 0x001,
|
||||
SPELL_GROUP_SPECIAL_FLAG_ELIXIR_GUARDIAN = 0x002,
|
||||
SPELL_GROUP_SPECIAL_FLAG_ELIXIR_UNSTABLE = 0x004,
|
||||
SPELL_GROUP_SPECIAL_FLAG_ELIXIR_SHATTRATH = 0x008,
|
||||
SPELL_GROUP_SPECIAL_FLAG_STACK_EXCLUSIVE_MAX= 0x00F,
|
||||
SPELL_GROUP_SPECIAL_FLAG_FORCED_STRONGEST = 0x010, // xinef: specially helpful flag if some spells have different auras, but only one should be present
|
||||
SPELL_GROUP_SPECIAL_FLAG_SKIP_STRONGER_CHECK= 0x020,
|
||||
SPELL_GROUP_SPECIAL_FLAG_BASE_AMOUNT_CHECK = 0x040,
|
||||
SPELL_GROUP_SPECIAL_FLAG_PRIORITY1 = 0x100,
|
||||
SPELL_GROUP_SPECIAL_FLAG_PRIORITY2 = 0x200,
|
||||
SPELL_GROUP_SPECIAL_FLAG_PRIORITY3 = 0x400,
|
||||
SPELL_GROUP_SPECIAL_FLAG_PRIORITY4 = 0x800,
|
||||
SPELL_GROUP_SPECIAL_FLAG_MAX = 0x1000,
|
||||
SPELL_GROUP_SPECIAL_FLAG_NONE = 0x000,
|
||||
SPELL_GROUP_SPECIAL_FLAG_ELIXIR_BATTLE = 0x001,
|
||||
SPELL_GROUP_SPECIAL_FLAG_ELIXIR_GUARDIAN = 0x002,
|
||||
SPELL_GROUP_SPECIAL_FLAG_ELIXIR_UNSTABLE = 0x004,
|
||||
SPELL_GROUP_SPECIAL_FLAG_ELIXIR_SHATTRATH = 0x008,
|
||||
SPELL_GROUP_SPECIAL_FLAG_STACK_EXCLUSIVE_MAX= 0x00F,
|
||||
SPELL_GROUP_SPECIAL_FLAG_FORCED_STRONGEST = 0x010, // xinef: specially helpful flag if some spells have different auras, but only one should be present
|
||||
SPELL_GROUP_SPECIAL_FLAG_SKIP_STRONGER_CHECK= 0x020,
|
||||
SPELL_GROUP_SPECIAL_FLAG_BASE_AMOUNT_CHECK = 0x040,
|
||||
SPELL_GROUP_SPECIAL_FLAG_PRIORITY1 = 0x100,
|
||||
SPELL_GROUP_SPECIAL_FLAG_PRIORITY2 = 0x200,
|
||||
SPELL_GROUP_SPECIAL_FLAG_PRIORITY3 = 0x400,
|
||||
SPELL_GROUP_SPECIAL_FLAG_PRIORITY4 = 0x800,
|
||||
SPELL_GROUP_SPECIAL_FLAG_MAX = 0x1000,
|
||||
};
|
||||
|
||||
enum SpellGroupStackFlags
|
||||
{
|
||||
SPELL_GROUP_STACK_FLAG_NONE = 0x00,
|
||||
SPELL_GROUP_STACK_FLAG_EXCLUSIVE = 0x01,
|
||||
SPELL_GROUP_STACK_FLAG_NOT_SAME_CASTER = 0x02,
|
||||
SPELL_GROUP_STACK_FLAG_FLAGGED = 0x04, // xinef: just a marker
|
||||
SPELL_GROUP_STACK_FLAG_NEVER_STACK = 0x08,
|
||||
SPELL_GROUP_STACK_FLAG_EFFECT_EXCLUSIVE = 0x10,
|
||||
SPELL_GROUP_STACK_FLAG_MAX = 0x20,
|
||||
SPELL_GROUP_STACK_FLAG_NONE = 0x00,
|
||||
SPELL_GROUP_STACK_FLAG_EXCLUSIVE = 0x01,
|
||||
SPELL_GROUP_STACK_FLAG_NOT_SAME_CASTER = 0x02,
|
||||
SPELL_GROUP_STACK_FLAG_FLAGGED = 0x04, // xinef: just a marker
|
||||
SPELL_GROUP_STACK_FLAG_NEVER_STACK = 0x08,
|
||||
SPELL_GROUP_STACK_FLAG_EFFECT_EXCLUSIVE = 0x10,
|
||||
SPELL_GROUP_STACK_FLAG_MAX = 0x20,
|
||||
|
||||
// Internal use
|
||||
SPELL_GROUP_STACK_FLAG_FORCED_STRONGEST = 0x100,
|
||||
SPELL_GROUP_STACK_FLAG_FORCED_WEAKEST = 0x200,
|
||||
// Internal use
|
||||
SPELL_GROUP_STACK_FLAG_FORCED_STRONGEST = 0x100,
|
||||
SPELL_GROUP_STACK_FLAG_FORCED_WEAKEST = 0x200,
|
||||
};
|
||||
|
||||
struct SpellStackInfo
|
||||
{
|
||||
uint32 groupId;
|
||||
SpellGroupSpecialFlags specialFlags;
|
||||
uint32 groupId;
|
||||
SpellGroupSpecialFlags specialFlags;
|
||||
};
|
||||
// spell_id, group_id
|
||||
typedef std::map<uint32, SpellStackInfo> SpellGroupMap;
|
||||
@@ -619,7 +619,7 @@ class SpellMgr
|
||||
// Spell correctness for client using
|
||||
static bool ComputeIsSpellValid(SpellInfo const* spellInfo, bool msg = true);
|
||||
static bool IsSpellValid(SpellInfo const* spellInfo);
|
||||
static bool CheckSpellValid(SpellInfo const* spellInfo, uint32 spellId, bool isTalent);
|
||||
static bool CheckSpellValid(SpellInfo const* spellInfo, uint32 spellId, bool isTalent);
|
||||
|
||||
// Spell difficulty
|
||||
uint32 GetSpellDifficultyId(uint32 spellId) const;
|
||||
@@ -650,10 +650,10 @@ class SpellMgr
|
||||
|
||||
// Spell Groups
|
||||
uint32 GetSpellGroup(uint32 spellid) const;
|
||||
SpellGroupSpecialFlags GetSpellGroupSpecialFlags(uint32 spell_id) const;
|
||||
SpellGroupStackFlags GetGroupStackFlags(uint32 groupid) const;
|
||||
SpellGroupSpecialFlags GetSpellGroupSpecialFlags(uint32 spell_id) const;
|
||||
SpellGroupStackFlags GetGroupStackFlags(uint32 groupid) const;
|
||||
SpellGroupStackFlags CheckSpellGroupStackRules(SpellInfo const* spellInfo1, SpellInfo const* spellInfo2, bool remove, bool areaAura) const;
|
||||
void GetSetOfSpellsInSpellGroupWithFlag(uint32 group_id, SpellGroupSpecialFlags flag, std::set<uint32>& availableElixirs) const;
|
||||
void GetSetOfSpellsInSpellGroupWithFlag(uint32 group_id, SpellGroupSpecialFlags flag, std::set<uint32>& availableElixirs) const;
|
||||
|
||||
// Spell proc event table
|
||||
SpellProcEventEntry const* GetSpellProcEvent(uint32 spellId) const;
|
||||
@@ -669,8 +669,8 @@ class SpellMgr
|
||||
// Spell threat table
|
||||
SpellThreatEntry const* GetSpellThreatEntry(uint32 spellID) const;
|
||||
|
||||
// Spell mixology table
|
||||
float GetSpellMixologyBonus(uint32 spellId) const;
|
||||
// Spell mixology table
|
||||
float GetSpellMixologyBonus(uint32 spellId) const;
|
||||
|
||||
SkillLineAbilityMapBounds GetSkillLineAbilityMapBounds(uint32 spell_id) const;
|
||||
|
||||
@@ -695,8 +695,8 @@ class SpellMgr
|
||||
SpellInfo const* GetSpellInfo(uint32 spellId) const { return spellId < GetSpellInfoStoreSize() ? mSpellInfoMap[spellId] : NULL; }
|
||||
uint32 GetSpellInfoStoreSize() const { return mSpellInfoMap.size(); }
|
||||
|
||||
// Talent Additional Set
|
||||
bool IsAdditionalTalentSpell(uint32 spellId) const;
|
||||
// Talent Additional Set
|
||||
bool IsAdditionalTalentSpell(uint32 spellId) const;
|
||||
|
||||
// Modifiers
|
||||
public:
|
||||
@@ -714,7 +714,7 @@ class SpellMgr
|
||||
void LoadSpellProcs();
|
||||
void LoadSpellBonusess();
|
||||
void LoadSpellThreats();
|
||||
void LoadSpellMixology();
|
||||
void LoadSpellMixology();
|
||||
void LoadSkillLineAbilityMap();
|
||||
void LoadSpellPetAuras();
|
||||
void LoadEnchantCustomAttr();
|
||||
@@ -728,7 +728,7 @@ class SpellMgr
|
||||
void UnloadSpellInfoImplicitTargetConditionLists();
|
||||
void LoadSpellCustomAttr();
|
||||
void LoadDbcDataCorrections();
|
||||
void LoadSpellSpecificAndAuraState();
|
||||
void LoadSpellSpecificAndAuraState();
|
||||
|
||||
private:
|
||||
SpellDifficultySearcherMap mSpellDifficultySearcherMap;
|
||||
@@ -743,7 +743,7 @@ class SpellMgr
|
||||
SpellProcMap mSpellProcMap;
|
||||
SpellBonusMap mSpellBonusMap;
|
||||
SpellThreatMap mSpellThreatMap;
|
||||
SpellMixologyMap mSpellMixologyMap;
|
||||
SpellMixologyMap mSpellMixologyMap;
|
||||
SpellPetAuraMap mSpellPetAuraMap;
|
||||
SpellLinkedMap mSpellLinkedMap;
|
||||
SpellEnchantProcEventMap mSpellEnchantProcEventMap;
|
||||
@@ -757,7 +757,7 @@ class SpellMgr
|
||||
PetLevelupSpellMap mPetLevelupSpellMap;
|
||||
PetDefaultSpellsMap mPetDefaultSpellsMap; // only spells not listed in related mPetLevelupSpellMap entry
|
||||
SpellInfoMap mSpellInfoMap;
|
||||
TalentAdditionalSet mTalentSpellAdditionalSet;
|
||||
TalentAdditionalSet mTalentSpellAdditionalSet;
|
||||
};
|
||||
|
||||
#define sSpellMgr ACE_Singleton<SpellMgr, ACE_Null_Mutex>::instance()
|
||||
|
||||
@@ -619,7 +619,7 @@ void SpellScript::FinishCast(SpellCastResult result)
|
||||
|
||||
void SpellScript::Cancel()
|
||||
{
|
||||
m_spell->cancel();
|
||||
m_spell->cancel();
|
||||
}
|
||||
|
||||
void SpellScript::SetCustomCastResultMessage(SpellCustomErrors result)
|
||||
@@ -642,7 +642,7 @@ bool AuraScript::_Validate(SpellInfo const* entry)
|
||||
{
|
||||
for (std::list<CheckAreaTargetHandler>::iterator itr = DoCheckAreaTarget.begin(); itr != DoCheckAreaTarget.end(); ++itr)
|
||||
if (!entry->HasAreaAuraEffect() && !entry->HasEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA))
|
||||
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());
|
||||
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<AuraDispelHandler>::iterator itr = OnDispel.begin(); itr != OnDispel.end(); ++itr)
|
||||
if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect())
|
||||
|
||||
@@ -208,7 +208,7 @@ class SpellScript : public _SpellScript
|
||||
TargetHook(uint8 _effectIndex, uint16 _targetType, bool _area, bool _dest);
|
||||
bool CheckEffect(SpellInfo const* spellInfo, uint8 effIndex);
|
||||
std::string ToString();
|
||||
uint16 GetTarget() const { return targetType; }
|
||||
uint16 GetTarget() const { return targetType; }
|
||||
protected:
|
||||
uint16 targetType;
|
||||
bool area;
|
||||
@@ -427,7 +427,7 @@ class SpellScript : public _SpellScript
|
||||
// finishes spellcast prematurely with selected error message
|
||||
void FinishCast(SpellCastResult result);
|
||||
|
||||
void Cancel(); // pussywizard
|
||||
void Cancel(); // pussywizard
|
||||
|
||||
void SetCustomCastResultMessage(SpellCustomErrors result);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user