I was wondering how can I make a spell use an object in the map as a trigger in order for the spell to be successful.
For example:
(in SpellEffects.cpp)
case 12345:
{
if(m_caster->GetTypeId()!=TYPEID_PLAYER)
return;
uint32 spell_id = 12345;
m_caster->CastSpell(m_caster,spell_id,true,NULL);
return;
}
This basically has no external checks....I would like to add a check (iterator maybe?) for a nearby object or creature from player's current XYZ position and if so then spell will be executed successfully.
Can anyone either point me out to a similar function or help me create this one please?
Thank you very much