mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 18:36:31 +01:00
Core/Spells: rework part 5: GameObject casting
Closes #21330
Closes #18885
Ref #18752
(cherry picked from commit 45c5e1b9d6)
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user