mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[10493] Implement EVENT_T_TARGET_MISSING_BUFF
This commit is contained in:
parent
92e9670a11
commit
26f8e9c35e
5 changed files with 19 additions and 1 deletions
|
|
@ -88,6 +88,7 @@ Some events such as EVENT_T_AGGRO, EVENT_T_DEATH, EVENT_T_SPAWNED, and EVENT_T_E
|
||||||
25 EVENT_T_SUMMONED_JUST_DIED CreatureId, RepeatMin, RepeatMax Expires after creature with entry = (Param1) is die (Param1 = 0 means all spawns). Will repeat every (Param2) and (Param3).
|
25 EVENT_T_SUMMONED_JUST_DIED CreatureId, RepeatMin, RepeatMax Expires after creature with entry = (Param1) is die (Param1 = 0 means all spawns). Will repeat every (Param2) and (Param3).
|
||||||
26 EVENT_T_SUMMONED_JUST_DESPAWN CreatureId, RepeatMin, RepeatMax Expires before creature with entry = (Param1) is despawn (Param1 = 0 means all spawns). Will repeat every (Param2) and (Param3).
|
26 EVENT_T_SUMMONED_JUST_DESPAWN CreatureId, RepeatMin, RepeatMax Expires before creature with entry = (Param1) is despawn (Param1 = 0 means all spawns). Will repeat every (Param2) and (Param3).
|
||||||
27 EVENT_T_MISSING_BUFF SpellID, AmmountInStack, RepeatMin, RepeatMax Expires when a creature not has spell (Param1) auras applied in a stack greater or equal to value provided in (Param2). Will repeat every (Param3) and (Param4).
|
27 EVENT_T_MISSING_BUFF SpellID, AmmountInStack, RepeatMin, RepeatMax Expires when a creature not has spell (Param1) auras applied in a stack greater or equal to value provided in (Param2). Will repeat every (Param3) and (Param4).
|
||||||
|
28 EVENT_T_TARGET_MISSING_BUFF SpellID, AmmountInStack, RepeatMin, RepeatMax Expires when a target unit not has spell (Param1) auras applied in a stack greater or equal to value provided in (Param2). Will repeat every (Param3) and (Param4).
|
||||||
|
|
||||||
|
|
||||||
=========================================
|
=========================================
|
||||||
|
|
|
||||||
|
|
@ -344,6 +344,20 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
|
||||||
pHolder.UpdateRepeatTimer(m_creature,event.buffed.repeatMin,event.buffed.repeatMax);
|
pHolder.UpdateRepeatTimer(m_creature,event.buffed.repeatMin,event.buffed.repeatMax);
|
||||||
break;
|
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:
|
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);
|
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;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ enum EventAI_Type
|
||||||
EVENT_T_SUMMONED_JUST_DIED = 25, // CreatureId, RepeatMin, RepeatMax
|
EVENT_T_SUMMONED_JUST_DIED = 25, // CreatureId, RepeatMin, RepeatMax
|
||||||
EVENT_T_SUMMONED_JUST_DESPAWN = 26, // CreatureId, RepeatMin, RepeatMax
|
EVENT_T_SUMMONED_JUST_DESPAWN = 26, // CreatureId, RepeatMin, RepeatMax
|
||||||
EVENT_T_MISSING_BUFF = 27, // Param1 = SpellID, Param2 = Number of time stacked expected, Param3/4 Repeat Min/Max
|
EVENT_T_MISSING_BUFF = 27, // Param1 = SpellID, Param2 = Number of time stacked expected, Param3/4 Repeat Min/Max
|
||||||
|
EVENT_T_TARGET_MISSING_BUFF = 28, // Param1 = SpellID, Param2 = Number of time stacked expected, Param3/4 Repeat Min/Max
|
||||||
|
|
||||||
EVENT_T_END,
|
EVENT_T_END,
|
||||||
};
|
};
|
||||||
|
|
@ -521,6 +522,7 @@ struct CreatureEventAI_Event
|
||||||
// EVENT_T_BUFFED = 23
|
// EVENT_T_BUFFED = 23
|
||||||
// EVENT_T_TARGET_BUFFED = 24
|
// EVENT_T_TARGET_BUFFED = 24
|
||||||
// EVENT_T_MISSING_BUFF = 27
|
// EVENT_T_MISSING_BUFF = 27
|
||||||
|
// EVENT_T_TARGET_MISSING_BUFF = 28
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
uint32 spellId;
|
uint32 spellId;
|
||||||
|
|
|
||||||
|
|
@ -463,6 +463,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
||||||
case EVENT_T_BUFFED:
|
case EVENT_T_BUFFED:
|
||||||
case EVENT_T_TARGET_BUFFED:
|
case EVENT_T_TARGET_BUFFED:
|
||||||
case EVENT_T_MISSING_BUFF:
|
case EVENT_T_MISSING_BUFF:
|
||||||
|
case EVENT_T_TARGET_MISSING_BUFF:
|
||||||
{
|
{
|
||||||
SpellEntry const* pSpell = sSpellStore.LookupEntry(temp.buffed.spellId);
|
SpellEntry const* pSpell = sSpellStore.LookupEntry(temp.buffed.spellId);
|
||||||
if (!pSpell)
|
if (!pSpell)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10492"
|
#define REVISION_NR "10493"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue