[7863] Implement for EVENT_T_SPAWNED map/zone/subzone only event conditions. Author: Alex

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-21 10:52:05 -05:00
parent 8d771cc9f7
commit 5fe179019f
4 changed files with 64 additions and 8 deletions
+16 -1
View File
@@ -44,7 +44,7 @@ enum EventAI_Type
EVENT_T_SPELLHIT = 8, // SpellID, School, RepeatMin, RepeatMax
EVENT_T_RANGE = 9, // MinDist, MaxDist, RepeatMin, RepeatMax
EVENT_T_OOC_LOS = 10, // NoHostile, MaxRnage, RepeatMin, RepeatMax
EVENT_T_SPAWNED = 11, // NONE
EVENT_T_SPAWNED = 11, // Condition, CondValue1
EVENT_T_TARGET_HP = 12, // HPMax%, HPMin%, RepeatMin, RepeatMax
EVENT_T_TARGET_CASTING = 13, // RepeatMin, RepeatMax
EVENT_T_FRIENDLY_HP = 14, // HPDeficit, Radius, RepeatMin, RepeatMax
@@ -160,6 +160,13 @@ enum EventFlags
EFLAG_DEBUG_ONLY = 0x80, //Event only occurs in debug build
};
enum SpawnedEventMode
{
SPAWNED_EVENT_ALWAY = 0,
SPAWNED_EVENT_MAP = 1,
SPAWNED_EVENT_ZONE = 2
};
// String text additional data, used in (CreatureEventAI)
struct StringTextData
{
@@ -436,6 +443,12 @@ struct CreatureEventAI_Event
uint32 repeatMin;
uint32 repeatMax;
} ooc_los;
// EVENT_T_SPAWNED = 11
struct
{
uint32 condition;
uint32 conditionValue1;
} spawned;
// EVENT_T_TARGET_CASTING = 13
struct
{
@@ -563,6 +576,8 @@ class TRINITY_DLL_SPEC CreatureEventAI : public CreatureAI
void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target);
bool CanCast(Unit* Target, SpellEntry const *Spell, bool Triggered);
bool SpawnedEventConditionsCheck(CreatureEventAI_Event const& event);
Unit* DoSelectLowestHpFriendly(float range, uint32 MinHPDiff);
void DoFindFriendlyMissingBuff(std::list<Creature*>& _list, float range, uint32 spellid);
void DoFindFriendlyCC(std::list<Creature*>& _list, float range);