Core/Spells: ported CastSpell unclusterfucking from 3.3.5 branch

This commit is contained in:
Ovahlord committed 2020-11-04 22:37:11 +01:00
1 parent 7e637971ee
commit 754c138f89
157 files changed
+1195 -1223

No files matched your search

+9 -9
View File
@@ -152,7 +152,7 @@ class spell_q5206_test_fetid_skull : public SpellScriptLoader
{
Unit* caster = GetCaster();
uint32 spellId = roll_chance_i(50) ? SPELL_CREATE_RESONATING_SKULL : SPELL_CREATE_BONE_DUST;
caster->CastSpell(caster, spellId, true, nullptr);
caster->CastSpell(caster, spellId, true);
}
void Register() override
@@ -310,7 +310,7 @@ class spell_q11396_11399_scourging_crystal_controller : public SpellScriptLoader
if (target->GetTypeId() == TYPEID_UNIT && target->HasAura(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3))
// Make sure nobody else is channeling the same target
if (!target->HasAura(SPELL_SCOURGING_CRYSTAL_CONTROLLER))
GetCaster()->CastSpell(target, SPELL_SCOURGING_CRYSTAL_CONTROLLER, true, GetCastItem());
GetCaster()->CastSpell(target, SPELL_SCOURGING_CRYSTAL_CONTROLLER, GetCastItem());
}
void Register() override
@@ -481,7 +481,7 @@ class spell_q11730_ultrasonic_screwdriver : public SpellScriptLoader
default:
return;
}
caster->CastSpell(caster, spellId, true, castItem);
caster->CastSpell(caster, spellId, castItem);
caster->CastSpell(caster, SPELL_ROBOT_KILL_CREDIT, true);
target->DespawnOrUnsummon();
}
@@ -587,7 +587,7 @@ class spell_q12634_despawn_fruit_tosser : public SpellScriptLoader
// sometimes, if you're lucky, you get a dwarf
if (roll_chance_i(5))
spellId = SPELL_SUMMON_ADVENTUROUS_DWARF;
GetCaster()->CastSpell(GetCaster(), spellId, true, nullptr);
GetCaster()->CastSpell(GetCaster(), spellId, true);
}
void Register() override
@@ -619,7 +619,7 @@ class spell_q12683_take_sputum_sample : public SpellScriptLoader
if (caster->HasAuraEffect(reqAuraId, 0))
{
uint32 spellId = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
caster->CastSpell(caster, spellId, true, nullptr);
caster->CastSpell(caster, spellId, true);
}
}
@@ -725,7 +725,7 @@ class spell_q12937_relief_for_the_fallen : public SpellScriptLoader
Player* caster = GetCaster()->ToPlayer();
if (Creature* target = GetHitCreature())
{
caster->CastSpell(caster, SPELL_TRIGGER_AID_OF_THE_EARTHEN, true, nullptr);
caster->CastSpell(caster, SPELL_TRIGGER_AID_OF_THE_EARTHEN, true);
caster->KilledMonsterCredit(NPC_FALLEN_EARTHEN_DEFENDER);
target->DespawnOrUnsummon();
}
@@ -1856,7 +1856,7 @@ class spell_q13086_cannons_target : public SpellScriptLoader
void HandleEffectDummy(SpellEffIndex /*effIndex*/)
{
if (WorldLocation const* pos = GetExplTargetDest())
GetCaster()->CastSpell(pos->GetPositionX(), pos->GetPositionY(), pos->GetPositionZ(), GetEffectValue(), true);
GetCaster()->CastSpell({ pos->GetPositionX(), pos->GetPositionY(), pos->GetPositionZ() }, GetEffectValue(), true);
}
void Register() override
@@ -2221,7 +2221,7 @@ class spell_q12619_emblazon_runeblade : public SpellScriptLoader
{
PreventDefaultAction();
if (Unit* caster = GetCaster())
caster->CastSpell(caster, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true, nullptr, aurEff);
caster->CastSpell(caster, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, aurEff);
}
void Register() override
@@ -2284,7 +2284,7 @@ class spell_q12919_gymers_grab : public SpellScriptLoader
int8 seatId = 2;
if (!GetHitCreature())
return;
GetHitCreature()->CastCustomSpell(SPELL_RIDE_GYMER, SPELLVALUE_BASE_POINT0, seatId, GetCaster(), true);
GetHitCreature()->CastSpell(GetCaster(), SPELL_RIDE_GYMER, CastSpellExtraArgs(true).AddSpellBP0(seatId));
GetHitCreature()->CastSpell(GetHitCreature(), SPELL_GRABBED, true);
}