[10433] Implement EVENT_T_MISSING_BUFF for self buff check

Also added amount spell stack checks at loading
for EVENT_T_BUFFED and EVENT_T_TARGET_BUFFED.
This commit is contained in:
VladimirMangos 2010-09-02 05:43:20 +04:00
parent acd0716297
commit 8dfeb61200
5 changed files with 31 additions and 8 deletions

View file

@ -334,6 +334,16 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
pHolder.UpdateRepeatTimer(m_creature,event.buffed.repeatMin,event.buffed.repeatMax);
break;
}
case EVENT_T_MISSING_BUFF:
{
SpellAuraHolder* holder = m_creature->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;