6#ifndef SKYFIRE_SMARTSCRIPT_H
7#define SKYFIRE_SMARTSCRIPT_H
39 SmartScriptHolder CreateEvent(
SMART_EVENT e,
uint32 event_flags,
uint32 event_param1,
uint32 event_param2,
uint32 event_param3,
uint32 event_param4,
uint32 event_param5,
SMART_ACTION action,
uint32 action_param1,
uint32 action_param2,
uint32 action_param3,
uint32 action_param4,
uint32 action_param5,
uint32 action_param6,
SMARTAI_TARGETS t,
uint32 target_param1,
uint32 target_param2,
uint32 target_param3,
uint32 phaseMask = 0);
40 void AddEvent(
SMART_EVENT e,
uint32 event_flags,
uint32 event_param1,
uint32 event_param2,
uint32 event_param3,
uint32 event_param4,
uint32 event_param5,
SMART_ACTION action,
uint32 action_param1,
uint32 action_param2,
uint32 action_param3,
uint32 action_param4,
uint32 action_param5,
uint32 action_param6,
SMARTAI_TARGETS t,
uint32 target_param1,
uint32 target_param2,
uint32 target_param3,
uint32 phaseMask = 0);
86 if (c && c->GetAIName() !=
"SmartAI")
89 if (!
me ||
me->GetAIName() !=
"SmartAI")
93 SF_LOG_ERROR(
"sql.sql",
"SmartScript: Action target Creature (GUID: %u Entry: %u) is not using SmartAI, action skipped to prevent crash.", c ? c->GetDBTableGUIDLow() : (
me ?
me->GetDBTableGUIDLow() : 0), c ? c->GetEntry() : (
me ?
me->GetEntry() : 0));
101 if (g && g->GetAIName() !=
"SmartGameObjectAI")
104 if (!
go ||
go->GetAIName() !=
"SmartGameObjectAI")
107 SF_LOG_ERROR(
"sql.sql",
"SmartScript: Action target GameObject (GUID: %u Entry: %u) is not using SmartGameObjectAI, action skipped to prevent crash.", g ? g->GetDBTableGUIDLow() : (
go ?
go->GetDBTableGUIDLow() : 0), g ? g->GetEntry() : (
go ?
go->GetEntry() : 0));
116 return (*itr).second;
204 for (SmartAIEventList::iterator i =
mEvents.begin(); i !=
mEvents.end(); ++i)
206 if (i->event_id == link)
TypeMapContainer< AllGridObjectTypes > GridTypeMapContainer
CoordPair< TOTAL_NUMBER_OF_CELLS_PER_MAP > CellCoord
#define SF_LOG_ERROR(filterType__,...)
std::vector< SmartScriptHolder > SmartAIEventList
UNORDERED_MAP< uint32, ObjectList * > ObjectListMap
std::list< WorldObject * > ObjectList
bool CheckTimer(SmartScriptHolder const &e) const
SmartAIEventList mStoredEvents
SMARTAI_TEMPLATE mTemplate
Creature * FindCreatureNear(WorldObject *searchObject, uint32 guid) const
void OnUpdate(const uint32 diff)
SmartScriptType mScriptType
ObjectList * GetWorldObjectsInDist(float dist)
void UpdateTimer(SmartScriptHolder &e, uint32 const diff)
void SetScript9(SmartScriptHolder &e, uint32 entry)
SmartScriptHolder CreateEvent(SMART_EVENT e, uint32 event_flags, uint32 event_param1, uint32 event_param2, uint32 event_param3, uint32 event_param4, uint32 event_param5, SMART_ACTION action, uint32 action_param1, uint32 action_param2, uint32 action_param3, uint32 action_param4, uint32 action_param5, uint32 action_param6, SMARTAI_TARGETS t, uint32 target_param1, uint32 target_param2, uint32 target_param3, uint32 phaseMask=0)
void DoFindFriendlyCC(std::list< Creature * > &_list, float range)
void RecalcTimer(SmartScriptHolder &e, uint32 min, uint32 max)
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Unit * DoSelectLowestHpFriendly(float range, uint32 MinHPDiff)
SmartScriptHolder FindLinkedEvent(uint32 link)
bool IsUnit(WorldObject *obj)
ObjectList * GetTargets(SmartScriptHolder const &e, Unit *invoker=NULL)
void OnInitialize(WorldObject *obj, AreaTriggerEntry const *at=NULL)
bool IsPlayer(WorldObject *obj)
void AddEvent(SMART_EVENT e, uint32 event_flags, uint32 event_param1, uint32 event_param2, uint32 event_param3, uint32 event_param4, uint32 event_param5, SMART_ACTION action, uint32 action_param1, uint32 action_param2, uint32 action_param3, uint32 action_param4, uint32 action_param5, uint32 action_param6, SMARTAI_TARGETS t, uint32 target_param1, uint32 target_param2, uint32 target_param3, uint32 phaseMask=0)
Unit * DoFindClosestFriendlyInRange(float range, bool playerOnly)
bool IsCreature(WorldObject *obj)
void FillScript(SmartAIEventList e, WorldObject *obj, AreaTriggerEntry const *at)
GameObject * FindGameObjectNear(WorldObject *searchObject, uint32 guid) const
void OnMoveInLineOfSight(Unit *who)
ObjectList * GetTargetList(uint32 id)
bool IsInPhase(uint32 p) const
SmartAIEventList mInstallEvents
void InitTimer(SmartScriptHolder &e)
AreaTriggerEntry const * trigger
ObjectListMap * mTargetStorage
UNORDERED_MAP< int32, int32 > mStoredDecimals
void DoFindFriendlyMissingBuff(std::list< Creature * > &list, float range, uint32 spellid)
std::list< uint32 > mRemIDs
bool IsGameObject(WorldObject *obj)
void ProcessEvent(SmartScriptHolder &e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
bool IsSmartGO(GameObject *g=NULL)
void SetPhase(uint32 p=0)
void ProcessTimedAction(SmartScriptHolder &e, uint32 const &min, uint32 const &max, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
void InstallTemplate(SmartScriptHolder const &e)
bool IsSmart(Creature *c=NULL)
WorldObject * GetBaseObject()
SmartAIEventList mTimedActionList
void ProcessAction(SmartScriptHolder &e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
void StoreTargetList(ObjectList *targets, uint32 id)
void RemoveStoredEvent(uint32 id)
void SetPathId(uint32 id)
float GetGridActivationRange() const
CellCoord ComputeCellCoord(float x, float y)
void Visit(CellCoord const &, TypeContainerVisitor< T, CONTAINER > &visitor, Map &, WorldObject const &, float) const
float GetPositionX() const
float GetPositionY() const