[10493] Implement EVENT_T_TARGET_MISSING_BUFF

This commit is contained in:
VladimirMangos 2010-09-17 17:56:59 +04:00
parent 92e9670a11
commit 26f8e9c35e
5 changed files with 19 additions and 1 deletions

View file

@ -344,6 +344,20 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
pHolder.UpdateRepeatTimer(m_creature,event.buffed.repeatMin,event.buffed.repeatMax);
break;
}
case EVENT_T_TARGET_MISSING_BUFF:
{
//Prevent event from occuring on no unit
if (!pActionInvoker)
return false;
SpellAuraHolder* holder = pActionInvoker->GetSpellAuraHolder(event.buffed.spellId);
if (holder && holder->GetStackAmount() >= event.buffed.amount)
return false;
//Repeat Timers
pHolder.UpdateRepeatTimer(m_creature,event.buffed.repeatMin,event.buffed.repeatMax);
break;
}
default:
sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u has invalid Event Type(%u), missing from ProcessEvent() Switch.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
break;