![]() |
TrinityCore
|
#include <SmartScript.h>
Public Types | |
| typedef std::unordered_map< uint32, uint32 > | CounterMap |
Public Member Functions | |
| SmartScript () | |
| SmartScript (SmartScript const &other) | |
| SmartScript (SmartScript &&other) noexcept | |
| SmartScript & | operator= (SmartScript const &other) |
| SmartScript & | operator= (SmartScript &&other) noexcept |
| ~SmartScript () | |
| void | OnInitialize (WorldObject *obj, AreaTriggerEntry const *at=nullptr, SceneTemplate const *scene=nullptr, Quest const *qst=nullptr, uint32 evnt=0) |
| void | GetScript () |
| void | FillScript (SmartAIEventList &&e, WorldObject *obj, AreaTriggerEntry const *at, SceneTemplate const *scene, Quest const *quest, uint32 event=0) |
| void | ProcessEventsFor (SMART_EVENT e, Unit *unit=nullptr, uint32 var0=0, uint32 var1=0, bool bvar=false, SpellInfo const *spell=nullptr, GameObject *gob=nullptr, std::string_view varString={ }) |
| void | ProcessEvent (SmartScriptHolder &e, Unit *unit=nullptr, uint32 var0=0, uint32 var1=0, bool bvar=false, SpellInfo const *spell=nullptr, GameObject *gob=nullptr, std::string_view varString={ }) |
| void | UpdateTimer (SmartScriptHolder &e, uint32 const diff) |
| void | ProcessAction (SmartScriptHolder &e, Unit *unit=nullptr, uint32 var0=0, uint32 var1=0, bool bvar=false, SpellInfo const *spell=nullptr, GameObject *gob=nullptr, std::string_view varString={ }) |
| void | ProcessTimedAction (SmartScriptHolder &e, uint32 const &min, uint32 const &max, Unit *unit=nullptr, uint32 var0=0, uint32 var1=0, bool bvar=false, SpellInfo const *spell=nullptr, GameObject *gob=nullptr, std::string_view varString={ }) |
| void | GetTargets (ObjectVector &targets, SmartScriptHolder const &e, WorldObject *invoker=nullptr) const |
| void | SetPathId (uint32 id) |
| uint32 | GetPathId () const |
| WorldObject * | GetBaseObject () const |
| WorldObject * | GetBaseObjectOrUnitInvoker (Unit *invoker) |
| bool | HasAnyEventWithFlag (uint32 flag) const |
| void | OnUpdate (const uint32 diff) |
| void | OnMoveInLineOfSight (Unit *who) |
| Unit * | DoSelectLowestHpFriendly (float range, uint32 MinHPDiff) const |
| Unit * | DoSelectLowestHpPercentFriendly (float range, uint32 minHpPct, uint32 maxHpPct) const |
| void | DoFindFriendlyCC (std::vector< Creature * > &creatures, float range) const |
| void | DoFindFriendlyMissingBuff (std::vector< Creature * > &creatures, float range, uint32 spellid) const |
| Unit * | DoFindClosestFriendlyInRange (float range, bool playerOnly) const |
| bool | IsSmart (Creature *c, bool silent=false) const |
| bool | IsSmart (GameObject *g, bool silent=false) const |
| bool | IsSmart (bool silent=false) const |
| void | ClearTargetList (uint32 id) |
| void | StoreTargetList (ObjectVector const &targets, uint32 id) |
| void | AddToStoredTargetList (ObjectVector const &targets, uint32 id) |
| ObjectVector const * | GetStoredTargetVector (uint32 id, WorldObject const &ref) const |
| void | StoreCounter (uint32 id, uint32 value, uint32 reset) |
| uint32 | GetCounterValue (uint32 id) const |
| GameObject * | FindGameObjectNear (WorldObject *searchObject, ObjectGuid::LowType guid) const |
| Creature * | FindCreatureNear (WorldObject *searchObject, ObjectGuid::LowType guid) const |
| void | OnReset () |
| void | ResetBaseObject () |
| void | SetTimedActionList (SmartScriptHolder &e, uint32 entry, Unit *invoker, uint32 startFromEventId=0) |
| Unit * | GetLastInvoker (Unit *invoker=nullptr) const |
Static Public Member Functions | |
| static void | RecalcTimer (SmartScriptHolder &e, uint32 min, uint32 max) |
| static void | InitTimer (SmartScriptHolder &e) |
| static SmartScriptHolder | CreateSmartEvent (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, uint32 action_param7, SMARTAI_TARGETS t, uint32 target_param1, uint32 target_param2, uint32 target_param3, uint32 target_param4, std::string_view targetParamString, uint32 phaseMask) |
Public Attributes | |
| ObjectGuid | mLastInvoker |
| CounterMap | mCounterList |
Private Member Functions | |
| void | IncPhase (uint32 p) |
| void | DecPhase (uint32 p) |
| void | SetPhase (uint32 p) |
| bool | IsInPhase (uint32 p) const |
| void | SortEvents (SmartAIEventList &events) |
| void | RaisePriority (SmartScriptHolder &e) |
| void | RetryLater (SmartScriptHolder &e, bool ignoreChanceRoll=false) |
| void | RemoveStoredEvent (uint32 id) |
Private Attributes | |
| SmartAIEventList | mEvents |
| SmartAIEventList | mTimedActionList |
| ObjectGuid | mTimedActionListInvoker |
| std::shared_ptr< Scripting::v2::ActionBase > | mTimedActionWaitEvent |
| bool | isProcessingTimedActionList |
| Creature * | me |
| ObjectGuid | meOrigGUID |
| GameObject * | go |
| ObjectGuid | goOrigGUID |
| Player * | player |
| AreaTriggerEntry const * | trigger |
| AreaTrigger * | areaTrigger |
| SceneTemplate const * | sceneTemplate |
| Quest const * | quest |
| uint32 | event |
| SmartScriptType | mScriptType |
| uint32 | mEventPhase |
| uint32 | mPathId |
| SmartAIEventStoredList | mStoredEvents |
| std::vector< uint32 > | mRemIDs |
| uint32 | mTextTimer |
| uint32 | mLastTextID |
| uint32 | mTalkerEntry |
| bool | mUseTextTimer |
| uint32 | mCurrentPriority |
| bool | mEventSortingRequired |
| uint32 | mNestedEventsCounter |
| uint32 | mAllEventFlags |
| ObjectVectorMap | _storedTargets |
Static Private Attributes | |
| static constexpr uint32 | MAX_NESTED_EVENTS = 10 |
Definition at line 41 of file SmartScript.h.
| typedef std::unordered_map<uint32, uint32> SmartScript::CounterMap |
Definition at line 100 of file SmartScript.h.
| SmartScript::SmartScript | ( | ) |
Definition at line 52 of file SmartScript.cpp.
|
default |
|
defaultnoexcept |
|
default |
| void SmartScript::AddToStoredTargetList | ( | ObjectVector const & | targets, |
| uint32 | id | ||
| ) |
| void SmartScript::ClearTargetList | ( | uint32 | id | ) |
|
static |
Definition at line 2732 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 4341 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| Unit * SmartScript::DoFindClosestFriendlyInRange | ( | float | range, |
| bool | playerOnly | ||
| ) | const |
Definition at line 4274 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SmartScript::DoFindFriendlyCC | ( | std::vector< Creature * > & | creatures, |
| float | range | ||
| ) | const |
Definition at line 4254 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SmartScript::DoFindFriendlyMissingBuff | ( | std::vector< Creature * > & | creatures, |
| float | range, | ||
| uint32 | spellid | ||
| ) | const |
Definition at line 4264 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| Unit * SmartScript::DoSelectLowestHpPercentFriendly | ( | float | range, |
| uint32 | minHpPct, | ||
| uint32 | maxHpPct | ||
| ) | const |
Definition at line 4242 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SmartScript::FillScript | ( | SmartAIEventList && | e, |
| WorldObject * | obj, | ||
| AreaTriggerEntry const * | at, | ||
| SceneTemplate const * | scene, | ||
| Quest const * | quest, | ||
| uint32 | event = 0 |
||
| ) |
Definition at line 4021 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| Creature * SmartScript::FindCreatureNear | ( | WorldObject * | searchObject, |
| ObjectGuid::LowType | guid | ||
| ) | const |
Definition at line 182 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| GameObject * SmartScript::FindGameObjectNear | ( | WorldObject * | searchObject, |
| ObjectGuid::LowType | guid | ||
| ) | const |
Definition at line 173 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| WorldObject * SmartScript::GetBaseObject | ( | ) | const |
| WorldObject * SmartScript::GetBaseObjectOrUnitInvoker | ( | Unit * | invoker | ) |
Definition at line 3896 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 4323 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
| void SmartScript::GetScript | ( | ) |
Definition at line 4065 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| ObjectVector const * SmartScript::GetStoredTargetVector | ( | uint32 | id, |
| WorldObject const & | ref | ||
| ) | const |
| void SmartScript::GetTargets | ( | ObjectVector & | targets, |
| SmartScriptHolder const & | e, | ||
| WorldObject * | invoker = nullptr |
||
| ) | const |
Definition at line 2766 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 68 of file SmartScript.h.
|
private |
Definition at line 4335 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 3741 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
| bool SmartScript::IsSmart | ( | bool | silent = false | ) | const |
| bool SmartScript::IsSmart | ( | Creature * | c, |
| bool | silent = false |
||
| ) | const |
Definition at line 82 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| bool SmartScript::IsSmart | ( | GameObject * | g, |
| bool | silent = false |
||
| ) | const |
| void SmartScript::OnInitialize | ( | WorldObject * | obj, |
| AreaTriggerEntry const * | at = nullptr, |
||
| SceneTemplate const * | scene = nullptr, |
||
| Quest const * | qst = nullptr, |
||
| uint32 | evnt = 0 |
||
| ) |
Definition at line 4110 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SmartScript::OnMoveInLineOfSight | ( | Unit * | who | ) |
Definition at line 4220 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SmartScript::OnReset | ( | ) |
Definition at line 196 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SmartScript::OnUpdate | ( | const uint32 | diff | ) |
Definition at line 3901 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
defaultnoexcept |
|
default |
| void SmartScript::ProcessAction | ( | SmartScriptHolder & | e, |
| Unit * | unit = nullptr, |
||
| uint32 | var0 = 0, |
||
| uint32 | var1 = 0, |
||
| bool | bvar = false, |
||
| SpellInfo const * | spell = nullptr, |
||
| GameObject * | gob = nullptr, |
||
| std::string_view | varString = { } |
||
| ) |
Definition at line 305 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SmartScript::ProcessEvent | ( | SmartScriptHolder & | e, |
| Unit * | unit = nullptr, |
||
| uint32 | var0 = 0, |
||
| uint32 | var1 = 0, |
||
| bool | bvar = false, |
||
| SpellInfo const * | spell = nullptr, |
||
| GameObject * | gob = nullptr, |
||
| std::string_view | varString = { } |
||
| ) |
Definition at line 3166 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SmartScript::ProcessEventsFor | ( | SMART_EVENT | e, |
| Unit * | unit = nullptr, |
||
| uint32 | var0 = 0, |
||
| uint32 | var1 = 0, |
||
| bool | bvar = false, |
||
| SpellInfo const * | spell = nullptr, |
||
| GameObject * | gob = nullptr, |
||
| std::string_view | varString = { } |
||
| ) |
Definition at line 251 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SmartScript::ProcessTimedAction | ( | SmartScriptHolder & | e, |
| uint32 const & | min, | ||
| uint32 const & | max, | ||
| Unit * | unit = nullptr, |
||
| uint32 | var0 = 0, |
||
| uint32 | var1 = 0, |
||
| bool | bvar = false, |
||
| SpellInfo const * | spell = nullptr, |
||
| GameObject * | gob = nullptr, |
||
| std::string_view | varString = { } |
||
| ) |
Definition at line 2720 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
|
static |
Definition at line 3760 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
| void SmartScript::ResetBaseObject | ( | ) |
Definition at line 217 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 4010 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
|
private |
| void SmartScript::SetTimedActionList | ( | SmartScriptHolder & | e, |
| uint32 | entry, | ||
| Unit * | invoker, | ||
| uint32 | startFromEventId = 0 |
||
| ) |
Definition at line 4286 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 149 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SmartScript::StoreTargetList | ( | ObjectVector const & | targets, |
| uint32 | id | ||
| ) |
| void SmartScript::UpdateTimer | ( | SmartScriptHolder & | e, |
| uint32 const | diff | ||
| ) |
Definition at line 3767 of file SmartScript.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 149 of file SmartScript.h.
|
private |
Definition at line 126 of file SmartScript.h.
|
private |
Definition at line 129 of file SmartScript.h.
|
private |
Definition at line 122 of file SmartScript.h.
|
private |
Definition at line 123 of file SmartScript.h.
|
private |
Definition at line 119 of file SmartScript.h.
|
private |
Definition at line 144 of file SmartScript.h.
|
staticconstexprprivate |
Definition at line 147 of file SmartScript.h.
| CounterMap SmartScript::mCounterList |
Definition at line 101 of file SmartScript.h.
|
private |
Definition at line 141 of file SmartScript.h.
|
private |
Definition at line 120 of file SmartScript.h.
|
private |
Definition at line 121 of file SmartScript.h.
|
private |
Definition at line 131 of file SmartScript.h.
|
private |
Definition at line 115 of file SmartScript.h.
|
private |
Definition at line 142 of file SmartScript.h.
| ObjectGuid SmartScript::mLastInvoker |
Definition at line 99 of file SmartScript.h.
|
private |
Definition at line 138 of file SmartScript.h.
|
private |
Definition at line 143 of file SmartScript.h.
|
private |
Definition at line 133 of file SmartScript.h.
|
private |
Definition at line 135 of file SmartScript.h.
|
private |
Definition at line 130 of file SmartScript.h.
|
private |
Definition at line 134 of file SmartScript.h.
|
private |
Definition at line 139 of file SmartScript.h.
|
private |
Definition at line 137 of file SmartScript.h.
|
private |
Definition at line 116 of file SmartScript.h.
|
private |
Definition at line 117 of file SmartScript.h.
|
private |
Definition at line 118 of file SmartScript.h.
|
private |
Definition at line 140 of file SmartScript.h.
|
private |
Definition at line 124 of file SmartScript.h.
|
private |
Definition at line 128 of file SmartScript.h.
|
private |
Definition at line 127 of file SmartScript.h.
|
private |
Definition at line 125 of file SmartScript.h.