Merge branch '4.3.4' of https://gitlab.com/trinitycore/TrinityCore_434 into 4.3.4
# Conflicts: # src/server/game/AI/CoreAI/PetAI.cpp # src/server/game/Battlegrounds/Battleground.cpp # src/server/game/Battlegrounds/Zones/BattlegroundTP.cpp # src/server/game/DungeonFinding/LFGMgr.h # src/server/game/DungeonFinding/LFGQueue.h # src/server/game/Entities/Creature/Creature.h # src/server/game/Entities/Pet/Pet.cpp # src/server/game/Entities/Player/Player.cpp # src/server/game/Entities/Player/Player.h # src/server/game/Entities/Unit/Unit.h # src/server/game/Globals/ObjectMgr.h # src/server/game/Groups/Group.cpp # src/server/game/Groups/Group.h # src/server/game/Guilds/Guild.cpp # src/server/game/Guilds/Guild.h # src/server/game/Handlers/GuildHandler.cpp # src/server/game/Handlers/LFGHandler.cpp # src/server/game/Handlers/MiscHandler.cpp # src/server/game/Handlers/NPCHandler.cpp # src/server/game/Instances/InstanceScript.cpp # src/server/game/Maps/Map.cpp # src/server/game/Maps/Map.h # src/server/game/Maps/ZoneScript.cpp # src/server/game/Server/WorldSession.cpp # src/server/game/Spells/SpellEffects.cpp # src/server/game/Weather/Weather.cpp # src/server/game/Weather/WeatherMgr.cpp # src/server/scripts/Commands/cs_reload.cpp # src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp # src/server/scripts/EasternKingdoms/Deadmines/deadmines.h # src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp # src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp # src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h # src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp # src/server/scripts/Kalimdor/VortexPinnacle/vortex_pinnacle.h # src/server/scripts/Spells/spell_dk.cpp # src/server/scripts/Spells/spell_druid.cpp # src/server/scripts/Spells/spell_generic.cpp # src/server/scripts/Spells/spell_hunter.cpp # src/server/scripts/Spells/spell_mage.cpp # src/server/scripts/Spells/spell_pet.cpp # src/server/scripts/Spells/spell_shaman.cpp # src/server/scripts/Spells/spell_warrior.cpp
This commit is contained in:
commit
2cfdd3cbe0
1450 files changed
+72503
-36529
No files matched your search
@@ -23,21 +23,23 @@
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "GameTime.h"
|
||||
#include "Battleground.h"
|
||||
#include "Cell.h"
|
||||
#include "CellImpl.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "DBCStores.h"
|
||||
#include "GameTime.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Group.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Item.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "Log.h"
|
||||
#include "Pet.h"
|
||||
#include "ReputationMgr.h"
|
||||
#include "SkillDiscovery.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Vehicle.h"
|
||||
|
||||
class spell_gen_absorb0_hitlimit1 : public SpellScriptLoader
|
||||
@@ -103,13 +105,14 @@ class spell_gen_adaptive_warding : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_GEN_ADAPTIVE_WARDING_FIRE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_ADAPTIVE_WARDING_NATURE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_ADAPTIVE_WARDING_FROST) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_ADAPTIVE_WARDING_SHADOW) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_ADAPTIVE_WARDING_ARCANE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_GEN_ADAPTIVE_WARDING_FIRE,
|
||||
SPELL_GEN_ADAPTIVE_WARDING_NATURE,
|
||||
SPELL_GEN_ADAPTIVE_WARDING_FROST,
|
||||
SPELL_GEN_ADAPTIVE_WARDING_SHADOW,
|
||||
SPELL_GEN_ADAPTIVE_WARDING_ARCANE
|
||||
});
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -176,8 +179,8 @@ class spell_gen_adaptive_warding : public SpellScriptLoader
|
||||
|
||||
enum AlchemistStone
|
||||
{
|
||||
ALECHEMIST_STONE_HEAL = 21399,
|
||||
ALECHEMIST_STONE_MANA = 21400,
|
||||
ALCHEMIST_STONE_HEAL = 21399,
|
||||
ALCHEMIST_STONE_MANA = 21400,
|
||||
};
|
||||
|
||||
// 17619 - Alchemist Stone
|
||||
@@ -192,10 +195,7 @@ class spell_gen_alchemist_stone : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(ALECHEMIST_STONE_HEAL) ||
|
||||
!sSpellMgr->GetSpellInfo(ALECHEMIST_STONE_MANA))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ ALCHEMIST_STONE_HEAL, ALCHEMIST_STONE_MANA });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -211,14 +211,14 @@ class spell_gen_alchemist_stone : public SpellScriptLoader
|
||||
int32 bp = int32(eventInfo.GetDamageInfo()->GetDamage() * 0.4f);
|
||||
|
||||
if (eventInfo.GetDamageInfo()->GetSpellInfo()->HasEffect(SPELL_EFFECT_HEAL))
|
||||
spellId = ALECHEMIST_STONE_HEAL;
|
||||
spellId = ALCHEMIST_STONE_HEAL;
|
||||
else if (eventInfo.GetDamageInfo()->GetSpellInfo()->HasEffect(SPELL_EFFECT_ENERGIZE))
|
||||
spellId = ALECHEMIST_STONE_MANA;
|
||||
spellId = ALCHEMIST_STONE_MANA;
|
||||
|
||||
if (!spellId)
|
||||
return;
|
||||
|
||||
GetTarget()->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, bp, GetTarget(), true, NULL, aurEff);
|
||||
GetTarget()->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, bp, GetTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
|
||||
@@ -280,9 +280,7 @@ class spell_gen_animal_blood : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SPAWN_BLOOD_POOL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SPAWN_BLOOD_POOL });
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -362,9 +360,7 @@ class spell_gen_aura_service_uniform : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SERVICE_UNIFORM))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_SERVICE_UNIFORM });
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -459,9 +455,7 @@ class spell_gen_bandage : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_RECENTLY_BANDAGED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_RECENTLY_BANDAGED });
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
@@ -511,9 +505,7 @@ class spell_gen_blood_reserve : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_GEN_BLOOD_RESERVE_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_GEN_BLOOD_RESERVE_HEAL });
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -679,7 +671,7 @@ enum BreakShieldSpells
|
||||
class spell_gen_break_shield: public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_break_shield(const char* name) : SpellScriptLoader(name) { }
|
||||
spell_gen_break_shield(char const* name) : SpellScriptLoader(name) { }
|
||||
|
||||
class spell_gen_break_shield_SpellScript : public SpellScript
|
||||
{
|
||||
@@ -792,9 +784,7 @@ class spell_gen_burning_depths_necrolyte_image : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(uint32(spellInfo->Effects[EFFECT_2].CalcValue())))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ uint32(spellInfo->Effects[EFFECT_2].CalcValue()) });
|
||||
}
|
||||
|
||||
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -837,16 +827,14 @@ class spell_gen_cannibalize : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_CANNIBALIZE_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_CANNIBALIZE_TRIGGERED });
|
||||
}
|
||||
|
||||
SpellCastResult CheckIfCorpseNear()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
float max_range = GetSpellInfo()->GetMaxRange(false);
|
||||
WorldObject* result = NULL;
|
||||
WorldObject* result = nullptr;
|
||||
// search for nearby enemy corpse in range
|
||||
Trinity::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_CHECK_ENEMY);
|
||||
Trinity::WorldObjectSearcher<Trinity::AnyDeadUnitSpellTargetInRangeCheck> searcher(caster, result, check);
|
||||
@@ -892,16 +880,14 @@ class spell_gen_chaos_blast : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_CHAOS_BLAST))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_CHAOS_BLAST });
|
||||
}
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
int32 basepoints0 = 100;
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetHitUnit())
|
||||
caster->CastCustomSpell(target, SPELL_CHAOS_BLAST, &basepoints0, NULL, NULL, true);
|
||||
caster->CastCustomSpell(target, SPELL_CHAOS_BLAST, &basepoints0, nullptr, nullptr, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1028,23 +1014,17 @@ class spell_gen_clone_weapon_aura : public SpellScriptLoader
|
||||
{
|
||||
PrepareAuraScript(spell_gen_clone_weapon_auraScript);
|
||||
|
||||
public:
|
||||
spell_gen_clone_weapon_auraScript()
|
||||
{
|
||||
prevItem = 0;
|
||||
}
|
||||
|
||||
private:
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_AURA) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_2_AURA) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_3_AURA) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_AURA) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_2_AURA) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_COPY_RANGED_AURA))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_COPY_WEAPON_AURA,
|
||||
SPELL_COPY_WEAPON_2_AURA,
|
||||
SPELL_COPY_WEAPON_3_AURA,
|
||||
SPELL_COPY_OFFHAND_AURA,
|
||||
SPELL_COPY_OFFHAND_2_AURA,
|
||||
SPELL_COPY_RANGED_AURA
|
||||
});
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -1132,8 +1112,7 @@ class spell_gen_clone_weapon_aura : public SpellScriptLoader
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_gen_clone_weapon_auraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 prevItem;
|
||||
uint32 prevItem = 0;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
@@ -1198,10 +1177,11 @@ class spell_gen_create_lance : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_LANCE_ALLIANCE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_CREATE_LANCE_HORDE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_CREATE_LANCE_ALLIANCE,
|
||||
SPELL_CREATE_LANCE_HORDE
|
||||
});
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
@@ -1282,28 +1262,33 @@ enum DalaranDisguiseSpells
|
||||
class spell_gen_dalaran_disguise : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_dalaran_disguise(const char* name) : SpellScriptLoader(name) { }
|
||||
spell_gen_dalaran_disguise(char const* name) : SpellScriptLoader(name) { }
|
||||
|
||||
class spell_gen_dalaran_disguise_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_dalaran_disguise_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
switch (spellInfo->Id)
|
||||
{
|
||||
case SPELL_SUNREAVER_DISGUISE_TRIGGER:
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_FEMALE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_MALE))
|
||||
return false;
|
||||
break;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_SUNREAVER_DISGUISE_FEMALE,
|
||||
SPELL_SUNREAVER_DISGUISE_MALE
|
||||
});
|
||||
case SPELL_SILVER_COVENANT_DISGUISE_TRIGGER:
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_FEMALE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_MALE))
|
||||
return false;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_SILVER_COVENANT_DISGUISE_FEMALE,
|
||||
SPELL_SILVER_COVENANT_DISGUISE_MALE
|
||||
});
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
@@ -1472,13 +1457,12 @@ class spell_gen_defend : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_1))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_2))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_3))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_VISUAL_SHIELD_1,
|
||||
SPELL_VISUAL_SHIELD_2,
|
||||
SPELL_VISUAL_SHIELD_3
|
||||
});
|
||||
}
|
||||
|
||||
void RefreshVisualShields(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
@@ -1490,7 +1474,7 @@ class spell_gen_defend : public SpellScriptLoader
|
||||
for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i)
|
||||
target->RemoveAurasDueToSpell(SPELL_VISUAL_SHIELD_1 + i);
|
||||
|
||||
target->CastSpell(target, SPELL_VISUAL_SHIELD_1 + GetAura()->GetStackAmount() - 1, true, NULL, aurEff);
|
||||
target->CastSpell(target, SPELL_VISUAL_SHIELD_1 + GetAura()->GetStackAmount() - 1, true, nullptr, aurEff);
|
||||
}
|
||||
else
|
||||
GetTarget()->RemoveAurasDueToSpell(GetId());
|
||||
@@ -1594,9 +1578,7 @@ class spell_gen_divine_storm_cd_reset : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DIVINE_STORM))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_DIVINE_STORM });
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
@@ -1664,13 +1646,6 @@ class spell_gen_dungeon_credit : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_gen_dungeon_credit_SpellScript);
|
||||
|
||||
public:
|
||||
spell_gen_dungeon_credit_SpellScript()
|
||||
{
|
||||
_handled = false;
|
||||
}
|
||||
|
||||
private:
|
||||
bool Load() override
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
||||
@@ -1685,7 +1660,7 @@ class spell_gen_dungeon_credit : public SpellScriptLoader
|
||||
_handled = true;
|
||||
Unit* caster = GetCaster();
|
||||
if (InstanceScript* instance = caster->GetInstanceScript())
|
||||
instance->UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, GetSpellInfo()->Id, caster);
|
||||
instance->UpdateEncounterStateForSpellCast(GetSpellInfo()->Id, caster);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1693,8 +1668,7 @@ class spell_gen_dungeon_credit : public SpellScriptLoader
|
||||
AfterHit += SpellHitFn(spell_gen_dungeon_credit_SpellScript::CreditEncounter);
|
||||
}
|
||||
|
||||
private:
|
||||
bool _handled;
|
||||
bool _handled = false;
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
@@ -1727,13 +1701,14 @@ class spell_gen_elune_candle : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HEAD) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_CHEST) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HAND_R) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HAND_L) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_NORMAL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_ELUNE_CANDLE_OMEN_HEAD,
|
||||
SPELL_ELUNE_CANDLE_OMEN_CHEST,
|
||||
SPELL_ELUNE_CANDLE_OMEN_HAND_R,
|
||||
SPELL_ELUNE_CANDLE_OMEN_HAND_L,
|
||||
SPELL_ELUNE_CANDLE_NORMAL
|
||||
});
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
@@ -1761,7 +1736,7 @@ class spell_gen_elune_candle : public SpellScriptLoader
|
||||
else
|
||||
spellId = SPELL_ELUNE_CANDLE_NORMAL;
|
||||
|
||||
GetCaster()->CastSpell(GetHitUnit(), spellId, true, NULL);
|
||||
GetCaster()->CastSpell(GetHitUnit(), spellId, true, nullptr);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -1794,11 +1769,12 @@ class spell_gen_gadgetzan_transporter_backfire : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_MALFUNCTION_POLYMORPH) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_EVIL_TWIN) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_MALFUNCTION_MISS))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_TRANSPORTER_MALFUNCTION_POLYMORPH,
|
||||
SPELL_TRANSPORTER_EVIL_TWIN,
|
||||
SPELL_TRANSPORTER_MALFUNCTION_MISS
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
@@ -1895,10 +1871,11 @@ class spell_gen_gnomish_transporter : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_SUCCESS) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_TRANSPORTER_FAILURE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_TRANSPORTER_SUCCESS,
|
||||
SPELL_TRANSPORTER_FAILURE
|
||||
});
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
@@ -1937,15 +1914,13 @@ class spell_gen_interrupt : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_GEN_THROW_INTERRUPT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_GEN_THROW_INTERRUPT });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_GEN_THROW_INTERRUPT, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_GEN_THROW_INTERRUPT, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -2001,7 +1976,7 @@ enum GenericLifebloom
|
||||
class spell_gen_lifebloom : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_lifebloom(const char* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
|
||||
spell_gen_lifebloom(char const* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
|
||||
|
||||
class spell_gen_lifebloom_AuraScript : public AuraScript
|
||||
{
|
||||
@@ -2012,9 +1987,7 @@ class spell_gen_lifebloom : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(_spellId))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ _spellId });
|
||||
}
|
||||
|
||||
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
@@ -2024,7 +1997,7 @@ class spell_gen_lifebloom : public SpellScriptLoader
|
||||
return;
|
||||
|
||||
// final heal
|
||||
GetTarget()->CastSpell(GetTarget(), _spellId, true, NULL, aurEff, GetCasterGUID());
|
||||
GetTarget()->CastSpell(GetTarget(), _spellId, true, nullptr, aurEff, GetCasterGUID());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -2224,9 +2197,7 @@ class spell_gen_moss_covered_feet : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_FALL_DOWN))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_FALL_DOWN });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -2247,7 +2218,7 @@ class spell_gen_moss_covered_feet : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
enum Netherbloom
|
||||
enum Netherbloom : uint32
|
||||
{
|
||||
SPELL_NETHERBLOOM_POLLEN_1 = 28703
|
||||
};
|
||||
@@ -2265,8 +2236,9 @@ class spell_gen_netherbloom : public SpellScriptLoader
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_NETHERBLOOM_POLLEN_1 + i))
|
||||
if (!ValidateSpellInfo({ SPELL_NETHERBLOOM_POLLEN_1 + i }))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2322,9 +2294,7 @@ class spell_gen_nightmare_vine : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_NIGHTMARE_POLLEN))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_NIGHTMARE_POLLEN });
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
@@ -2373,14 +2343,15 @@ class spell_gen_obsidian_armor : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_HOLY) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_FIRE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_NATURE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_FROST) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_SHADOW) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_ARCANE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_GEN_OBSIDIAN_ARMOR_HOLY,
|
||||
SPELL_GEN_OBSIDIAN_ARMOR_FIRE,
|
||||
SPELL_GEN_OBSIDIAN_ARMOR_NATURE,
|
||||
SPELL_GEN_OBSIDIAN_ARMOR_FROST,
|
||||
SPELL_GEN_OBSIDIAN_ARMOR_SHADOW,
|
||||
SPELL_GEN_OBSIDIAN_ARMOR_ARCANE
|
||||
});
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
@@ -2423,7 +2394,7 @@ class spell_gen_obsidian_armor : public SpellScriptLoader
|
||||
default:
|
||||
return;
|
||||
}
|
||||
GetTarget()->CastSpell(GetTarget(), spellId, true, NULL, aurEff);
|
||||
GetTarget()->CastSpell(GetTarget(), spellId, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -2501,11 +2472,12 @@ class spell_gen_orc_disguise : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_TRIGGER) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_MALE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_FEMALE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_ORC_DISGUISE_TRIGGER,
|
||||
SPELL_ORC_DISGUISE_MALE,
|
||||
SPELL_ORC_DISGUISE_FEMALE
|
||||
});
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
@@ -2550,9 +2522,7 @@ class spell_gen_paralytic_poison : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PARALYSIS))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PARALYSIS });
|
||||
}
|
||||
|
||||
void HandleStun(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
@@ -2578,7 +2548,7 @@ class spell_gen_paralytic_poison : public SpellScriptLoader
|
||||
class spell_gen_proc_below_pct_damaged : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_proc_below_pct_damaged(const char* name) : SpellScriptLoader(name) { }
|
||||
spell_gen_proc_below_pct_damaged(char const* name) : SpellScriptLoader(name) { }
|
||||
|
||||
class spell_gen_proc_below_pct_damaged_AuraScript : public AuraScript
|
||||
{
|
||||
@@ -2654,10 +2624,11 @@ class spell_gen_parachute : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE_BUFF))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_PARACHUTE,
|
||||
SPELL_PARACHUTE_BUFF
|
||||
});
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
@@ -2974,9 +2945,7 @@ class spell_gen_running_wild : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ALTERED_FORM))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_ALTERED_FORM });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -3094,9 +3063,7 @@ class spell_gen_seaforium_blast : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -3107,7 +3074,7 @@ class spell_gen_seaforium_blast : public SpellScriptLoader
|
||||
|
||||
void AchievementCredit(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
// but in effect handling OriginalCaster can become NULL
|
||||
// but in effect handling OriginalCaster can become nullptr
|
||||
if (Unit* originalCaster = GetOriginalCaster())
|
||||
if (GameObject* go = GetHitGObj())
|
||||
if (go->GetGOInfo()->type == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING)
|
||||
@@ -3182,7 +3149,7 @@ class spell_gen_spirit_healer_res : public SpellScriptLoader
|
||||
{
|
||||
WorldPacket data(SMSG_SPIRIT_HEALER_CONFIRM, 8);
|
||||
data << uint64(target->GetGUID());
|
||||
originalCaster->GetSession()->SendPacket(&data);
|
||||
originalCaster->SendDirectMessage(&data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3207,7 +3174,7 @@ enum SummonElemental
|
||||
class spell_gen_summon_elemental : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_summon_elemental(const char* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
|
||||
spell_gen_summon_elemental(char const* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
|
||||
|
||||
class spell_gen_summon_elemental_AuraScript : public AuraScript
|
||||
{
|
||||
@@ -3218,9 +3185,7 @@ class spell_gen_summon_elemental : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(_spellId))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ _spellId });
|
||||
}
|
||||
|
||||
void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -3273,9 +3238,7 @@ class spell_gen_summon_tournament_mount : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_LANCE_EQUIPPED))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_LANCE_EQUIPPED });
|
||||
}
|
||||
|
||||
SpellCastResult CheckIfLanceEquiped()
|
||||
@@ -3349,10 +3312,11 @@ class spell_gen_tournament_duel : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_ON_TOURNAMENT_MOUNT) ||
|
||||
!sSpellMgr->GetSpellInfo(SPELL_MOUNTED_DUEL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_ON_TOURNAMENT_MOUNT,
|
||||
SPELL_MOUNTED_DUEL
|
||||
});
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
@@ -3439,7 +3403,7 @@ class spell_gen_turkey_marker : public SpellScriptLoader
|
||||
|
||||
// on stack 15 cast the achievement crediting spell
|
||||
if (GetStackAmount() >= 15)
|
||||
target->CastSpell(target, SPELL_TURKEY_VENGEANCE, true, NULL, aurEff, GetCasterGUID());
|
||||
target->CastSpell(target, SPELL_TURKEY_VENGEANCE, true, nullptr, aurEff, GetCasterGUID());
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
@@ -3531,9 +3495,7 @@ class spell_gen_vampiric_touch : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_VAMPIRIC_TOUCH_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_VAMPIRIC_TOUCH_HEAL });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
@@ -3698,15 +3660,13 @@ class spell_gen_whisper_gulch_yogg_saron_whisper : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_YOGG_SARON_WHISPER_DUMMY))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_YOGG_SARON_WHISPER_DUMMY });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell((Unit*)NULL, SPELL_YOGG_SARON_WHISPER_DUMMY, true);
|
||||
GetTarget()->CastSpell((Unit*)nullptr, SPELL_YOGG_SARON_WHISPER_DUMMY, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -3801,9 +3761,7 @@ class spell_gen_gm_freeze : public SpellScriptLoader
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_GM_FREEZE))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_GM_FREEZE });
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
@@ -3986,18 +3944,9 @@ public:
|
||||
{
|
||||
PrepareAuraScript(spell_gen_mixology_bonus_AuraScript);
|
||||
|
||||
public:
|
||||
spell_gen_mixology_bonus_AuraScript()
|
||||
{
|
||||
bonus = 0;
|
||||
}
|
||||
|
||||
private:
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MIXOLOGY))
|
||||
return false;
|
||||
return true;
|
||||
return ValidateSpellInfo({ SPELL_MIXOLOGY });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
@@ -4183,7 +4132,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
int32 bonus;
|
||||
int32 bonus = 0;
|
||||
|
||||
void Register() override
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user