![]() |
TrinityCore
|
#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) |
Static Private Attributes | |
| static constexpr uint32 | MAX_NESTED_EVENTS = 10 |
Definition at line 32 of file SmartScript.h.
| typedef std::unordered_map<uint32, uint32> SmartScript::CounterMap |
Definition at line 93 of file SmartScript.h.
| SmartScript::SmartScript | ( | ) |
Definition at line 47 of file SmartScript.cpp.
References atPlayer, go, isProcessingTimedActionList, mAllEventFlags, mCurrentPriority, me, mEventPhase, mEventSortingRequired, mLastTextID, mNestedEventsCounter, mPathId, mScriptType, mTalkerEntry, mTextTimer, mUseTextTimer, SMART_SCRIPT_TYPE_CREATURE, and trigger.
| SmartScript::~SmartScript | ( | ) |
Definition at line 67 of file SmartScript.cpp.
| void SmartScript::AddToStoredTargetList | ( | ObjectVector const & | targets, |
| uint32 | id | ||
| ) |
Definition at line 117 of file SmartScript.cpp.
References _storedTargets.
Referenced by ProcessAction().
| bool SmartScript::CheckTimer | ( | SmartScriptHolder const & | e | ) | const |
Definition at line 3443 of file SmartScript.cpp.
References SmartScriptHolder::active.
|
static |
Definition at line 2363 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, 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 3855 of file SmartScript.cpp.
References mEventPhase, and SetPhase().
Referenced by ProcessAction().
| Unit * SmartScript::DoFindClosestFriendlyInRange | ( | float | range, |
| bool | playerOnly | ||
| ) | const |
Definition at line 3791 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 3771 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 3781 of file SmartScript.cpp.
References me, and Cell::VisitGridObjects().
Referenced by ProcessEvent().
Definition at line 3747 of file SmartScript.cpp.
References me, and Cell::VisitGridObjects().
| 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().
| void SmartScript::FillScript | ( | SmartAIEventList | e, |
| WorldObject * | obj, | ||
| AreaTriggerEntry const * | at | ||
| ) |
Definition at line 3635 of file SmartScript.cpp.
References Object::GetEntry(), WorldObject::GetMap(), Map::GetSpawnMode(), AreaTriggerEntry::ID, Map::IsDungeon(), mAllEventFlags, mEvents, SMART_EVENT_FLAG_DEBUG_ONLY, SMART_EVENT_FLAG_DIFFICULTY_ALL, and TC_LOG_DEBUG.
Referenced by GetScript().
| 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().
| 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().
| WorldObject * SmartScript::GetBaseObject | ( | ) | const |
Definition at line 3474 of file SmartScript.cpp.
Referenced by GetBaseObjectOrPlayerTrigger(), GetLastInvoker(), GetTargets(), OnUpdate(), ProcessAction(), ProcessEvent(), ProcessEventsFor(), and ProcessTimedAction().
| WorldObject * SmartScript::GetBaseObjectOrPlayerTrigger | ( | ) | const |
Definition at line 3484 of file SmartScript.cpp.
References atPlayer, GetBaseObject(), and trigger.
Referenced by GetTargets(), GetWorldObjectsInDist(), and ProcessAction().
Definition at line 149 of file SmartScript.cpp.
References mCounterList.
Referenced by ProcessEvent().
Definition at line 3837 of file SmartScript.cpp.
References GetBaseObject(), ObjectAccessor::GetUnit(), and mLastInvoker.
Referenced by GetTargets(), and ProcessAction().
|
inline |
Definition at line 54 of file SmartScript.h.
Referenced by SmartAI::EndPath().
| void SmartScript::GetScript | ( | ) |
Definition at line 3665 of file SmartScript.cpp.
References FillScript(), Object::GetEntry(), Creature::GetSpawnId(), GameObject::GetSpawnId(), go, AreaTriggerEntry::ID, me, mScriptType, sSmartScriptMgr, and trigger.
Referenced by OnInitialize().
| 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().
| 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().
| void SmartScript::GetWorldObjectsInDist | ( | ObjectVector & | objects, |
| float | dist | ||
| ) | const |
Definition at line 2756 of file SmartScript.cpp.
References GetBaseObjectOrPlayerTrigger(), and Cell::VisitAllObjects().
Referenced by GetTargets().
|
inline |
Definition at line 57 of file SmartScript.h.
|
private |
Definition at line 3849 of file SmartScript.cpp.
References mEventPhase, SetPhase(), and SMART_EVENT_PHASE_12.
Referenced by ProcessAction().
|
static |
Definition at line 3320 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 3448 of file SmartScript.cpp.
References mEvents, and mInstallEvents.
Referenced by OnInitialize(), and OnUpdate().
|
static |
Definition at line 3504 of file SmartScript.cpp.
References Object::ToCreature().
Referenced by ProcessAction(), and ProcessEvent().
|
static |
Definition at line 3499 of file SmartScript.cpp.
References Object::GetTypeId(), and TYPEID_UNIT.
Referenced by GetTargets(), ProcessAction(), and ProcessEvent().
|
static |
Definition at line 3515 of file SmartScript.cpp.
References Object::GetTypeId(), and TYPEID_GAMEOBJECT.
Referenced by GetTargets(), and ProcessAction().
|
private |
Definition at line 3868 of file SmartScript.cpp.
References mEventPhase.
Referenced by ProcessEvent(), and UpdateTimer().
|
static |
Definition at line 3494 of file SmartScript.cpp.
References Object::GetTypeId(), and TYPEID_PLAYER.
Referenced by SmartAI::EndPath(), GetTargets(), SmartAI::IsEscortInvokerInRange(), and ProcessAction().
| bool SmartScript::IsSmart | ( | bool | silent = false | ) | const |
Definition at line 101 of file SmartScript.cpp.
| 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().
| bool SmartScript::IsSmart | ( | GameObject * | g, |
| bool | silent = false |
||
| ) | const |
Definition at line 86 of file SmartScript.cpp.
References GameObject::AI(), Object::GetEntry(), GameObject::GetSpawnId(), go, and TC_LOG_ERROR.
|
static |
Definition at line 3489 of file SmartScript.cpp.
References Object::GetTypeId(), TYPEID_PLAYER, and TYPEID_UNIT.
Referenced by ProcessAction(), and ProcessEvent().
| void SmartScript::OnInitialize | ( | WorldObject * | obj, |
| AreaTriggerEntry const * | at = nullptr |
||
| ) |
Definition at line 3689 of file SmartScript.cpp.
References atPlayer, Object::GetEntry(), Object::GetGUID(), GetScript(), Object::GetTypeId(), go, AreaTriggerEntry::ID, InitTimer(), InstallEvents(), mCounterList, me, mEvents, mScriptType, ProcessEventsFor(), SMART_EVENT_AI_INIT, SMART_EVENT_JUST_CREATED, SMART_SCRIPT_TYPE_AREATRIGGER, SMART_SCRIPT_TYPE_CREATURE, SMART_SCRIPT_TYPE_GAMEOBJECT, TC_LOG_DEBUG, TC_LOG_ERROR, Object::ToCreature(), Object::ToGameObject(), Object::ToPlayer(), ObjectGuid::ToString(), trigger, TYPEID_GAMEOBJECT, TYPEID_PLAYER, and TYPEID_UNIT.
Referenced by SmartAI::InitializeAI(), SmartGameObjectAI::InitializeAI(), and SmartTrigger::OnTrigger().
| void SmartScript::OnMoveInLineOfSight | ( | Unit * | who | ) |
Definition at line 3738 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 180 of file SmartScript.cpp.
References ObjectGuid::Clear(), SmartScriptHolder::DEFAULT_PRIORITY, 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 3520 of file SmartScript.cpp.
References GetBaseObject(), InstallEvents(), Creature::IsInEvadeMode(), isProcessingTimedActionList, me, mEvents, mEventSortingRequired, mLastTextID, mRemIDs, mScriptType, mStoredEvents, mTalkerEntry, mTextTimer, mTimedActionList, mUseTextTimer, ProcessEventsFor(), RemoveStoredEvent(), SMART_EVENT_TEXT_OVER, SMART_SCRIPT_TYPE_CREATURE, SMART_SCRIPT_TYPE_GAMEOBJECT, SortEvents(), and UpdateTimer().
Referenced by SmartAI::UpdateAI(), and SmartGameObjectAI::UpdateAI().
| 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().
| 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().
| 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().
| 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 |
||
| ) |
Definition at line 2351 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 3613 of file SmartScript.cpp.
References SmartScriptHolder::DEFAULT_PRIORITY, mCurrentPriority, mEventSortingRequired, SmartScriptHolder::priority, and SmartScriptHolder::timer.
Referenced by RetryLater(), and UpdateTimer().
|
static |
Definition at line 3339 of file SmartScript.cpp.
References SmartScriptHolder::active, SmartScriptHolder::timer, and urand().
Referenced by InitTimer(), ProcessEvent(), and ProcessTimedAction().
|
private |
Definition at line 3459 of file SmartScript.cpp.
References mStoredEvents.
Referenced by OnUpdate().
| void SmartScript::ResetBaseObject | ( | ) |
Definition at line 201 of file SmartScript.cpp.
References ObjectGuid::Clear(), ObjectAccessor::GetCreature(), ObjectAccessor::GetGameObject(), go, goOrigGUID, ObjectGuid::IsEmpty(), me, and meOrigGUID.
Referenced by OnReset().
|
private |
Definition at line 3624 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 53 of file SmartScript.h.
Referenced by SmartAI::EndPath(), and SmartAI::LoadPath().
|
private |
Definition at line 3863 of file SmartScript.cpp.
References mEventPhase.
Referenced by DecPhase(), IncPhase(), and ProcessAction().
| void SmartScript::SetTimedActionList | ( | SmartScriptHolder & | e, |
| uint32 | entry, | ||
| Unit * | invoker | ||
| ) |
Definition at line 3803 of file SmartScript.cpp.
References SmartScriptHolder::action, SmartAction::allowOverride, ObjectGuid::Empty, SmartScriptHolder::entryOrGuid, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetEventType(), Object::GetGUID(), SmartScriptHolder::GetScriptType(), InitTimer(), isProcessingTimedActionList, mTimedActionList, mTimedActionListInvoker, 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(), SmartAI::SetTimedActionList(), and SmartGameObjectAI::SetTimedActionList().
|
private |
Definition at line 3608 of file SmartScript.cpp.
Referenced by OnUpdate().
Definition at line 133 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 110 of file SmartScript.cpp.
References _storedTargets.
Referenced by ProcessAction().
| void SmartScript::UpdateTimer | ( | SmartScriptHolder & | e, |
| uint32 const | diff | ||
| ) |
Definition at line 3346 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, 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 138 of file SmartScript.h.
Referenced by AddToStoredTargetList(), GetStoredTargetVector(), and StoreTargetList().
|
private |
Definition at line 117 of file SmartScript.h.
Referenced by GetBaseObjectOrPlayerTrigger(), OnInitialize(), and SmartScript().
|
private |
Definition at line 115 of file SmartScript.h.
Referenced by GetBaseObject(), GetScript(), GetTargets(), IsSmart(), IsSmart(), OnInitialize(), ProcessAction(), ResetBaseObject(), and SmartScript().
|
private |
Definition at line 116 of file SmartScript.h.
Referenced by ResetBaseObject().
|
private |
Definition at line 112 of file SmartScript.h.
Referenced by OnUpdate(), SetTimedActionList(), and SmartScript().
|
private |
Definition at line 133 of file SmartScript.h.
Referenced by FillScript(), and SmartScript().
|
staticconstexprprivate |
Definition at line 136 of file SmartScript.h.
Referenced by ProcessEventsFor().
| CounterMap SmartScript::mCounterList |
Definition at line 94 of file SmartScript.h.
Referenced by GetCounterValue(), OnInitialize(), and StoreCounter().
|
private |
Definition at line 130 of file SmartScript.h.
Referenced by RaisePriority(), and SmartScript().
|
private |
Definition at line 113 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 114 of file SmartScript.h.
Referenced by ResetBaseObject().
|
private |
Definition at line 120 of file SmartScript.h.
Referenced by DecPhase(), IncPhase(), IsInPhase(), SetPhase(), and SmartScript().
|
private |
Definition at line 108 of file SmartScript.h.
Referenced by FillScript(), InstallEvents(), OnInitialize(), OnReset(), OnUpdate(), ProcessAction(), and ProcessEventsFor().
|
private |
Definition at line 131 of file SmartScript.h.
Referenced by OnReset(), OnUpdate(), RaisePriority(), SmartScript(), and UpdateTimer().
|
private |
Definition at line 109 of file SmartScript.h.
Referenced by InstallEvents().
| ObjectGuid SmartScript::mLastInvoker |
Definition at line 92 of file SmartScript.h.
Referenced by GetLastInvoker(), OnReset(), and ProcessAction().
|
private |
Definition at line 127 of file SmartScript.h.
Referenced by OnUpdate(), ProcessAction(), and SmartScript().
|
private |
Definition at line 132 of file SmartScript.h.
Referenced by ProcessEventsFor(), and SmartScript().
|
private |
Definition at line 122 of file SmartScript.h.
Referenced by SmartScript().
|
private |
Definition at line 124 of file SmartScript.h.
Referenced by OnUpdate(), and ProcessAction().
|
private |
Definition at line 119 of file SmartScript.h.
Referenced by GetScript(), OnInitialize(), OnUpdate(), and SmartScript().
|
private |
Definition at line 123 of file SmartScript.h.
Referenced by OnUpdate(), ProcessAction(), and RemoveStoredEvent().
|
private |
Definition at line 128 of file SmartScript.h.
Referenced by OnUpdate(), ProcessAction(), and SmartScript().
|
private |
Definition at line 126 of file SmartScript.h.
Referenced by OnUpdate(), ProcessAction(), and SmartScript().
|
private |
Definition at line 110 of file SmartScript.h.
Referenced by OnUpdate(), SetTimedActionList(), and UpdateTimer().
|
private |
Definition at line 111 of file SmartScript.h.
Referenced by SetTimedActionList(), and UpdateTimer().
|
private |
Definition at line 129 of file SmartScript.h.
Referenced by OnUpdate(), ProcessAction(), and SmartScript().
|
private |
Definition at line 118 of file SmartScript.h.
Referenced by GetBaseObjectOrPlayerTrigger(), GetScript(), OnInitialize(), and SmartScript().