Core/Spells: rework part 5: GameObject casting

Closes #21330
Closes #18885
Ref #18752

(cherry picked from commit 45c5e1b9d6)
This commit is contained in:
ariel-
2018-02-10 16:43:01 -03:00
committed by Shauren
parent 65dca120d3
commit 962f6d7988
46 changed files with 2775 additions and 2419 deletions

View File

@@ -1865,12 +1865,12 @@ class spell_icc_sprit_alarm : public SpellScriptLoader
return;
}
if (GameObject* trap = GetCaster()->FindNearestGameObject(trapId, 5.0f))
if (GameObject* trap = GetGObjCaster()->FindNearestGameObject(trapId, 5.0f))
trap->SetRespawnTime(trap->GetGOInfo()->GetAutoCloseTime() / IN_MILLISECONDS);
std::list<Creature*> wards;
GetCaster()->GetCreatureListWithEntryInGrid(wards, NPC_DEATHBOUND_WARD, 150.0f);
wards.sort(Trinity::ObjectDistanceOrderPred(GetCaster()));
GetGObjCaster()->GetCreatureListWithEntryInGrid(wards, NPC_DEATHBOUND_WARD, 150.0f);
wards.sort(Trinity::ObjectDistanceOrderPred(GetGObjCaster()));
for (std::list<Creature*>::iterator itr = wards.begin(); itr != wards.end(); ++itr)
{
if ((*itr)->IsAlive() && (*itr)->HasAura(SPELL_STONEFORM))

View File

@@ -1310,7 +1310,7 @@ class go_ulduar_tower : public GameObjectScript
InstanceScript* instance;
void Destroyed(Player* /*player*/, uint32 /*eventId*/) override
void Destroyed(WorldObject* /*attacker*/, uint32 /*eventId*/) override
{
switch (me->GetEntry())
{

View File

@@ -907,15 +907,17 @@ class spell_warl_unstable_affliction : public SpellScriptLoader
{
if (AuraEffect const* aurEff = GetEffect(EFFECT_1))
{
Unit* target = dispelInfo->GetDispeller();
int32 bp = aurEff->GetAmount();
bp = target->SpellDamageBonusTaken(caster, aurEff->GetSpellInfo(), bp, DOT);
bp *= 9;
if (Unit* target = dispelInfo->GetDispeller()->ToUnit())
{
int32 bp = aurEff->GetAmount();
bp = target->SpellDamageBonusTaken(caster, aurEff->GetSpellInfo(), bp, DOT);
bp *= 9;
// backfire damage and silence
CastSpellExtraArgs args(aurEff);
args.AddSpellBP0(bp);
caster->CastSpell(target, SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL, args);
// backfire damage and silence
CastSpellExtraArgs args(aurEff);
args.AddSpellBP0(bp);
caster->CastSpell(target, SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL, args);
}
}
}
}