![]() |
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.
References areaTrigger, go, isProcessingTimedActionList, mAllEventFlags, mCurrentPriority, me, mEventPhase, mEventSortingRequired, mLastTextID, mNestedEventsCounter, mPathId, mScriptType, mTalkerEntry, mTextTimer, mUseTextTimer, player, quest, sceneTemplate, SMART_SCRIPT_TYPE_CREATURE, and trigger.
|
default |
|
defaultnoexcept |
|
default |
| void SmartScript::AddToStoredTargetList | ( | ObjectVector const & | targets, |
| uint32 | id | ||
| ) |
Definition at line 133 of file SmartScript.cpp.
References _storedTargets.
Referenced by ProcessAction().
| void SmartScript::ClearTargetList | ( | uint32 | id | ) |
Definition at line 121 of file SmartScript.cpp.
References _storedTargets.
Referenced by ProcessAction().
|
static |
Definition at line 2742 of file SmartScript.cpp.
References SmartScriptHolder::action, SmartScriptHolder::event, SmartEvent::event_chance, SmartEvent::event_flags, SmartEvent::event_phase_mask, InitTimer(), SmartEvent::param1, SmartAction::param1, SmartTarget::param1, SmartEvent::param2, SmartAction::param2, SmartTarget::param2, SmartEvent::param3, SmartAction::param3, SmartTarget::param3, SmartEvent::param4, SmartAction::param4, SmartTarget::param4, SmartEvent::param5, SmartAction::param5, SmartAction::param6, SmartAction::param7, SmartTarget::param_string, SmartEvent::raw, SmartAction::raw, SmartTarget::raw, SMART_SCRIPT_TYPE_CREATURE, SmartScriptHolder::source_type, SmartScriptHolder::target, SmartEvent::type, SmartAction::type, and SmartTarget::type.
Referenced by ProcessAction().
|
private |
Definition at line 4351 of file SmartScript.cpp.
References mEventPhase, and SetPhase().
Referenced by ProcessAction().
| Unit * SmartScript::DoFindClosestFriendlyInRange | ( | float | range, |
| bool | playerOnly | ||
| ) | const |
Definition at line 4284 of file SmartScript.cpp.
References me, and Cell::VisitAllObjects().
Referenced by GetTargets().
| void SmartScript::DoFindFriendlyCC | ( | std::vector< Creature * > & | creatures, |
| float | range | ||
| ) | const |
Definition at line 4264 of file SmartScript.cpp.
References me, and Cell::VisitGridObjects().
Referenced by ProcessEvent().
| void SmartScript::DoFindFriendlyMissingBuff | ( | std::vector< Creature * > & | creatures, |
| float | range, | ||
| uint32 | spellid | ||
| ) | const |
Definition at line 4274 of file SmartScript.cpp.
References me, and Cell::VisitGridObjects().
Referenced by ProcessEvent().
Definition at line 4239 of file SmartScript.cpp.
References me, and Cell::VisitGridObjects().
| Unit * SmartScript::DoSelectLowestHpPercentFriendly | ( | float | range, |
| uint32 | minHpPct, | ||
| uint32 | maxHpPct | ||
| ) | const |
Definition at line 4252 of file SmartScript.cpp.
References me, and Cell::VisitGridObjects().
Referenced by ProcessEvent().
| void SmartScript::FillScript | ( | SmartAIEventList && | e, |
| WorldObject * | obj, | ||
| AreaTriggerEntry const * | at, | ||
| SceneTemplate const * | scene, | ||
| Quest const * | quest, | ||
| uint32 | event = 0 |
||
| ) |
Definition at line 4031 of file SmartScript.cpp.
References event, Map::GetDifficultyID(), Object::GetEntry(), WorldObject::GetMap(), Quest::GetQuestId(), AreaTriggerEntry::ID, mAllEventFlags, mEvents, quest, SceneTemplate::SceneId, SMART_EVENT_FLAG_DEBUG_ONLY, and TC_LOG_DEBUG.
Referenced by GetScript().
| Creature * SmartScript::FindCreatureNear | ( | WorldObject * | searchObject, |
| ObjectGuid::LowType | guid | ||
| ) | const |
Definition at line 182 of file SmartScript.cpp.
References Map::GetCreatureBySpawnIdStore(), and WorldObject::GetMap().
Referenced by GetTargets(), and ProcessEvent().
| GameObject * SmartScript::FindGameObjectNear | ( | WorldObject * | searchObject, |
| ObjectGuid::LowType | guid | ||
| ) | const |
Definition at line 173 of file SmartScript.cpp.
References Map::GetGameObjectBySpawnIdStore(), and WorldObject::GetMap().
Referenced by GetTargets(), and ProcessEvent().
| WorldObject * SmartScript::GetBaseObject | ( | ) | const |
Definition at line 3892 of file SmartScript.cpp.
References areaTrigger, go, me, and player.
Referenced by GetBaseObjectOrUnitInvoker(), GetLastInvoker(), GetTargets(), OnUpdate(), ProcessAction(), ProcessEvent(), ProcessEventsFor(), and ProcessTimedAction().
| WorldObject * SmartScript::GetBaseObjectOrUnitInvoker | ( | Unit * | invoker | ) |
Definition at line 3906 of file SmartScript.cpp.
References GetBaseObject().
Referenced by ProcessAction().
Definition at line 165 of file SmartScript.cpp.
References mCounterList.
Referenced by ProcessEvent().
Definition at line 4333 of file SmartScript.cpp.
References GetBaseObject(), ObjectAccessor::GetUnit(), and mLastInvoker.
Referenced by GetTargets(), and ProcessAction().
|
inline |
Definition at line 65 of file SmartScript.h.
Referenced by SmartAI::EndPath().
| void SmartScript::GetScript | ( | ) |
Definition at line 4075 of file SmartScript.cpp.
References areaTrigger, event, FillScript(), Object::GetEntry(), Quest::GetQuestId(), Creature::GetSpawnId(), GameObject::GetSpawnId(), go, AreaTriggerEntry::ID, me, mScriptType, quest, SceneTemplate::SceneId, sceneTemplate, SMART_SCRIPT_TYPE_AREATRIGGER, SMART_SCRIPT_TYPE_AREATRIGGER_ENTITY, SMART_SCRIPT_TYPE_AREATRIGGER_ENTITY_CUSTOM, SMART_SCRIPT_TYPE_CREATURE, SMART_SCRIPT_TYPE_EVENT, SMART_SCRIPT_TYPE_GAMEOBJECT, SMART_SCRIPT_TYPE_QUEST, SMART_SCRIPT_TYPE_SCENE, sSmartScriptMgr, and trigger.
Referenced by OnInitialize().
| ObjectVector const * SmartScript::GetStoredTargetVector | ( | uint32 | id, |
| WorldObject const & | ref | ||
| ) | const |
Definition at line 141 of file SmartScript.cpp.
References _storedTargets.
Referenced by SmartAI::EndPath(), GetTargets(), and ProcessAction().
| void SmartScript::GetTargets | ( | ObjectVector & | targets, |
| SmartScriptHolder const & | e, | ||
| WorldObject * | invoker = nullptr |
||
| ) | const |
Definition at line 2776 of file SmartScript.cpp.
References Creature::AI(), Unit::CanHaveThreatList(), SmartTarget::closestAttackable, SmartTarget::closestFriendly, SmartTarget::dbGuid, SmartTarget::dist, DoFindClosestFriendlyInRange(), SmartTarget::entry, SmartScriptHolder::entryOrGuid, SmartScriptHolder::event_id, SmartTarget::farthest, SmartTarget::findCreatureAliveState, FindCreatureNear(), FindGameObjectNear(), WorldObject::FindNearestCreatureWithOptions(), WorldObject::FindNearestGameObjectWithOptions(), WorldObject::FindNearestUnspawnedGameObject(), gameObjects, SmartScriptHolder::GetActionType(), Vehicle::GetBase(), GetBaseObject(), WorldObject::GetCharmerOrOwnerGUID(), Unit::GetCharmerOrOwnerGUID(), Unit::GetCreatorGUID(), WorldObject::GetCreatureListWithOptionsInGrid(), WorldObject::GetGameObjectListWithOptionsInGrid(), Player::GetGroup(), GetLastInvoker(), GameObject::GetOwnerGUID(), ObjectAccessor::GetPlayer(), WorldObject::GetPlayerListInGrid(), SmartScriptHolder::GetScriptType(), GetStoredTargetVector(), Creature::GetTapList(), SmartScriptHolder::GetTargetType(), Unit::GetThreatManager(), ObjectAccessor::GetUnit(), ThreatManager::GetUnsortedThreatList(), Unit::GetVehicle(), Unit::GetVehicleKit(), Unit::GetVictim(), ObjectAccessor::GetWorldObject(), go, SmartTarget::goClosest, SmartTarget::goDistance, SmartTarget::goGUID, SmartTarget::goRange, SmartTarget::hostilRandom, SmartTarget::id, SmartTarget::isInLos, Unit::IsVehicle(), Unit::IsWithinCombatRange(), WorldObject::IsWithinDist(), SmartTarget::maxDist, MaxDistance, SmartTarget::maxSize, MaxThreat, me, SmartTarget::minDist, MinThreat, SmartTarget::owner, SmartTarget::param_string, player, 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().
|
inline |
Definition at line 68 of file SmartScript.h.
|
private |
Definition at line 4345 of file SmartScript.cpp.
References mEventPhase, SetPhase(), and SMART_EVENT_PHASE_12.
Referenced by ProcessAction().
|
static |
Definition at line 3751 of file SmartScript.cpp.
References SmartScriptHolder::active, SmartEvent::distance, SmartScriptHolder::event, SmartScriptHolder::GetEventType(), SmartEvent::max, SmartEvent::min, SmartEvent::minMaxRepeat, RecalcTimer(), SmartEvent::repeat, SMART_EVENT_DISTANCE_CREATURE, SMART_EVENT_DISTANCE_GAMEOBJECT, SMART_EVENT_UPDATE, SMART_EVENT_UPDATE_IC, and SMART_EVENT_UPDATE_OOC.
Referenced by CreateSmartEvent(), OnInitialize(), OnReset(), ProcessAction(), and SetTimedActionList().
|
private |
Definition at line 4364 of file SmartScript.cpp.
References mEventPhase.
Referenced by ProcessEvent(), and UpdateTimer().
| bool SmartScript::IsSmart | ( | bool | silent = false | ) | const |
Definition at line 112 of file SmartScript.cpp.
| bool SmartScript::IsSmart | ( | Creature * | c, |
| bool | silent = false |
||
| ) | const |
Definition at line 82 of file SmartScript.cpp.
References Creature::AI(), Object::GetEntry(), Creature::GetSpawnId(), me, TC_LOG_ERROR, and UI64LIT.
Referenced by IsSmart(), and ProcessAction().
| bool SmartScript::IsSmart | ( | GameObject * | g, |
| bool | silent = false |
||
| ) | const |
Definition at line 97 of file SmartScript.cpp.
References GameObject::AI(), Object::GetEntry(), GameObject::GetSpawnId(), go, TC_LOG_ERROR, and UI64LIT.
| void SmartScript::OnInitialize | ( | WorldObject * | obj, |
| AreaTriggerEntry const * | at = nullptr, |
||
| SceneTemplate const * | scene = nullptr, |
||
| Quest const * | qst = nullptr, |
||
| uint32 | evnt = 0 |
||
| ) |
Definition at line 4120 of file SmartScript.cpp.
References areaTrigger, event, Object::GetEntry(), BaseEntity::GetGUID(), Quest::GetQuestId(), GetScript(), BaseEntity::GetTypeId(), go, AreaTriggerEntry::ID, InitTimer(), BaseEntity::IsCreature(), AreaTrigger::IsCustom(), BaseEntity::IsGameObject(), BaseEntity::IsPlayer(), mCounterList, me, mEvents, mScriptType, player, ProcessEventsFor(), quest, SceneTemplate::SceneId, sceneTemplate, SMART_EVENT_AI_INIT, SMART_EVENT_JUST_CREATED, SMART_SCRIPT_TYPE_AREATRIGGER, SMART_SCRIPT_TYPE_AREATRIGGER_ENTITY, SMART_SCRIPT_TYPE_AREATRIGGER_ENTITY_CUSTOM, SMART_SCRIPT_TYPE_CREATURE, SMART_SCRIPT_TYPE_EVENT, SMART_SCRIPT_TYPE_GAMEOBJECT, SMART_SCRIPT_TYPE_QUEST, SMART_SCRIPT_TYPE_SCENE, TC_LOG_DEBUG, TC_LOG_ERROR, Object::ToAreaTrigger(), Object::ToCreature(), Object::ToGameObject(), Object::ToPlayer(), trigger, TYPEID_AREATRIGGER, TYPEID_GAMEOBJECT, and TYPEID_UNIT.
Referenced by SmartAI::InitializeAI(), SmartGameObjectAI::InitializeAI(), SmartTrigger::OnExit(), SmartAreaTriggerAI::OnInitialize(), SmartQuest::OnQuestObjectiveChange(), SmartQuest::OnQuestStatusChange(), SmartScene::OnSceneCancel(), SmartScene::OnSceneComplete(), SmartScene::OnSceneStart(), SmartScene::OnSceneTriggerEvent(), SmartTrigger::OnTrigger(), and SmartEventTrigger::OnTrigger().
| void SmartScript::OnMoveInLineOfSight | ( | Unit * | who | ) |
Definition at line 4230 of file SmartScript.cpp.
References Creature::IsEngaged(), me, ProcessEventsFor(), SMART_EVENT_IC_LOS, and SMART_EVENT_OOC_LOS.
Referenced by SmartAI::MoveInLineOfSight().
| void SmartScript::OnReset | ( | ) |
Definition at line 196 of file SmartScript.cpp.
References ObjectGuid::Clear(), SmartScriptHolder::DEFAULT_PRIORITY, event, InitTimer(), mEvents, mEventSortingRequired, mLastInvoker, ProcessEventsFor(), ResetBaseObject(), SMART_EVENT_FLAG_DONT_RESET, and SMART_EVENT_RESET.
Referenced by SmartAI::EnterEvadeMode(), SmartAI::JustAppeared(), SmartAI::JustReachedHome(), ProcessAction(), and SmartGameObjectAI::Reset().
| void SmartScript::OnUpdate | ( | const uint32 | diff | ) |
Definition at line 3911 of file SmartScript.cpp.
References SmartScriptHolder::enableTimed, GetBaseObject(), Creature::IsInEvadeMode(), isProcessingTimedActionList, me, mEvents, mEventSortingRequired, mLastTextID, mRemIDs, mScriptType, mStoredEvents, mTalkerEntry, mTextTimer, mTimedActionList, mUseTextTimer, ProcessEventsFor(), RemoveStoredEvent(), SMART_EVENT_TEXT_OVER, SMART_SCRIPT_TYPE_AREATRIGGER_ENTITY, SMART_SCRIPT_TYPE_AREATRIGGER_ENTITY_CUSTOM, SMART_SCRIPT_TYPE_CREATURE, SMART_SCRIPT_TYPE_GAMEOBJECT, SortEvents(), and UpdateTimer().
Referenced by SmartAreaTriggerAI::OnUpdate(), SmartAI::UpdateAI(), and SmartGameObjectAI::UpdateAI().
|
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.
References SmartScriptHolder::action, SmartAction::actionId, SmartAction::actionLists, SmartAction::activateGameObject, SmartAction::active, PhasingHandler::AddPhase(), PhasingHandler::AddPhaseGroup(), Player::AddQuestAndCheckCompletion(), ThreatManager::AddThreat(), AddToStoredTargetList(), SmartAction::addToStoredTargets, Creature::AI(), GameObject::AI(), SmartAction::angle, SmartAction::animKit, SmartAction::apply, Player::AreaExploredOrEventHappens(), SmartAction::areaLightId, SmartAction::attack, AttackInvoker, SmartAction::attackInvoker, CreatureAI::AttackStart(), AURA_REMOVE_BY_EXPIRE, SmartAction::autoAttack, SmartAction::becomePersonalClone, BROADCAST_TEXT_CALL_FOR_HELP, BROADCAST_TEXT_FLEE_FOR_ASSIST, SmartAction::byte1, Creature::CallForHelp(), SmartAction::callHelp, Unit::CanHaveThreatList(), Player::CanTakeQuest(), SmartAction::cast, CAST_AI, SmartAction::castFlags, WorldObject::CastSpell(), SmartAction::chance, SmartAction::charges, CHAT_MSG_ADDON, CHAT_MSG_MONSTER_EMOTE, ObjectMgr::ChooseDisplayId(), SmartAction::cinematic, ClearTargetList(), SmartAction::combatMove, Unit::CombatStop(), Player::CompleteQuest(), SmartAction::ContactDistance, advstd::ranges::contains, SmartAction::conversation, SmartAction::corpseDelay, SmartAction::count, SmartAction::counterId, Conversation::CreateConversation(), SmartAction::createdBySpell, CreateSmartEvent(), SmartAction::creature, CreatureModel::CreatureDisplayID, SmartAction::creatureGroup, SmartAction::credit, SmartAction::creditType, SmartAction::crossCast, SmartAction::data, SmartAction::dec, DecPhase(), Default, SmartAction::delay, Unit::DeMorph(), SmartAction::despawnTime, SmartAction::destroyConversation, DIFFICULTY_NONE, SmartAction::directAdd, SmartAction::disable, SmartAction::disableEvade, SmartAction::disablePathfinding, Unit::Dismount(), SmartAction::dist, SmartAction::distance, SmartAction::doAction, Creature::DoFleeToGetAssistance(), CreatureAI::DoZoneInCombat(), SmartAction::duration, SmartAction::emote, SmartAction::emotes, SmartAction::enable, SmartAction::enableTempGO, ENSURE_AI, CreatureAI::EnterEvadeMode(), SmartAction::enterVehicle, Unit::EnterVehicle(), SmartAction::entry, SmartScriptHolder::entryOrGuid, SmartAction::equip, SmartAction::evade, SmartScriptHolder::event, SmartEvent::event_chance, SmartEvent::event_flags, SmartScriptHolder::event_id, SmartAction::eventId, SmartAction::faction, SmartAction::factionID, SmartAction::FadeObjectDuration, SmartAction::fail, SmartAction::field, SmartAction::flag, SmartAction::flags, flags, SmartAction::fleeAssist, SmartAction::follow, SmartAction::force, SmartAction::forceDespawn, SmartAction::forceRespawnTimer, QuaternionData::fromOrientation(), RefManager< ReferenceType >::front(), SmartAction::gameEventStart, SmartAction::gameEventStop, SmartAction::gameObjectAction, SmartScriptHolder::GetActionType(), PhasingHandler::GetAlwaysVisiblePhaseShift(), Unit::GetAura(), GetBaseObject(), GetBaseObjectOrUnitInvoker(), InstanceScript::GetBossStateName(), WorldObject::GetContactPoint(), Unit::GetDirectTransport(), Object::GetEntry(), SmartScriptHolder::GetEventType(), Unit::GetGender(), Player::GetGossipTextId(), BaseEntity::GetGUID(), Creature::GetHomePosition(), WorldObject::GetInstanceScript(), GetLastInvoker(), WorldObject::GetMap(), ThreatManager::GetModifiableThreatList(), Unit::GetMotionMaster(), WorldObject::GetName(), Position::GetOrientation(), ObjectAccessor::GetPlayer(), Position::GetPosition(), Position::GetPositionWithOffset(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), WorldObject::GetPrivateObjectOwner(), Player::GetQuestStatus(), Creature::GetRespawnPosition(), Scripting::v2::ActionResult< T >::GetResultSetter(), SmartScriptHolder::GetScriptType(), GetStoredTargetVector(), Creature::GetTapList(), GetTargets(), SmartScriptHolder::GetTargetType(), Unit::GetThreatManager(), WorldObject::GetTransport(), Creature::GetTransportHomePosition(), go, GO_READY, SmartAction::gossipMenuId, SmartAction::gossipNpcTextId, SmartAction::goState, Ground, SmartAction::group, SmartAction::groupId, SmartAction::groupSpawn, Quest::HasFlag(), SmartAction::id, WaypointPath::Id, SmartAction::idMax, SmartAction::idMin, SmartAction::immuneNPC, SmartAction::immunePC, SmartAction::inc, SmartAction::incEventPhase, SmartAction::includeDecayRatio, IncPhase(), SmartAction::ingamePhaseGroup, SmartAction::ingamePhaseId, InitTimer(), SmartAction::intensity, Interrupted, Unit::InterruptNonMeleeSpells(), SmartAction::interruptSpellCasting, SmartAction::invincHP, Unit::IsAIEnabled(), Unit::IsCharmed(), BaseEntity::IsCreature(), Unit::isDead(), SmartAction::isPrivate, WorldObject::IsPrivateObject(), IsSmart(), BaseEntity::IsUnit(), SmartAction::item, ItemId, EquipmentInfo::Items, SmartAction::jump, SmartAction::killedMonster, Player::KilledMonsterCredit(), Unit::KillSelf(), SmartAction::kitType, LANG_ADDON, SmartAction::loadEquipment, M_PI, SmartAction::mapID, SmartAction::mask, SmartEvent::max, SmartAction::max, MAX_EQUIPMENT_ITEMS, SmartAction::maxDelay, SmartAction::maxHeight, SmartAction::maxId, me, SmartEvent::min, SmartAction::min, SmartAction::minDelay, SmartAction::minHeight, SmartAction::minHP, SmartAction::minId, SmartEvent::minMaxRepeat, mLastInvoker, mLastTextID, SmartAction::model, ThreatManager::ModifyThreatByPercent(), SmartAction::morphOrMount, Unit::Mount(), SmartAction::move, MotionMaster::MoveIdle(), MotionMaster::MoveJump(), SmartAction::movementSlot, SmartAction::movementSpeed, SmartAction::movementType, SmartAction::moveOffset, MotionMaster::MovePoint(), SmartAction::moveRandom, MotionMaster::MoveRandom(), SmartAction::moveToPos, SmartAction::movie, mRemIDs, mStoredEvents, mTalkerEntry, mTextTimer, mTimedActionList, mTimedActionWaitEvent, mUseTextTimer, SmartAction::newPower, WaypointPath::Nodes, Normal, GameTime::Now(), SmartTarget::o, SmartAction::onlyOwnedAuras, SmartAction::onlySelf, OnReset(), SmartAction::overrideLight, SmartAction::overrideLightId, SmartAction::overrideWeather, SmartAction::param, SmartAction::param_string, SmartAction::pathID, SmartAction::pauseMovement, SmartAction::pauseTimer, SmartAction::percent, PersonalSpawn, SmartAction::phase, SmartAction::phaseMax, SmartAction::phaseMin, SmartAction::phases, player, Player::PlayerTalkClass, SmartAction::pointId, SmartAction::PointId, SmartAction::power, SmartAction::powerType, PreferUnit, Player::PrepareGossipMenu(), ProcessEventsFor(), quest, SmartAction::quest, QUEST_FLAGS_COMPLETION_AREA_TRIGGER, QUEST_FLAGS_COMPLETION_EVENT, QUEST_FLAGS_TRACKING_EVENT, QUEST_STATUS_INCOMPLETE, QUEST_STATUS_REWARDED, 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, Unit::RemoveAllAuras(), SmartAction::removeAura, Unit::RemoveAurasDueToSpell(), PhasingHandler::RemovePhase(), PhasingHandler::RemovePhaseGroup(), SmartAction::repeat, SmartEvent::repeatMax, SmartAction::repeatMax, SmartEvent::repeatMin, SmartAction::repeatMin, SmartAction::reset, Map::Respawn(), SmartAction::respawnData, SmartAction::resumeMovement, SmartAction::resumeTimer, RetryLater(), roll_chance(), SmartAction::root, SmartAction::run, SmartScriptHolder::runOnce, SmartAction::scene, SmartAction::sceneId, sCreatureTextMgr, SmartAction::seatId, Trinity::Containers::SelectRandomContainerElement(), CreatureTextMgr::SendChatPacket(), SmartAction::sendGossipMenu, SmartAction::sendTargetToTarget, InstanceScript::SetBossState(), Creature::SetCanMelee(), SmartAction::setCounter, UnitAI::SetData(), GameObjectAI::SetData(), SmartAction::setData, ZoneScript::SetData(), SmartAction::setDisableGravity, Creature::SetDisplayId(), 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, Scripting::v2::ActionResultSetter< T >::SetResult(), SmartAction::setRoot, SmartAction::setRun, CastSpellExtraArgs::SetScriptResult(), CastSpellExtraArgs::SetScriptWaitsForSpellHit(), 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_BECOME_PERSONAL_CLONE_FOR_PLAYER, SMART_ACTION_BOARD_PASSENGER, SMART_ACTION_CALL_FOR_HELP, 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_COMPLETE_QUEST, SMART_ACTION_CREATE_CONVERSATION, SMART_ACTION_CREATE_TIMED_EVENT, SMART_ACTION_CREDIT_QUEST_OBJECTIVE_TALK_TO, SMART_ACTION_CROSS_CAST, SMART_ACTION_DESPAWN_SPAWNGROUP, SMART_ACTION_DESTROY_CONVERSATION, SMART_ACTION_DIE, SMART_ACTION_DISABLE_EVADE, SMART_ACTION_DO_ACTION, SMART_ACTION_ENABLE_TEMP_GOBJ, SMART_ACTION_ENTER_VEHICLE, SMART_ACTION_EQUIP, SMART_ACTION_EVADE, SMART_ACTION_EXIT_VEHICLE, SMART_ACTION_FAIL_QUEST, SMART_ACTION_FALL, 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_ANIMKIT, SMART_ACTION_PLAY_CINEMATIC, SMART_ACTION_PLAY_EMOTE, SMART_ACTION_PLAY_SPELL_VISUAL_KIT, 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_SCENE_CANCEL, SMART_ACTION_SCENE_PLAY, 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_GROUP, SMART_ACTION_SET_INGAME_PHASE_ID, 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_GAME_EVENT, 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_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, SMARTCAST_WAIT_FOR_HIT, sObjectMgr, SmartAction::sound, SmartAction::sounds, SmartAction::spawnflags, Map::SpawnGroupDespawn(), Map::SpawnGroupSpawn(), SmartAction::spawnId, SmartAction::spawnType, SmartAction::speedFraction, SmartAction::speedInteger, SmartAction::SpeedXY, SmartAction::spell, SPELL_CAST_OK, SPELL_EFFECT_SUMMON, SPELL_FAILED_BAD_TARGETS, SPELL_FAILED_SPELL_IN_PROGRESS, SmartAction::spell_id, SmartAction::spellVisualKit, SmartAction::spellVisualKitId, sSpellMgr, sSummonPropertiesStore, SmartAction::state, StoreCounter(), SmartAction::storedTargetId, StoreTargetList(), SmartAction::storeTargets, SmartAction::summonCreature, Map::SummonCreature(), WorldObject::SummonCreatureGroup(), WorldObject::SummonGameObject(), SmartAction::summonGO, WorldObject::SummonPersonalClone(), SmartAction::summonType, sWaypointMgr, SmartAction::talk, Player::TalkedToCreature(), SmartScriptHolder::target, SmartAction::targetParam1, SmartAction::targetParam2, SmartAction::targetParam3, SmartAction::targetParam4, SmartAction::targetsLimit, SmartAction::targetType, 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::ToAreaTrigger(), Object::ToCreature(), Object::ToGameObject(), Object::ToPlayer(), SmartAction::toRespawnPosition, Object::ToUnit(), SmartAction::transitionMilliseconds, SmartAction::transport, GameEvents::Trigger(), TRIGGERED_FULL_MASK, SmartAction::triggerFlags, CastSpellExtraArgsInit::TriggerFlags, SmartAction::triggerGameEvent, SmartEvent::type, SmartAction::type, SmartTarget::type, SmartAction::uninteractible, UNIT_FLAG_IMMUNE_TO_NPC, UNIT_FLAG_IMMUNE_TO_PC, UNIT_STAND_STATE_STAND, SmartAction::updateLevel, SmartAction::updateTemplate, urand(), SmartAction::useSaiTargetAsGameEventSource, SmartAction::useTalkTarget, SmartAction::value, SmartAction::visibility, Cell::VisitGridObjects(), SmartAction::weatherId, SmartAction::withDelayed, SmartAction::withEmote, SmartAction::withInstant, SmartAction::wpPause, SmartAction::wpStart, SmartAction::wpStop, SmartTarget::x, SmartTarget::y, SmartTarget::z, and SmartAction::zoneId.
Referenced by ProcessEvent(), and ProcessTimedAction().
| 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 3176 of file SmartScript.cpp.
References SmartEvent::action, SmartScriptHolder::active, SmartEvent::Any, SmartEvent::area, 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(), BaseEntity::GetTypeId(), Unit::GetVictim(), SmartEvent::goLootStateChanged, SmartEvent::gossip, SmartEvent::gossipHello, SmartEvent::guid, SmartEvent::Hostile, SmartEvent::hostilityMode, SmartEvent::id, SpellInfo::Id, SmartEvent::instancePlayerEnter, Unit::IsAlive(), Unit::IsCharmed(), BaseEntity::IsCreature(), Creature::IsEngaged(), WorldObject::IsFriendlyTo(), WorldObject::IsHostileTo(), Unit::IsInCombat(), Creature::IsInEvadeMode(), IsInPhase(), WorldObject::IsInRange(), Unit::IsNonMeleeSpellCast(), 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::param_string, SmartEvent::pathID, SmartEvent::playerOnly, SmartEvent::pointID, POWER_MANA, ProcessAction(), ProcessTimedAction(), SmartEvent::quest, SmartEvent::questObjective, 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_ENTER, SMART_EVENT_AREATRIGGER_EXIT, 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_SCENE_CANCEL, SMART_EVENT_SCENE_COMPLETE, SMART_EVENT_SCENE_START, SMART_EVENT_SCENE_TRIGGER, SMART_EVENT_SEND_EVENT_TRIGGER, 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::ToCreature(), Object::ToUnit(), SmartEvent::transportAddCreature, SmartEvent::transportRelocate, SmartEvent::type, TYPEID_PLAYER, SmartEvent::value, and SmartEvent::waypoint.
Referenced by ProcessEventsFor(), and UpdateTimer().
| 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.
References event, 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(), SmartTrigger::OnExit(), SmartAI::OnGameEvent(), SmartGameObjectAI::OnGameEvent(), SmartAI::OnGossipHello(), SmartGameObjectAI::OnGossipHello(), SmartAI::OnGossipSelect(), SmartGameObjectAI::OnGossipSelect(), OnInitialize(), SmartGameObjectAI::OnLootStateChanged(), OnMoveInLineOfSight(), SmartAI::OnQuestAccept(), SmartGameObjectAI::OnQuestAccept(), SmartQuest::OnQuestObjectiveChange(), SmartAI::OnQuestReward(), SmartGameObjectAI::OnQuestReward(), SmartQuest::OnQuestStatusChange(), SmartGameObjectAI::OnReportUse(), OnReset(), SmartScene::OnSceneCancel(), SmartScene::OnSceneComplete(), SmartScene::OnSceneStart(), SmartScene::OnSceneTriggerEvent(), SmartAI::OnSpellCast(), SmartAI::OnSpellClick(), SmartAI::OnSpellFailed(), SmartAI::OnSpellStart(), SmartTrigger::OnTrigger(), SmartEventTrigger::OnTrigger(), SmartAreaTriggerAI::OnUnitEnter(), SmartAreaTriggerAI::OnUnitExit(), 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().
| 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 2730 of file SmartScript.cpp.
References SmartScriptHolder::entryOrGuid, SmartScriptHolder::event_id, GetBaseObject(), ProcessAction(), RecalcTimer(), sConditionMgr, and SmartScriptHolder::source_type.
Referenced by ProcessEvent().
|
private |
Definition at line 4009 of file SmartScript.cpp.
References SmartScriptHolder::DEFAULT_PRIORITY, mCurrentPriority, mEventSortingRequired, SmartScriptHolder::priority, and SmartScriptHolder::timer.
Referenced by RetryLater(), and UpdateTimer().
|
static |
Definition at line 3770 of file SmartScript.cpp.
References SmartScriptHolder::active, SmartScriptHolder::timer, and urand().
Referenced by InitTimer(), ProcessEvent(), and ProcessTimedAction().
|
private |
Definition at line 3877 of file SmartScript.cpp.
References mStoredEvents.
Referenced by OnUpdate().
| void SmartScript::ResetBaseObject | ( | ) |
Definition at line 217 of file SmartScript.cpp.
References areaTrigger, ObjectGuid::Clear(), ObjectAccessor::GetCreature(), ObjectAccessor::GetGameObject(), go, goOrigGUID, ObjectGuid::IsEmpty(), me, meOrigGUID, and player.
Referenced by OnReset().
|
private |
Definition at line 4020 of file SmartScript.cpp.
References SmartScriptHolder::event, SmartEvent::event_flags, RaisePriority(), SmartScriptHolder::runOnce, and SMART_EVENT_FLAG_TEMP_IGNORE_CHANCE_ROLL.
Referenced by ProcessAction().
|
inline |
Definition at line 64 of file SmartScript.h.
Referenced by SmartAI::EndPath(), and SmartAI::LoadPath().
|
private |
Definition at line 4359 of file SmartScript.cpp.
References mEventPhase.
Referenced by DecPhase(), IncPhase(), and ProcessAction().
| void SmartScript::SetTimedActionList | ( | SmartScriptHolder & | e, |
| uint32 | entry, | ||
| Unit * | invoker, | ||
| uint32 | startFromEventId = 0 |
||
| ) |
Definition at line 4296 of file SmartScript.cpp.
References SmartScriptHolder::action, SmartAction::allowOverride, ObjectGuid::Empty, SmartScriptHolder::entryOrGuid, Trinity::Containers::EraseIf(), SmartScriptHolder::event_id, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetEventType(), BaseEntity::GetGUID(), SmartScriptHolder::GetScriptType(), InitTimer(), isProcessingTimedActionList, mTimedActionList, mTimedActionListInvoker, SMART_ACTION_CALL_TIMED_ACTIONLIST, SMART_EVENT_UPDATE, SMART_EVENT_UPDATE_IC, SMART_EVENT_UPDATE_OOC, SMART_SCRIPT_TYPE_TIMED_ACTIONLIST, sSmartScriptMgr, TC_LOG_ERROR, SmartAction::timedActionList, and SmartAction::timerType.
Referenced by ProcessAction(), SmartGameObjectAI::SetTimedActionList(), SmartAreaTriggerAI::SetTimedActionList(), and SmartAI::SetTimedActionList().
|
private |
Definition at line 4004 of file SmartScript.cpp.
Referenced by OnUpdate().
Definition at line 149 of file SmartScript.cpp.
References mCounterList, ProcessEventsFor(), and SMART_EVENT_COUNTER_SET.
Referenced by ProcessAction().
| void SmartScript::StoreTargetList | ( | ObjectVector const & | targets, |
| uint32 | id | ||
| ) |
Definition at line 126 of file SmartScript.cpp.
References _storedTargets.
Referenced by ProcessAction().
| void SmartScript::UpdateTimer | ( | SmartScriptHolder & | e, |
| uint32 const | diff | ||
| ) |
Definition at line 3777 of file SmartScript.cpp.
References SmartScriptHolder::action, SmartScriptHolder::active, SmartAction::cast, SmartAction::castFlags, SmartScriptHolder::DEFAULT_PRIORITY, SmartScriptHolder::enableTimed, SmartScriptHolder::event, SmartScriptHolder::event_id, SmartEvent::event_phase_mask, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetEventType(), SmartScriptHolder::GetScriptType(), ObjectAccessor::GetUnit(), Unit::HasUnitState(), ObjectGuid::IsEmpty(), Creature::IsEngaged(), IsInPhase(), me, mEventSortingRequired, mTimedActionList, mTimedActionListInvoker, mTimedActionWaitEvent, SmartScriptHolder::priority, ProcessEvent(), RaisePriority(), SMART_ACTION_CAST, SMART_ACTION_FLEE_FOR_ASSIST, SMART_EVENT_DISTANCE_CREATURE, SMART_EVENT_DISTANCE_GAMEOBJECT, SMART_EVENT_FRIENDLY_HEALTH_PCT, SMART_EVENT_FRIENDLY_IS_CC, SMART_EVENT_FRIENDLY_MISSING_BUFF, SMART_EVENT_HAS_AURA, SMART_EVENT_HEALTH_PCT, SMART_EVENT_LINK, SMART_EVENT_MANA_PCT, SMART_EVENT_RANGE, SMART_EVENT_TARGET_BUFFED, SMART_EVENT_UPDATE, SMART_EVENT_UPDATE_IC, SMART_EVENT_UPDATE_OOC, SMART_EVENT_VICTIM_CASTING, SMART_SCRIPT_TYPE_TIMED_ACTIONLIST, SMARTCAST_INTERRUPT_PREVIOUS, SmartScriptHolder::timer, UNIT_STATE_CASTING, UNIT_STATE_LOST_CONTROL, and UNIT_STATE_ROOT.
Referenced by OnUpdate().
|
private |
Definition at line 149 of file SmartScript.h.
Referenced by AddToStoredTargetList(), ClearTargetList(), GetStoredTargetVector(), and StoreTargetList().
|
private |
Definition at line 126 of file SmartScript.h.
Referenced by GetBaseObject(), GetScript(), OnInitialize(), ResetBaseObject(), and SmartScript().
|
private |
Definition at line 129 of file SmartScript.h.
Referenced by FillScript(), GetScript(), OnInitialize(), OnReset(), and ProcessEventsFor().
|
private |
Definition at line 122 of file SmartScript.h.
Referenced by GetBaseObject(), GetScript(), GetTargets(), IsSmart(), IsSmart(), OnInitialize(), ProcessAction(), ResetBaseObject(), and SmartScript().
|
private |
Definition at line 123 of file SmartScript.h.
Referenced by ResetBaseObject().
|
private |
Definition at line 119 of file SmartScript.h.
Referenced by OnUpdate(), SetTimedActionList(), and SmartScript().
|
private |
Definition at line 144 of file SmartScript.h.
Referenced by FillScript(), and SmartScript().
|
staticconstexprprivate |
Definition at line 147 of file SmartScript.h.
Referenced by ProcessEventsFor().
| CounterMap SmartScript::mCounterList |
Definition at line 101 of file SmartScript.h.
Referenced by GetCounterValue(), OnInitialize(), and StoreCounter().
|
private |
Definition at line 141 of file SmartScript.h.
Referenced by RaisePriority(), and SmartScript().
|
private |
Definition at line 120 of file SmartScript.h.
Referenced by DoFindClosestFriendlyInRange(), DoFindFriendlyCC(), DoFindFriendlyMissingBuff(), DoSelectLowestHpFriendly(), DoSelectLowestHpPercentFriendly(), GetBaseObject(), GetScript(), GetTargets(), IsSmart(), IsSmart(), OnInitialize(), OnMoveInLineOfSight(), OnUpdate(), ProcessAction(), ProcessEvent(), ResetBaseObject(), SmartScript(), and UpdateTimer().
|
private |
Definition at line 121 of file SmartScript.h.
Referenced by ResetBaseObject().
|
private |
Definition at line 131 of file SmartScript.h.
Referenced by DecPhase(), IncPhase(), IsInPhase(), SetPhase(), and SmartScript().
|
private |
Definition at line 115 of file SmartScript.h.
Referenced by FillScript(), OnInitialize(), OnReset(), OnUpdate(), and ProcessEventsFor().
|
private |
Definition at line 142 of file SmartScript.h.
Referenced by OnReset(), OnUpdate(), RaisePriority(), SmartScript(), and UpdateTimer().
| ObjectGuid SmartScript::mLastInvoker |
Definition at line 99 of file SmartScript.h.
Referenced by GetLastInvoker(), OnReset(), and ProcessAction().
|
private |
Definition at line 138 of file SmartScript.h.
Referenced by OnUpdate(), ProcessAction(), and SmartScript().
|
private |
Definition at line 143 of file SmartScript.h.
Referenced by ProcessEventsFor(), and SmartScript().
|
private |
Definition at line 133 of file SmartScript.h.
Referenced by SmartScript().
|
private |
Definition at line 135 of file SmartScript.h.
Referenced by OnUpdate(), and ProcessAction().
|
private |
Definition at line 130 of file SmartScript.h.
Referenced by GetScript(), OnInitialize(), OnUpdate(), and SmartScript().
|
private |
Definition at line 134 of file SmartScript.h.
Referenced by OnUpdate(), ProcessAction(), and RemoveStoredEvent().
|
private |
Definition at line 139 of file SmartScript.h.
Referenced by OnUpdate(), ProcessAction(), and SmartScript().
|
private |
Definition at line 137 of file SmartScript.h.
Referenced by OnUpdate(), ProcessAction(), and SmartScript().
|
private |
Definition at line 116 of file SmartScript.h.
Referenced by OnUpdate(), ProcessAction(), SetTimedActionList(), and UpdateTimer().
|
private |
Definition at line 117 of file SmartScript.h.
Referenced by SetTimedActionList(), and UpdateTimer().
|
private |
Definition at line 118 of file SmartScript.h.
Referenced by ProcessAction(), and UpdateTimer().
|
private |
Definition at line 140 of file SmartScript.h.
Referenced by OnUpdate(), ProcessAction(), and SmartScript().
|
private |
Definition at line 124 of file SmartScript.h.
Referenced by GetBaseObject(), GetTargets(), OnInitialize(), ProcessAction(), ResetBaseObject(), and SmartScript().
|
private |
Definition at line 128 of file SmartScript.h.
Referenced by FillScript(), GetScript(), OnInitialize(), ProcessAction(), and SmartScript().
|
private |
Definition at line 127 of file SmartScript.h.
Referenced by GetScript(), OnInitialize(), and SmartScript().
|
private |
Definition at line 125 of file SmartScript.h.
Referenced by GetScript(), OnInitialize(), and SmartScript().