Skip to content

Commit

Permalink
Icecrown: Add custom error and reagent consumption to summon spells
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Aug 23, 2024
1 parent b48537f commit 9186c69
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/game/AI/ScriptDevAI/scripts/northrend/icecrown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1160,22 +1160,46 @@ struct RodOfSiphoning : public AuraScript
};

// 60561 - Summon Dark Messenger Beam
struct SummonDarkMessengerBeam : public AuraScript
struct SummonDarkMessengerBeam : public SpellScript, public AuraScript
{
SpellCastResult OnCheckCast(Spell* spell, bool /*strict*/) const override
{
if (spell->GetCaster()->IsPlayer())
{
Player* player = static_cast<Player*>(spell->GetCaster());
if (!player->HasItemCount(44434, 5))
{
return SPELL_FAILED_REAGENTS;
}
}
return SPELL_CAST_OK;
}

void OnSpellCastResultOverride(SpellCastResult& result, uint32& param1, uint32& param2) const override
{
if (result == SPELL_FAILED_REAGENTS)
{
result = SPELL_FAILED_CUSTOM_ERROR;
param1 = SPELL_FAILED_CUSTOM_ERROR_55;
}
}

void OnPeriodicTrigger(Aura* aura, PeriodicTriggerData& data) const override
{
data.caster = aura->GetCaster();
data.target = nullptr;
data.triggerFlags |= TRIGGERED_FORCE_COSTS;
}
};

// 60831 - Alumeth's Remains
struct AlumethsRemains : public AuraScript
struct AlumethsRemains : public SpellScript, public AuraScript
{
void OnPeriodicTrigger(Aura* aura, PeriodicTriggerData& data) const override
{
data.caster = aura->GetCaster();
data.target = nullptr;
data.triggerFlags |= TRIGGERED_FORCE_COSTS;
}
};

Expand Down

0 comments on commit 9186c69

Please sign in to comment.