80 if (!smart && !silent)
95 if (!smart && !silent)
96 TC_LOG_ERROR(
"sql.sql",
"SmartScript: Action target GameObject (GUID: {} Entry: {}) is not using SmartGameObjectAI, action called by GameObject (GUID: {} Entry: {}) skipped to prevent crash.", g->
GetSpawnId(), g->
GetEntry(),
go ?
go->
GetSpawnId() : 0,
go ?
go->
GetEntry() : 0);
122 itr->second.AddGuid(obj->GetGUID());
129 return itr->second.GetObjectVector(ref);
139 itr->second += value;
160 if (bounds.first == bounds.second)
163 return bounds.first->second;
169 if (bounds.first == bounds.second)
172 auto creatureItr = std::find_if(bounds.first, bounds.second, [](Map::CreatureBySpawnIdContainer::value_type
const& pair)
174 return pair.second->IsAlive();
177 return creatureItr != bounds.second ? creatureItr->second : bounds.first->second;
188 event.runOnce =
false;
238 TC_LOG_WARN(
"scripts.ai",
"SmartScript::ProcessEventsFor: reached the limit of max allowed nested ProcessEventsFor() calls with event {}, skipping!\n{}", e,
GetBaseObject()->
GetDebugInfo());
249 if (
sConditionMgr->IsObjectMeetingSmartEventConditions(event.entryOrGuid, event.event_id, event.source_type, unit,
GetBaseObject()))
250 ProcessEvent(event, unit, var0, var1, bvar, spell, gob);
275 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: Invoker: {} {}", tempInvoker->GetName(), tempInvoker->GetGUID().ToString());
278 GetTargets(targets, e, Coalesce<WorldObject>(unit, gob));
285 Unit* talkTarget =
nullptr;
289 if (
IsCreature(target) && !target->ToCreature()->IsPet())
319 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_TALK: talker: {} {}, textGuid: {}",
334 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SIMPLE_TALK: talker: {} {}, textGroupId: {}",
345 target->ToUnit()->HandleEmoteCommand(
static_cast<Emote>(e.
action.
emote.emote));
346 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_PLAY_EMOTE: target: {} {}, emote: {}",
347 target->GetName(), target->GetGUID().ToString(), e.
action.
emote.emote);
363 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SOUND: target: {} {}, sound: {}, onlyself: {}",
378 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature {} set faction to {}",
385 if (target->ToCreature()->GetFaction() != ci->faction)
387 target->ToCreature()->SetFaction(ci->faction);
388 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature {} set faction to {}",
389 target->GetGUID().ToString(), ci->faction);
412 target->ToCreature()->SetDisplayId(displayId);
413 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature {} set displayid to {}",
414 target->GetGUID().ToString(), displayId);
421 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature {} set displayid to {}",
427 target->ToCreature()->DeMorph();
428 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature {} demorphs.",
429 target->GetGUID().ToString());
440 target->ToPlayer()->FailQuest(e.
action.
quest.quest);
441 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_FAIL_QUEST: Player {} fails quest {}",
442 target->GetGUID().ToString(), e.
action.
quest.quest);
457 if (player->CanTakeQuest(q,
true))
463 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_OFFER_QUEST: Player {} - offering quest {}", player->GetGUID().ToString(), e.
action.
questOffer.
questID);
469 player->AddQuestAndCheckCompletion(q,
nullptr);
470 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_OFFER_QUEST: Player {} - quest {} added",
491 std::vector<uint32> emotes;
493 std::back_inserter(emotes), [](
uint32 emote) { return emote != 0; });
500 target->ToUnit()->HandleEmoteCommand(emote);
501 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_RANDOM_EMOTE: Creature {} handle random emote {}",
502 target->GetGUID().ToString(), emote);
515 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_THREAT_ALL_PCT: Creature {} modify threat for unit {}, value {}",
530 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_THREAT_SINGLE_PCT: Creature {} modify threat for unit {}, value {}",
542 if (
Vehicle* vehicle = target->ToUnit()->GetVehicleKit())
543 for (std::pair<int8 const, VehicleSeat>& seat : vehicle->Seats)
545 player->AreaExploredOrEventHappens(e.
action.
quest.quest);
549 target->ToPlayer()->AreaExploredOrEventHappens(e.
action.
quest.quest);
551 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS: Player {} credited quest {}",
552 target->GetGUID().ToString(), e.
action.
quest.quest);
565 bool failedSpellCast =
false, successfulSpellCast =
false;
602 failedSpellCast =
true;
604 successfulSpellCast =
true;
609 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_CAST:: {} casts spell {} on target {} with castflags {}",
613 TC_LOG_DEBUG(
"scripts.ai",
"Spell {} not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target ({}) already has the aura", e.
action.
cast.
spell, target->GetGUID().ToString());
617 if (failedSpellCast && !successfulSpellCast)
661 if (!tempLastInvoker)
690 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_INVOKER_CAST: Invoker {} casts spell {} on target {} with castflags {}",
694 TC_LOG_DEBUG(
"scripts.ai",
"Spell {} not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target ({}) already has the aura", e.
action.
cast.
spell, target->GetGUID().ToString());
705 target->ToGameObject()->SetLootState(
GO_READY);
706 target->ToGameObject()->UseDoorOrButton(0,
false, unit);
707 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_ACTIVATE_GOBJECT. Gameobject {} activated",
708 target->GetGUID().ToString());
719 target->ToGameObject()->ResetDoorOrButton();
720 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_RESET_GOBJECT. Gameobject {} reset",
721 target->GetGUID().ToString());
733 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_EMOTE_STATE. Unit {} set emotestate to {}",
734 target->GetGUID().ToString(), e.
action.
emote.emote);
745 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_AUTO_ATTACK: Creature: {} bool on = {}",
756 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_ALLOW_COMBAT_MOVEMENT: Creature {} bool on = {}",
766 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_EVENT_PHASE: Creature {} set event phase {}",
777 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_INC_EVENT_PHASE: Creature {} inc event phase by {}, "
789 float homeX, homeY, homeZ, homeO;
810 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_FLEE_FOR_ASSIST: Creature {} DoFleeToGetAssistance",
me->
GetGUID().
ToString());
823 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_CALL_GROUPEVENTHAPPENS: Player {}, group credit for quest {}",
829 for (std::pair<int8 const, VehicleSeat>& seat : vehicle->Seats)
869 target->ToUnit()->RemoveAllAuras();
871 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_REMOVEAURASFROMSPELL: Unit {}, spell {}",
893 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_FOLLOW: Creature {} following target {}",
905 std::vector<uint32> phases;
907 std::back_inserter(phases), [](
uint32 phase) { return phase != 0; });
911 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE: Creature {} sets event phase to {}",
922 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE_RANGE: Creature {} sets event phase to {}",
936 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player {}, Killcredit: {}",
947 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player {}, Killcredit: {}",
951 if (
Vehicle* vehicle = target->ToUnit()->GetVehicleKit())
952 for (std::pair<int8 const, VehicleSeat>& seat : vehicle->Seats)
979 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA: SetData Field: {}, data: {}",
984 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA: SetBossState BossId: {}, State: {} ({})",
1008 if (targets.empty())
1012 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: {}, data: {}",
1060 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_SET_SHEATH: Creature {}, State: {}",
1069 if (despawnDelay <= 0ms)
1077 creature->DespawnOrUnsummon(despawnDelay, forceRespawnTimer);
1079 goTarget->DespawnOrUnsummon(despawnDelay, forceRespawnTimer);
1112 target->ToUnit()->Dismount();
1161 unitTarget->AttackStop();
1204 if (targets.empty())
1228 target->GetPosition(x, y, z, o);
1233 for (
uint32 counter = 0; counter < spawnsCount; counter++)
1237 summon->AI()->AttackStart(target->ToUnit());
1244 for (
uint32 counter = 0; counter < spawnsCount; counter++)
1248 summon->AI()->AttackStart(unit);
1338 if (!targets.empty())
1347 TC_LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SET_COUNTER is not using SmartAI, skipping");
1354 TC_LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SET_COUNTER is not using SmartGameObjectAI, skipping");
1426 else if (!targets.empty())
1449 if (!targets.empty())
1477 TC_LOG_WARN(
"sql.sql",
"Invalid creature target '{}' (entry {}, spawnId {}) specified for SMART_ACTION_ENABLE_TEMP_GOBJ", target->GetName(), target->GetEntry(), target->ToCreature()->GetSpawnId());
1480 if (target->ToGameObject()->isSpawnedByDefault())
1481 TC_LOG_WARN(
"sql.sql",
"Invalid gameobject target '{}' (entry {}, spawnId {}) for SMART_ACTION_ENABLE_TEMP_GOBJ - the object is spawned by default", target->GetName(), target->GetEntry(), target->ToGameObject()->GetSpawnId());
1492 target->ToPlayer()->PlayerTalkClass->SendCloseGossip();
1501 std::array<uint32, MAX_EQUIPMENT_ITEMS> slot;
1507 TC_LOG_ERROR(
"sql.sql",
"SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info id {} for creature {}", equipId, npc->GetEntry());
1511 npc->SetCurrentEquipmentId(equipId);
1513 std::copy(std::begin(eInfo->
ItemEntry), std::end(eInfo->
ItemEntry), std::begin(slot));
1524 npc->SetVirtualItem(i, slot[i]);
1592 if (
IsSmart(creature) && creature->GetVictim())
1594 creature->GetMotionMaster()->MoveChase(creature->GetVictim(), attackDistance, attackAngle);
1645 if (targets.empty())
1649 GetTargets(casters,
CreateSmartEvent(
SMART_EVENT_UPDATE_IC, 0, 0, 0, 0, 0, 0,
SMART_ACTION_NONE, 0, 0, 0, 0, 0, 0, (
SMARTAI_TARGETS)e.
action.
crossCast.
targetType, e.
action.
crossCast.
targetParam1, e.
action.
crossCast.
targetParam2, e.
action.
crossCast.
targetParam3, 0, 0), unit);
1658 bool interruptedSpell =
false;
1670 interruptedSpell =
true;
1676 TC_LOG_DEBUG(
"scripts.ai",
"Spell {} not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target ({}) already has the aura", e.
action.
crossCast.
spell, target->GetGUID().ToString());
1683 std::vector<uint32> actionLists;
1685 std::back_inserter(actionLists), [](
uint32 actionList) { return actionList != 0; });
1737 target->ToPlayer()->ActivateTaxiPathTo(e.
action.
taxi.
id);
1742 bool foundTarget =
false;
1753 target->ToCreature()->GetMotionMaster()->MoveIdle();
1864 TC_LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartAI, skipping");
1871 TC_LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartGameObjectAI, skipping");
1881 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SEND_GOSSIP_MENU: gossipMenuId {}, gossipNpcTextId {}",
1897 player->PlayerTalkClass->ClearMenus();
1922 target->ToCreature()->SetHomePosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation());
1925 TC_LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SET_HOME_POS is invalid, skipping");
1946 std::list<TempSummon*> summonList;
1951 summon->AI()->AttackStart(unit);
1980 TC_LOG_ERROR(
"sql.sql",
"SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_STOP, inactive event (id: {})", eventId);
1991 TC_LOG_ERROR(
"sql.sql",
"SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_START, already activated event (id: {})", eventId);
1999 std::vector<uint32> waypoints;
2001 std::back_inserter(waypoints), [](
uint32 wp) { return wp != 0; });
2003 float distanceToClosest = std::numeric_limits<float>::max();
2004 std::pair<uint32, uint32> closest = { 0, 0 };
2012 for (
uint32 pathId : waypoints)
2015 if (!path || path->
nodes.empty())
2020 float distamceToThisNode = creature->GetDistance(waypoint.x, waypoint.y, waypoint.z);
2021 if (distamceToThisNode < distanceToClosest)
2023 distanceToClosest = distamceToThisNode;
2024 closest.first = pathId;
2025 closest.second = waypoint.
id;
2030 if (closest.first != 0)
2031 ENSURE_AI(
SmartAI, creature->AI())->StartPath(closest.first,
true,
nullptr, closest.second);
2039 std::vector<uint32> sounds;
2041 std::back_inserter(sounds), [](
uint32 sound) { return sound != 0; });
2051 target->PlayDistanceSound(sound, onlySelf ? target->ToPlayer() :
nullptr);
2053 target->PlayDirectSound(sound, onlySelf ? target->ToPlayer() :
nullptr);
2055 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_RANDOM_SOUND: target: {} ({}), sound: {}, onlyself: {}",
2056 target->GetName(), target->GetGUID().ToString(), sound, onlySelf ?
"true" :
"false");
2197 map = obj->GetMap();
2198 else if (!targets.empty())
2199 map = targets.front()->GetMap();
2222 float speed = float(speedInteger) + float(speedFraction) / std::pow(10, std::floor(std::log10(
float(speedFraction ? speedFraction : 1)) + 1));
2235 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_OVERRIDE_LIGHT: {} sets zone override light (zoneId: {}, areaLightId: {}, overrideLightId: {}, transitionMilliseconds: {})",
2245 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_OVERRIDE_WEATHER: {} sets zone weather (zoneId: {}, weatherId: {}, intensity: {})",
2319 if (!targets.empty())
2324 TC_LOG_WARN(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_ADD_TO_STORED_TARGET_LIST: var {}, baseObject {}, event {} - tried to add no targets to stored target list",
2345 ProcessEvent(linked, unit, var0, var1, bvar, spell, gob);
2360 RecalcTimer(e, std::min<uint32>(min, 5000), std::min<uint32>(min, 5000));
2363SmartScriptHolder SmartScript::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)
2399 scriptTrigger = invoker;
2401 scriptTrigger = tempLastInvoker;
2408 targets.push_back(baseObject);
2413 targets.push_back(victim);
2421 targets.push_back(u);
2424 targets.push_back(u);
2433 targets.push_back(u);
2436 targets.push_back(u);
2445 targets.push_back(u);
2448 targets.push_back(u);
2457 targets.push_back(u);
2460 targets.push_back(u);
2467 targets.push_back(u);
2472 targets.push_back(scriptTrigger);
2483 if (
Group* group = player->GetGroup())
2485 for (
GroupReference* groupRef = group->GetFirstMember(); groupRef !=
nullptr; groupRef = groupRef->next())
2486 if (
Player* member = groupRef->GetSource())
2487 if (member->IsInMap(player))
2488 targets.push_back(member);
2494 targets.push_back(scriptTrigger);
2512 targets.push_back(unit);
2533 targets.push_back(unit);
2554 targets.push_back(unit);
2575 targets.push_back(unit);
2584 if (!scriptTrigger && !baseObject)
2586 TC_LOG_ERROR(
"sql.sql",
"SMART_TARGET_CREATURE_GUID can not be used without invoker");
2592 targets.push_back(target);
2597 if (!scriptTrigger && !baseObject)
2599 TC_LOG_ERROR(
"sql.sql",
"SMART_TARGET_GAMEOBJECT_GUID can not be used without invoker");
2605 targets.push_back(target);
2613 if (!units.empty() && baseObject)
2616 targets.push_back(unit);
2626 targets.push_back(unit);
2633 ref = scriptTrigger;
2637 targets.assign(stored->begin(), stored->end());
2643 targets.push_back(target);
2649 targets.push_back(target);
2656 targets.push_back(target);
2665 if (!charmerOrOwnerGuid)
2667 if (
WorldObject* summoner = tempSummon->GetSummoner())
2668 charmerOrOwnerGuid = summoner->GetGUID();
2670 if (!charmerOrOwnerGuid)
2674 targets.push_back(owner);
2679 targets.push_back(owner);
2689 targets.push_back(base);
2698 targets.push_back(ref->GetVictim());
2705 targets.push_back(target);
2712 targets.push_back(target);
2721 for (
GroupReference* it = lootGroup->GetFirstMember(); it !=
nullptr; it = it->
next())
2722 if (
Player* recipient = it->GetSource())
2723 if (recipient->IsInMap(
me))
2724 targets.push_back(recipient);
2729 targets.push_back(recipient);
2740 targets.push_back(u);
2746 targets.push_back(target);
2851 std::vector<Creature*> creatures;
2853 if (creatures.empty())
2864 std::vector<Creature*> creatures;
2867 if (creatures.empty())
3167 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript: Gossip Select: menu {} action {}", var0, var1);
3207 Unit* unitTarget =
nullptr;
3223 if (
IsUnit(target) &&
me->
IsFriendlyTo(target->ToUnit()) && target->ToUnit()->IsAlive() && target->ToUnit()->IsInCombat())
3225 uint32 healthPct =
uint32(target->ToUnit()->GetHealthPct());
3229 unitTarget = target->
ToUnit();
3266 std::list<Creature*> list;
3270 creature = list.front();
3296 std::list<GameObject*> list;
3300 gameobject = list.front();
3406 Unit* invoker =
nullptr;
3414 if (scriptholder.event_id > e.
event_id)
3416 scriptholder.enableTimed =
true;
3453 mEvents.push_back(installevent);
3465 if (i->event_id ==
id)
3510 return creatureObj->IsCharmed();
3532 bool needCleanup =
true;
3535 if (scriptholder.enableTimed)
3536 needCleanup =
false;
3559 SmartAIEventStoredList::iterator i, icurr;
3567 bool needCleanup =
true;
3573 if (scriptholder.enableTimed)
3576 needCleanup =
false;
3610 std::sort(events.begin(), events.end());
3629 if (ignoreChanceRoll)
3640 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript: EventMap for Entry {} is empty but is using SmartScript.", obj->
GetEntry());
3642 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript: EventMap for AreaTrigger {} is empty but is using SmartScript.", at->
ID);
3647 #ifndef TRINITY_DEBUG
3661 mEvents.push_back(scriptholder);
3714 TC_LOG_ERROR(
"misc",
"SmartScript::OnInitialize: !WARNING! Player TypeID is only allowed for AreaTriggers");
3717 TC_LOG_ERROR(
"misc",
"SmartScript::OnInitialize: Unhandled TypeID !WARNING!");
3723 TC_LOG_ERROR(
"misc",
"SmartScript::OnInitialize: !WARNING! Initialized objects are NULL.");
3752 Unit* unit =
nullptr;
3764 Unit* unit =
nullptr;
3796 Unit* unit =
nullptr;
std::chrono::seconds Seconds
Seconds shorthand typedef.
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
std::string GetDebugInfo()
@ BROADCAST_TEXT_CALL_FOR_HELP
@ BROADCAST_TEXT_FLEE_FOR_ASSIST
#define TC_LOG_WARN(filterType__,...)
#define TC_LOG_DEBUG(filterType__,...)
#define TC_LOG_ERROR(filterType__,...)
uint32 urand(uint32 min, uint32 max)
bool roll_chance_i(int chance)
@ SPELL_FAILED_SPELL_IN_PROGRESS
@ SMART_SCRIPT_TYPE_TIMED_ACTIONLIST
@ SMART_SCRIPT_TYPE_CREATURE
@ SMART_SCRIPT_TYPE_GAMEOBJECT
@ SMART_SCRIPT_TYPE_AREATRIGGER
std::vector< SmartScriptHolder > SmartAIEventList
@ SMART_EVENT_FLAG_WHILE_CHARMED
@ SMART_EVENT_FLAG_DIFFICULTY_ALL
@ SMART_EVENT_FLAG_DONT_RESET
@ SMART_EVENT_FLAG_DEBUG_ONLY
@ SMART_EVENT_FLAG_TEMP_IGNORE_CHANCE_ROLL
@ SMART_EVENT_FLAG_NOT_REPEATABLE
@ SMART_TARGET_LOOT_RECIPIENTS
@ SMART_TARGET_CLOSEST_CREATURE
@ SMART_TARGET_CREATURE_DISTANCE
@ SMART_TARGET_HOSTILE_RANDOM_NOT_TOP
@ SMART_TARGET_INVOKER_PARTY
@ SMART_TARGET_CLOSEST_FRIENDLY
@ SMART_TARGET_CLOSEST_GAMEOBJECT
@ SMART_TARGET_VEHICLE_PASSENGER
@ SMART_TARGET_GAMEOBJECT_RANGE
@ SMART_TARGET_CREATURE_GUID
@ SMART_TARGET_PLAYER_RANGE
@ SMART_TARGET_CLOSEST_UNSPAWNED_GAMEOBJECT
@ SMART_TARGET_GAMEOBJECT_DISTANCE
@ SMART_TARGET_CREATURE_RANGE
@ SMART_TARGET_CLOSEST_PLAYER
@ SMART_TARGET_HOSTILE_RANDOM
@ SMART_TARGET_GAMEOBJECT_GUID
@ SMART_TARGET_HOSTILE_SECOND_AGGRO
@ SMART_TARGET_OWNER_OR_SUMMONER
@ SMART_TARGET_ACTION_INVOKER
@ SMART_TARGET_HOSTILE_LAST_AGGRO
@ SMART_TARGET_ACTION_INVOKER_VEHICLE
@ SMART_TARGET_THREAT_LIST
@ SMART_TARGET_CLOSEST_ENEMY
@ SMART_TARGET_PLAYER_DISTANCE
std::vector< WorldObject * > ObjectVector
@ SMART_SCRIPT_RESPAWN_CONDITION_AREA
@ SMART_SCRIPT_RESPAWN_CONDITION_MAP
@ SMART_ACTION_REMOVE_TIMED_EVENT
@ SMART_ACTION_UPDATE_TEMPLATE
@ SMART_ACTION_STORE_TARGET_LIST
@ SMART_ACTION_SET_HEALTH_REGEN
@ SMART_ACTION_ACTIVATE_GOBJECT
@ SMART_ACTION_FORCE_DESPAWN
@ SMART_ACTION_GAME_EVENT_START
@ SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST
@ SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1
@ SMART_ACTION_SET_DISABLE_GRAVITY
@ SMART_ACTION_SET_INST_DATA64
@ SMART_ACTION_SET_FACTION
@ SMART_ACTION_THREAT_SINGLE_PCT
@ SMART_ACTION_OFFER_QUEST
@ SMART_ACTION_OVERRIDE_LIGHT
@ SMART_ACTION_SET_INGAME_PHASE_MASK
@ SMART_ACTION_SET_UNIT_FIELD_BYTES_1
@ SMART_ACTION_CLOSE_GOSSIP
@ SMART_ACTION_DISABLE_EVADE
@ SMART_ACTION_LOAD_EQUIPMENT
@ SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS
@ SMART_ACTION_ATTACK_START
@ SMART_ACTION_CALL_GROUPEVENTHAPPENS
@ SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL
@ SMART_ACTION_INVOKER_CAST
@ SMART_ACTION_JUMP_TO_POS
@ SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST
@ SMART_ACTION_SEND_GOSSIP_MENU
@ SMART_ACTION_SET_COUNTER
@ SMART_ACTION_FLEE_FOR_ASSIST
@ SMART_ACTION_ATTACK_STOP
@ SMART_ACTION_SIMPLE_TALK
@ SMART_ACTION_SPAWN_SPAWNGROUP
@ SMART_ACTION_ALLOW_COMBAT_MOVEMENT
@ SMART_ACTION_THREAT_ALL_PCT
@ SMART_ACTION_SET_MOVEMENT_SPEED
@ SMART_ACTION_PLAY_CINEMATIC
@ SMART_ACTION_ADD_NPC_FLAG
@ SMART_ACTION_FAIL_QUEST
@ SMART_ACTION_INTERRUPT_SPELL
@ SMART_ACTION_RANDOM_SOUND
@ SMART_ACTION_SET_IMMUNE_PC
@ SMART_ACTION_SEND_TARGET_TO_TARGET
@ SMART_ACTION_REMOVE_POWER
@ SMART_ACTION_RESUME_MOVEMENT
@ SMART_ACTION_GO_SET_GO_STATE
@ SMART_ACTION_MOVE_OFFSET
@ SMART_ACTION_REMOVE_ITEM
@ SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL
@ SMART_ACTION_RANDOM_PHASE
@ SMART_ACTION_SET_EMOTE_STATE
@ SMART_ACTION_CROSS_CAST
@ SMART_ACTION_GAME_EVENT_STOP
@ SMART_ACTION_CALL_KILLEDMONSTER
@ SMART_ACTION_CALL_SCRIPT_RESET
@ SMART_ACTION_COMBAT_STOP
@ SMART_ACTION_ACTIVATE_GAMEOBJECT
@ SMART_ACTION_ADD_TO_STORED_TARGET_LIST
@ SMART_ACTION_SET_HEALTH_PCT
@ SMART_ACTION_AUTO_ATTACK
@ SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL
@ SMART_ACTION_SET_VISIBILITY
@ SMART_ACTION_RANDOM_PHASE_RANGE
@ SMART_ACTION_GO_SET_LOOT_STATE
@ SMART_ACTION_SET_INST_DATA
@ SMART_ACTION_CALL_FOR_HELP
@ SMART_ACTION_SET_UNINTERACTIBLE
@ SMART_ACTION_OVERRIDE_WEATHER
@ SMART_ACTION_ADD_THREAT
@ SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT
@ SMART_ACTION_PLAY_EMOTE
@ SMART_ACTION_SET_EVENT_PHASE
@ SMART_ACTION_DESPAWN_SPAWNGROUP
@ SMART_ACTION_SET_CORPSE_DELAY
@ SMART_ACTION_SET_SHEATH
@ SMART_ACTION_SET_ORIENTATION
@ SMART_ACTION_RESPAWN_BY_SPAWNID
@ SMART_ACTION_SET_NPC_FLAG
@ SMART_ACTION_MOVE_TO_POS
@ SMART_ACTION_RANDOM_EMOTE
@ SMART_ACTION_INC_EVENT_PHASE
@ SMART_ACTION_ENABLE_TEMP_GOBJ
@ SMART_ACTION_CREATE_TIMED_EVENT
@ SMART_ACTION_REMOVE_NPC_FLAG
@ SMART_ACTION_SUMMON_CREATURE
@ SMART_ACTION_RESET_GOBJECT
@ SMART_ACTION_CALL_TIMED_ACTIONLIST
@ SMART_ACTION_SET_IN_COMBAT_WITH_ZONE
@ SMART_ACTION_SET_HOME_POS
@ SMART_ACTION_SET_ACTIVE
@ SMART_ACTION_SET_RANGED_MOVEMENT
@ SMART_ACTION_ACTIVATE_TAXI
@ SMART_ACTION_START_CLOSEST_WAYPOINT
@ SMART_ACTION_SUMMON_CREATURE_GROUP
@ SMART_ACTION_SET_REACT_STATE
@ SMART_ACTION_RANDOM_MOVE
@ SMART_ACTION_SET_IMMUNE_NPC
@ SMART_ACTION_TRIGGER_TIMED_EVENT
@ SMART_ACTION_REMOVEAURASFROMSPELL
@ SMART_ACTION_PAUSE_MOVEMENT
@ SMART_EVENT_ACTION_DONE
@ SMART_EVENT_SUMMON_DESPAWNED
@ SMART_EVENT_RECEIVE_EMOTE
@ SMART_EVENT_FRIENDLY_HEALTH_PCT
@ SMART_EVENT_ON_AURA_APPLIED
@ SMART_EVENT_RECEIVE_HEAL
@ SMART_EVENT_TIMED_EVENT_TRIGGERED
@ SMART_EVENT_QUEST_COMPLETION
@ SMART_EVENT_JUST_CREATED
@ SMART_EVENT_AREATRIGGER_ONTRIGGER
@ SMART_EVENT_DISTANCE_GAMEOBJECT
@ SMART_EVENT_ON_SPELLCLICK
@ SMART_EVENT_MOVEMENTINFORM
@ SMART_EVENT_PASSENGER_REMOVED
@ SMART_EVENT_ON_AURA_REMOVED
@ SMART_EVENT_INSTANCE_PLAYER_ENTER
@ SMART_EVENT_WAYPOINT_PAUSED
@ SMART_EVENT_REACHED_HOME
@ SMART_EVENT_TRANSPORT_ADDCREATURE
@ SMART_EVENT_REWARD_QUEST
@ SMART_EVENT_GO_EVENT_INFORM
@ SMART_EVENT_GO_LOOT_STATE_CHANGED
@ SMART_EVENT_JUST_SUMMONED
@ SMART_EVENT_ON_SPELL_CAST
@ SMART_EVENT_SPELLHIT_TARGET
@ SMART_EVENT_GAME_EVENT_START
@ SMART_EVENT_TRANSPORT_REMOVE_PLAYER
@ SMART_EVENT_GOSSIP_HELLO
@ SMART_EVENT_GOSSIP_SELECT
@ SMART_EVENT_CORPSE_REMOVED
@ SMART_EVENT_PASSENGER_BOARDED
@ SMART_EVENT_TRANSPORT_ADDPLAYER
@ SMART_EVENT_WAYPOINT_ENDED
@ SMART_EVENT_ACCEPTED_QUEST
@ SMART_EVENT_COUNTER_SET
@ SMART_EVENT_FRIENDLY_MISSING_BUFF
@ SMART_EVENT_WAYPOINT_RESUMED
@ SMART_EVENT_ON_SPELL_FAILED
@ SMART_EVENT_WAYPOINT_REACHED
@ SMART_EVENT_TARGET_BUFFED
@ SMART_EVENT_QUEST_ACCEPTED
@ SMART_EVENT_QUEST_REWARDED
@ SMART_EVENT_TRANSPORT_RELOCATE
@ SMART_EVENT_GAME_EVENT_END
@ SMART_EVENT_FOLLOW_COMPLETED
@ SMART_EVENT_QUEST_OBJ_COMPLETION
@ SMART_EVENT_DISTANCE_CREATURE
@ SMART_EVENT_WAYPOINT_STOPPED
@ SMART_EVENT_SUMMONED_UNIT_DIES
@ SMART_EVENT_FRIENDLY_IS_CC
@ SMART_EVENT_ON_SPELL_START
@ SMART_EVENT_VICTIM_CASTING
@ SMART_EVENT_DAMAGED_TARGET
@ SMART_EVENT_SUMMONED_UNIT
SmartActionSummonCreatureFlags
@ SMARTAI_SPAWN_FLAG_FORCE_SPAWN
@ SMARTAI_SPAWN_FLAG_NOSAVE_RESPAWN
@ SMARTAI_SPAWN_FLAG_IGNORE_RESPAWN
@ SMARTCAST_INTERRUPT_PREVIOUS
@ SMARTCAST_AURA_NOT_PRESENT
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ MOVEMENTFLAG_ONTRANSPORT
NPCFlags
Non Player Character flags.
#define MAX_EQUIPMENT_ITEMS
@ UNIT_FLAG_IMMUNE_TO_NPC
@ UNIT_FLAG_UNINTERACTIBLE
@ UNIT_STATE_LOST_CONTROL
void DoZoneInCombat(Creature *creature=nullptr)
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
void SetHomePosition(float x, float y, float z, float o)
void GetRespawnPosition(float &x, float &y, float &z, float *ori=nullptr, float *dist=nullptr) const
void CallForHelp(float fRadius)
void GetHomePosition(float &x, float &y, float &z, float &ori) const
void GetTransportHomePosition(float &x, float &y, float &z, float &ori) const
bool IsEngaged() const override
void DoFleeToGetAssistance()
Player * GetLootRecipient() const
ObjectGuid::LowType GetSpawnId() const
Group * GetLootRecipientGroup() const
Unit * SelectNearestTarget(float dist=0, bool playerOnly=false) const
bool IsInEvadeMode() const
virtual void SetData(uint32, uint32)
ObjectGuid GetOwnerGUID() const override
GameObjectAI * AI() const
ObjectGuid::LowType GetSpawnId() const
virtual bool SetBossState(uint32 id, EncounterState state)
static char const * GetBossStateName(uint8 state)
bool SpawnGroupSpawn(uint32 groupId, bool ignoreRespawn=false, bool force=false, std::vector< WorldObject * > *spawnedObjects=nullptr)
uint8 GetSpawnMode() const
GameObjectBySpawnIdContainer & GetGameObjectBySpawnIdStore()
bool SpawnGroupDespawn(uint32 groupId, bool deleteRespawnTimes=false, size_t *count=nullptr)
CreatureBySpawnIdContainer & GetCreatureBySpawnIdStore()
void Respawn(RespawnInfo *info, CharacterDatabaseTransaction dbTrans=nullptr)
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={})
void MoveRandom(float wanderDistance=0.0f)
static ObjectGuid const Empty
std::string ToString() const
static uint32 ChooseDisplayId(CreatureTemplate const *cinfo, CreatureData const *data=nullptr)
static Creature * ToCreature(Object *o)
static Unit * ToUnit(Object *o)
static GameObject * ToGameObject(Object *o)
static ObjectGuid GetGUID(Object const *o)
static Player * ToPlayer(Object *o)
void GroupEventHappens(uint32 questId, WorldObject const *pEventObject)
static SmartScriptHolder & FindLinkedEvent(SmartAIEventList &list, uint32 link)
void SetInvincibilityHpLevel(uint32 level)
bool CheckTimer(SmartScriptHolder const &e) const
static constexpr uint32 MAX_NESTED_EVENTS
void DoFindFriendlyMissingBuff(std::vector< Creature * > &creatures, float range, uint32 spellid) const
void OnUpdate(const uint32 diff)
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 DoFindFriendlyCC(std::vector< Creature * > &creatures, float range) const
SmartScriptType mScriptType
void ProcessAction(SmartScriptHolder &e, Unit *unit=nullptr, uint32 var0=0, uint32 var1=0, bool bvar=false, SpellInfo const *spell=nullptr, GameObject *gob=nullptr)
void UpdateTimer(SmartScriptHolder &e, uint32 const diff)
void SortEvents(SmartAIEventList &events)
static void RecalcTimer(SmartScriptHolder &e, uint32 min, uint32 max)
void ProcessEvent(SmartScriptHolder &e, Unit *unit=nullptr, uint32 var0=0, uint32 var1=0, bool bvar=false, SpellInfo const *spell=nullptr, GameObject *gob=nullptr)
uint32 GetCounterValue(uint32 id) const
static bool IsCharmedCreature(WorldObject *obj)
void StoreTargetList(ObjectVector const &targets, uint32 id)
static bool IsUnit(WorldObject *obj)
void AddToStoredTargetList(ObjectVector const &targets, uint32 id)
void RetryLater(SmartScriptHolder &e, bool ignoreChanceRoll=false)
SmartAIEventStoredList mStoredEvents
void RaisePriority(SmartScriptHolder &e)
static bool IsPlayer(WorldObject *obj)
Unit * GetLastInvoker(Unit *invoker=nullptr) const
static bool IsCreature(WorldObject *obj)
void FillScript(SmartAIEventList e, WorldObject *obj, AreaTriggerEntry const *at)
void OnMoveInLineOfSight(Unit *who)
bool IsSmart(Creature *c, bool silent=false) const
WorldObject * GetBaseObjectOrPlayerTrigger() const
Unit * DoSelectLowestHpFriendly(float range, uint32 MinHPDiff) const
bool IsInPhase(uint32 p) const
SmartAIEventList mInstallEvents
static void InitTimer(SmartScriptHolder &e)
AreaTriggerEntry const * trigger
Unit * DoSelectLowestHpPercentFriendly(float range, uint32 minHpPct, uint32 maxHpPct) const
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)
void OnInitialize(WorldObject *obj, AreaTriggerEntry const *at=nullptr)
void StoreCounter(uint32 id, uint32 value, uint32 reset)
WorldObject * GetBaseObject() const
void GetWorldObjectsInDist(ObjectVector &objects, float dist) const
uint32 mNestedEventsCounter
Creature * FindCreatureNear(WorldObject *searchObject, ObjectGuid::LowType guid) const
static bool IsGameObject(WorldObject *obj)
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
bool isProcessingTimedActionList
ObjectVector const * GetStoredTargetVector(uint32 id, WorldObject const &ref) const
Unit * DoFindClosestFriendlyInRange(float range, bool playerOnly) const
SmartAIEventList mTimedActionList
ObjectVectorMap _storedTargets
void SetTimedActionList(SmartScriptHolder &e, uint32 entry, Unit *invoker)
bool mEventSortingRequired
ObjectGuid mTimedActionListInvoker
void RemoveStoredEvent(uint32 id)
std::vector< uint32 > mRemIDs
GameObject * FindGameObjectNear(WorldObject *searchObject, ObjectGuid::LowType guid) const
void ModifyThreatByPercent(Unit *target, int32 percent)
Trinity::IteratorPair< ThreatListIterator, std::nullptr_t > GetUnsortedThreatList() const
void AddThreat(Unit *target, float amount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false, bool ignoreRedirects=false)
== AFFECT MY THREAT LIST ==
std::vector< ThreatReference * > GetModifiableThreatList()
virtual void SetData(uint32, uint32)
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
virtual void AttackStart(Unit *)
Vehicle * GetVehicle() const
float GetHealthPct() const
void KillSelf(bool durabilityLoss=true)
bool CanHaveThreatList() const
====================== THREAT & COMBAT ====================
ThreatManager & GetThreatManager()
bool IsWithinCombatRange(Unit const *obj, float dist2compare) const
ObjectGuid GetCreatorGUID() const
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
MotionMaster * GetMotionMaster()
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
uint32 GetMaxHealth() const
TempSummon * ToTempSummon()
ObjectGuid GetCharmerOrOwnerGUID() const override
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Unit * EnsureVictim() const
virtual void SetSheath(SheathState sheathed)
void SetFacingToObject(WorldObject const *object, bool force=true, uint32 movementId=EVENT_FACE)
uint32 GetAuraCount(uint32 spellId) const
bool HasUnitMovementFlag(uint32 f) const
uint32 GetMaxPower(Powers power) const
TransportBase * GetDirectTransport() const
Returns the transport this unit is on directly (if on vehicle and transport, return vehicle)
ObjectGuid GetTransGUID() const override
bool HasUnitState(const uint32 f) const
float GetPowerPct(Powers power) const
void SetFacingTo(float ori, bool force=true, uint32 movementId=EVENT_FACE)
void CombatStop(bool includingCast=false, bool mutualPvP=true)
Vehicle * GetVehicleKit() const
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Unit * GetBase() const
May be called from scripts.
SeatMap Seats
The collection of all seats on the vehicle. Including vacant ones.
GameObject * FindNearestGameObject(uint32 entry, float range, bool spawnedOnly=true) const
Player * SelectNearestPlayer(float distance) const
InstanceScript * GetInstanceScript() const
void GetCreatureListWithEntryInGrid(Container &creatureContainer, uint32 entry, float maxSearchRange=250.0f) const
ObjectGuid GetPrivateObjectOwner() const
void GetGameObjectListWithEntryInGrid(Container &gameObjectContainer, uint32 entry, float maxSearchRange=250.0f) const
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
bool IsHostileTo(WorldObject const *target) const
virtual ObjectGuid GetCharmerOrOwnerGUID() const
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
bool IsPrivateObject() const
GameObject * SummonGameObject(uint32 entry, Position const &pos, QuaternionData const &rot, Seconds respawnTime, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
std::string const & GetName() const
bool IsWithinLOSInMap(WorldObject const *obj, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
void GetContactPoint(WorldObject const *obj, float &x, float &y, float &z, float distance2d=CONTACT_DISTANCE) const
GameObject * FindNearestUnspawnedGameObject(uint32 entry, float range) const
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
bool IsInRange(WorldObject const *obj, float minRange, float maxRange, bool is3D=true) const
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
bool IsFriendlyTo(WorldObject const *target) const
Player session in the World.
virtual void SetData(uint32, uint32)
virtual void SetGuidData(uint32, ObjectGuid)
TC_GAME_API WorldObject * GetWorldObject(WorldObject const &, ObjectGuid const &)
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
void RandomResize(C &container, std::size_t requestedSize)
static void VisitAllObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
uint32 ItemEntry[MAX_EQUIPMENT_ITEMS]
Position GetPositionWithOffset(Position const &offset) const
float GetPositionZ() const
float GetOrientation() const
float GetPositionX() const
void GetPosition(float &x, float &y) const
float GetPositionY() const
static QuaternionData fromEulerAnglesZYX(float Z, float Y, float X)
struct SmartAction::@65::@144 loadEquipment
struct SmartAction::@65::@97 invincHP
struct SmartAction::@65::@161 raw
struct SmartAction::@65::@83 combatMove
struct SmartAction::@65::@102 summonGO
struct SmartAction::@65::@70 morphOrMount
struct SmartAction::@65::@146 pauseMovement
struct SmartAction::@65::@139 closestWaypointFromList
struct SmartAction::@65::@69 faction
struct SmartAction::@65::@130 sendTargetToTarget
struct SmartAction::@65::@129 setGoLootState
struct SmartAction::@65::@85 incEventPhase
struct SmartAction::@65::@106 wpPause
uint32 wps[SMART_ACTION_PARAM_COUNT]
struct SmartAction::@65::@111 teleport
struct SmartAction::@65::@99 setData
struct SmartAction::@65::@137 gameEventStop
struct SmartAction::@65::@157 setUninteractible
struct SmartAction::@65::@134 goState
struct SmartAction::@65::@155 setImmunePC
uint32 emotes[SMART_ACTION_PARAM_COUNT]
uint32 transitionMilliseconds
struct SmartAction::@65::@92 setInstanceData64
struct SmartAction::@65::@127 moveToPos
struct SmartAction::@65::@152 setHover
struct SmartAction::@65::@118 setunitByte
struct SmartAction::@65::@126 enableTempGO
struct SmartAction::@65::@128 sendGossipMenu
struct SmartAction::@65::@141 corpseDelay
struct SmartAction::@65::@121 randTimedActionList
struct SmartAction::@65::@108 item
struct SmartAction::@65::@140 randomSound
struct SmartAction::@65::@78 crossCast
struct SmartAction::@65::@138 gameEventStart
struct SmartAction::@65::@74 questOffer
SAIBool toRespawnPosition
struct SmartAction::@65::@110 setDisableGravity
struct SmartAction::@65::@160 resumeMovement
struct SmartAction::@65::@153 evade
struct SmartAction::@65::@89 randomPhaseRange
struct SmartAction::@65::@120 timedActionList
struct SmartAction::@65::@115 movie
struct SmartAction::@65::@158 activateGameObject
struct SmartAction::@65::@81 threat
struct SmartAction::@65::@67 talk
struct SmartAction::@65::@114 timeEvent
struct SmartAction::@65::@151 overrideWeather
struct SmartAction::@65::@147 respawnData
struct SmartAction::@65::@100 moveRandom
struct SmartAction::@65::@131 setRangedMovement
uint32 actionLists[SMART_ACTION_PARAM_COUNT]
struct SmartAction::@65::@150 overrideLight
struct SmartAction::@65::@156 setImmuneNPC
struct SmartAction::@65::@125 fleeAssist
struct SmartAction::@65::@148 cinematic
uint32 phases[SMART_ACTION_PARAM_COUNT]
struct SmartAction::@65::@104 taxi
struct SmartAction::@65::@154 setHealthPct
struct SmartAction::@65::@132 setHealthRegen
struct SmartAction::@65::@75 react
struct SmartAction::@65::@123 interruptSpellCasting
struct SmartAction::@65::@88 randomPhase
struct SmartAction::@65::@93 updateTemplate
struct SmartAction::@65::@96 forceDespawn
struct SmartAction::@65::@124 jump
struct SmartAction::@65::@136 power
struct SmartAction::@65::@86 removeAura
SAIBool disablePathfinding
struct SmartAction::@65::@98 ingamePhaseMask
struct SmartAction::@65::@91 setInstanceData
struct SmartAction::@65::@77 cast
struct SmartAction::@65::@68 simpleTalk
struct SmartAction::@65::@133 setRoot
struct SmartAction::@65::@109 setRun
struct SmartAction::@65::@142 disableEvade
struct SmartAction::@65::@113 storeTargets
struct SmartAction::@65::@76 randomEmote
struct SmartAction::@65::@82 autoAttack
struct SmartAction::@65::@87 follow
struct SmartAction::@65::@94 callHelp
struct SmartAction::@65::@105 wpStart
struct SmartAction::@65::@101 visibility
struct SmartAction::@65::@116 equip
struct SmartAction::@65::@79 summonCreature
struct SmartAction::@65::@107 wpStop
struct SmartAction::@65::@149 movementSpeed
struct SmartAction::@65::@159 addToStoredTargets
struct SmartAction::@65::@143 groupSpawn
struct SmartAction::@65::@80 threatPCT
struct SmartAction::@65::@103 active
struct SmartAction::@65::@84 setEventPhase
struct SmartAction::@65::@145 randomTimedEvent
struct SmartAction::@65::@112 setCounter
struct SmartAction::@65::@122 randRangeTimedActionList
struct SmartAction::@65::@95 setSheath
struct SmartAction::@65::@90 killedMonster
struct SmartAction::@65::@135 creatureGroup
struct SmartEvent::@29::@62 counter
struct SmartEvent::@29::@36 minMax
struct SmartEvent::@29::@56 gameEvent
struct SmartEvent::@29::@50 instancePlayerEnter
struct SmartEvent::@29::@45 movementInform
struct SmartEvent::@29::@44 charm
struct SmartEvent::@29::@52 textOver
struct SmartEvent::@29::@32 kill
struct SmartEvent::@29::@40 summoned
struct SmartEvent::@29::@54 gossipHello
struct SmartEvent::@29::@59 doAction
struct SmartEvent::@29::@37 targetCasting
struct SmartEvent::@29::@48 transportAddCreature
struct SmartEvent::@29::@43 aura
struct SmartEvent::@29::@46 dataSet
struct SmartEvent::@29::@58 eventInform
struct SmartEvent::@29::@39 missingBuff
uint32 hostilityMode
Hostility mode of the event. 0: hostile, 1: not hostile, 2: any.
struct SmartEvent::@29::@49 transportRelocate
struct SmartEvent::@29::@61 distance
struct SmartEvent::@29::@38 friendlyCC
struct SmartEvent::@29::@34 los
struct SmartEvent::@29::@63 spellCast
struct SmartEvent::@29::@35 respawn
struct SmartEvent::@29::@60 friendlyHealthPct
struct SmartEvent::@29::@57 goLootStateChanged
struct SmartEvent::@29::@33 spellHit
struct SmartEvent::@29::@53 timedEvent
struct SmartEvent::@29::@47 waypoint
struct SmartEvent::@29::@51 areatrigger
struct SmartEvent::@29::@64 raw
struct SmartEvent::@29::@55 gossip
struct SmartEvent::@29::@31 minMaxRepeat
static constexpr uint32 DEFAULT_PRIORITY
uint32 GetScriptType() const
uint32 GetEventType() const
uint32 GetTargetType() const
SmartScriptType source_type
uint32 GetActionType() const
struct SmartTarget::@162::@180 vehicle
struct SmartTarget::@162::@170 playerRange
struct SmartTarget::@162::@166 unitRange
struct SmartTarget::@162::@179 owner
struct SmartTarget::@162::@175 unitClosest
struct SmartTarget::@162::@171 stored
struct SmartTarget::@162::@167 unitGUID
SAIBool useCharmerOrOwner
struct SmartTarget::@162::@173 goGUID
struct SmartTarget::@162::@181 threatList
struct SmartTarget::@162::@178 closestFriendly
struct SmartTarget::@162::@177 closestAttackable
struct SmartTarget::@162::@172 goRange
struct SmartTarget::@162::@168 unitDistance
struct SmartTarget::@162::@174 goDistance
struct SmartTarget::@162::@182 raw
struct SmartTarget::@162::@169 playerDistance
struct SmartTarget::@162::@165 farthest
struct SmartTarget::@162::@176 goClosest
struct SmartTarget::@162::@164 hostilRandom
std::vector< WaypointNode > nodes