mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-27 15:46:24 +00:00
@@ -2449,15 +2449,15 @@ void SpellMgr::LoadPetDefaultSpells()
|
||||
// different summon spells
|
||||
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
|
||||
{
|
||||
SpellInfo const* spellEntry = GetSpellInfo(i);
|
||||
if (!spellEntry)
|
||||
SpellInfo const* spellInfo = GetSpellInfo(i);
|
||||
if (!spellInfo)
|
||||
continue;
|
||||
|
||||
for (uint8 k = 0; k < MAX_SPELL_EFFECTS; ++k)
|
||||
{
|
||||
if (spellEntry->Effects[k].Effect == SPELL_EFFECT_SUMMON || spellEntry->Effects[k].Effect == SPELL_EFFECT_SUMMON_PET)
|
||||
if (spellInfo->Effects[k].Effect == SPELL_EFFECT_SUMMON || spellInfo->Effects[k].Effect == SPELL_EFFECT_SUMMON_PET)
|
||||
{
|
||||
uint32 creature_id = spellEntry->Effects[k].MiscValue;
|
||||
uint32 creature_id = spellInfo->Effects[k].MiscValue;
|
||||
CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creature_id);
|
||||
if (!cInfo)
|
||||
continue;
|
||||
|
||||
@@ -75,7 +75,7 @@ _SpellScript::EffectHook::EffectHook(uint8 _effIndex)
|
||||
effIndex = _effIndex;
|
||||
}
|
||||
|
||||
uint8 _SpellScript::EffectHook::GetAffectedEffectsMask(SpellInfo const* spellEntry)
|
||||
uint8 _SpellScript::EffectHook::GetAffectedEffectsMask(SpellInfo const* spellInfo)
|
||||
{
|
||||
uint8 mask = 0;
|
||||
if ((effIndex == EFFECT_ALL) || (effIndex == EFFECT_FIRST_FOUND))
|
||||
@@ -84,21 +84,21 @@ uint8 _SpellScript::EffectHook::GetAffectedEffectsMask(SpellInfo const* spellEnt
|
||||
{
|
||||
if ((effIndex == EFFECT_FIRST_FOUND) && mask)
|
||||
return mask;
|
||||
if (CheckEffect(spellEntry, i))
|
||||
if (CheckEffect(spellInfo, i))
|
||||
mask |= (uint8)1 << i;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CheckEffect(spellEntry, effIndex))
|
||||
if (CheckEffect(spellInfo, effIndex))
|
||||
mask |= (uint8)1 << effIndex;
|
||||
}
|
||||
return mask;
|
||||
}
|
||||
|
||||
bool _SpellScript::EffectHook::IsEffectAffected(SpellInfo const* spellEntry, uint8 effIndex)
|
||||
bool _SpellScript::EffectHook::IsEffectAffected(SpellInfo const* spellInfo, uint8 effIndex)
|
||||
{
|
||||
return GetAffectedEffectsMask(spellEntry) & 1 << effIndex;
|
||||
return GetAffectedEffectsMask(spellInfo) & 1 << effIndex;
|
||||
}
|
||||
|
||||
std::string _SpellScript::EffectHook::EffIndexToString()
|
||||
@@ -119,13 +119,13 @@ std::string _SpellScript::EffectHook::EffIndexToString()
|
||||
return "Invalid Value";
|
||||
}
|
||||
|
||||
bool _SpellScript::EffectNameCheck::Check(SpellInfo const* spellEntry, uint8 effIndex)
|
||||
bool _SpellScript::EffectNameCheck::Check(SpellInfo const* spellInfo, uint8 effIndex)
|
||||
{
|
||||
if (!spellEntry->Effects[effIndex].Effect && !effName)
|
||||
if (!spellInfo->Effects[effIndex].Effect && !effName)
|
||||
return true;
|
||||
if (!spellEntry->Effects[effIndex].Effect)
|
||||
if (!spellInfo->Effects[effIndex].Effect)
|
||||
return false;
|
||||
return (effName == SPELL_EFFECT_ANY) || (spellEntry->Effects[effIndex].Effect == effName);
|
||||
return (effName == SPELL_EFFECT_ANY) || (spellInfo->Effects[effIndex].Effect == effName);
|
||||
}
|
||||
|
||||
std::string _SpellScript::EffectNameCheck::ToString()
|
||||
@@ -141,13 +141,13 @@ std::string _SpellScript::EffectNameCheck::ToString()
|
||||
}
|
||||
}
|
||||
|
||||
bool _SpellScript::EffectAuraNameCheck::Check(SpellInfo const* spellEntry, uint8 effIndex)
|
||||
bool _SpellScript::EffectAuraNameCheck::Check(SpellInfo const* spellInfo, uint8 effIndex)
|
||||
{
|
||||
if (!spellEntry->Effects[effIndex].ApplyAuraName && !effAurName)
|
||||
if (!spellInfo->Effects[effIndex].ApplyAuraName && !effAurName)
|
||||
return true;
|
||||
if (!spellEntry->Effects[effIndex].ApplyAuraName)
|
||||
if (!spellInfo->Effects[effIndex].ApplyAuraName)
|
||||
return false;
|
||||
return (effAurName == SPELL_AURA_ANY) || (spellEntry->Effects[effIndex].ApplyAuraName == effAurName);
|
||||
return (effAurName == SPELL_AURA_ANY) || (spellInfo->Effects[effIndex].ApplyAuraName == effAurName);
|
||||
}
|
||||
|
||||
std::string _SpellScript::EffectAuraNameCheck::ToString()
|
||||
@@ -194,9 +194,9 @@ std::string SpellScript::EffectHandler::ToString()
|
||||
return "Index: " + EffIndexToString() + " Name: " + _SpellScript::EffectNameCheck::ToString();
|
||||
}
|
||||
|
||||
bool SpellScript::EffectHandler::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex)
|
||||
bool SpellScript::EffectHandler::CheckEffect(SpellInfo const* spellInfo, uint8 effIndex)
|
||||
{
|
||||
return _SpellScript::EffectNameCheck::Check(spellEntry, effIndex);
|
||||
return _SpellScript::EffectNameCheck::Check(spellInfo, effIndex);
|
||||
}
|
||||
|
||||
void SpellScript::EffectHandler::Call(SpellScript* spellScript, SpellEffIndex effIndex)
|
||||
@@ -234,13 +234,13 @@ std::string SpellScript::TargetHook::ToString()
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
bool SpellScript::TargetHook::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex)
|
||||
bool SpellScript::TargetHook::CheckEffect(SpellInfo const* spellInfo, uint8 effIndex)
|
||||
{
|
||||
if (!targetType)
|
||||
return false;
|
||||
|
||||
if (spellEntry->Effects[effIndex].TargetA.GetTarget() != targetType &&
|
||||
spellEntry->Effects[effIndex].TargetB.GetTarget() != targetType)
|
||||
if (spellInfo->Effects[effIndex].TargetA.GetTarget() != targetType &&
|
||||
spellInfo->Effects[effIndex].TargetB.GetTarget() != targetType)
|
||||
return false;
|
||||
|
||||
SpellImplicitTargetInfo targetInfo(targetType);
|
||||
@@ -785,9 +785,9 @@ AuraScript::EffectBase::EffectBase(uint8 _effIndex, uint16 _effName)
|
||||
{
|
||||
}
|
||||
|
||||
bool AuraScript::EffectBase::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex)
|
||||
bool AuraScript::EffectBase::CheckEffect(SpellInfo const* spellInfo, uint8 effIndex)
|
||||
{
|
||||
return _SpellScript::EffectAuraNameCheck::Check(spellEntry, effIndex);
|
||||
return _SpellScript::EffectAuraNameCheck::Check(spellInfo, effIndex);
|
||||
}
|
||||
|
||||
std::string AuraScript::EffectBase::ToString()
|
||||
|
||||
@@ -74,9 +74,9 @@ protected:
|
||||
EffectHook(uint8 _effIndex);
|
||||
virtual ~EffectHook() { }
|
||||
|
||||
uint8 GetAffectedEffectsMask(SpellInfo const* spellEntry);
|
||||
bool IsEffectAffected(SpellInfo const* spellEntry, uint8 effIndex);
|
||||
virtual bool CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) = 0;
|
||||
uint8 GetAffectedEffectsMask(SpellInfo const* spellInfo);
|
||||
bool IsEffectAffected(SpellInfo const* spellInfo, uint8 effIndex);
|
||||
virtual bool CheckEffect(SpellInfo const* spellInfo, uint8 effIndex) = 0;
|
||||
std::string EffIndexToString();
|
||||
protected:
|
||||
uint8 effIndex;
|
||||
@@ -86,7 +86,7 @@ protected:
|
||||
{
|
||||
public:
|
||||
EffectNameCheck(uint16 _effName) { effName = _effName; }
|
||||
bool Check(SpellInfo const* spellEntry, uint8 effIndex);
|
||||
bool Check(SpellInfo const* spellInfo, uint8 effIndex);
|
||||
std::string ToString();
|
||||
private:
|
||||
uint16 effName;
|
||||
@@ -96,7 +96,7 @@ protected:
|
||||
{
|
||||
public:
|
||||
EffectAuraNameCheck(uint16 _effAurName) { effAurName = _effAurName; }
|
||||
bool Check(SpellInfo const* spellEntry, uint8 effIndex);
|
||||
bool Check(SpellInfo const* spellInfo, uint8 effIndex);
|
||||
std::string ToString();
|
||||
private:
|
||||
uint16 effAurName;
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
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(SpellInfo const* /*spellEntry*/) { return true; }
|
||||
virtual bool Validate(SpellInfo const* /*spellInfo*/) { 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; }
|
||||
@@ -218,7 +218,7 @@ public:
|
||||
public:
|
||||
EffectHandler(SpellEffectFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName);
|
||||
std::string ToString();
|
||||
bool CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) override;
|
||||
bool CheckEffect(SpellInfo const* spellInfo, uint8 effIndex) override;
|
||||
void Call(SpellScript* spellScript, SpellEffIndex effIndex);
|
||||
private:
|
||||
SpellEffectFnType pEffectHandlerScript;
|
||||
@@ -557,7 +557,7 @@ public:
|
||||
public:
|
||||
EffectBase(uint8 _effIndex, uint16 _effName);
|
||||
std::string ToString();
|
||||
bool CheckEffect(SpellInfo const* spellEntry, uint8 effIndex) override;
|
||||
bool CheckEffect(SpellInfo const* spellInfo, uint8 effIndex) override;
|
||||
};
|
||||
class EffectPeriodicHandler : public EffectBase
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user