91 if (!smart && !silent)
106 if (!smart && !silent)
138 itr->second.AddGuid(obj->GetGUID());
145 return itr->second.GetObjectVector(ref);
155 itr->second += value;
176 if (bounds.first == bounds.second)
179 return bounds.first->second;
185 if (bounds.first == bounds.second)
188 auto creatureItr = std::find_if(bounds.first, bounds.second, [](Map::CreatureBySpawnIdContainer::value_type
const& pair)
190 return pair.second->IsAlive();
193 return creatureItr != bounds.second ? creatureItr->second : bounds.first->second;
204 event.runOnce =
false;
258 TC_LOG_WARN(
"scripts.ai",
"SmartScript::ProcessEventsFor: reached the limit of max allowed nested ProcessEventsFor() calls with event {}, skipping!\n{}", e,
GetBaseObject()->
GetDebugInfo());
279template <
typename Result,
typename ConcreteActionImpl = Scripting::v2::ActionResult<Result>,
typename... Args>
280static std::shared_ptr<ConcreteActionImpl> CreateTimedActionListWaitEventFor(
SmartScriptHolder const& e, Args&&... args)
288 return std::make_shared<ConcreteActionImpl>(std::forward<Args>(args)...);
291template <
typename InnerResult>
294 std::vector<Scripting::v2::ActionResult<InnerResult>> Results;
296 explicit MultiActionResult(std::size_t estimatedSize) { Results.reserve(estimatedSize); }
298 bool IsReady() const noexcept
override
323 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: Invoker: {} {}", tempInvoker->GetName(), tempInvoker->GetGUID());
326 GetTargets(targets, e, Coalesce<WorldObject>(unit, gob));
333 Unit* talkTarget =
nullptr;
339 if (targetUnit->IsPet())
345 talkTarget = targetUnit;
366 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_TALK: talker: {} {}, textGuid: {}",
378 duration = std::max(
sCreatureTextMgr->SendChat(
me,
uint8(e.
action.
simpleTalk.
textGroupID),
Object::ToPlayer(
GetLastInvoker()),
CHAT_MSG_ADDON,
LANG_ADDON,
TEXT_RANGE_NORMAL, 0,
SoundKitPlayType::Normal,
TEAM_OTHER,
false, playerTarget), duration);
379 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SIMPLE_TALK: talker: {} {}, textGroupId: {}",
392 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_PLAY_EMOTE: target: {} {}, emote: {}",
393 target->GetName(), target->GetGUID(), e.
action.
emote.emote);
407 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SOUND: target: {} {}, sound: {}, onlyself: {}",
421 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature {} set faction to {}",
426 creatureTarget->RestoreFaction();
427 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature {} set faction to {}",
428 target->GetGUID(), creatureTarget->GetFaction());
451 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature {} set displayid to {}",
459 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature {} set displayid to {}",
466 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature {} demorphs.",
479 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_FAIL_QUEST: Player {} fails quest {}",
504 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_OFFER_QUEST: Player {} - quest {} added",
529 unitTarget->HandleEmoteCommand(emote);
530 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_RANDOM_EMOTE: Creature {} handle random emote {}",
531 target->GetGUID(), emote);
544 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_THREAT_ALL_PCT: Creature {} modify threat for unit {}, value {}",
559 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_THREAT_SINGLE_PCT: Creature {} modify threat for unit {}, value {}",
573 bool failedSpellCast =
false, successfulSpellCast =
false;
584 std::shared_ptr<MultiActionResult<SpellCastResult>> waitEvent = CreateTimedActionListWaitEventFor<void, MultiActionResult<SpellCastResult>>(e, targets.size());
588 if (e.action.cast.castFlags &
SMARTCAST_AURA_NOT_PRESENT && (!target->IsUnit() || target->ToUnit()->HasAura(e.action.cast.spell)))
590 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());
606 result =
me->
CastSpell(target, e.action.cast.spell, args);
609 result =
go->
CastSpell(target, e.action.cast.spell, args);
619 failedSpellCast =
true;
621 successfulSpellCast =
true;
623 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_CAST:: {} casts spell {} on target {} with castflags {}",
624 me ?
me->
GetGUID() :
go->
GetGUID(), e.action.cast.spell, target->GetGUID(), e.action.cast.castFlags);
627 if (waitEvent && !waitEvent->Results.empty())
631 if (failedSpellCast && !successfulSpellCast)
647 std::shared_ptr<MultiActionResult<SpellCastResult>> waitEvent = CreateTimedActionListWaitEventFor<void, MultiActionResult<SpellCastResult>>(e, targets.size());
652 if (e.action.cast.triggerFlags)
660 if (e.action.cast.castFlags &
SMARTCAST_AURA_NOT_PRESENT && (!target->IsUnit() || target->ToUnit()->HasAura(e.action.cast.spell)))
670 target->ToUnit()->InterruptNonMeleeSpells(
false);
672 target->CastSpell(target, e.action.cast.spell, args);
674 if (waitEvent && !waitEvent->Results.empty())
681 if (!tempLastInvoker)
699 std::shared_ptr<MultiActionResult<SpellCastResult>> waitEvent = CreateTimedActionListWaitEventFor<void, MultiActionResult<SpellCastResult>>(e, targets.size());
703 if (e.action.cast.castFlags &
SMARTCAST_AURA_NOT_PRESENT && (!target->IsUnit() || target->ToUnit()->HasAura(e.action.cast.spell)))
705 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());
718 tempLastInvoker->
CastSpell(target, e.action.cast.spell, args);
719 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_INVOKER_CAST: Invoker {} casts spell {} on target {} with castflags {}",
720 tempLastInvoker->
GetGUID(), e.action.cast.spell, target->GetGUID(), e.action.cast.castFlags);
722 if (waitEvent && !waitEvent->Results.empty())
734 gameObject->UseDoorOrButton(0,
false, unit);
735 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_ACTIVATE_GOBJECT. Gameobject {} activated",
747 gameObject->ResetDoorOrButton();
748 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_RESET_GOBJECT. Gameobject {} reset",
761 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_EMOTE_STATE. Unit {} set emotestate to {}",
770 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_AUTO_ATTACK: Creature: {} bool on = {}",
781 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_ALLOW_COMBAT_MOVEMENT: Creature {} bool on = {}",
791 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_EVENT_PHASE: Creature {} set event phase {}",
802 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_INC_EVENT_PHASE: Creature {} inc event phase by {}, "
816 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_EVADE: Creature {} EnterEvadeMode",
me->
GetGUID());
831 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_FLEE_FOR_ASSIST: Creature {} DoFleeToGetAssistance",
me->
GetGUID());
840 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_COMBAT_STOP: {} CombatStop",
me->
GetGUID());
872 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_REMOVEAURASFROMSPELL: Unit {}, spell {}",
894 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_FOLLOW: Creature {} following target {}",
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 {}",
938 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player {}, Killcredit: {}",
950 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player {}, Killcredit: {}",
954 if (
Vehicle* vehicle = unitTarget->GetVehicleKit())
955 for (std::pair<int8 const, VehicleSeat>& seat : vehicle->Seats)
982 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA: SetData Field: {}, data: {}",
987 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA: SetBossState BossId: {}, State: {} ({})",
1011 if (targets.empty())
1015 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: {}, data: {}",
1031 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_DIE: Creature {}",
me->
GetGUID());
1040 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_SET_IN_COMBAT_WITH_ZONE: Creature {}",
me->
GetGUID());
1054 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_CALL_FOR_HELP: Creature {}",
me->
GetGUID());
1063 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_SET_SHEATH: Creature {}, State: {}",
1072 if (despawnDelay <= 0ms)
1080 creature->DespawnOrUnsummon(despawnDelay, forceRespawnTimer);
1082 goTarget->DespawnOrUnsummon(despawnDelay, forceRespawnTimer);
1176 unitTarget->AttackStop();
1185 std::shared_ptr<MultiActionResult<MovementStopReason>> waitEvent = CreateTimedActionListWaitEventFor<void, MultiActionResult<MovementStopReason>>(e, targets.size());
1190 if (!creatureTarget)
1201 x = pos.
GetPositionX() + (std::cos(o - (
M_PI / 2))*e.target.x) + (std::cos(o)*e.target.y);
1202 y = pos.
GetPositionY() + (std::sin(o - (
M_PI / 2))*e.target.x) + (std::sin(o)*e.target.y);
1212 if (waitEvent && !waitEvent->Results.empty())
1234 std::erase_if(targets, [](
WorldObject const* target)
1236 return !target->
IsUnit();
1239 if (targets.empty())
1268 for (
SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
1276 auto DoSummon = [&](
float x,
float y,
float z,
float o,
Unit* attackTarget)
1278 for (
uint32 counter = 0; counter < spawnsCount; counter++)
1280 if (
TempSummon* summon = summoner->
GetMap()->
SummonCreature(e.
action.
summonCreature.
creature, { x, y, z, o }, summonProperties,
Milliseconds(e.
action.
summonCreature.
duration), summoner, e.
action.
summonCreature.
createdBySpell, 0, privateObjectOwner))
1285 if (attackInvoker && attackTarget)
1286 summon->AI()->AttackStart(attackTarget);
1294 target->GetPosition(x, y, z, o);
1299 DoSummon(x, y, z, o, target->ToUnit());
1339 unitTarget->KillSelf();
1389 if (!targets.empty())
1398 TC_LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SET_COUNTER is not using SmartAI, skipping");
1405 TC_LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SET_COUNTER is not using SmartGameObjectAI, skipping");
1423 if (target->IsPlayer())
1430 std::shared_ptr<Scripting::v2::ActionResult<MovementStopReason>> waitEvent = CreateTimedActionListWaitEventFor<MovementStopReason>(e);
1483 else if (!targets.empty())
1502 if (!targets.empty())
1509 std::shared_ptr<Scripting::v2::ActionResult<MovementStopReason>> waitEvent = CreateTimedActionListWaitEventFor<MovementStopReason>(e);
1542 if (target->IsCreature())
1543 TC_LOG_WARN(
"sql.sql",
"Invalid creature target '{}' (entry {}, spawnId {}) specified for SMART_ACTION_ENABLE_TEMP_GOBJ", target->GetName(), target->GetEntry(), target->ToCreature()->GetSpawnId());
1546 if (gameObject->isSpawnedByDefault())
1547 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(), gameObject->GetSpawnId());
1558 playerTarget->PlayerTalkClass->SendCloseGossip();
1567 std::array<EquipmentItem, MAX_EQUIPMENT_ITEMS> slot;
1573 TC_LOG_ERROR(
"sql.sql",
"SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info id {} for creature {}", equipId, npc->GetEntry());
1577 npc->SetCurrentEquipmentId(equipId);
1579 std::copy(std::begin(eInfo->
Items), std::end(eInfo->
Items), std::begin(slot));
1590 npc->SetVirtualItem(i, slot[i].
ItemId, slot[i].AppearanceModId, slot[i].ItemVisual);
1651 if (
IsSmart(creature) && creature->GetVictim())
1653 creature->StartDefaultCombatMovement(creature->GetVictim(), attackDistance, attackAngle);
1707 if (targets.empty())
1711 GetTargets(casters,
CreateSmartEvent(
SMART_EVENT_UPDATE_IC, 0, 0, 0, 0, 0, 0,
SMART_ACTION_NONE, 0, 0, 0, 0, 0, 0, 0, (
SMARTAI_TARGETS)e.
action.
crossCast.
targetType, e.
action.
crossCast.
targetParam1, e.
action.
crossCast.
targetParam2, e.
action.
crossCast.
targetParam3, e.
action.
crossCast.
targetParam4, e.
action.
param_string, 0), unit);
1713 std::shared_ptr<MultiActionResult<SpellCastResult>> waitEvent = CreateTimedActionListWaitEventFor<void, MultiActionResult<SpellCastResult>>(e, casters.size()* targets.size());
1725 bool interruptedSpell =
false;
1729 if (e.action.crossCast.castFlags &
SMARTCAST_AURA_NOT_PRESENT && (!target->IsUnit() || target->ToUnit()->HasAura(e.action.crossCast.spell)))
1731 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());
1738 interruptedSpell =
true;
1747 casterUnit->
CastSpell(target, e.action.crossCast.spell, args);
1750 if (waitEvent && !waitEvent->Results.empty())
1813 std::shared_ptr<MultiActionResult<MovementStopReason>> waitEvent = CreateTimedActionListWaitEventFor<void, MultiActionResult<MovementStopReason>>(e, targets.size());
1823 if (!playerTarget->ActivateTaxiPathTo(e.action.taxi.id, 0, {}, scriptResult))
1828 if (waitEvent && !waitEvent->Results.empty())
1834 bool foundTarget =
false;
1845 creatureTarget->GetMotionMaster()->MoveIdle();
1915 if (!targets.empty())
1930 std::shared_ptr<Scripting::v2::ActionResult<MovementStopReason>> waitEvent = CreateTimedActionListWaitEventFor<MovementStopReason>(e);
1938 {},
false,
false, {},
nullptr,
nullptr, std::move(actionResultSetter));
1977 TC_LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartAI, skipping");
1984 TC_LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartGameObjectAI, skipping");
1994 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SEND_GOSSIP_MENU: gossipMenuId {}, gossipNpcTextId {}",
2013 if (!gossipNpcTextId)
2039 creatureTarget->SetHomePosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation());
2042 TC_LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SET_HOME_POS is invalid, skipping");
2063 std::list<TempSummon*> summonList;
2068 summon->AI()->AttackStart(unit);
2100 TC_LOG_ERROR(
"sql.sql",
"SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_STOP, inactive event (id: {})", eventId);
2111 TC_LOG_ERROR(
"sql.sql",
"SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_START, already activated event (id: {})", eventId);
2119 float distanceToClosest = std::numeric_limits<float>::max();
2120 std::pair<uint32, uint32> closest = { 0, 0 };
2122 std::shared_ptr<MultiActionResult<MovementStopReason>> waitEvent = CreateTimedActionListWaitEventFor<void, MultiActionResult<MovementStopReason>>(e, targets.size());
2130 for (
uint32 pathId : e.action.closestWaypointFromList.wps)
2133 if (!path || path->
Nodes.empty())
2139 if (distanceToThisNode < distanceToClosest)
2141 distanceToClosest = distanceToThisNode;
2142 closest.first = pathId;
2148 if (closest.first != 0)
2154 ENSURE_AI(
SmartAI, creature->AI())->StartPath(closest.first,
true,
nullptr, closest.second, 0, std::move(actionResultSetter));
2160 if (waitEvent && !waitEvent->Results.empty())
2175 target->PlayDistanceSound(sound, onlySelf ? target->ToPlayer() :
nullptr);
2177 target->PlayDirectSound(sound, onlySelf ? target->ToPlayer() :
nullptr);
2179 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_RANDOM_SOUND: target: {} ({}), sound: {}, onlyself: {}",
2180 target->GetName(), target->GetGUID(), sound, onlySelf ?
"true" :
"false");
2309 map = obj->GetMap();
2310 else if (!targets.empty())
2311 map = targets.
front()->GetMap();
2326 creatureTarget->PlayOneShotAnimKitId(e.
action.
animKit.animKit);
2330 creatureTarget->SetMeleeAnimKitId(e.
action.
animKit.animKit);
2332 creatureTarget->SetMovementAnimKitId(e.
action.
animKit.animKit);
2334 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_PLAY_ANIMKIT: target: {} ({}), AnimKit: {}, Type: {}",
2351 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_PLAY_ANIMKIT: target: {} ({}), AnimKit: {}, Type: {}",
2385 float speed = float(speedInteger) + float(speedFraction) / std::pow(10, std::floor(std::log10(
float(speedFraction ? speedFraction : 1)) + 1));
2402 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_PLAY_SPELL_VISUAL_KIT: target: {} ({}), SpellVisualKit: {}",
2414 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_OVERRIDE_LIGHT: {} sets zone override light (zoneId: {}, areaLightId: {}, overrideLightId: {}, transitionMilliseconds: {})",
2424 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_OVERRIDE_WEATHER: {} sets zone weather (zoneId: {}, weatherId: {}, intensity: {})",
2452 *playerTarget, playerTarget->GetGUID(),
nullptr);
2454 TC_LOG_WARN(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_CREATE_CONVERSATION: id {}, baseObject {}, target {} - failed to create conversation",
2509 if (!targets.empty())
2514 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",
2523 auto doCreatePersonalClone = [&](
Position const& position,
Player* privateObjectOwner)
2535 doCreatePersonalClone(baseObject->
GetPosition(), playerTarget);
2566 if (unitTarget->GetAI())
2628 if (conversation->IsPrivateObject())
2637 conversation->Remove();
2680 unitTarget->ExitVehicle();
2687 std::shared_ptr<MultiActionResult<MovementStopReason>> waitEvent = CreateTimedActionListWaitEventFor<void, MultiActionResult<MovementStopReason>>(e, targets.size());
2697 unitTarget->GetMotionMaster()->MoveFall(e.action.fall.pointId, std::move(actionResultSetter));
2701 if (waitEvent && !waitEvent->Results.empty())
2714 ProcessEvent(linked, unit, var0, var1, bvar, spell, gob, varString);
2726 ProcessAction(e, unit, var0, var1, bvar, spell, gob, varString);
2729 RecalcTimer(e, std::min<uint32>(min, 5000), std::min<uint32>(min, 5000));
2732SmartScriptHolder 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,
uint32 action_param7,
SMARTAI_TARGETS t,
uint32 target_param1,
uint32 target_param2,
uint32 target_param3,
uint32 target_param4, std::string_view targetParamString,
uint32 phaseMask)
2770 scriptTrigger = invoker;
2772 scriptTrigger = tempLastInvoker;
2779 targets.push_back(baseObject);
2784 targets.push_back(victim);
2792 targets.push_back(u);
2795 targets.push_back(u);
2804 targets.push_back(u);
2807 targets.push_back(u);
2816 targets.push_back(u);
2819 targets.push_back(u);
2828 targets.push_back(u);
2831 targets.push_back(u);
2838 targets.push_back(u);
2843 targets.push_back(scriptTrigger);
2857 if (groupRef.GetSource()->IsInMap(
player))
2858 targets.push_back(groupRef.GetSource());
2864 targets.push_back(scriptTrigger);
2872 ref = scriptTrigger;
2876 TC_LOG_ERROR(
"sql.sql",
"SMART_TARGET_CREATURE_RANGE: Entry {} SourceType {} Event {} Action {} Target {} is missing base object or invoker.",
2881 std::vector<Creature*> creatures;
2883 .CreatureId = e.target.unitRange.creature ? Optional<uint32>(e.target.unitRange.creature) : Optional<uint32>(),
2884 .StringId = !e.target.param_string.empty() ? Optional<std::string_view>(e.target.param_string) : Optional<std::string_view>(),
2898 std::vector<Creature*> creatures;
2900 .CreatureId = e.target.unitDistance.creature ? Optional<uint32>(e.target.unitDistance.creature) : Optional<uint32>(),
2901 .StringId = !e.target.param_string.empty() ? Optional<std::string_view>(e.target.param_string) : Optional<std::string_view>(),
2904 targets = { creatures.begin(), creatures.end() };
2914 ref = scriptTrigger;
2918 TC_LOG_ERROR(
"sql.sql",
"SMART_TARGET_GAMEOBJECT_RANGE: Entry {} SourceType {} Event {} Action {} Target {} is missing base object or invoker.",
2923 std::vector<GameObject*> gameObjects;
2925 .GameObjectId = e.target.goRange.entry ? Optional<uint32>(e.target.goRange.entry) : Optional<uint32>(),
2926 .StringId = !e.target.param_string.empty() ? Optional<std::string_view>(e.target.param_string) : Optional<std::string_view>(),
2940 std::vector<GameObject*> gameObjects;
2942 .GameObjectId = e.target.goDistance.entry ? Optional<uint32>(e.target.goDistance.entry) : Optional<uint32>(),
2943 .StringId = !e.target.param_string.empty() ? Optional<std::string_view>(e.target.param_string) : Optional<std::string_view>(),
2946 targets = { gameObjects.begin(), gameObjects.end() };
2954 if (!scriptTrigger && !baseObject)
2956 TC_LOG_ERROR(
"sql.sql",
"SMART_TARGET_CREATURE_GUID: Entry {} SourceType {} Event {} Action {} Target {} is missing base object or invoker.",
2963 targets.push_back(target);
2968 if (!scriptTrigger && !baseObject)
2970 TC_LOG_ERROR(
"sql.sql",
"SMART_TARGET_GAMEOBJECT_GUID: Entry {} SourceType {} Event {} Action {} Target {} is missing base object or invoker.",
2977 targets.push_back(target);
2985 std::vector<Player*> players;
2995 std::vector<Player*> players;
2997 targets = { players.begin(), players.end() };
3004 ref = scriptTrigger;
3008 TC_LOG_ERROR(
"sql.sql",
"SMART_TARGET_STORED: Entry {} SourceType {} Event {} Action {} Target {} is missing base object or invoker.",
3014 targets.assign(stored->begin(), stored->end());
3021 ref = scriptTrigger;
3025 TC_LOG_ERROR(
"sql.sql",
"SMART_TARGET_CLOSEST_CREATURE: Entry {} SourceType {} Event {} Action {} Target {} is missing base object or invoker.",
3037 targets.push_back(target);
3044 ref = scriptTrigger;
3048 TC_LOG_ERROR(
"sql.sql",
"SMART_TARGET_CLOSEST_GAMEOBJECT: Entry {} SourceType {} Event {} Action {} Target {} is missing base object or invoker.",
3059 targets.push_back(target);
3066 ref = scriptTrigger;
3070 TC_LOG_ERROR(
"sql.sql",
"SMART_TARGET_CLOSEST_PLAYER: Entry {} SourceType {} Event {} Action {} Target {} is missing base object or invoker.",
3076 targets.push_back(target);
3085 if (!charmerOrOwnerGuid)
3087 if (
WorldObject* summoner = tempSummon->GetSummoner())
3088 charmerOrOwnerGuid = summoner->GetGUID();
3090 if (!charmerOrOwnerGuid)
3094 targets.push_back(owner);
3099 targets.push_back(owner);
3109 targets.push_back(base);
3118 targets.push_back(ref->GetVictim());
3125 targets.push_back(target);
3132 targets.push_back(target);
3140 targets.push_back(tapper);
3150 targets.push_back(u);
3156 targets.push_back(target);
3250 std::vector<Creature*> creatures;
3252 if (creatures.empty())
3263 std::vector<Creature*> creatures;
3266 if (creatures.empty())
3571 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript: Gossip Select: menu {} action {}", var0, var1);
3611 Unit* unitTarget =
nullptr;
3625 auto unitTargetItr = std::ranges::find_if(targets, [
this, &e](
WorldObject* target)
3630 uint32 healthPct = uint32(unit->GetHealthPct());
3631 if (e.event.friendlyHealthPct.minHpPct <= healthPct && healthPct <= e.event.friendlyHealthPct.maxHpPct)
3637 if (unitTargetItr != targets.end())
3638 unitTarget = (*unitTargetItr)->
ToUnit();
3672 std::list<Creature*> list;
3676 creature = list.front();
3702 std::list<GameObject*> list;
3706 gameobject = list.front();
3732 ProcessAction(e, unit, var0, 0,
false,
nullptr,
nullptr, varString);
3830 Unit* invoker =
nullptr;
3838 if (scriptholder.event_id > e.
event_id)
3840 scriptholder.enableTimed =
true;
3873 if (i->event_id ==
id)
3917 bool needCleanup =
true;
3920 if (scriptholder.enableTimed)
3921 needCleanup =
false;
3942 SmartAIEventStoredList::iterator i, icurr;
3950 bool needCleanup =
true;
3961 needCleanup =
false;
3996 std::sort(events.begin(), events.end());
4015 if (ignoreChanceRoll)
4026 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript: EventMap for Entry {} is empty but is using SmartScript.", obj->
GetEntry());
4028 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript: EventMap for AreaTrigger {} is empty but is using SmartScript.", at->
ID);
4030 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript: EventMap for SceneId {} is empty but is using SmartScript.", scene->
SceneId);
4034 TC_LOG_DEBUG(
"scripts.ai",
"SmartScript: EventMap for Event {} is empty but is using SmartScript.",
event);
4039 #ifndef TRINITY_DEBUG
4044 if (obj && !scriptholder.Difficulties.empty())
4046 bool foundValidDifficulty =
false;
4047 for (
Difficulty difficulty : scriptholder.Difficulties)
4051 foundValidDifficulty =
true;
4056 if (!foundValidDifficulty)
4061 mEvents.push_back(std::move(scriptholder));
4076 FillScript(std::move(e),
me,
nullptr,
nullptr,
nullptr, 0);
4082 FillScript(std::move(e),
go,
nullptr,
nullptr,
nullptr, 0);
4120 TC_LOG_ERROR(
"misc",
"SmartScript::OnInitialize: source is AreaTrigger with id {}, missing trigger player",
trigger->
ID);
4134 TC_LOG_ERROR(
"misc",
"SmartScript::OnInitialize: source is Scene with id {}, missing trigger player", scene->
SceneId);
4148 TC_LOG_ERROR(
"misc",
"SmartScript::OnInitialize: source is Quest with id {}, missing trigger player", qst->
GetQuestId());
4176 TC_LOG_ERROR(
"misc",
"SmartScript::OnInitialize: source is Event {}, missing trigger WorldObject",
event);
4200 TC_LOG_ERROR(
"misc",
"SmartScript::OnInitialize: Unhandled TypeID !WARNING!");
4206 TC_LOG_ERROR(
"misc",
"SmartScript::OnInitialize: !WARNING! Initialized objects are NULL.");
4234 Unit* unit =
nullptr;
4247 Unit* unit =
nullptr;
4279 Unit* unit =
nullptr;
DB2Storage< SummonPropertiesEntry > sSummonPropertiesStore("SummonProperties.db2", &SummonPropertiesLoadInfo::Instance)
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
std::chrono::seconds Seconds
Seconds shorthand typedef.
std::string GetDebugInfo()
@ BROADCAST_TEXT_CALL_FOR_HELP
@ BROADCAST_TEXT_FLEE_FOR_ASSIST
#define TC_LOG_DEBUG(filterType__, message__,...)
#define TC_LOG_ERROR(filterType__, message__,...)
#define TC_LOG_WARN(filterType__, message__,...)
std::optional< T > Optional
Optional helper class to wrap optional values within.
@ QUEST_STATUS_INCOMPLETE
@ QUEST_FLAGS_COMPLETION_AREA_TRIGGER
@ QUEST_FLAGS_COMPLETION_EVENT
@ QUEST_FLAGS_TRACKING_EVENT
uint32 urand(uint32 min, uint32 max)
bool roll_chance(T chance)
@ SPELL_FAILED_BAD_TARGETS
@ SPELL_FAILED_SPELL_IN_PROGRESS
@ SMART_SCRIPT_TYPE_TIMED_ACTIONLIST
@ SMART_SCRIPT_TYPE_CREATURE
@ SMART_SCRIPT_TYPE_AREATRIGGER_ENTITY_CUSTOM
@ SMART_SCRIPT_TYPE_GAMEOBJECT
@ SMART_SCRIPT_TYPE_AREATRIGGER
@ SMART_SCRIPT_TYPE_AREATRIGGER_ENTITY
@ SMART_SCRIPT_TYPE_EVENT
@ SMART_SCRIPT_TYPE_SCENE
@ SMART_SCRIPT_TYPE_QUEST
std::vector< SmartScriptHolder > SmartAIEventList
@ SMART_EVENT_FLAG_WHILE_CHARMED
@ SMART_EVENT_FLAG_DONT_RESET
@ SMART_EVENT_FLAG_ACTIONLIST_WAITS
@ 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_CREATE_CONVERSATION
@ SMART_ACTION_DESTROY_CONVERSATION
@ 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_UNIT_FIELD_BYTES_1
@ SMART_ACTION_CLOSE_GOSSIP
@ SMART_ACTION_DISABLE_EVADE
@ SMART_ACTION_LOAD_EQUIPMENT
@ SMART_ACTION_ATTACK_START
@ SMART_ACTION_BECOME_PERSONAL_CLONE_FOR_PLAYER
@ SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL
@ SMART_ACTION_INVOKER_CAST
@ SMART_ACTION_SCENE_PLAY
@ 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_ENTER_VEHICLE
@ SMART_ACTION_RANDOM_SOUND
@ SMART_ACTION_SET_IMMUNE_PC
@ SMART_ACTION_SCENE_CANCEL
@ SMART_ACTION_SEND_TARGET_TO_TARGET
@ SMART_ACTION_SET_INGAME_PHASE_ID
@ SMART_ACTION_REMOVE_POWER
@ 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_TRIGGER_GAME_EVENT
@ SMART_ACTION_CALL_SCRIPT_RESET
@ SMART_ACTION_PLAY_SPELL_VISUAL_KIT
@ SMART_ACTION_BOARD_PASSENGER
@ SMART_ACTION_COMBAT_STOP
@ SMART_ACTION_EXIT_VEHICLE
@ SMART_ACTION_SET_INGAME_PHASE_GROUP
@ 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_CREDIT_QUEST_OBJECTIVE_TALK_TO
@ SMART_ACTION_SET_INST_DATA
@ SMART_ACTION_PLAY_ANIMKIT
@ 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_COMPLETE_QUEST
@ 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_SCENE_START
@ 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_SCENE_COMPLETE
@ SMART_EVENT_QUEST_COMPLETION
@ SMART_EVENT_JUST_CREATED
@ 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_AREATRIGGER_EXIT
@ SMART_EVENT_GO_LOOT_STATE_CHANGED
@ SMART_EVENT_SCENE_CANCEL
@ 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_SCENE_TRIGGER
@ SMART_EVENT_AREATRIGGER_ENTER
@ 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_SEND_EVENT_TRIGGER
@ 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
Used when doing CastSpell with triggered == true.
NPCFlags
Non Player Character flags.
#define MAX_EQUIPMENT_ITEMS
@ UNIT_FLAG_IMMUNE_TO_NPC
@ UNIT_STATE_LOST_CONTROL
static float waypoint[6][3]
ObjectGuid const & GetGUID() const
bool IsGameObject() const
static Conversation * CreateConversation(uint32 conversationEntry, Unit *creator, Position const &pos, ObjectGuid privateObjectOwner, SpellInfo const *spellInfo=nullptr, bool autoStart=true)
virtual void EnterEvadeMode(EvadeReason why=EvadeReason::Other)
void AttackStart(Unit *victim) override
== Triggered Actions Requested ==================
static void SendChatPacket(WorldObject *source, Builder const &builder, ChatMsg msgType, WorldObject const *whisperTarget=nullptr, CreatureTextRange range=TEXT_RANGE_NORMAL, Team team=TEAM_OTHER, bool gmOnly=false)
void SetHomePosition(float x, float y, float z, float o)
void SetCanMelee(bool canMelee, bool fleeFromMelee=false)
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
GuidUnorderedSet const & GetTapList() const
void DoFleeToGetAssistance()
ObjectGuid::LowType GetSpawnId() const
Position GetRespawnPosition(float *dist=nullptr) const
void SetDisplayId(uint32 displayId, bool setNative=false) override
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)
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, Milliseconds duration=0ms, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty, SmoothPhasingInfo const *smoothPhasingInfo=nullptr)
Difficulty GetDifficultyID() const
GameObjectBySpawnIdContainer & GetGameObjectBySpawnIdStore()
bool SpawnGroupDespawn(uint32 groupId, bool deleteRespawnTimes=false, size_t *count=nullptr)
CreatureBySpawnIdContainer & GetCreatureBySpawnIdStore()
void Respawn(RespawnInfo *info, CharacterDatabaseTransaction dbTrans=nullptr)
void MoveJump(uint32 id, Position const &pos, std::variant< std::monostate, float, Milliseconds > speedOrTime={}, Optional< float > minHeight={}, Optional< float > maxHeight={}, MovementFacingTarget const &facing={}, bool orientationFixed=false, bool unlimitedSpeed=false, Optional< float > speedMultiplier={}, JumpArrivalCastArgs const *arrivalCast=nullptr, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
void MoveRandom(float wanderDistance=0.0f, Optional< Milliseconds > duration={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::ForceWalk, MovementSlot slot=MOTION_SLOT_DEFAULT, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={}, Optional< MovementFadeObject > fadeObject={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
static ObjectGuid const Empty
static CreatureModel const * ChooseDisplayId(CreatureTemplate const *cinfo, CreatureData const *data=nullptr)
AreaTrigger * ToAreaTrigger()
GameObject * ToGameObject()
static void AddPhase(WorldObject *object, uint32 phaseId, bool updateVisibility)
static void AddPhaseGroup(WorldObject *object, uint32 phaseGroupId, bool updateVisibility)
static void RemovePhaseGroup(WorldObject *object, uint32 phaseGroupId, bool updateVisibility)
static PhaseShift const & GetAlwaysVisiblePhaseShift()
static void RemovePhase(WorldObject *object, uint32 phaseId, bool updateVisibility)
void KilledMonsterCredit(uint32 entry, ObjectGuid guid=ObjectGuid::Empty)
void TalkedToCreature(uint32 entry, ObjectGuid guid)
void CompleteQuest(uint32 quest_id)
void AddQuestAndCheckCompletion(Quest const *quest, Object *questGiver)
bool CanTakeQuest(Quest const *quest, bool msg) const
void AreaExploredOrEventHappens(uint32 questId)
QuestStatus GetQuestStatus(uint32 quest_id) const
Group * GetGroup(Optional< uint8 > partyIndex)
void PrepareGossipMenu(WorldObject *source, uint32 menuId, bool showQuests=false)
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
std::unique_ptr< PlayerMenu > PlayerTalkClass
uint32 GetQuestId() const
bool HasFlag(QuestFlags flag) const
virtual bool IsReady() const noexcept
static ActionResultSetter< T > GetResultSetter(std::shared_ptr< ActionResult > action)
static SmartScriptHolder & FindLinkedEvent(SmartAIEventList &list, uint32 link)
void SetInvincibilityHpLevel(uint32 level)
static constexpr uint32 MAX_NESTED_EVENTS
void DoFindFriendlyMissingBuff(std::vector< Creature * > &creatures, float range, uint32 spellid) const
void ProcessTimedAction(SmartScriptHolder &e, uint32 const &min, uint32 const &max, Unit *unit=nullptr, uint32 var0=0, uint32 var1=0, bool bvar=false, SpellInfo const *spell=nullptr, GameObject *gob=nullptr, std::string_view varString={ })
void OnUpdate(const uint32 diff)
void DoFindFriendlyCC(std::vector< Creature * > &creatures, float range) const
SmartScriptType mScriptType
void UpdateTimer(SmartScriptHolder &e, uint32 const diff)
static SmartScriptHolder CreateSmartEvent(SMART_EVENT e, uint32 event_flags, uint32 event_param1, uint32 event_param2, uint32 event_param3, uint32 event_param4, uint32 event_param5, SMART_ACTION action, uint32 action_param1, uint32 action_param2, uint32 action_param3, uint32 action_param4, uint32 action_param5, uint32 action_param6, uint32 action_param7, SMARTAI_TARGETS t, uint32 target_param1, uint32 target_param2, uint32 target_param3, uint32 target_param4, std::string_view targetParamString, uint32 phaseMask)
void SortEvents(SmartAIEventList &events)
SceneTemplate const * sceneTemplate
static void RecalcTimer(SmartScriptHolder &e, uint32 min, uint32 max)
void OnInitialize(WorldObject *obj, AreaTriggerEntry const *at=nullptr, SceneTemplate const *scene=nullptr, Quest const *qst=nullptr, uint32 evnt=0)
void FillScript(SmartAIEventList &&e, WorldObject *obj, AreaTriggerEntry const *at, SceneTemplate const *scene, Quest const *quest, uint32 event=0)
uint32 GetCounterValue(uint32 id) const
void StoreTargetList(ObjectVector const &targets, uint32 id)
void AddToStoredTargetList(ObjectVector const &targets, uint32 id)
void ProcessAction(SmartScriptHolder &e, Unit *unit=nullptr, uint32 var0=0, uint32 var1=0, bool bvar=false, SpellInfo const *spell=nullptr, GameObject *gob=nullptr, std::string_view varString={ })
void RetryLater(SmartScriptHolder &e, bool ignoreChanceRoll=false)
SmartAIEventStoredList mStoredEvents
void RaisePriority(SmartScriptHolder &e)
Unit * GetLastInvoker(Unit *invoker=nullptr) const
void OnMoveInLineOfSight(Unit *who)
bool IsSmart(Creature *c, bool silent=false) const
WorldObject * GetBaseObjectOrUnitInvoker(Unit *invoker)
Unit * DoSelectLowestHpFriendly(float range, uint32 MinHPDiff) const
bool IsInPhase(uint32 p) const
static void InitTimer(SmartScriptHolder &e)
AreaTriggerEntry const * trigger
void ProcessEvent(SmartScriptHolder &e, Unit *unit=nullptr, uint32 var0=0, uint32 var1=0, bool bvar=false, SpellInfo const *spell=nullptr, GameObject *gob=nullptr, std::string_view varString={ })
Unit * DoSelectLowestHpPercentFriendly(float range, uint32 minHpPct, uint32 maxHpPct) const
SmartScript & operator=(SmartScript const &other)
AreaTrigger * areaTrigger
void StoreCounter(uint32 id, uint32 value, uint32 reset)
WorldObject * GetBaseObject() const
uint32 mNestedEventsCounter
Creature * FindCreatureNear(WorldObject *searchObject, ObjectGuid::LowType guid) const
void GetTargets(ObjectVector &targets, SmartScriptHolder const &e, WorldObject *invoker=nullptr) const
std::shared_ptr< Scripting::v2::ActionBase > mTimedActionWaitEvent
bool isProcessingTimedActionList
ObjectVector const * GetStoredTargetVector(uint32 id, WorldObject const &ref) const
Unit * DoFindClosestFriendlyInRange(float range, bool playerOnly) const
SmartAIEventList mTimedActionList
ObjectVectorMap _storedTargets
void ClearTargetList(uint32 id)
bool mEventSortingRequired
ObjectGuid mTimedActionListInvoker
void RemoveStoredEvent(uint32 id)
void SetTimedActionList(SmartScriptHolder &e, uint32 entry, Unit *invoker, uint32 startFromEventId=0)
std::vector< uint32 > mRemIDs
GameObject * FindGameObjectNear(WorldObject *searchObject, ObjectGuid::LowType guid) const
void ProcessEventsFor(SMART_EVENT e, Unit *unit=nullptr, uint32 var0=0, uint32 var1=0, bool bvar=false, SpellInfo const *spell=nullptr, GameObject *gob=nullptr, std::string_view varString={ })
Trinity::IteratorPair< ThreatListIterator, std::nullptr_t > GetUnsortedThreatList() const
void ModifyThreatByPercent(Unit *target, float percent)
void AddThreat(Unit *target, float amount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false, bool ignoreRedirects=false)
== AFFECT MY THREAT LIST ==
std::vector< ThreatReference * > GetModifiableThreatList()
Utility class to enable range for loop syntax for multimap.equal_range uses.
virtual void SetData(uint32 id, uint32 value)
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
void EnterVehicle(Unit *base, int8 seatId=-1)
Vehicle * GetVehicle() const
float GetHealthPct() const
void CombatStop(bool includingCast=false, bool mutualPvP=true, bool(*unitFilter)(Unit const *otherUnit)=nullptr)
bool CanHaveThreatList() const
====================== THREAT & COMBAT ====================
ThreatManager & GetThreatManager()
bool IsWithinCombatRange(Unit const *obj, float dist2compare) 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
void SetFacingToObject(WorldObject const *object, bool force=true)
int32 GetMaxPower(Powers power) const
TempSummon * ToTempSummon()
ObjectGuid GetCharmerOrOwnerGUID() const override
ObjectGuid GetCreatorGUID() const override
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
void SetSheath(SheathState sheathed)
Unit * EnsureVictim() const
uint32 GetAuraCount(uint32 spellId) const
uint64 GetMaxHealth() const
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
TransportBase * GetDirectTransport() const
Returns the transport this unit is on directly (if on vehicle and transport, return vehicle)
void SetFacingTo(float const ori, bool force=true)
bool HasUnitState(const uint32 f) const
float GetPowerPct(Powers power) const
Vehicle * GetVehicleKit() const
void KillSelf(bool durabilityLoss=true, bool skipSettingDeathState=false)
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
SeatMap Seats
The collection of all seats on the vehicle. Including vacant ones.
TempSummon * SummonPersonalClone(Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, Player *privateObjectOwner=nullptr)
void GetPlayerListInGrid(Container &playerContainer, float maxSearchRange, bool alive=true) const
Player * SelectNearestPlayer(float range) const
void GetGameObjectListWithOptionsInGrid(Container &gameObjectContainer, float maxSearchRange, FindGameObjectOptions const &options) const
Creature * FindNearestCreatureWithOptions(float range, FindCreatureOptions const &options) 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
TransportBase * GetTransport() const
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 * FindNearestGameObjectWithOptions(float range, FindGameObjectOptions const &options) const
GameObject * FindNearestUnspawnedGameObject(uint32 entry, float range) 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 GetCreatureListWithOptionsInGrid(Container &creatureContainer, float maxSearchRange, FindCreatureOptions const &options) const
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
bool IsFriendlyTo(WorldObject const *target) const
virtual void SetData(uint32, uint32)
virtual void SetGuidData(uint32, ObjectGuid)
TC_GAME_API void Trigger(uint32 gameEventId, WorldObject *source, WorldObject *target)
TimePoint Now()
Current chrono steady_clock time point.
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)
constexpr void EraseIf(Container &c, Predicate p)
auto SelectRandomContainerElement(C const &container) -> std::add_const_t< decltype(*std::ranges::begin(container))> &
void RandomResize(C &container, std::size_t requestedSize)
struct advstd::ranges::Contains contains
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)
EquipmentItem Items[MAX_EQUIPMENT_ITEMS]
constexpr float GetPositionX() const
constexpr float GetPositionY() const
Position GetPositionWithOffset(Position const &offset) const
constexpr void GetPosition(float &x, float &y) const
constexpr float GetOrientation() const
constexpr float GetPositionZ() const
static QuaternionData fromEulerAnglesZYX(float Z, float Y, float X)
struct SmartAction::@61::@148 scene
struct SmartAction::@61::@142 groupSpawn
struct SmartAction::@61::@70 questOffer
struct SmartAction::@61::@112 timeEvent
struct SmartAction::@61::@129 setRangedMovement
struct SmartAction::@61::@116 setunitByte
struct SmartAction::@61::@168 raw
struct SmartAction::@61::@66 morphOrMount
struct SmartAction::@61::@165 doAction
struct SmartAction::@61::@125 moveToPos
struct SmartAction::@61::@164 triggerGameEvent
struct SmartAction::@61::@63 talk
struct SmartAction::@61::@105 wpStop
struct SmartAction::@61::@97 moveRandom
struct SmartAction::@61::@132 goState
struct SmartAction::@61::@161 activateGameObject
struct SmartAction::@61::@92 forceDespawn
struct SmartAction::@61::@160 setUninteractible
struct SmartAction::@61::@121 interruptSpellCasting
struct SmartAction::@61::@98 visibility
struct SmartAction::@61::@77 threat
struct SmartAction::@61::@158 setImmunePC
struct SmartAction::@61::@64 simpleTalk
struct SmartAction::@61::@71 react
struct SmartAction::@61::@76 threatPCT
uint32 emotes[SMART_ACTION_PARAM_COUNT]
struct SmartAction::@61::@79 combatMove
struct SmartAction::@61::@103 wpStart
struct SmartAction::@61::@84 randomPhase
uint32 transitionMilliseconds
struct SmartAction::@61::@140 corpseDelay
struct SmartAction::@61::@81 incEventPhase
struct SmartAction::@61::@118 timedActionList
struct SmartAction::@61::@72 randomEmote
struct SmartAction::@61::@82 removeAura
struct SmartAction::@61::@95 ingamePhaseGroup
struct SmartAction::@61::@141 disableEvade
struct SmartAction::@61::@99 summonGO
struct SmartAction::@61::@128 sendTargetToTarget
struct SmartAction::@61::@138 moveOffset
SAIBool toRespawnPosition
struct SmartAction::@61::@75 summonCreature
struct SmartAction::@61::@150 movementSpeed
struct SmartAction::@61::@93 invincHP
struct SmartAction::@61::@123 fleeAssist
struct SmartAction::@61::@65 faction
struct SmartAction::@61::@120 randRangeTimedActionList
struct SmartAction::@61::@149 cinematic
struct SmartAction::@61::@122 jump
struct SmartAction::@61::@156 setHealthPct
struct SmartAction::@61::@154 setHover
struct SmartAction::@61::@94 ingamePhaseId
struct SmartAction::@61::@155 evade
struct SmartAction::@61::@96 setData
struct SmartAction::@61::@133 creatureGroup
struct SmartAction::@61::@113 movie
struct SmartAction::@61::@85 randomPhaseRange
struct SmartAction::@61::@111 storeTargets
struct SmartAction::@61::@153 overrideWeather
uint32 FadeObjectDuration
struct SmartAction::@61::@124 enableTempGO
struct SmartAction::@61::@74 crossCast
uint32 actionLists[SMART_ACTION_PARAM_COUNT]
struct SmartAction::@61::@100 active
struct SmartAction::@61::@157 conversation
uint32 phases[SMART_ACTION_PARAM_COUNT]
struct SmartAction::@61::@162 addToStoredTargets
struct SmartAction::@61::@130 setHealthRegen
struct SmartAction::@61::@163 becomePersonalClone
struct SmartAction::@61::@126 sendGossipMenu
struct SmartAction::@61::@131 setRoot
struct SmartAction::@61::@90 callHelp
struct SmartAction::@61::@139 randomSound
struct SmartAction::@61::@108 setDisableGravity
struct SmartAction::@61::@104 wpPause
struct SmartAction::@61::@106 item
struct SmartAction::@61::@146 respawnData
struct SmartAction::@61::@143 loadEquipment
SAIBool disablePathfinding
struct SmartAction::@61::@166 enterVehicle
struct SmartAction::@61::@134 power
struct SmartAction::@61::@110 setCounter
struct SmartAction::@61::@78 autoAttack
struct SmartAction::@61::@159 setImmuneNPC
struct SmartAction::@61::@144 randomTimedEvent
struct SmartAction::@61::@152 overrideLight
SAIBool useSaiTargetAsGameEventSource
struct SmartAction::@61::@89 updateTemplate
struct SmartAction::@61::@87 setInstanceData
struct SmartAction::@61::@119 randTimedActionList
struct SmartAction::@61::@114 equip
struct SmartAction::@61::@86 killedMonster
struct SmartAction::@61::@136 gameEventStart
struct SmartAction::@61::@107 setRun
struct SmartAction::@61::@145 pauseMovement
struct SmartAction::@61::@167 destroyConversation
struct SmartAction::@61::@109 teleport
struct SmartAction::@61::@88 setInstanceData64
struct SmartAction::@61::@91 setSheath
struct SmartAction::@61::@73 cast
struct SmartAction::@61::@135 gameEventStop
struct SmartAction::@61::@127 setGoLootState
struct SmartAction::@61::@83 follow
struct SmartAction::@61::@80 setEventPhase
struct SmartAction::@61::@151 spellVisualKit
struct SmartEvent::@25::@48 textOver
struct SmartEvent::@25::@34 friendlyCC
struct SmartEvent::@25::@52 gameEvent
struct SmartEvent::@25::@50 gossipHello
struct SmartEvent::@25::@56 friendlyHealthPct
struct SmartEvent::@25::@40 aura
struct SmartEvent::@25::@33 targetCasting
struct SmartEvent::@25::@49 timedEvent
struct SmartEvent::@25::@44 waypoint
struct SmartEvent::@25::@47 instancePlayerEnter
struct SmartEvent::@25::@54 eventInform
struct SmartEvent::@25::@42 movementInform
struct SmartEvent::@25::@60 raw
struct SmartEvent::@25::@31 respawn
struct SmartEvent::@25::@53 goLootStateChanged
struct SmartEvent::@25::@58 counter
struct SmartEvent::@25::@59 spellCast
struct SmartEvent::@25::@51 gossip
struct SmartEvent::@25::@28 kill
uint32 hostilityMode
Hostility mode of the event. 0: hostile, 1: not hostile, 2: any.
struct SmartEvent::@25::@46 transportRelocate
struct SmartEvent::@25::@45 transportAddCreature
struct SmartEvent::@25::@32 minMax
struct SmartEvent::@25::@30 los
struct SmartEvent::@25::@36 summoned
struct SmartEvent::@25::@35 missingBuff
struct SmartEvent::@25::@38 questObjective
struct SmartEvent::@25::@55 doAction
struct SmartEvent::@25::@29 spellHit
struct SmartEvent::@25::@41 charm
struct SmartEvent::@25::@57 distance
struct SmartEvent::@25::@27 minMaxRepeat
struct SmartEvent::@25::@43 dataSet
static constexpr uint32 DEFAULT_PRIORITY
uint32 GetScriptType() const
uint32 GetEventType() const
uint32 GetTargetType() const
SmartScriptType source_type
uint32 GetActionType() const
struct SmartTarget::@169::@186 owner
struct SmartTarget::@169::@175 unitDistance
struct SmartTarget::@169::@176 playerDistance
SAIBool useCharmerOrOwner
struct SmartTarget::@169::@178 stored
struct SmartTarget::@169::@185 closestFriendly
struct SmartTarget::@169::@187 vehicle
struct SmartTarget::@169::@184 closestAttackable
struct SmartTarget::@169::@180 goGUID
struct SmartTarget::@169::@172 farthest
struct SmartTarget::@169::@177 playerRange
struct SmartTarget::@169::@183 goClosest
struct SmartTarget::@169::@182 unitClosest
struct SmartTarget::@169::@189 raw
struct SmartTarget::@169::@179 goRange
struct SmartTarget::@169::@171 hostilRandom
struct SmartTarget::@169::@188 threatList
struct SmartTarget::@169::@173 unitRange
uint32 findCreatureAliveState
struct SmartTarget::@169::@174 unitGUID
struct SmartTarget::@169::@181 goDistance
std::vector< WaypointNode > Nodes