TrinityCore
Loading...
Searching...
No Matches
SmartScript Class Reference

#include <SmartScript.h>

Public Types

typedef std::unordered_map< uint32, uint32 > CounterMap
 

Public Member Functions

 SmartScript ()
 
 ~SmartScript ()
 
void OnInitialize (WorldObject *obj, AreaTriggerEntry const *at=nullptr)
 
void GetScript ()
 
void FillScript (SmartAIEventList e, WorldObject *obj, AreaTriggerEntry const *at)
 
void ProcessEventsFor (SMART_EVENT e, Unit *unit=nullptr, uint32 var0=0, uint32 var1=0, bool bvar=false, SpellInfo const *spell=nullptr, GameObject *gob=nullptr)
 
void ProcessEvent (SmartScriptHolder &e, Unit *unit=nullptr, uint32 var0=0, uint32 var1=0, bool bvar=false, SpellInfo const *spell=nullptr, GameObject *gob=nullptr)
 
bool CheckTimer (SmartScriptHolder const &e) const
 
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)
 
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)
 
void GetTargets (ObjectVector &targets, SmartScriptHolder const &e, WorldObject *invoker=nullptr) const
 
void GetWorldObjectsInDist (ObjectVector &objects, float dist) const
 
void SetPathId (uint32 id)
 
uint32 GetPathId () const
 
WorldObject * GetBaseObject () const
 
WorldObject * GetBaseObjectOrPlayerTrigger () const
 
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 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)
 
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, SMARTAI_TARGETS t, uint32 target_param1, uint32 target_param2, uint32 target_param3, uint32 target_param4, uint32 phaseMask)
 
static bool IsUnit (WorldObject *obj)
 
static bool IsPlayer (WorldObject *obj)
 
static bool IsCreature (WorldObject *obj)
 
static bool IsCharmedCreature (WorldObject *obj)
 
static bool IsGameObject (WorldObject *obj)
 

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 InstallEvents ()
 
void RemoveStoredEvent (uint32 id)
 

Private Attributes

SmartAIEventList mEvents
 
SmartAIEventList mInstallEvents
 
SmartAIEventList mTimedActionList
 
ObjectGuid mTimedActionListInvoker
 
bool isProcessingTimedActionList
 
Creature * me
 
ObjectGuid meOrigGUID
 
GameObject * go
 
ObjectGuid goOrigGUID
 
Player * atPlayer
 
AreaTriggerEntry const * trigger
 
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
 

Detailed Description

Definition at line 32 of file SmartScript.h.

Member Typedef Documentation

◆ CounterMap

typedef std::unordered_map<uint32, uint32> SmartScript::CounterMap

Definition at line 93 of file SmartScript.h.

Constructor & Destructor Documentation

◆ SmartScript()

◆ ~SmartScript()

SmartScript::~SmartScript ( )

Definition at line 67 of file SmartScript.cpp.

Member Function Documentation

◆ AddToStoredTargetList()

void SmartScript::AddToStoredTargetList ( ObjectVector const &  targets,
uint32  id 
)

Definition at line 117 of file SmartScript.cpp.

References _storedTargets.

Referenced by ProcessAction().

◆ CheckTimer()

bool SmartScript::CheckTimer ( SmartScriptHolder const &  e) const

Definition at line 3443 of file SmartScript.cpp.

References SmartScriptHolder::active.

◆ CreateSmartEvent()

◆ DecPhase()

void SmartScript::DecPhase ( uint32  p)
private

Definition at line 3855 of file SmartScript.cpp.

References mEventPhase, and SetPhase().

Referenced by ProcessAction().

◆ DoFindClosestFriendlyInRange()

Unit * SmartScript::DoFindClosestFriendlyInRange ( float  range,
bool  playerOnly 
) const

Definition at line 3791 of file SmartScript.cpp.

References me, and Cell::VisitAllObjects().

Referenced by GetTargets().

◆ DoFindFriendlyCC()

void SmartScript::DoFindFriendlyCC ( std::vector< Creature * > &  creatures,
float  range 
) const

Definition at line 3771 of file SmartScript.cpp.

References me, and Cell::VisitGridObjects().

Referenced by ProcessEvent().

◆ DoFindFriendlyMissingBuff()

void SmartScript::DoFindFriendlyMissingBuff ( std::vector< Creature * > &  creatures,
float  range,
uint32  spellid 
) const

Definition at line 3781 of file SmartScript.cpp.

References me, and Cell::VisitGridObjects().

Referenced by ProcessEvent().

◆ DoSelectLowestHpFriendly()

Unit * SmartScript::DoSelectLowestHpFriendly ( float  range,
uint32  MinHPDiff 
) const

Definition at line 3747 of file SmartScript.cpp.

References me, and Cell::VisitGridObjects().

◆ DoSelectLowestHpPercentFriendly()

Unit * SmartScript::DoSelectLowestHpPercentFriendly ( float  range,
uint32  minHpPct,
uint32  maxHpPct 
) const

Definition at line 3759 of file SmartScript.cpp.

References me, and Cell::VisitGridObjects().

Referenced by ProcessEvent().

◆ FillScript()

◆ FindCreatureNear()

Creature * SmartScript::FindCreatureNear ( WorldObject *  searchObject,
ObjectGuid::LowType  guid 
) const

Definition at line 166 of file SmartScript.cpp.

References Map::GetCreatureBySpawnIdStore(), and WorldObject::GetMap().

Referenced by GetTargets(), and ProcessEvent().

◆ FindGameObjectNear()

GameObject * SmartScript::FindGameObjectNear ( WorldObject *  searchObject,
ObjectGuid::LowType  guid 
) const

Definition at line 157 of file SmartScript.cpp.

References Map::GetGameObjectBySpawnIdStore(), and WorldObject::GetMap().

Referenced by GetTargets(), and ProcessEvent().

◆ GetBaseObject()

WorldObject * SmartScript::GetBaseObject ( ) const

◆ GetBaseObjectOrPlayerTrigger()

WorldObject * SmartScript::GetBaseObjectOrPlayerTrigger ( ) const

Definition at line 3484 of file SmartScript.cpp.

References atPlayer, GetBaseObject(), and trigger.

Referenced by GetTargets(), GetWorldObjectsInDist(), and ProcessAction().

◆ GetCounterValue()

uint32 SmartScript::GetCounterValue ( uint32  id) const

Definition at line 149 of file SmartScript.cpp.

References mCounterList.

Referenced by ProcessEvent().

◆ GetLastInvoker()

Unit * SmartScript::GetLastInvoker ( Unit *  invoker = nullptr) const

Definition at line 3837 of file SmartScript.cpp.

References GetBaseObject(), ObjectAccessor::GetUnit(), and mLastInvoker.

Referenced by GetTargets(), and ProcessAction().

◆ GetPathId()

uint32 SmartScript::GetPathId ( ) const
inline

Definition at line 54 of file SmartScript.h.

Referenced by SmartAI::EndPath().

◆ GetScript()

void SmartScript::GetScript ( )

◆ GetStoredTargetVector()

ObjectVector const * SmartScript::GetStoredTargetVector ( uint32  id,
WorldObject const &  ref 
) const

Definition at line 125 of file SmartScript.cpp.

References _storedTargets.

Referenced by SmartAI::EndPath(), GetTargets(), and ProcessAction().

◆ GetTargets()

void SmartScript::GetTargets ( ObjectVector &  targets,
SmartScriptHolder const &  e,
WorldObject *  invoker = nullptr 
) const

Definition at line 2395 of file SmartScript.cpp.

References Creature::AI(), Unit::CanHaveThreatList(), SmartTarget::closestAttackable, SmartTarget::closestFriendly, SmartTarget::creature, SmartTarget::dbGuid, SmartTarget::dead, SmartTarget::dist, DoFindClosestFriendlyInRange(), SmartTarget::entry, SmartTarget::farthest, FindCreatureNear(), FindGameObjectNear(), WorldObject::FindNearestCreature(), WorldObject::FindNearestGameObject(), WorldObject::FindNearestUnspawnedGameObject(), Vehicle::GetBase(), GetBaseObject(), GetBaseObjectOrPlayerTrigger(), WorldObject::GetCharmerOrOwnerGUID(), Unit::GetCharmerOrOwnerGUID(), Unit::GetCreatorGUID(), Object::GetGUID(), GetLastInvoker(), Creature::GetLootRecipient(), Creature::GetLootRecipientGroup(), GameObject::GetOwnerGUID(), GetStoredTargetVector(), SmartScriptHolder::GetTargetType(), Unit::GetThreatManager(), ObjectAccessor::GetUnit(), ThreatManager::GetUnsortedThreatList(), Unit::GetVehicle(), Unit::GetVehicleKit(), Unit::GetVictim(), ObjectAccessor::GetWorldObject(), GetWorldObjectsInDist(), go, SmartTarget::goClosest, SmartTarget::goDistance, SmartTarget::goGUID, SmartTarget::goRange, SmartTarget::hostilRandom, SmartTarget::id, IsCreature(), IsGameObject(), SmartTarget::isInLos, WorldObject::IsInRange(), IsPlayer(), Unit::IsVehicle(), Unit::IsWithinCombatRange(), SmartTarget::maxDist, MaxDistance, SmartTarget::maxSize, MaxThreat, me, SmartTarget::minDist, MinThreat, GroupReference::next(), SmartTarget::owner, SmartTarget::playerDistance, SmartTarget::playerOnly, SmartTarget::playerRange, SmartTarget::powerType, Random, Trinity::Containers::RandomResize(), SmartTarget::seatMask, Vehicle::Seats, WorldObject::SelectNearestPlayer(), Creature::SelectNearestTarget(), UnitAI::SelectTarget(), SMART_TARGET_ACTION_INVOKER, SMART_TARGET_ACTION_INVOKER_VEHICLE, SMART_TARGET_CLOSEST_CREATURE, SMART_TARGET_CLOSEST_ENEMY, SMART_TARGET_CLOSEST_FRIENDLY, SMART_TARGET_CLOSEST_GAMEOBJECT, SMART_TARGET_CLOSEST_PLAYER, SMART_TARGET_CLOSEST_UNSPAWNED_GAMEOBJECT, SMART_TARGET_CREATURE_DISTANCE, SMART_TARGET_CREATURE_GUID, SMART_TARGET_CREATURE_RANGE, SMART_TARGET_FARTHEST, SMART_TARGET_GAMEOBJECT_DISTANCE, SMART_TARGET_GAMEOBJECT_GUID, SMART_TARGET_GAMEOBJECT_RANGE, SMART_TARGET_HOSTILE_LAST_AGGRO, SMART_TARGET_HOSTILE_RANDOM, SMART_TARGET_HOSTILE_RANDOM_NOT_TOP, SMART_TARGET_HOSTILE_SECOND_AGGRO, SMART_TARGET_INVOKER_PARTY, SMART_TARGET_LOOT_RECIPIENTS, SMART_TARGET_NONE, SMART_TARGET_OWNER_OR_SUMMONER, SMART_TARGET_PLAYER_DISTANCE, SMART_TARGET_PLAYER_RANGE, SMART_TARGET_POSITION, SMART_TARGET_SELF, SMART_TARGET_STORED, SMART_TARGET_THREAT_LIST, SMART_TARGET_VEHICLE_PASSENGER, SMART_TARGET_VICTIM, SmartTarget::stored, SmartScriptHolder::target, TC_LOG_ERROR, SmartTarget::threatList, Object::ToPlayer(), Unit::ToTempSummon(), Object::ToUnit(), SmartTarget::unitClosest, SmartTarget::unitDistance, SmartTarget::unitGUID, SmartTarget::unitRange, SmartTarget::useCharmerOrOwner, and SmartTarget::vehicle.

Referenced by ProcessAction(), and ProcessEvent().

◆ GetWorldObjectsInDist()

void SmartScript::GetWorldObjectsInDist ( ObjectVector &  objects,
float  dist 
) const

Definition at line 2756 of file SmartScript.cpp.

References GetBaseObjectOrPlayerTrigger(), and Cell::VisitAllObjects().

Referenced by GetTargets().

◆ HasAnyEventWithFlag()

bool SmartScript::HasAnyEventWithFlag ( uint32  flag) const
inline

Definition at line 57 of file SmartScript.h.

◆ IncPhase()

void SmartScript::IncPhase ( uint32  p)
private

Definition at line 3849 of file SmartScript.cpp.

References mEventPhase, SetPhase(), and SMART_EVENT_PHASE_12.

Referenced by ProcessAction().

◆ InitTimer()

◆ InstallEvents()

void SmartScript::InstallEvents ( )
private

Definition at line 3448 of file SmartScript.cpp.

References mEvents, and mInstallEvents.

Referenced by OnInitialize(), and OnUpdate().

◆ IsCharmedCreature()

bool SmartScript::IsCharmedCreature ( WorldObject *  obj)
static

Definition at line 3504 of file SmartScript.cpp.

References Object::ToCreature().

Referenced by ProcessAction(), and ProcessEvent().

◆ IsCreature()

bool SmartScript::IsCreature ( WorldObject *  obj)
static

Definition at line 3499 of file SmartScript.cpp.

References Object::GetTypeId(), and TYPEID_UNIT.

Referenced by GetTargets(), ProcessAction(), and ProcessEvent().

◆ IsGameObject()

bool SmartScript::IsGameObject ( WorldObject *  obj)
static

Definition at line 3515 of file SmartScript.cpp.

References Object::GetTypeId(), and TYPEID_GAMEOBJECT.

Referenced by GetTargets(), and ProcessAction().

◆ IsInPhase()

bool SmartScript::IsInPhase ( uint32  p) const
private

Definition at line 3868 of file SmartScript.cpp.

References mEventPhase.

Referenced by ProcessEvent(), and UpdateTimer().

◆ IsPlayer()

bool SmartScript::IsPlayer ( WorldObject *  obj)
static

◆ IsSmart() [1/3]

bool SmartScript::IsSmart ( bool  silent = false) const

Definition at line 101 of file SmartScript.cpp.

References go, IsSmart(), and me.

◆ IsSmart() [2/3]

bool SmartScript::IsSmart ( Creature *  c,
bool  silent = false 
) const

Definition at line 71 of file SmartScript.cpp.

References Creature::AI(), Object::GetEntry(), Creature::GetSpawnId(), me, and TC_LOG_ERROR.

Referenced by IsSmart(), and ProcessAction().

◆ IsSmart() [3/3]

bool SmartScript::IsSmart ( GameObject *  g,
bool  silent = false 
) const

◆ IsUnit()

bool SmartScript::IsUnit ( WorldObject *  obj)
static

Definition at line 3489 of file SmartScript.cpp.

References Object::GetTypeId(), TYPEID_PLAYER, and TYPEID_UNIT.

Referenced by ProcessAction(), and ProcessEvent().

◆ OnInitialize()

◆ OnMoveInLineOfSight()

void SmartScript::OnMoveInLineOfSight ( Unit *  who)

◆ OnReset()

◆ OnUpdate()

◆ ProcessAction()

void SmartScript::ProcessAction ( SmartScriptHolder &  e,
Unit *  unit = nullptr,
uint32  var0 = 0,
uint32  var1 = 0,
bool  bvar = false,
SpellInfo const *  spell = nullptr,
GameObject *  gob = nullptr 
)

Definition at line 257 of file SmartScript.cpp.

References SmartScriptHolder::action, SmartAction::actionLists, SmartAction::activateGameObject, SmartAction::active, ThreatManager::AddThreat(), AddToStoredTargetList(), SmartAction::addToStoredTargets, Creature::AI(), GameObject::AI(), SmartAction::angle, SmartAction::areaLightId, SmartAction::attack, SmartAction::attackInvoker, UnitAI::AttackStart(), AURA_REMOVE_BY_EXPIRE, SmartAction::autoAttack, BROADCAST_TEXT_CALL_FOR_HELP, BROADCAST_TEXT_FLEE_FOR_ASSIST, SmartAction::byte1, Creature::CallForHelp(), SmartAction::callHelp, Unit::CanHaveThreatList(), SmartAction::cast, CAST_AI, SmartAction::castFlags, WorldObject::CastSpell(), SmartAction::chance, SmartAction::charges, CHAT_MSG_ADDON, CHAT_MSG_MONSTER_EMOTE, ObjectMgr::ChooseDisplayId(), SmartAction::cinematic, SmartAction::closestWaypointFromList, SmartAction::combatMove, Unit::CombatStop(), SmartAction::ContactDistance, SmartAction::corpseDelay, SmartAction::count, SmartAction::counterId, CreateSmartEvent(), SmartAction::creature, SmartAction::creatureGroup, SmartAction::credit, SmartAction::creditType, SmartAction::crossCast, SmartAction::data, SmartAction::dec, DecPhase(), SmartAction::delay, SmartAction::despawnTime, SmartAction::directAdd, SmartAction::disable, SmartAction::disableEvade, SmartAction::disablePathfinding, SmartAction::dist, SmartAction::distance, Creature::DoFleeToGetAssistance(), CreatureAI::DoZoneInCombat(), SmartAction::duration, SmartAction::emote, SmartAction::emotes, SmartAction::enable, SmartAction::enableTempGO, ENSURE_AI, CreatureAI::EnterEvadeMode(), SmartAction::entry, SmartScriptHolder::entryOrGuid, SmartAction::equip, SmartAction::evade, SmartScriptHolder::event, SmartEvent::event_chance, SmartEvent::event_flags, SmartScriptHolder::event_id, SmartAction::faction, SmartAction::factionID, SmartAction::fail, SmartAction::field, SmartAIMgr::FindLinkedEvent(), SmartAction::flag, SmartAction::flags, flags, SmartAction::fleeAssist, SmartAction::follow, SmartAction::force, SmartAction::forceDespawn, SmartAction::forceRespawnTimer, QuaternionData::fromEulerAnglesZYX(), SmartAction::gameEventStart, SmartAction::gameEventStop, SmartAction::gameObjectAction, SmartScriptHolder::GetActionType(), GetBaseObject(), GetBaseObjectOrPlayerTrigger(), InstanceScript::GetBossStateName(), WorldObject::GetCharmerOrOwnerPlayerOrPlayerItself(), WorldObject::GetContactPoint(), Unit::GetDirectTransport(), Object::GetEntry(), SmartScriptHolder::GetEventType(), Unit::GetGender(), Object::GetGUID(), Creature::GetHomePosition(), WorldObject::GetInstanceScript(), GetLastInvoker(), Creature::GetLootRecipient(), WorldObject::GetMap(), ThreatManager::GetModifiableThreatList(), Unit::GetMotionMaster(), WorldObject::GetName(), Position::GetOrientation(), ObjectAccessor::GetPlayer(), Position::GetPosition(), Position::GetPositionWithOffset(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), WorldObject::GetPrivateObjectOwner(), Creature::GetRespawnPosition(), SmartScriptHolder::GetScriptType(), GetStoredTargetVector(), GetTargets(), SmartScriptHolder::GetTargetType(), Unit::GetThreatManager(), Unit::GetTransGUID(), Creature::GetTransportHomePosition(), Unit::GetVehicleKit(), go, GO_READY, SmartAction::gossipMenuId, SmartAction::gossipNpcTextId, SmartAction::goState, Ground, SmartAction::group, Player::GroupEventHappens(), SmartAction::groupId, SmartAction::groupSpawn, Unit::HasAura(), Unit::HasUnitMovementFlag(), SmartAction::id, WaypointPath::id, SmartAction::idMax, SmartAction::idMin, SmartAction::immuneNPC, SmartAction::immunePC, SmartAction::inc, SmartAction::incEventPhase, SmartAction::includeDecayRatio, IncPhase(), SmartAction::ingamePhaseMask, InitTimer(), SmartAction::intensity, Unit::InterruptNonMeleeSpells(), SmartAction::interruptSpellCasting, SmartAction::invincHP, Unit::IsAIEnabled(), IsCharmedCreature(), IsCreature(), Unit::isDead(), ObjectGuid::IsEmpty(), IsGameObject(), IsPlayer(), WorldObject::IsPrivateObject(), IsSmart(), IsUnit(), SmartAction::item, EquipmentInfo::ItemEntry, SmartAction::jump, SmartAction::killedMonster, Unit::KillSelf(), LANG_ADDON, SmartScriptHolder::link, SmartAction::loadEquipment, M_PI, Position::m_positionX, Position::m_positionY, Position::m_positionZ, SmartAction::mapID, SmartAction::mask, SmartEvent::max, SmartAction::max, MAX_EQUIPMENT_ITEMS, SmartAction::maxDelay, SmartAction::maxId, me, mEvents, SmartEvent::min, SmartAction::min, SmartAction::minDelay, SmartAction::minHP, SmartAction::minId, SmartEvent::minMaxRepeat, mLastInvoker, mLastTextID, SmartAction::model, ThreatManager::ModifyThreatByPercent(), SmartAction::morphOrMount, SmartAction::move, MotionMaster::MoveIdle(), MOVEMENTFLAG_ONTRANSPORT, SmartAction::movementSlot, SmartAction::movementSpeed, SmartAction::movementType, MotionMaster::MovePoint(), SmartAction::moveRandom, MotionMaster::MoveRandom(), SmartAction::moveToPos, SmartAction::movie, mRemIDs, mStoredEvents, mTalkerEntry, mTextTimer, mUseTextTimer, SmartAction::newPower, WaypointPath::nodes, SmartTarget::o, SmartAction::onlyOwnedAuras, SmartAction::onlySelf, OnReset(), SmartAction::overrideLight, SmartAction::overrideLightId, SmartAction::overrideWeather, SmartAction::pathID, SmartAction::pauseMovement, SmartAction::pauseTimer, SmartAction::percent, PersonalSpawn, SmartAction::phase, SmartAction::phaseMax, SmartAction::phaseMin, SmartAction::phases, SmartAction::pointId, SmartAction::power, SmartAction::powerType, PreferUnit, ProcessEvent(), ProcessEventsFor(), SmartAction::quest, SmartAction::questID, SmartAction::questOffer, SmartAction::randomEmote, SmartAction::randomPhase, SmartAction::randomPhaseRange, Trinity::Containers::RandomResize(), SmartAction::randomSound, SmartAction::randomTimedEvent, SmartAction::randRangeTimedActionList, SmartAction::randTimedActionList, SmartAction::range, SmartAction::react, SmartAction::regenHealth, SmartAction::removeAura, SmartAction::repeat, SmartEvent::repeatMax, SmartAction::repeatMax, SmartEvent::repeatMin, SmartAction::repeatMin, SmartAction::reset, Map::Respawn(), SmartAction::respawnData, SmartAction::resumeMovement, SmartAction::resumeTimer, RetryLater(), roll_chance_i(), SmartAction::root, SmartAction::run, SmartScriptHolder::runOnce, sCreatureTextMgr, Trinity::Containers::SelectRandomContainerElement(), CreatureTextMgr::SendChatPacket(), SmartAction::sendGossipMenu, PlayerMenu::SendQuestGiverQuestDetails(), SmartAction::sendTargetToTarget, InstanceScript::SetBossState(), SmartAction::setCounter, GameObjectAI::SetData(), UnitAI::SetData(), SmartAction::setData, ZoneScript::SetData(), SmartAction::setDisableGravity, SmartAction::setEventPhase, Unit::SetFacingTo(), Unit::SetFacingToObject(), SmartAction::setGoLootState, ZoneScript::SetGuidData(), SmartAction::setHealthPct, SmartAction::setHealthRegen, Creature::SetHomePosition(), SmartAction::setHover, SmartAction::setImmuneNPC, SmartAction::setImmunePC, SmartAction::setInstanceData, SmartAction::setInstanceData64, SmartAI::SetInvincibilityHpLevel(), SetPhase(), SmartAction::setRangedMovement, SmartAction::setRoot, SmartAction::setRun, SmartAction::setSheath, Unit::SetSheath(), SetTimedActionList(), SmartAction::setUninteractible, SmartAction::setunitByte, sGameEventMgr, SmartAction::sheath, SmartAction::simpleTalk, SmartAction::slot1, SmartAction::slot2, SmartAction::slot3, SMART_ACTION_ACTIVATE_GAMEOBJECT, SMART_ACTION_ACTIVATE_GOBJECT, SMART_ACTION_ACTIVATE_TAXI, SMART_ACTION_ADD_ITEM, SMART_ACTION_ADD_NPC_FLAG, SMART_ACTION_ADD_POWER, SMART_ACTION_ADD_THREAT, SMART_ACTION_ADD_TO_STORED_TARGET_LIST, SMART_ACTION_ALLOW_COMBAT_MOVEMENT, SMART_ACTION_ATTACK_START, SMART_ACTION_ATTACK_STOP, SMART_ACTION_AUTO_ATTACK, SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS, SMART_ACTION_CALL_FOR_HELP, SMART_ACTION_CALL_GROUPEVENTHAPPENS, SMART_ACTION_CALL_KILLEDMONSTER, SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST, SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST, SMART_ACTION_CALL_SCRIPT_RESET, SMART_ACTION_CALL_TIMED_ACTIONLIST, SMART_ACTION_CAST, SMART_ACTION_CLOSE_GOSSIP, SMART_ACTION_COMBAT_STOP, SMART_ACTION_CREATE_TIMED_EVENT, SMART_ACTION_CROSS_CAST, SMART_ACTION_DESPAWN_SPAWNGROUP, SMART_ACTION_DIE, SMART_ACTION_DISABLE_EVADE, SMART_ACTION_ENABLE_TEMP_GOBJ, SMART_ACTION_EQUIP, SMART_ACTION_EVADE, SMART_ACTION_FAIL_QUEST, SMART_ACTION_FLEE_FOR_ASSIST, SMART_ACTION_FOLLOW, SMART_ACTION_FORCE_DESPAWN, SMART_ACTION_GAME_EVENT_START, SMART_ACTION_GAME_EVENT_STOP, SMART_ACTION_GO_SET_GO_STATE, SMART_ACTION_GO_SET_LOOT_STATE, SMART_ACTION_INC_EVENT_PHASE, SMART_ACTION_INTERRUPT_SPELL, SMART_ACTION_INVOKER_CAST, SMART_ACTION_JUMP_TO_POS, SMART_ACTION_KILL_UNIT, SMART_ACTION_LOAD_EQUIPMENT, SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL, SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL, SMART_ACTION_MOVE_OFFSET, SMART_ACTION_MOVE_TO_POS, SMART_ACTION_NONE, SMART_ACTION_OFFER_QUEST, SMART_ACTION_OVERRIDE_LIGHT, SMART_ACTION_OVERRIDE_WEATHER, SMART_ACTION_PAUSE_MOVEMENT, SMART_ACTION_PLAY_CINEMATIC, SMART_ACTION_PLAY_EMOTE, SMART_ACTION_PLAYMOVIE, SMART_ACTION_RANDOM_EMOTE, SMART_ACTION_RANDOM_MOVE, SMART_ACTION_RANDOM_PHASE, SMART_ACTION_RANDOM_PHASE_RANGE, SMART_ACTION_RANDOM_SOUND, SMART_ACTION_REMOVE_ITEM, SMART_ACTION_REMOVE_NPC_FLAG, SMART_ACTION_REMOVE_POWER, SMART_ACTION_REMOVE_TIMED_EVENT, SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1, SMART_ACTION_REMOVEAURASFROMSPELL, SMART_ACTION_RESET_GOBJECT, SMART_ACTION_RESPAWN_BY_SPAWNID, SMART_ACTION_RESUME_MOVEMENT, SMART_ACTION_SELF_CAST, SMART_ACTION_SEND_GOSSIP_MENU, SMART_ACTION_SEND_TARGET_TO_TARGET, SMART_ACTION_SET_ACTIVE, SMART_ACTION_SET_CORPSE_DELAY, SMART_ACTION_SET_COUNTER, SMART_ACTION_SET_DATA, SMART_ACTION_SET_DISABLE_GRAVITY, SMART_ACTION_SET_EMOTE_STATE, SMART_ACTION_SET_EVENT_PHASE, SMART_ACTION_SET_FACTION, SMART_ACTION_SET_HEALTH_PCT, SMART_ACTION_SET_HEALTH_REGEN, SMART_ACTION_SET_HOME_POS, SMART_ACTION_SET_HOVER, SMART_ACTION_SET_IMMUNE_NPC, SMART_ACTION_SET_IMMUNE_PC, SMART_ACTION_SET_IN_COMBAT_WITH_ZONE, SMART_ACTION_SET_INGAME_PHASE_MASK, SMART_ACTION_SET_INST_DATA, SMART_ACTION_SET_INST_DATA64, SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL, SMART_ACTION_SET_MOVEMENT_SPEED, SMART_ACTION_SET_NPC_FLAG, SMART_ACTION_SET_ORIENTATION, SMART_ACTION_SET_POWER, SMART_ACTION_SET_RANGED_MOVEMENT, SMART_ACTION_SET_REACT_STATE, SMART_ACTION_SET_ROOT, SMART_ACTION_SET_RUN, SMART_ACTION_SET_SHEATH, SMART_ACTION_SET_UNINTERACTIBLE, SMART_ACTION_SET_UNIT_FIELD_BYTES_1, SMART_ACTION_SET_VISIBILITY, SMART_ACTION_SIMPLE_TALK, SMART_ACTION_SOUND, SMART_ACTION_SPAWN_SPAWNGROUP, SMART_ACTION_START_CLOSEST_WAYPOINT, SMART_ACTION_STORE_TARGET_LIST, SMART_ACTION_SUMMON_CREATURE, SMART_ACTION_SUMMON_CREATURE_GROUP, SMART_ACTION_SUMMON_GO, SMART_ACTION_TALK, SMART_ACTION_TELEPORT, SMART_ACTION_THREAT_ALL_PCT, SMART_ACTION_THREAT_SINGLE_PCT, SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT, SMART_ACTION_TRIGGER_TIMED_EVENT, SMART_ACTION_UPDATE_TEMPLATE, SMART_ACTION_WP_PAUSE, SMART_ACTION_WP_RESUME, SMART_ACTION_WP_START, SMART_ACTION_WP_STOP, SMART_ESCORT_TARGETS, SMART_EVENT_FLAG_NOT_REPEATABLE, SMART_EVENT_FLAG_TEMP_IGNORE_CHANCE_ROLL, SMART_EVENT_FLAG_WHILE_CHARMED, SMART_EVENT_LINK, SMART_EVENT_TIMED_EVENT_TRIGGERED, SMART_EVENT_UPDATE, SMART_EVENT_UPDATE_IC, SMART_RANDOM_POINT, SMART_TARGET_ACTION_INVOKER, SMART_TARGET_CLOSEST_CREATURE, SMART_TARGET_CLOSEST_ENEMY, SMART_TARGET_CLOSEST_FRIENDLY, SMART_TARGET_CLOSEST_GAMEOBJECT, SMART_TARGET_CLOSEST_UNSPAWNED_GAMEOBJECT, SMART_TARGET_CREATURE_DISTANCE, SMART_TARGET_CREATURE_GUID, SMART_TARGET_CREATURE_RANGE, SMART_TARGET_GAMEOBJECT_DISTANCE, SMART_TARGET_GAMEOBJECT_GUID, SMART_TARGET_GAMEOBJECT_RANGE, SMART_TARGET_NONE, SMART_TARGET_OWNER_OR_SUMMONER, SMART_TARGET_POSITION, SMART_TARGET_SELF, SMARTAI_SPAWN_FLAG_FORCE_SPAWN, SMARTAI_SPAWN_FLAG_IGNORE_RESPAWN, SMARTAI_SPAWN_FLAG_NOSAVE_RESPAWN, SMARTCAST_AURA_NOT_PRESENT, SMARTCAST_COMBAT_MOVE, SMARTCAST_INTERRUPT_PREVIOUS, SMARTCAST_TRIGGERED, sObjectMgr, SmartAction::sound, SmartAction::sounds, SmartAction::spawnflags, Map::SpawnGroupDespawn(), Map::SpawnGroupSpawn(), SmartAction::spawnId, SmartAction::spawnType, SmartAction::speedFraction, SmartAction::speedInteger, SmartAction::speedxy, SmartAction::speedz, SmartAction::spell, SPELL_CAST_OK, SPELL_FAILED_SPELL_IN_PROGRESS, SmartAction::spell_id, SmartAction::state, StoreCounter(), StoreTargetList(), SmartAction::storeTargets, SmartAction::summonCreature, WorldObject::SummonCreature(), WorldObject::SummonCreatureGroup(), WorldObject::SummonGameObject(), SmartAction::summonGO, SmartAction::summonType, sWaypointMgr, SmartAction::talk, SmartScriptHolder::target, SmartAction::targetParam1, SmartAction::targetParam2, SmartAction::targetParam3, SmartAction::targetsLimit, SmartAction::targetType, SmartAction::taxi, TC_LOG_DEBUG, TC_LOG_ERROR, TC_LOG_WARN, TEAM_OTHER, SmartAction::teleport, TEXT_RANGE_NORMAL, SmartAction::textGroupID, SmartAction::threat, SmartAction::threatDEC, SmartAction::threatINC, SmartAction::threatPCT, SmartAction::timedActionList, SmartAction::timeEvent, SmartAction::timer, Object::ToCreature(), Object::ToGameObject(), Object::ToPlayer(), SmartAction::toRespawnPosition, ObjectGuid::ToString(), Object::ToUnit(), SmartAction::transitionMilliseconds, SmartAction::transport, TRIGGERED_FULL_MASK, TRIGGERED_NONE, SmartAction::triggerFlags, SmartEvent::type, SmartAction::type, SmartTarget::type, SmartAction::uninteractible, UNIT_FLAG_IMMUNE_TO_NPC, UNIT_FLAG_IMMUNE_TO_PC, UNIT_FLAG_UNINTERACTIBLE, UNIT_STAND_STATE_STAND, UNIT_STATE_ROOT, SmartAction::updateLevel, SmartAction::updateTemplate, urand(), SmartAction::useTalkTarget, SmartAction::value, SmartAction::visibility, SmartAction::weatherId, SmartAction::withDelayed, SmartAction::withEmote, SmartAction::withInstant, SmartAction::wpPause, SmartAction::wps, SmartAction::wpStart, SmartAction::wpStop, SmartTarget::x, SmartTarget::y, SmartTarget::z, and SmartAction::zoneId.

Referenced by ProcessEvent(), and ProcessTimedAction().

◆ ProcessEvent()

void SmartScript::ProcessEvent ( SmartScriptHolder &  e,
Unit *  unit = nullptr,
uint32  var0 = 0,
uint32  var1 = 0,
bool  bvar = false,
SpellInfo const *  spell = nullptr,
GameObject *  gob = nullptr 
)

Definition at line 2767 of file SmartScript.cpp.

References SmartEvent::action, SmartScriptHolder::active, SmartEvent::Any, SmartEvent::area, SmartEvent::areatrigger, SmartEvent::aura, SmartEvent::charm, SmartEvent::cooldownMax, SmartEvent::cooldownMin, SmartEvent::count, SmartEvent::counter, SmartEvent::creature, SmartEvent::creatureEntry, CURRENT_GENERIC_SPELL, SmartEvent::dataSet, SmartEvent::dist, SmartEvent::distance, SmartEvent::doAction, DoFindFriendlyCC(), DoFindFriendlyMissingBuff(), DoSelectLowestHpPercentFriendly(), SmartEvent::emote, Unit::EnsureVictim(), SmartEvent::entry, SmartScriptHolder::event, SmartEvent::event_flags, SmartEvent::event_phase_mask, SmartEvent::eventId, SmartEvent::eventInform, SmartEvent::filter, FindCreatureNear(), FindGameObjectNear(), SmartEvent::friendlyCC, SmartEvent::friendlyHealthPct, SmartEvent::gameEvent, SmartEvent::gameEventId, Unit::GetAuraCount(), GetBaseObject(), GetCounterValue(), WorldObject::GetCreatureListWithEntryInGrid(), Unit::GetCurrentSpell(), Object::GetEntry(), SmartScriptHolder::GetEventType(), WorldObject::GetGameObjectListWithEntryInGrid(), Unit::GetHealthPct(), Unit::GetMaxHealth(), Unit::GetMaxPower(), Unit::GetPowerPct(), GetTargets(), SmartScriptHolder::GetTargetType(), Object::GetTypeId(), Unit::GetVictim(), SmartEvent::goLootStateChanged, SmartEvent::gossip, SmartEvent::gossipHello, SmartEvent::guid, SmartEvent::Hostile, SmartEvent::hostilityMode, SmartEvent::id, SpellInfo::Id, SmartEvent::instancePlayerEnter, IsCharmedCreature(), IsCreature(), Creature::IsEngaged(), WorldObject::IsFriendlyTo(), WorldObject::IsHostileTo(), IsInPhase(), WorldObject::IsInRange(), Unit::IsNonMeleeSpellCast(), IsUnit(), WorldObject::IsWithinDistInMap(), WorldObject::IsWithinLOSInMap(), SmartEvent::kill, SmartEvent::lootState, SmartEvent::los, SmartEvent::map, SmartEvent::max, SmartEvent::maxDist, SmartEvent::maxHpPct, me, SmartEvent::min, SmartEvent::minHpPct, SmartEvent::minMax, SmartEvent::minMaxRepeat, SmartEvent::missingBuff, SmartEvent::movementInform, SmartEvent::NotHostile, SmartEvent::onRemove, SmartEvent::pathID, SmartEvent::playerOnly, SmartEvent::pointID, POWER_MANA, ProcessAction(), ProcessTimedAction(), SmartEvent::quest, SmartEvent::radius, RecalcTimer(), SmartEvent::repeat, SmartEvent::repeatMax, SmartEvent::repeatMin, SmartEvent::respawn, SmartScriptHolder::runOnce, SmartEvent::school, SpellInfo::SchoolMask, Trinity::Containers::SelectRandomContainerElement(), SmartEvent::sender, SMART_EVENT_ACCEPTED_QUEST, SMART_EVENT_ACTION_DONE, SMART_EVENT_AGGRO, SMART_EVENT_AI_INIT, SMART_EVENT_AREATRIGGER_ONTRIGGER, SMART_EVENT_CHARMED, SMART_EVENT_CORPSE_REMOVED, SMART_EVENT_COUNTER_SET, SMART_EVENT_DAMAGED, SMART_EVENT_DAMAGED_TARGET, SMART_EVENT_DATA_SET, SMART_EVENT_DEATH, SMART_EVENT_DISTANCE_CREATURE, SMART_EVENT_DISTANCE_GAMEOBJECT, SMART_EVENT_EVADE, SMART_EVENT_FLAG_NOT_REPEATABLE, SMART_EVENT_FLAG_WHILE_CHARMED, SMART_EVENT_FOLLOW_COMPLETED, SMART_EVENT_FRIENDLY_HEALTH_PCT, SMART_EVENT_FRIENDLY_IS_CC, SMART_EVENT_FRIENDLY_MISSING_BUFF, SMART_EVENT_GAME_EVENT_END, SMART_EVENT_GAME_EVENT_START, SMART_EVENT_GO_EVENT_INFORM, SMART_EVENT_GO_LOOT_STATE_CHANGED, SMART_EVENT_GOSSIP_HELLO, SMART_EVENT_GOSSIP_SELECT, SMART_EVENT_HAS_AURA, SMART_EVENT_HEALTH_PCT, SMART_EVENT_IC_LOS, SMART_EVENT_INSTANCE_PLAYER_ENTER, SMART_EVENT_JUST_CREATED, SMART_EVENT_JUST_SUMMONED, SMART_EVENT_KILL, SMART_EVENT_LINK, SMART_EVENT_MANA_PCT, SMART_EVENT_MOVEMENTINFORM, SMART_EVENT_ON_AURA_APPLIED, SMART_EVENT_ON_AURA_REMOVED, SMART_EVENT_ON_DESPAWN, SMART_EVENT_ON_SPELL_CAST, SMART_EVENT_ON_SPELL_FAILED, SMART_EVENT_ON_SPELL_START, SMART_EVENT_ON_SPELLCLICK, SMART_EVENT_OOC_LOS, SMART_EVENT_PASSENGER_BOARDED, SMART_EVENT_PASSENGER_REMOVED, SMART_EVENT_QUEST_ACCEPTED, SMART_EVENT_QUEST_COMPLETION, SMART_EVENT_QUEST_FAIL, SMART_EVENT_QUEST_OBJ_COMPLETION, SMART_EVENT_QUEST_REWARDED, SMART_EVENT_RANGE, SMART_EVENT_REACHED_HOME, SMART_EVENT_RECEIVE_EMOTE, SMART_EVENT_RECEIVE_HEAL, SMART_EVENT_RESET, SMART_EVENT_RESPAWN, SMART_EVENT_REWARD_QUEST, SMART_EVENT_SPELLHIT, SMART_EVENT_SPELLHIT_TARGET, SMART_EVENT_SUMMON_DESPAWNED, SMART_EVENT_SUMMONED_UNIT, SMART_EVENT_SUMMONED_UNIT_DIES, SMART_EVENT_TARGET_BUFFED, SMART_EVENT_TEXT_OVER, SMART_EVENT_TIMED_EVENT_TRIGGERED, SMART_EVENT_TRANSPORT_ADDCREATURE, SMART_EVENT_TRANSPORT_ADDPLAYER, SMART_EVENT_TRANSPORT_RELOCATE, SMART_EVENT_TRANSPORT_REMOVE_PLAYER, SMART_EVENT_UPDATE, SMART_EVENT_UPDATE_IC, SMART_EVENT_UPDATE_OOC, SMART_EVENT_VICTIM_CASTING, SMART_EVENT_WAYPOINT_ENDED, SMART_EVENT_WAYPOINT_PAUSED, SMART_EVENT_WAYPOINT_REACHED, SMART_EVENT_WAYPOINT_RESUMED, SMART_EVENT_WAYPOINT_STOPPED, SMART_SCRIPT_RESPAWN_CONDITION_AREA, SMART_SCRIPT_RESPAWN_CONDITION_MAP, SMART_TARGET_ACTION_INVOKER, SMART_TARGET_CLOSEST_CREATURE, SMART_TARGET_CLOSEST_PLAYER, SMART_TARGET_CREATURE_DISTANCE, SMART_TARGET_CREATURE_GUID, SMART_TARGET_CREATURE_RANGE, SMART_TARGET_PLAYER_DISTANCE, SMART_TARGET_PLAYER_RANGE, SmartEvent::spell, SmartEvent::spellCast, SmartEvent::spellHit, SmartEvent::spellId, SmartEvent::summoned, SmartEvent::targetCasting, TC_LOG_DEBUG, TC_LOG_ERROR, SmartEvent::team, SmartEvent::textGroupID, SmartEvent::textOver, SmartEvent::timedEvent, Object::ToUnit(), SmartEvent::transportAddCreature, SmartEvent::transportRelocate, SmartEvent::type, TYPEID_PLAYER, SmartEvent::value, and SmartEvent::waypoint.

Referenced by ProcessAction(), ProcessEventsFor(), and UpdateTimer().

◆ ProcessEventsFor()

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 
)

Definition at line 231 of file SmartScript.cpp.

References GetBaseObject(), GetDebugInfo(), MAX_NESTED_EVENTS, mEvents, mNestedEventsCounter, ProcessEvent(), sConditionMgr, SMART_EVENT_LINK, and TC_LOG_WARN.

Referenced by SmartAI::CorpseRemoved(), SmartAI::DamageDealt(), SmartAI::DamageTaken(), SmartGameObjectAI::Destroyed(), SmartAI::DoAction(), SmartAI::EndPath(), SmartAI::EnterEvadeMode(), SmartGameObjectAI::EventInform(), SmartAI::HealReceived(), SmartGameObjectAI::InitializeAI(), SmartAI::IsSummonedBy(), SmartAI::JustAppeared(), SmartAI::JustDied(), SmartAI::JustEngagedWith(), SmartAI::JustReachedHome(), SmartAI::JustSummoned(), SmartGameObjectAI::JustSummoned(), SmartAI::KilledUnit(), SmartAI::MovementInform(), SmartAI::OnAuraApplied(), SmartAI::OnAuraRemoved(), SmartAI::OnCharmed(), SmartAI::OnDespawn(), SmartAI::OnGameEvent(), SmartGameObjectAI::OnGameEvent(), SmartAI::OnGossipHello(), SmartGameObjectAI::OnGossipHello(), SmartAI::OnGossipSelect(), SmartGameObjectAI::OnGossipSelect(), OnInitialize(), SmartGameObjectAI::OnLootStateChanged(), OnMoveInLineOfSight(), SmartAI::OnQuestAccept(), SmartGameObjectAI::OnQuestAccept(), SmartAI::OnQuestReward(), SmartGameObjectAI::OnQuestReward(), SmartGameObjectAI::OnReportUse(), OnReset(), SmartAI::OnSpellCast(), SmartAI::OnSpellClick(), SmartAI::OnSpellFailed(), SmartAI::OnSpellStart(), SmartTrigger::OnTrigger(), OnUpdate(), SmartAI::PassengerBoarded(), SmartAI::PausePath(), ProcessAction(), SmartAI::ReceiveEmote(), SmartAI::ResumePath(), SmartAI::SetData(), SmartGameObjectAI::SetData(), SmartAI::SpellHit(), SmartGameObjectAI::SpellHit(), SmartAI::SpellHitTarget(), SmartAI::StopFollow(), SmartAI::StopPath(), StoreCounter(), SmartAI::SummonedCreatureDespawn(), SmartGameObjectAI::SummonedCreatureDespawn(), SmartAI::SummonedCreatureDies(), SmartGameObjectAI::SummonedCreatureDies(), SmartAI::UpdatePath(), SmartAI::WaypointPathEnded(), and SmartAI::WaypointReached().

◆ ProcessTimedAction()

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 
)

◆ RaisePriority()

void SmartScript::RaisePriority ( SmartScriptHolder &  e)
private

◆ RecalcTimer()

void SmartScript::RecalcTimer ( SmartScriptHolder &  e,
uint32  min,
uint32  max 
)
static

◆ RemoveStoredEvent()

void SmartScript::RemoveStoredEvent ( uint32  id)
private

Definition at line 3459 of file SmartScript.cpp.

References mStoredEvents.

Referenced by OnUpdate().

◆ ResetBaseObject()

void SmartScript::ResetBaseObject ( )

◆ RetryLater()

void SmartScript::RetryLater ( SmartScriptHolder &  e,
bool  ignoreChanceRoll = false 
)
private

◆ SetPathId()

void SmartScript::SetPathId ( uint32  id)
inline

Definition at line 53 of file SmartScript.h.

Referenced by SmartAI::EndPath(), and SmartAI::LoadPath().

◆ SetPhase()

void SmartScript::SetPhase ( uint32  p)
private

Definition at line 3863 of file SmartScript.cpp.

References mEventPhase.

Referenced by DecPhase(), IncPhase(), and ProcessAction().

◆ SetTimedActionList()

◆ SortEvents()

void SmartScript::SortEvents ( SmartAIEventList &  events)
private

Definition at line 3608 of file SmartScript.cpp.

Referenced by OnUpdate().

◆ StoreCounter()

void SmartScript::StoreCounter ( uint32  id,
uint32  value,
uint32  reset 
)

Definition at line 133 of file SmartScript.cpp.

References mCounterList, ProcessEventsFor(), and SMART_EVENT_COUNTER_SET.

Referenced by ProcessAction().

◆ StoreTargetList()

void SmartScript::StoreTargetList ( ObjectVector const &  targets,
uint32  id 
)

Definition at line 110 of file SmartScript.cpp.

References _storedTargets.

Referenced by ProcessAction().

◆ UpdateTimer()

Member Data Documentation

◆ _storedTargets

ObjectVectorMap SmartScript::_storedTargets
private

Definition at line 138 of file SmartScript.h.

Referenced by AddToStoredTargetList(), GetStoredTargetVector(), and StoreTargetList().

◆ atPlayer

Player* SmartScript::atPlayer
private

Definition at line 117 of file SmartScript.h.

Referenced by GetBaseObjectOrPlayerTrigger(), OnInitialize(), and SmartScript().

◆ go

◆ goOrigGUID

ObjectGuid SmartScript::goOrigGUID
private

Definition at line 116 of file SmartScript.h.

Referenced by ResetBaseObject().

◆ isProcessingTimedActionList

bool SmartScript::isProcessingTimedActionList
private

Definition at line 112 of file SmartScript.h.

Referenced by OnUpdate(), SetTimedActionList(), and SmartScript().

◆ mAllEventFlags

uint32 SmartScript::mAllEventFlags
private

Definition at line 133 of file SmartScript.h.

Referenced by FillScript(), and SmartScript().

◆ MAX_NESTED_EVENTS

constexpr uint32 SmartScript::MAX_NESTED_EVENTS = 10
staticconstexprprivate

Definition at line 136 of file SmartScript.h.

Referenced by ProcessEventsFor().

◆ mCounterList

CounterMap SmartScript::mCounterList

Definition at line 94 of file SmartScript.h.

Referenced by GetCounterValue(), OnInitialize(), and StoreCounter().

◆ mCurrentPriority

uint32 SmartScript::mCurrentPriority
private

Definition at line 130 of file SmartScript.h.

Referenced by RaisePriority(), and SmartScript().

◆ me

◆ meOrigGUID

ObjectGuid SmartScript::meOrigGUID
private

Definition at line 114 of file SmartScript.h.

Referenced by ResetBaseObject().

◆ mEventPhase

uint32 SmartScript::mEventPhase
private

Definition at line 120 of file SmartScript.h.

Referenced by DecPhase(), IncPhase(), IsInPhase(), SetPhase(), and SmartScript().

◆ mEvents

SmartAIEventList SmartScript::mEvents
private

◆ mEventSortingRequired

bool SmartScript::mEventSortingRequired
private

Definition at line 131 of file SmartScript.h.

Referenced by OnReset(), OnUpdate(), RaisePriority(), SmartScript(), and UpdateTimer().

◆ mInstallEvents

SmartAIEventList SmartScript::mInstallEvents
private

Definition at line 109 of file SmartScript.h.

Referenced by InstallEvents().

◆ mLastInvoker

ObjectGuid SmartScript::mLastInvoker

Definition at line 92 of file SmartScript.h.

Referenced by GetLastInvoker(), OnReset(), and ProcessAction().

◆ mLastTextID

uint32 SmartScript::mLastTextID
private

Definition at line 127 of file SmartScript.h.

Referenced by OnUpdate(), ProcessAction(), and SmartScript().

◆ mNestedEventsCounter

uint32 SmartScript::mNestedEventsCounter
private

Definition at line 132 of file SmartScript.h.

Referenced by ProcessEventsFor(), and SmartScript().

◆ mPathId

uint32 SmartScript::mPathId
private

Definition at line 122 of file SmartScript.h.

Referenced by SmartScript().

◆ mRemIDs

std::vector<uint32> SmartScript::mRemIDs
private

Definition at line 124 of file SmartScript.h.

Referenced by OnUpdate(), and ProcessAction().

◆ mScriptType

SmartScriptType SmartScript::mScriptType
private

Definition at line 119 of file SmartScript.h.

Referenced by GetScript(), OnInitialize(), OnUpdate(), and SmartScript().

◆ mStoredEvents

SmartAIEventStoredList SmartScript::mStoredEvents
private

Definition at line 123 of file SmartScript.h.

Referenced by OnUpdate(), ProcessAction(), and RemoveStoredEvent().

◆ mTalkerEntry

uint32 SmartScript::mTalkerEntry
private

Definition at line 128 of file SmartScript.h.

Referenced by OnUpdate(), ProcessAction(), and SmartScript().

◆ mTextTimer

uint32 SmartScript::mTextTimer
private

Definition at line 126 of file SmartScript.h.

Referenced by OnUpdate(), ProcessAction(), and SmartScript().

◆ mTimedActionList

SmartAIEventList SmartScript::mTimedActionList
private

Definition at line 110 of file SmartScript.h.

Referenced by OnUpdate(), SetTimedActionList(), and UpdateTimer().

◆ mTimedActionListInvoker

ObjectGuid SmartScript::mTimedActionListInvoker
private

Definition at line 111 of file SmartScript.h.

Referenced by SetTimedActionList(), and UpdateTimer().

◆ mUseTextTimer

bool SmartScript::mUseTextTimer
private

Definition at line 129 of file SmartScript.h.

Referenced by OnUpdate(), ProcessAction(), and SmartScript().

◆ trigger

AreaTriggerEntry const* SmartScript::trigger
private

Definition at line 118 of file SmartScript.h.

Referenced by GetBaseObjectOrPlayerTrigger(), GetScript(), OnInitialize(), and SmartScript().


The documentation for this class was generated from the following files: