Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
SmartScript Class Reference

#include <SmartScript.h>

Collaboration diagram for SmartScript:

Public Member Functions

void AddEvent (SMART_EVENT e, uint32 event_flags, uint32 event_param1, uint32 event_param2, uint32 event_param3, uint32 event_param4, uint32 event_param5, SMART_ACTION action, uint32 action_param1, uint32 action_param2, uint32 action_param3, uint32 action_param4, uint32 action_param5, uint32 action_param6, SMARTAI_TARGETS t, uint32 target_param1, uint32 target_param2, uint32 target_param3, uint32 phaseMask=0)
bool CheckTimer (SmartScriptHolder const &e) const
SmartScriptHolder CreateEvent (SMART_EVENT e, uint32 event_flags, uint32 event_param1, uint32 event_param2, uint32 event_param3, uint32 event_param4, uint32 event_param5, SMART_ACTION action, uint32 action_param1, uint32 action_param2, uint32 action_param3, uint32 action_param4, uint32 action_param5, uint32 action_param6, SMARTAI_TARGETS t, uint32 target_param1, uint32 target_param2, uint32 target_param3, uint32 phaseMask=0)
UnitDoFindClosestFriendlyInRange (float range, bool playerOnly)
void DoFindFriendlyCC (std::list< Creature * > &_list, float range)
void DoFindFriendlyMissingBuff (std::list< Creature * > &list, float range, uint32 spellid)
UnitDoSelectLowestHpFriendly (float range, uint32 MinHPDiff)
void FillScript (SmartAIEventList e, WorldObject *obj, AreaTriggerEntry const *at)
CreatureFindCreatureNear (WorldObject *searchObject, uint32 guid) const
GameObjectFindGameObjectNear (WorldObject *searchObject, uint32 guid) const
WorldObjectGetBaseObject ()
UnitGetLastInvoker ()
uint32 GetPathId () const
void GetScript ()
ObjectListGetTargetList (uint32 id)
ObjectListGetTargets (SmartScriptHolder const &e, Unit *invoker=NULL)
ObjectListGetWorldObjectsInDist (float dist)
void InitTimer (SmartScriptHolder &e)
void InstallTemplate (SmartScriptHolder const &e)
bool IsCreature (WorldObject *obj)
bool IsGameObject (WorldObject *obj)
bool IsPlayer (WorldObject *obj)
bool IsSmart (Creature *c=NULL)
bool IsSmartGO (GameObject *g=NULL)
bool IsUnit (WorldObject *obj)
void OnInitialize (WorldObject *obj, AreaTriggerEntry const *at=NULL)
void OnMoveInLineOfSight (Unit *who)
void OnReset ()
void OnUpdate (const uint32 diff)
void ProcessAction (SmartScriptHolder &e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
void ProcessEvent (SmartScriptHolder &e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
void ProcessEventsFor (SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
void ProcessTimedAction (SmartScriptHolder &e, uint32 const &min, uint32 const &max, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
void RecalcTimer (SmartScriptHolder &e, uint32 min, uint32 max)
void ResetBaseObject ()
void SetPathId (uint32 id)
void SetScript9 (SmartScriptHolder &e, uint32 entry)
 SmartScript ()
void StoreTargetList (ObjectList *targets, uint32 id)
void UpdateTimer (SmartScriptHolder &e, uint32 const diff)
 ~SmartScript ()

Public Attributes

uint64 mLastInvoker
ObjectListMapmTargetStorage

Private Member Functions

void DecPhase (int32 p=1)
SmartScriptHolder FindLinkedEvent (uint32 link)
void IncPhase (int32 p=1)
void InstallEvents ()
bool IsInPhase (uint32 p) const
void RemoveStoredEvent (uint32 id)
void SetPhase (uint32 p=0)

Private Attributes

GameObjectgo
uint64 goOrigGUID
Creatureme
uint64 meOrigGUID
uint32 mEventPhase
SmartAIEventList mEvents
SmartAIEventList mInstallEvents
uint32 mLastTextID
uint32 mPathId
std::list< uint32mRemIDs
SmartScriptType mScriptType
UNORDERED_MAP< int32, int32mStoredDecimals
SmartAIEventList mStoredEvents
uint32 mTalkerEntry
SMARTAI_TEMPLATE mTemplate
uint32 mTextTimer
SmartAIEventList mTimedActionList
bool mUseTextTimer
AreaTriggerEntry const * trigger

Detailed Description

Definition at line 18 of file SmartScript.h.

Constructor & Destructor Documentation

◆ SmartScript()

◆ ~SmartScript()

SmartScript::~SmartScript ( )

Definition at line 75 of file SmartScript.cpp.

References mTargetStorage.

Member Function Documentation

◆ AddEvent()

void SmartScript::AddEvent ( SMART_EVENT e,
uint32 event_flags,
uint32 event_param1,
uint32 event_param2,
uint32 event_param3,
uint32 event_param4,
uint32 event_param5,
SMART_ACTION action,
uint32 action_param1,
uint32 action_param2,
uint32 action_param3,
uint32 action_param4,
uint32 action_param5,
uint32 action_param6,
SMARTAI_TARGETS t,
uint32 target_param1,
uint32 target_param2,
uint32 target_param3,
uint32 phaseMask = 0 )

Definition at line 2412 of file SmartScript.cpp.

References CreateEvent(), and mInstallEvents.

Referenced by InstallTemplate().

◆ CheckTimer()

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

Definition at line 3328 of file SmartScript.cpp.

References SmartScriptHolder::active.

◆ CreateEvent()

◆ DecPhase()

void SmartScript::DecPhase ( int32 p = 1)
inlineprivate

Definition at line 170 of file SmartScript.h.

References mEventPhase.

Referenced by IncPhase(), and ProcessAction().

◆ DoFindClosestFriendlyInRange()

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

Definition at line 3612 of file SmartScript.cpp.

References me.

Referenced by GetTargets().

◆ DoFindFriendlyCC()

void SmartScript::DoFindFriendlyCC ( std::list< Creature * > & _list,
float range )

Definition at line 3578 of file SmartScript.cpp.

References Skyfire::ComputeCellCoord(), me, Cell::SetNoCreate(), and Cell::Visit().

Referenced by ProcessEvent().

◆ DoFindFriendlyMissingBuff()

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

Definition at line 3595 of file SmartScript.cpp.

References Skyfire::ComputeCellCoord(), me, Cell::SetNoCreate(), and Cell::Visit().

Referenced by ProcessEvent().

◆ DoSelectLowestHpFriendly()

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

Definition at line 3558 of file SmartScript.cpp.

References Skyfire::ComputeCellCoord(), me, Cell::SetNoCreate(), and Cell::Visit().

Referenced by ProcessEvent().

◆ FillScript()

◆ FindCreatureNear()

Creature * SmartScript::FindCreatureNear ( WorldObject * searchObject,
uint32 guid ) const
inline

◆ FindGameObjectNear()

GameObject * SmartScript::FindGameObjectNear ( WorldObject * searchObject,
uint32 guid ) const
inline

◆ FindLinkedEvent()

SmartScriptHolder SmartScript::FindLinkedEvent ( uint32 link)
inlineprivate

Definition at line 200 of file SmartScript.h.

References mEvents.

Referenced by ProcessAction().

◆ GetBaseObject()

WorldObject * SmartScript::GetBaseObject ( )
inline

◆ GetLastInvoker()

Unit * SmartScript::GetLastInvoker ( )

Definition at line 3662 of file SmartScript.cpp.

References ObjectAccessor::FindUnit(), and mLastInvoker.

Referenced by GetTargets(), and ProcessAction().

◆ GetPathId()

uint32 SmartScript::GetPathId ( ) const
inline

Definition at line 42 of file SmartScript.h.

References mPathId.

Referenced by ProcessEvent().

◆ GetScript()

void SmartScript::GetScript ( )

Definition at line 3447 of file SmartScript.cpp.

References FillScript(), go, me, mScriptType, sSmartScriptMgr, and trigger.

Referenced by OnInitialize().

◆ GetTargetList()

ObjectList * SmartScript::GetTargetList ( uint32 id)
inline

Definition at line 112 of file SmartScript.h.

References mTargetStorage.

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

◆ GetTargets()

ObjectList * SmartScript::GetTargets ( SmartScriptHolder const & e,
Unit * invoker = NULL )

Definition at line 2448 of file SmartScript.cpp.

References SmartTarget::closest, SmartTarget::closestAttackable, SmartTarget::closestFriendly, SmartTarget::creature, SmartTarget::dbGuid, SmartTarget::dead, SmartTarget::dist, DoFindClosestFriendlyInRange(), SmartTarget::entry, FindCreatureNear(), FindGameObjectNear(), Vehicle::GetBase(), GetBaseObject(), GetClosestCreatureWithEntry(), GetClosestGameObjectWithEntry(), Object::GetEntry(), GetLastInvoker(), SmartScriptHolder::GetTargetType(), ObjectAccessor::GetUnit(), Unit::GetUnit(), Unit::GetVehicle(), GetWorldObjectsInDist(), go, SmartTarget::goDistance, SmartTarget::goGUID, SmartTarget::goRange, SmartTarget::id, IsCreature(), IsGameObject(), WorldObject::IsInRange(), IsPlayer(), SmartTarget::maxDist, me, SmartTarget::minDist, mTargetStorage, GroupReference::next(), SmartTarget::playerDistance, SmartTarget::playerOnly, SmartTarget::playerRange, SELECT_TARGET_BOTTOMAGGRO, SELECT_TARGET_RANDOM, SELECT_TARGET_TOPAGGRO, SF_LOG_ERROR, 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_CREATURE_DISTANCE, SMART_TARGET_CREATURE_GUID, SMART_TARGET_CREATURE_RANGE, 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_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_VICTIM, SmartTarget::stored, SmartScriptHolder::target, Object::ToPlayer(), SmartTarget::unitDistance, SmartTarget::unitGUID, and SmartTarget::unitRange.

Referenced by ProcessAction(), and ProcessEvent().

◆ GetWorldObjectsInDist()

ObjectList * SmartScript::GetWorldObjectsInDist ( float dist)

Definition at line 2734 of file SmartScript.cpp.

References GetBaseObject(), and WorldObject::VisitNearbyObject().

Referenced by GetTargets().

◆ IncPhase()

void SmartScript::IncPhase ( int32 p = 1)
inlineprivate

Definition at line 162 of file SmartScript.h.

References DecPhase(), and mEventPhase.

Referenced by ProcessAction().

◆ InitTimer()

◆ InstallEvents()

void SmartScript::InstallEvents ( )
private

Definition at line 3333 of file SmartScript.cpp.

References mEvents, and mInstallEvents.

Referenced by OnInitialize(), and OnUpdate().

◆ InstallTemplate()

◆ IsCreature()

bool SmartScript::IsCreature ( WorldObject * obj)
inline

Definition at line 63 of file SmartScript.h.

References Object::GetTypeId(), and TYPEID_UNIT.

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

◆ IsGameObject()

bool SmartScript::IsGameObject ( WorldObject * obj)
inline

Definition at line 68 of file SmartScript.h.

References Object::GetTypeId(), and TYPEID_GAMEOBJECT.

Referenced by GetTargets(), and ProcessAction().

◆ IsInPhase()

bool SmartScript::IsInPhase ( uint32 p) const
inlineprivate

Definition at line 171 of file SmartScript.h.

References mEventPhase.

Referenced by ProcessEvent(), and UpdateTimer().

◆ IsPlayer()

bool SmartScript::IsPlayer ( WorldObject * obj)
inline

Definition at line 58 of file SmartScript.h.

References Object::GetTypeId(), and TYPEID_PLAYER.

Referenced by GetTargets(), and ProcessAction().

◆ IsSmart()

bool SmartScript::IsSmart ( Creature * c = NULL)
inline

Definition at line 83 of file SmartScript.h.

References me, and SF_LOG_ERROR.

Referenced by ProcessAction().

◆ IsSmartGO()

bool SmartScript::IsSmartGO ( GameObject * g = NULL)
inline

Definition at line 98 of file SmartScript.h.

References go, and SF_LOG_ERROR.

Referenced by ProcessAction().

◆ IsUnit()

bool SmartScript::IsUnit ( WorldObject * obj)
inline

Definition at line 53 of file SmartScript.h.

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

Referenced by ProcessAction(), and ProcessEvent().

◆ OnInitialize()

◆ OnMoveInLineOfSight()

void SmartScript::OnMoveInLineOfSight ( Unit * who)

Definition at line 3514 of file SmartScript.cpp.

References me, ProcessEventsFor(), SMART_EVENT_IC_LOS, and SMART_EVENT_OOC_LOS.

Referenced by SmartAI::MoveInLineOfSight().

◆ OnReset()

◆ OnUpdate()

◆ ProcessAction()

void SmartScript::ProcessAction ( SmartScriptHolder & e,
Unit * unit = NULL,
uint32 var0 = 0,
uint32 var1 = 0,
bool bvar = false,
const SpellInfo * spell = NULL,
GameObject * gob = NULL )
Todo
Resume path when reached jump location

Definition at line 140 of file SmartScript.cpp.

References SmartScriptHolder::action, SmartAction::active, ALLIANCE, SmartAction::angle, SmartAction::anim, SmartAction::apply, SmartAction::attack, SmartAction::attackInvoker, SmartAction::autoAttack, SmartAction::byte1, SmartAction::callHelp, SmartAction::cast, CAST_AI, Unit::CastSpell(), SmartAction::chance, CHAT_MSG_ADDON, CHAT_MSG_MONSTER_EMOTE, ObjectMgr::ChooseDisplayId(), SmartAction::combatMove, SmartAction::count, CreateEvent(), SmartAction::creature, SmartAction::creatureGroup, SmartAction::credit, SmartAction::creditType, SmartAction::data, SmartAction::dec, DecPhase(), SmartAction::delay, SmartAction::delunitByte, SmartAction::despawnTime, SmartAction::dist, SmartAction::distance, SmartAction::duration, SmartAction::emote, SmartAction::emote1, SmartAction::emote2, SmartAction::emote3, SmartAction::emote4, SmartAction::emote5, SmartAction::emote6, SmartAction::entry, SmartAction::entry1, SmartAction::entry2, SmartAction::entry3, SmartAction::entry4, SmartAction::entry5, SmartAction::entry6, SmartScriptHolder::entryOrGuid, SmartAction::equip, SmartScriptHolder::event, SmartEvent::event_chance, SmartEvent::event_flags, SmartScriptHolder::event_id, SmartAction::faction, SmartAction::factionID, SmartAction::fail, SmartAction::field, FindLinkedEvent(), ObjectAccessor::FindPlayer(), SmartAction::flag, SmartAction::flags, SmartAction::flee, SmartAction::fly, SmartAction::follow, SmartAction::forceDespawn, SmartAction::gameEventStart, SmartAction::gameEventStop, GAMEOBJECT_FIELD_FLAGS, SmartScriptHolder::GetActionType(), GetBaseObject(), Object::GetEntry(), SmartScriptHolder::GetEventType(), Object::GetGUID(), Object::GetGUIDLow(), WorldObject::GetInstanceScript(), GetLastInvoker(), WorldObject::GetName(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), SmartScriptHolder::GetScriptType(), GetTargetList(), GetTargets(), SmartScriptHolder::GetTargetType(), Unit::GetUnit(), Unit::GetVehicleKit(), go, GO_READY, SmartAction::goFlag, goOrigGUID, SmartAction::goRespawnTime, SmartAction::gossipMenuId, SmartAction::gossipNpcTextId, SmartAction::group, Player::GroupEventHappens(), SmartAction::healthpoint, SmartAction::healthpointmod, SmartAction::healthpointpercent, HORDE, SmartAction::id, SmartAction::inc, SmartAction::incEventPhase, IncPhase(), SmartAction::ingamePhaseId, InitTimer(), InstallTemplate(), Unit::InterruptNonMeleeSpells(), SmartAction::interruptSpellCasting, SmartAction::invincHP, IsCreature(), IsGameObject(), IsPlayer(), IsSmart(), IsSmartGO(), IsUnit(), SmartAction::item, EquipmentInfo::ItemEntry, SmartAction::jump, SmartAction::killedMonster, LANG_ADDON, LANG_CALL_FOR_HELP, LANG_FLEE, LANG_UNIVERSAL, SmartScriptHolder::link, M_PI, SmartAction::mapID, SmartAction::mask, SmartAction::max, SmartEvent::max, me, meOrigGUID, SmartAction::min, SmartEvent::min, SmartAction::minHP, SmartEvent::minMaxRepeat, mLastInvoker, mLastTextID, SmartAction::model, SmartAction::morphOrMount, SmartAction::move, SmartAction::moveRandom, SmartAction::MoveToPos, SmartAction::movie, mRemIDs, mStoredDecimals, mStoredEvents, mTalkerEntry, mTextTimer, mUseTextTimer, SmartAction::newPower, SmartAction::number, SmartTarget::o, OBJECT_FIELD_DYNAMIC_FLAGS, SmartAction::onlySelf, OnReset(), SmartAction::pathID, SmartAction::percent, SmartAction::phase, SmartAction::phase1, SmartAction::phase2, SmartAction::phase3, SmartAction::phase4, SmartAction::phase5, SmartAction::phase6, SmartAction::phaseMax, SmartAction::phaseMin, SmartAction::pointId, SmartAction::power, SmartAction::powerType, ProcessEvent(), ProcessEventsFor(), SmartAction::quest, SmartAction::randomEmote, SmartAction::randomPhase, SmartAction::randomPhaseRange, SmartAction::randomSound, SmartAction::randTimedActionList, SmartAction::range, SmartAction::react, SmartAction::reactState, SmartAction::regenHealth, SmartAction::removeAura, SmartAction::repeat, SmartAction::repeatMax, SmartEvent::repeatMax, SmartAction::repeatMin, SmartEvent::repeatMin, ResetBaseObject(), SmartAction::RespawnTarget, SmartAction::root, SmartAction::run, SmartScriptHolder::runOnce, sCreatureTextMgr, SmartAction::sendGoCustomAnim, SmartAction::sendGossipMenu, SmartAction::sendTargetToTarget, ZoneScript::SetData(), SmartAction::setData, ZoneScript::SetData64(), SmartAction::setEventPhase, SmartAction::setFly, SmartAction::setGoLootState, SmartAction::sethealthpointorpercent, SmartAction::setHealthRegen, SmartAction::setInstanceData, SmartAction::setInstanceData64, SmartAI::SetInvincibilityHpLevel(), SetPhase(), SmartAction::setRangedMovement, SmartAction::setRoot, SmartAction::setRun, SmartAction::setSheath, SmartAction::setSwim, SmartAction::setunitByte, SF_LOG_DEBUG, SF_LOG_ERROR, sGameEventMgr, SmartAction::sheath, SmartAction::slot1, SmartAction::slot2, SmartAction::slot3, SMART_ACTION_ACTIVATE_GOBJECT, SMART_ACTION_ACTIVATE_TAXI, SMART_ACTION_ADD_AURA, SMART_ACTION_ADD_DYNAMIC_FLAG, SMART_ACTION_ADD_GO_FLAG, SMART_ACTION_ADD_ITEM, SMART_ACTION_ADD_NPC_FLAG, SMART_ACTION_ADD_POWER, SMART_ACTION_ADD_QUEST, SMART_ACTION_ALLOW_COMBAT_MOVEMENT, SMART_ACTION_ATTACK_START, 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_DIE, 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_LOOT_STATE, SMART_ACTION_INC_EVENT_PHASE, SMART_ACTION_INSTALL_AI_TEMPLATE, SMART_ACTION_INTERRUPT_SPELL, SMART_ACTION_INVOKER_CAST, SMART_ACTION_JUMP_TO_POS, SMART_ACTION_KILL_UNIT, SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL, SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL, SMART_ACTION_MOVE_FORWARD, SMART_ACTION_MOVE_TO_POS, SMART_ACTION_NONE, SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT, SMART_ACTION_PARAM_COUNT, 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_DYNAMIC_FLAG, SMART_ACTION_REMOVE_GO_FLAG, SMART_ACTION_REMOVE_ITEM, SMART_ACTION_REMOVE_NPC_FLAG, SMART_ACTION_REMOVE_POWER, SMART_ACTION_REMOVE_TIMED_EVENT, SMART_ACTION_REMOVE_UNIT_FIELD_ANIM_TIER, SMART_ACTION_REMOVE_UNIT_FLAG, SMART_ACTION_REMOVEAURASFROMSPELL, SMART_ACTION_RESET_GOBJECT, SMART_ACTION_RESET_SCRIPT_BASE_OBJECT, SMART_ACTION_RESPAWN_TARGET, SMART_ACTION_SEND_GO_CUSTOM_ANIM, SMART_ACTION_SEND_GOSSIP_MENU, SMART_ACTION_SEND_TARGET_TO_TARGET, SMART_ACTION_SET_ACTIVE, SMART_ACTION_SET_DATA, SMART_ACTION_SET_DYNAMIC_FLAG, SMART_ACTION_SET_EMOTE_STATE, SMART_ACTION_SET_EVENT_PHASE, SMART_ACTION_SET_FACTION, SMART_ACTION_SET_FLY, SMART_ACTION_SET_GO_FLAG, SMART_ACTION_SET_HEALTH, SMART_ACTION_SET_HEALTH_REGEN, SMART_ACTION_SET_HOME_POS, 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_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_SWIM, SMART_ACTION_SET_UNIT_FIELD_ANIM_TIER, SMART_ACTION_SET_UNIT_FLAG, SMART_ACTION_SET_VISIBILITY, SMART_ACTION_SIMPLE_TALK, SMART_ACTION_SOUND, SMART_ACTION_STORE_TARGET_LIST, SMART_ACTION_STORE_VARIABLE_DECIMAL, 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_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_LINK, SMART_EVENT_TIMED_EVENT_TRIGGERED, SMART_EVENT_UPDATE, SMART_EVENT_UPDATE_IC, SMART_EVENT_WAYPOINT_REACHED, 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_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, SMARTCAST_AURA_NOT_PRESENT, SMARTCAST_INTERRUPT_PREVIOUS, SMARTCAST_TRIGGERED, sObjectMgr, SmartAction::sound, SmartAction::sound1, SmartAction::sound2, SmartAction::sound3, SmartAction::sound4, SmartAction::sound5, SmartAction::speedxy, SmartAction::speedz, SmartAction::spell, SmartAction::spell_id, SmartAction::state, StoreTargetList(), SmartAction::storeTargets, SmartAction::storeVar, SmartAction::summonCreature, WorldObject::SummonCreatureGroup(), WorldObject::SummonGameObject(), SmartAction::summonGO, SmartAction::swim, SmartAction::talk, SmartScriptHolder::target, SmartAction::targetParam1, SmartAction::targetParam2, SmartAction::targetParam3, SmartAction::targetType, SmartAction::taxi, SmartAction::team, TEAM_OTHER, SmartAction::teleport, TEXT_RANGE_NORMAL, SmartAction::textGroupID, SmartAction::threatDEC, SmartAction::threatINC, SmartAction::threatPCT, SmartAction::timedActionList, SmartAction::timeEvent, Object::ToCreature(), Object::ToGameObject(), Object::ToPlayer(), SmartAction::transport, SmartAction::type, SmartEvent::type, SmartTarget::type, UI64FMTD, UNIT_FIELD_ANIM_TIER, UNIT_FIELD_FLAGS, UNIT_FIELD_FLAGS2, UNIT_FIELD_NPC_EMOTESTATE, UNIT_FIELD_NPC_FLAGS, UNIT_FIELD_VIRTUAL_ITEM_ID, UNIT_STATE_ROOT, SmartAction::unitFlag, SmartAction::updateTemplate, SmartAction::visibility, SmartAction::withDelayed, SmartAction::withEmote, SmartAction::withInstant, SmartAction::wpPause, SmartAction::wpStart, SmartAction::wpStop, SmartTarget::x, SmartTarget::y, and SmartTarget::z.

Referenced by ProcessEvent(), and ProcessTimedAction().

◆ ProcessEvent()

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

Definition at line 2747 of file SmartScript.cpp.

References SmartEvent::action, SmartScriptHolder::active, SmartEvent::area, SmartEvent::areatrigger, SmartEvent::aura, SmartEvent::behindTarget, SmartEvent::cooldownMax, SmartEvent::cooldownMin, SmartEvent::count, SmartEvent::creature, SmartEvent::creatureEntry, CURRENT_GENERIC_SPELL, SmartEvent::dataSet, SmartEvent::doAction, DoFindFriendlyCC(), DoFindFriendlyMissingBuff(), DoSelectLowestHpFriendly(), SmartEvent::dummy, SmartEvent::effIndex, SmartEvent::emote, SmartScriptHolder::event, SmartEvent::event_flags, SmartEvent::event_phase_mask, SmartEvent::eventId, SmartEvent::eventInform, SmartEvent::friendlyCC, SmartEvent::friendlyHealth, SmartEvent::friendlyHealthPct, SmartEvent::gameEvent, SmartEvent::gameEventId, GetBaseObject(), Unit::GetCurrentSpell(), Object::GetEntry(), SmartScriptHolder::GetEventType(), GetPathId(), GetTargets(), SmartScriptHolder::GetTargetType(), Object::GetTypeId(), SmartEvent::gossip, SmartEvent::goStateChanged, SmartEvent::hpDeficit, SpellInfo::Id, SmartEvent::id, SmartEvent::instancePlayerEnter, IsCreature(), Unit::IsInCombat(), IsInPhase(), Unit::IsNonMeleeSpellCasted(), IsUnit(), SmartEvent::kill, SmartEvent::los, M_PI, SmartEvent::map, SmartEvent::max, SmartEvent::maxDist, SmartEvent::maxHpPct, me, SmartEvent::min, SmartEvent::minHpPct, SmartEvent::minMax, SmartEvent::minMaxRepeat, SmartEvent::missingBuff, SmartEvent::movementInform, SmartEvent::noHostile, SmartEvent::pathID, SmartEvent::playerOnly, SmartEvent::pointID, POWER_MANA, ProcessAction(), ProcessTimedAction(), SmartEvent::quest, SmartEvent::radius, RecalcTimer(), SmartEvent::repeatMax, SmartEvent::repeatMin, SmartEvent::respawn, SmartScriptHolder::runOnce, SmartEvent::school, SpellInfo::SchoolMask, SmartEvent::sender, SF_LOG_DEBUG, SF_LOG_ERROR, SMART_EVENT_ACCEPTED_QUEST, SMART_EVENT_ACTION_DONE, SMART_EVENT_AGGRO, SMART_EVENT_AI_INIT, SMART_EVENT_AREATRIGGER_ONTRIGGER, SMART_EVENT_CHARMED, SMART_EVENT_CHARMED_TARGET, SMART_EVENT_CORPSE_REMOVED, SMART_EVENT_DAMAGED, SMART_EVENT_DAMAGED_TARGET, SMART_EVENT_DATA_SET, SMART_EVENT_DEATH, SMART_EVENT_DUMMY_EFFECT, SMART_EVENT_EVADE, SMART_EVENT_FLAG_NOT_REPEATABLE, SMART_EVENT_FOLLOW_COMPLETED, SMART_EVENT_FRIENDLY_HEALTH, 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_STATE_CHANGED, SMART_EVENT_GOSSIP_HELLO, SMART_EVENT_GOSSIP_SELECT, SMART_EVENT_HAS_AURA, SMART_EVENT_HEALT_PCT, SMART_EVENT_IC_LOS, SMART_EVENT_INSTANCE_PLAYER_ENTER, SMART_EVENT_IS_BEHIND_TARGET, SMART_EVENT_JUST_CREATED, SMART_EVENT_JUST_SUMMONED, SMART_EVENT_KILL, SMART_EVENT_LINK, SMART_EVENT_MANA_PCT, SMART_EVENT_MOVEMENTINFORM, 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_COPLETETION, 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_TARGET_BUFFED, SMART_EVENT_TARGET_HEALTH_PCT, SMART_EVENT_TARGET_MANA_PCT, 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_START, SMART_EVENT_WAYPOINT_STOPPED, SMART_SCRIPT_RESPAWN_CONDITION_AREA, SMART_SCRIPT_RESPAWN_CONDITION_MAP, 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::spellHit, SmartEvent::spellId, SmartEvent::state, SmartEvent::summoned, SmartEvent::targetCasting, SmartEvent::team, SmartEvent::textGroupID, SmartEvent::textOver, SmartEvent::timedEvent, Object::ToUnit(), SmartEvent::transportAddCreature, SmartEvent::type, TYPEID_PLAYER, SmartEvent::value, and SmartEvent::waypoint.

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

◆ ProcessEventsFor()

void SmartScript::ProcessEventsFor ( SMART_EVENT e,
Unit * unit = NULL,
uint32 var0 = 0,
uint32 var1 = 0,
bool bvar = false,
const SpellInfo * spell = NULL,
GameObject * gob = NULL )

◆ ProcessTimedAction()

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

◆ RecalcTimer()

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

◆ RemoveStoredEvent()

void SmartScript::RemoveStoredEvent ( uint32 id)
private

Definition at line 3344 of file SmartScript.cpp.

References mStoredEvents.

Referenced by OnUpdate().

◆ ResetBaseObject()

void SmartScript::ResetBaseObject ( )

Definition at line 99 of file SmartScript.cpp.

References HashMapHolder< T >::Find(), go, goOrigGUID, me, and meOrigGUID.

Referenced by OnReset(), and ProcessAction().

◆ SetPathId()

void SmartScript::SetPathId ( uint32 id)
inline

Definition at line 41 of file SmartScript.h.

References mPathId.

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

◆ SetPhase()

void SmartScript::SetPhase ( uint32 p = 0)
inlineprivate

Definition at line 172 of file SmartScript.h.

References mEventPhase.

Referenced by OnReset(), and ProcessAction().

◆ SetScript9()

◆ StoreTargetList()

void SmartScript::StoreTargetList ( ObjectList * targets,
uint32 id )

Definition at line 3624 of file SmartScript.cpp.

References mTargetStorage.

Referenced by ProcessAction().

◆ UpdateTimer()

Member Data Documentation

◆ go

◆ goOrigGUID

uint64 SmartScript::goOrigGUID
private

Definition at line 180 of file SmartScript.h.

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

◆ me

◆ meOrigGUID

uint64 SmartScript::meOrigGUID
private

Definition at line 178 of file SmartScript.h.

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

◆ mEventPhase

uint32 SmartScript::mEventPhase
private

Definition at line 183 of file SmartScript.h.

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

◆ mEvents

SmartAIEventList SmartScript::mEvents
private

◆ mInstallEvents

SmartAIEventList SmartScript::mInstallEvents
private

Definition at line 175 of file SmartScript.h.

Referenced by AddEvent(), and InstallEvents().

◆ mLastInvoker

uint64 SmartScript::mLastInvoker

◆ mLastTextID

uint32 SmartScript::mLastTextID
private

Definition at line 191 of file SmartScript.h.

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

◆ mPathId

uint32 SmartScript::mPathId
private

Definition at line 186 of file SmartScript.h.

Referenced by GetPathId(), SetPathId(), and SmartScript().

◆ mRemIDs

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

Definition at line 188 of file SmartScript.h.

Referenced by OnUpdate(), and ProcessAction().

◆ mScriptType

SmartScriptType SmartScript::mScriptType
private

Definition at line 182 of file SmartScript.h.

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

◆ mStoredDecimals

UNORDERED_MAP<int32, int32> SmartScript::mStoredDecimals
private

Definition at line 185 of file SmartScript.h.

Referenced by ProcessAction().

◆ mStoredEvents

SmartAIEventList SmartScript::mStoredEvents
private

Definition at line 187 of file SmartScript.h.

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

◆ mTalkerEntry

uint32 SmartScript::mTalkerEntry
private

Definition at line 192 of file SmartScript.h.

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

◆ mTargetStorage

ObjectListMap* SmartScript::mTargetStorage

Definition at line 151 of file SmartScript.h.

Referenced by GetTargetList(), GetTargets(), SmartScript(), StoreTargetList(), and ~SmartScript().

◆ mTemplate

SMARTAI_TEMPLATE SmartScript::mTemplate
private

Definition at line 195 of file SmartScript.h.

Referenced by InstallTemplate(), and SmartScript().

◆ mTextTimer

uint32 SmartScript::mTextTimer
private

Definition at line 190 of file SmartScript.h.

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

◆ mTimedActionList

SmartAIEventList SmartScript::mTimedActionList
private

Definition at line 176 of file SmartScript.h.

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

◆ mUseTextTimer

bool SmartScript::mUseTextTimer
private

Definition at line 193 of file SmartScript.h.

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

◆ trigger

AreaTriggerEntry const* SmartScript::trigger
private

Definition at line 181 of file SmartScript.h.

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


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