115{
116
118 {
121 return;
122 }
124
125 if (unit)
127
129 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: Invoker: {} ({})", tempInvoker->GetName(), tempInvoker->GetGUID().ToString());
130
132
135
137 {
139 {
141 Unit* talkTarget =
nullptr;
142
144 {
145 if (
IsCreature((target)) && !target->ToCreature()->IsPet())
146 {
148 {
151 }
152 else
154 break;
155 }
157 {
160 break;
161 }
162 }
163
164 if (!talkTarget)
166
167 if (!talker)
168 break;
169
171 {
173 break;
174 }
175
182 break;
183 }
185 {
187 {
191 {
194 }
195
196 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_SIMPLE_TALK: talker: {} ({}), textGroupId: {}",
198 }
199 break;
200 }
202 {
204 {
206 {
207 target->ToUnit()->HandleEmoteCommand(e.
action.
emote.emote);
208 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_PLAY_EMOTE: target: {} ({}), emote: {}",
209 target->GetName(), target->GetGUID().ToString(), e.
action.
emote.emote);
210 }
211 }
212 break;
213 }
215 {
217 {
219 {
222 else
224 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_SOUND: target: {} ({}), sound: {}, onlyself: {}",
226 }
227 }
228 break;
229 }
231 {
239 for (unsigned int sound : sounds)
240 {
241 if (sound)
242 {
243 temp[count] = sound;
244 ++count;
245 }
246 }
247
248 if (count == 0)
249 {
250 break;
251 }
252
254 {
256 {
259 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_RANDOM_SOUND: target: {} ({}), sound: {}, onlyself: {}",
261 }
262 }
263
264 break;
265 }
267 {
269
271 {
273 {
275
277 {
279 if (
Player* player = i->GetSource())
280 {
282 {
284 {
286 targets.push_back(player);
287 }
288 else
289 targets.push_back(player);
290 }
291 }
292 }
293 }
294 }
295 else
297
298 if (!targets.empty())
299 {
301 {
303 {
305 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_MUSIC: target: {} ({}), sound: {}, onlySelf: {}, type: {}",
307 }
308 }
309 }
310 break;
311 }
313 {
315
317 {
319 {
321
323 {
325 if (
Player* player = i->GetSource())
326 {
328 {
330 {
332 targets.push_back(player);
333 }
334 else
335 targets.push_back(player);
336 }
337 }
338 }
339 }
340 }
341 else
343
344 if (targets.empty())
345 break;
346
354 for (unsigned int sound : sounds)
355 {
356 if (sound)
357 {
358 temp[count] = sound;
359 ++count;
360 }
361 }
362
363 if (count == 0)
364 {
365 break;
366 }
367
369 {
371 {
374 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_RANDOM_MUSIC: target: {} ({}), sound: {}, onlyself: {}, type: {}",
376 }
377 }
378
379 break;
380 }
382 {
384 {
386 {
388 {
390 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry {}, GuidLow {} set faction to {}",
392 }
393 else
394 {
396 {
397 if (target->ToCreature()->GetFaction() != ci->faction)
398 {
399 target->ToCreature()->SetFaction(ci->faction);
400 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry {}, GuidLow {} set faction to {}",
401 target->GetEntry(), target->GetGUID().ToString(), ci->faction);
402 }
403 }
404 }
405 }
406 }
407 break;
408 }
410 {
412 {
414 continue;
415
417 {
418
420 {
422 {
424 target->ToCreature()->SetDisplayId(displayId);
425 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry {}, GuidLow {} set displayid to {}",
426 target->GetEntry(), target->GetGUID().ToString(), displayId);
427 }
428 }
429
430 else
431 {
433 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry {}, GuidLow {} set displayid to {}",
435 }
436 }
437 else
438 {
439 target->ToCreature()->DeMorph();
440 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry {}, GuidLow {} demorphs.",
441 target->GetEntry(), target->GetGUID().ToString());
442 }
443 }
444 break;
445 }
447 {
449 {
451 {
452 target->ToPlayer()->FailQuest(e.
action.
quest.quest);
453 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_FAIL_QUEST: Player guidLow {} fails quest {}",
454 target->GetGUID().ToString(), e.
action.
quest.quest);
455 }
456 }
457 break;
458 }
460 {
462 {
464 {
466 {
468 {
469 if (player->CanTakeQuest(q, true))
470 {
472 {
474 menu.SendQuestGiverQuestDetails(q,
me->
GetGUID(),
true);
475 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_OFFER_QUEST: Player guidLow {} - offering quest {}",
477 }
478 }
479 }
480 else
481 {
482 player->AddQuestAndCheckCompletion(q, nullptr);
483 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_OFFER_QUEST: Player guidLow {} - quest {} added",
485 }
486 }
487 }
488 }
489 break;
490 }
492 {
494 {
496 continue;
497
499 }
500 break;
501 }
503 {
504 std::vector<uint32> emotes;
506 std::back_inserter(emotes), [](
uint32 emote) { return emote != 0; });
507
509 {
511 {
513 target->ToUnit()->HandleEmoteCommand(emote);
514 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_RANDOM_EMOTE: Creature guidLow {} handle random emote {}",
515 target->GetGUID().ToString(), emote);
516 }
517 }
518 break;
519 }
521 {
523 break;
524
526 for (ThreatContainer::StorageType::const_iterator i = threatList.begin(); i != threatList.end(); ++i)
527 {
529 {
531 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_THREAT_ALL_PCT: Creature {} modify threat for unit {}, value {}",
533 }
534 }
535 break;
536 }
538 {
540 break;
541
543 {
545 {
547 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_THREAT_SINGLE_PCT: Creature guidLow {} modify threat for unit {}, value %i",
549 }
550 }
551 break;
552 }
554 {
556 {
557
559 if (
Vehicle* vehicle = target->ToUnit()->GetVehicleKit())
560 for (auto & Seat : vehicle->Seats)
562 player->AreaExploredOrEventHappens(e.
action.
quest.quest);
563
565 {
566 target->ToPlayer()->AreaExploredOrEventHappens(e.
action.
quest.quest);
567
568 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS: Player guidLow {} credited quest {}",
569 target->GetGUID().ToString(), e.
action.
quest.quest);
570 }
571 }
572 break;
573 }
575 {
576 if (targets.empty())
577 break;
578
580
583
586
588 {
589
591 {
593 }
594
596 continue;
597
598 if (caster && caster !=
me)
599 {
601 }
603 {
606
607
609 {
610
613
615 {
618 }
620 {
623 }
624 }
625
627 }
628 }
629
630 break;
631 }
633 {
635 if (!tempLastInvoker)
636 break;
637
638 if (targets.empty())
639 break;
640
643
645 {
647 continue;
648
650 {
653
655 }
656 }
657
658 break;
659 }
661 {
663 {
665 {
667 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_ADD_AURA: Adding aura {} to unit {}",
669 }
670 }
671 break;
672 }
674 {
676 {
678 {
680
681
683 {
685 }
686
688 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_ACTIVATE_GOBJECT. Gameobject {} activated",
go->
GetGUID().
ToString());
689 }
690 }
691
692 break;
693 }
695 {
697 {
699 {
700 target->ToGameObject()->ResetDoorOrButton();
701 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_RESET_GOBJECT. Gameobject {} (entry: {}) reset",
702 target->GetGUID().ToString(), target->GetEntry());
703 }
704 }
705 break;
706 }
708 {
710 {
712 {
714 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_EMOTE_STATE. Unit {} set emotestate to {}",
715 target->GetGUID().ToString(), e.
action.
emote.emote);
716 }
717 }
718 break;
719 }
721 {
723 {
725 {
727 {
729 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit {} added flag {} to UNIT_FIELD_FLAGS",
731 }
732 else
733 {
735 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit {} added flag {} to UNIT_FIELD_FLAGS_2",
737 }
738 }
739 }
740 break;
741 }
743 {
745 {
747 {
749 {
751 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit {} removed flag {} to UNIT_FIELD_FLAGS",
753 }
754 else
755 {
757 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit {} removed flag {} to UNIT_FIELD_FLAGS_2",
759 }
760 }
761 }
762 break;
763 }
765 {
767 break;
768
770 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_AUTO_ATTACK: Creature: {} bool on = {}",
772 break;
773 }
775 {
777 break;
778
779
782 {
785 }
786 else
788 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_ALLOW_COMBAT_MOVEMENT: Creature {} bool on = {}",
790 break;
791 }
793 {
795 break;
796
798 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_SET_EVENT_PHASE: Creature {} set event phase {}",
800 break;
801 }
803 {
805 break;
806
809 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_INC_EVENT_PHASE: Creature {} inc event phase by {}, "
811 break;
812 }
814 {
816 break;
817
820 if (target->ToCreature()->IsAIEnabled)
821 target->ToCreature()->AI()->EnterEvadeMode();
822
823 break;
824 }
826 {
827
829 break;
830
833 {
836 }
837 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_FLEE_FOR_ASSIST: Creature {} DoFleeToGetAssistance",
me->
GetGUID().
ToString());
838 break;
839 }
841 {
843 break;
844
846 break;
847 }
849 {
851 {
853 continue;
854
856
859 {
861 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_CALL_GROUPEVENTHAPPENS: Player {}, group credit for quest {}",
863 }
864
865
867 {
868 for (auto& Seat : vehicle->Seats)
869 {
871 {
873 }
874 }
875 }
876 }
877 break;
878 }
880 {
882 {
884 continue;
885
887 {
889 {
892 }
893 else
895 }
896 else
897 target->ToUnit()->RemoveAllAuras();
898
899 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_REMOVEAURASFROMSPELL: Unit {}, spell {}",
901 }
902 break;
903 }
905 {
907 break;
908
909 if (targets.empty())
910 {
912 break;
913 }
914
916 {
918 {
921 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_FOLLOW: Creature {} following target {}",
923 break;
924 }
925 }
926 break;
927 }
929 {
931 break;
932
933 std::vector<uint32> phases;
935 std::back_inserter(phases), [](
uint32 phase) { return phase != 0; });
936
939 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE: Creature {} sets event phase to {}",
941 break;
942 }
944 {
946 break;
947
950 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE_RANGE: Creature {} sets event phase to {}",
952 break;
953 }
955 {
957 {
959 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: (trigger == true) Player {}, Killcredit: {}",
961 }
963 {
965 break;
966
968 {
970 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player {}, Killcredit: {}",
972 }
973 }
974 else
975 {
977 {
979 continue;
980
982 if (!player)
983 continue;
984
986 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player {}, Killcredit: {}",
988 }
989 }
990 break;
991 }
993 {
995 if (!obj)
996 obj = unit;
997
998 if (!obj)
999 break;
1000
1002 if (!instance)
1003 {
1004 LOG_ERROR(
"scripts.ai.sai",
"SmartScript: Event {} attempt to set instance data without instance script. EntryOrGuid {}", e.
GetEventType(), e.
entryOrGuid);
1005 break;
1006 }
1007
1009 {
1010 case 0:
1011 {
1014 } break;
1015 case 1:
1016 {
1019 } break;
1020 default:
1021 {
1022 break;
1023 }
1024 }
1025 break;
1026 }
1028 {
1030 if (!obj)
1031 obj = unit;
1032
1033 if (!obj)
1034 break;
1035
1037 if (!instance)
1038 {
1040 break;
1041 }
1042
1043 if (targets.empty())
1044 break;
1045
1047 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: {}, data: {}",
1049 break;
1050 }
1052 {
1056 break;
1057 }
1059 {
1061 {
1064 }
1065 break;
1066 }
1068 {
1069 if (targets.empty())
1070 break;
1071
1073 {
1076
1080 {
1084 }
1085 }
1086 else
1087 {
1089 {
1091 {
1092 target->ToCreature()->SetInCombatWithZone();
1093 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_SET_IN_COMBAT_WITH_ZONE: Creature {}, target: {}",
1095 }
1096 }
1097 }
1098
1099 break;
1100 }
1102 {
1104 {
1106 {
1109 {
1112 }
1113 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_CALL_FOR_HELP: Creature {}, target: {}",
1115 }
1116 }
1117 break;
1118 }
1120 {
1122 {
1124 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_SET_SHEATH: Creature {}, State: {}",
1126 }
1127 break;
1128 }
1130 {
1132 {
1134
1135
1136 if (despawnDelay <= 0ms)
1137 {
1138 despawnDelay = 1ms;
1139 }
1140
1143 {
1144 creature->DespawnOrUnsummon(despawnDelay, forceRespawnTimer);
1145 }
1147 {
1149 }
1150 }
1151
1152 break;
1153 }
1155 {
1157 {
1162 }
1163 break;
1164 }
1166 {
1168 {
1170 continue;
1171
1173 {
1175 {
1178 }
1179 else
1181 }
1182 else
1183 target->ToUnit()->Dismount();
1184 }
1185 break;
1186 }
1188 {
1190 {
1192 {
1194 if (!ai)
1195 continue;
1196
1199 else
1201 }
1202 }
1203 break;
1204 }
1206 {
1208 {
1213 }
1214 break;
1215 }
1217 {
1219 break;
1220
1221 float x, y, z;
1224 break;
1225 }
1227 {
1229 break;
1230
1232 break;
1233 }
1235 {
1239
1240 break;
1241 }
1243 {
1246 break;
1247 }
1249 {
1251 break;
1252
1253 if (targets.empty())
1254 break;
1255
1256
1259 break;
1260 }
1262 {
1266 break;
1267 }
1269 {
1271 bool preferUnit = flags.HasFlag(SmartActionSummonCreatureFlags::PreferUnit);
1273 if (!summoner)
1274 break;
1275
1276 bool personalSpawn = flags.HasFlag(SmartActionSummonCreatureFlags::PersonalSpawn);
1277
1279 {
1284 {
1287 else
1290 {
1292 summon->AI()->AttackStart(unit);
1294 summon->AI()->AttackStart(
me);
1295 }
1296 }
1297 break;
1298 }
1299
1300 float x, y, z, o;
1302 {
1303 target->GetPosition(x, y, z, o);
1309 {
1311 summon->AI()->AttackStart(unit);
1313 summon->AI()->AttackStart(target->ToUnit());
1315 summon->AI()->AttackStart(
me);
1316 }
1317 }
1318
1320 break;
1321
1323 {
1325 summon->AI()->AttackStart(unit);
1327 summon->AI()->AttackStart(
me);
1328 }
1329 break;
1330 }
1332 {
1334 break;
1335
1336 if (!targets.empty())
1337 {
1338 float x, y, z, o;
1340 {
1341
1342
1343
1344
1345 target->GetPosition(x, y, z, o);
1352 else
1354 }
1355 }
1356
1358 break;
1359
1361 break;
1362 }
1364 {
1366 {
1368 continue;
1369
1370 Unit::Kill(target->ToUnit(), target->ToUnit());
1371 }
1372
1373 break;
1374 }
1376 {
1378 break;
1379 }
1381 {
1383 {
1385 continue;
1386
1388 }
1389 break;
1390 }
1392 {
1394 {
1396 continue;
1397
1399 }
1400 break;
1401 }
1403 {
1405 break;
1406 }
1408 {
1410 {
1415 }
1416 break;
1417 }
1419 {
1421 break;
1422
1424
1427
1428
1430 break;
1431 }
1433 {
1435 {
1437 {
1438 if (
IsSmart(target->ToCreature()))
1440 else
1442 }
1443 }
1444
1445 break;
1446 }
1448 {
1450 break;
1451
1453 break;
1454 }
1456 {
1457 if (!targets.empty())
1458 {
1460 {
1462 {
1465 else
1466 LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SET_COUNTER is not using SmartAI, skipping");
1467 }
1469 {
1472 else
1473 LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SET_COUNTER is not using SmartGameObjectAI, skipping");
1474 }
1475 }
1476 }
1477 else
1479 break;
1480 }
1482 {
1484 break;
1485
1489
1491 {
1493 {
1495 break;
1496 }
1497 }
1498
1501
1506 break;
1507 }
1509 {
1511 break;
1512
1515 break;
1516 }
1518 {
1520 break;
1521
1526 break;
1527 }
1529 {
1531 break;
1532
1534 break;
1535 }
1537 {
1539 break;
1540
1542 {
1543 float randomOri =
frand(0.0f, 2 * M_PI);
1547 break;
1548 }
1549
1551 {
1555 }
1557 {
1561 }
1562 else if (!targets.empty())
1563 {
1567 }
1568
1569 break;
1570 }
1572 {
1574 {
1576 continue;
1577
1579 }
1580 break;
1581 }
1583 {
1585 break;
1586
1588
1590 {
1592 {
1601 true,
1602 true,
1604 );
1605 }
1606
1607 break;
1608 }
1609
1610
1611
1612
1613
1614
1615
1616
1617 {
1618
1619 if (!targets.empty())
1621 }
1622
1623 if (!target)
1624 {
1628 trans->CalculatePassengerPosition(dest.x, dest.y, dest.z);
1629
1632 }
1633 else
1634 {
1635 float x, y, z;
1640 }
1641 break;
1642 }
1644 {
1646 {
1648 {
1651 }
1652 }
1653
1654 break;
1655 }
1657 {
1659 {
1663 {
1664
1667 else
1669 }
1670 }
1671 break;
1672 }
1674 {
1678 break;
1679 }
1681 {
1683 {
1685 {
1686 std::array<uint32, MAX_EQUIPMENT_ITEMS> slot;
1688 {
1690 if (!eInfo)
1691 {
1692 LOG_ERROR(
"sql.sql",
"SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info id {} for creature {}", equipId,
npc->GetEntry());
1693 break;
1694 }
1695
1696 npc->SetCurrentEquipmentId(equipId);
1697
1698 std::copy(std::begin(eInfo->
ItemEntry), std::end(eInfo->
ItemEntry), std::begin(slot));
1699 }
1700 else
1702
1706 }
1707 }
1708 break;
1709 }
1711 {
1716
1721
1725
1729
1737 break;
1738 }
1741
1742
1745 break;
1748 break;
1750 {
1752 {
1754 {
1761 break;
1762 }
1764 {
1771 break;
1772 }
1773 }
1774
1775 break;
1776 }
1779 break;
1782 break;
1784 {
1786 break;
1787
1790
1793 if (
IsSmart(creature) && creature->GetVictim())
1795 creature->GetMotionMaster()->MoveChase(creature->GetVictim(), attackDistance, attackAngle);
1796
1797 break;
1798 }
1800 {
1802 {
1804 break;
1805 }
1806
1808 {
1810 {
1813 }
1815 {
1818 }
1819 }
1820 break;
1821 }
1823 {
1827 break;
1828 }
1830 {
1834 break;
1835 }
1837 {
1841 break;
1842 }
1844 {
1845 if (targets.empty())
1846 break;
1847
1849 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);
1850
1852 {
1854 continue;
1855
1857
1858 bool interruptedSpell = false;
1859
1861 {
1863 continue;
1864
1866 {
1868 {
1870 interruptedSpell = true;
1871 }
1872
1874 }
1875 else
1877 }
1878 }
1879 break;
1880 }
1882 {
1883 std::vector<uint32> actionLists;
1885 std::back_inserter(actionLists), [](
uint32 actionList) { return actionList != 0; });
1886
1889 {
1891 break;
1892 }
1893
1895 {
1897 {
1900 }
1902 {
1905 }
1906 }
1907 break;
1908 }
1910 {
1913 {
1915 break;
1916 }
1917
1919 {
1921 {
1924 }
1926 {
1929 }
1930 }
1931 break;
1932 }
1934 {
1938 break;
1939 }
1941 {
1942 bool foundTarget = false;
1943
1945 {
1947 {
1948 foundTarget = true;
1949
1952 else
1954 }
1955 }
1956
1958 {
1961 else
1963 }
1964 break;
1965 }
1967 {
1971 break;
1972 }
1974 {
1978 break;
1979 }
1981 {
1985 break;
1986 }
1988 {
1992 break;
1993 }
1995 {
1999 break;
2000 }
2002 {
2006 break;
2007 }
2009 {
2013 break;
2014 }
2016 {
2018 {
2020 {
2025 }
2026
2027 break;
2028 }
2029
2030 if (targets.empty())
2031 break;
2032
2033
2035 {
2039 }
2040 else
2041 {
2044 {
2047 }
2048 }
2049
2050 break;
2051 }
2053 {
2057 break;
2058 }
2060 {
2064 break;
2065 }
2067 {
2069
2070 if (!ref)
2071 ref = unit;
2072
2073 if (!ref)
2074 break;
2075
2077 if (!storedTargets)
2078 break;
2079
2081 {
2083 {
2086 else
2087 LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartAI, skipping");
2088 }
2090 {
2093 else
2094 LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartGameObjectAI, skipping");
2095 }
2096 }
2097 break;
2098 }
2100 {
2102 break;
2103
2104 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_SEND_GOSSIP_MENU: gossipMenuId {}, gossipNpcTextId {}",
2106
2109 {
2112 else
2114
2116 }
2117
2118 break;
2119 }
2121 {
2122 if (!targets.empty())
2123 {
2124 float x, y, z, o;
2127 {
2129 {
2132 }
2133 else
2135 }
2136 }
2138 {
2140 {
2141 float x, y, z, o;
2144 }
2145 else
2147 }
2148 break;
2149 }
2151 {
2155
2156 break;
2157 }
2159 {
2163 break;
2164 }
2166 {
2170 break;
2171 }
2173 {
2177 break;
2178 }
2180 {
2184 break;
2185 }
2187 {
2188 std::list<TempSummon*> summonList;
2190
2191 for (std::list<TempSummon*>::const_iterator itr = summonList.begin(); itr != summonList.end(); ++itr)
2192 {
2194 (*itr)->AI()->AttackStart(unit);
2196 (*itr)->AI()->AttackStart(
me);
2197 }
2198
2199 break;
2200 }
2202 {
2206 break;
2207 }
2209 {
2213 break;
2214 }
2216 {
2220 break;
2221 }
2223 {
2226 {
2227 LOG_ERROR(
"scripts.ai.sai",
"SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_STOP, inactive event (id: {})", eventId);
2228 break;
2229 }
2231 break;
2232 }
2234 {
2237 {
2238 LOG_ERROR(
"scripts.ai.sai",
"SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_START, already activated event (id: {})", eventId);
2239 break;
2240 }
2242 break;
2243 }
2245 {
2246 std::vector<uint32> waypoints;
2248 std::back_inserter(waypoints), [](
uint32 wp) { return wp != 0; });
2249
2250 float distanceToClosest = std::numeric_limits<float>::max();
2252
2254 {
2256 {
2258 {
2259 for (
uint32 wp : waypoints)
2260 {
2262 if (!path || path->empty())
2263 continue;
2264
2265 auto itrWp = path->find(0);
2266 if (itrWp != path->end())
2267 {
2269 {
2270 float distToThisPath = creature->GetDistance(wp->x, wp->y, wp->z);
2271 if (distToThisPath < distanceToClosest)
2272 {
2273 distanceToClosest = distToThisPath;
2274 closestWp = wp;
2275 }
2276 }
2277 }
2278 }
2279
2280 if (closestWp)
2282 }
2283 }
2284 }
2285 break;
2286 }
2288 {
2292
2293 break;
2294 }
2296 {
2300
2301 break;
2302 }
2304 {
2307 {
2310 }
2311
2312 break;
2313 }
2315 {
2319
2320 break;
2321 }
2323 {
2326 else
2328
2331 break;
2332 }
2334 {
2338 break;
2339 }
2341 {
2345 break;
2346 }
2348 {
2352 break;
2353 }
2355 {
2359 break;
2360 }
2362 {
2365 break;
2366 }
2368 {
2372 break;
2373 }
2375 {
2379
2380 break;
2381 }
2383 {
2387 break;
2388 }
2390 {
2394
2395 break;
2396 }
2398 {
2400 break;
2401 }
2403 {
2407 break;
2408 }
2410 {
2412 {
2414 {
2419 }
2420 }
2421 break;
2422 }
2424 {
2428
2429 break;
2430 }
2432 {
2436 {
2438 break;
2439 }
2440
2441 break;
2442 }
2444 {
2447 break;
2448 }
2450 {
2452
2453 if (!targets.empty())
2457
2458 break;
2459 }
2461 {
2463 break;
2464
2466 {
2468 {
2471
2473 {
2474
2475
2476
2477 bool _allowMove = false;
2480
2485 _allowMove = true;
2486
2488 }
2489
2491 {
2500 }
2501 }
2502 }
2503 break;
2504 }
2506 {
2508 break;
2509
2510 if (targets.empty())
2511 break;
2512
2514
2519
2520
2521
2522
2523
2524 float factor = std::exp(k * delta_phi);
2525
2526
2527 float summonRadius = a;
2528
2530 {
2531
2532
2534
2535 do
2536 {
2538 summonPosition.RelocatePolarOffset(phi, summonRadius);
2539
2541
2542 phi += delta_phi;
2543 summonRadius *= factor;
2544 } while (summonRadius <= r_max);
2545 }
2546
2547 break;
2548 }
2550 {
2552 break;
2553
2555
2558
2560 {
2561 float deltaAngle = 0.0f;
2562 if (radius > 0)
2563 deltaAngle = distInARow / radius;
2564
2566 if (deltaAngle > 0)
2567 count += coneAngle / deltaAngle;
2568
2569 float currentAngle = -static_cast<float>(count) * deltaAngle / 2.0f;
2570
2573 else if (!targets.empty())
2574 {
2576 }
2577
2578 for (
uint32 index = 0; index < count; ++index)
2579 {
2581 spawnPosition.RelocatePolarOffset(currentAngle, radius);
2582 currentAngle += deltaAngle;
2583
2585 }
2586 }
2587
2588 break;
2589 }
2591 {
2593 {
2595 {
2596 playerTarget->RemoveArenaSpellCooldowns();
2597 playerTarget->RemoveAurasDueToSpell(57724);
2598 playerTarget->RemoveAurasDueToSpell(57723);
2599 playerTarget->RemoveAurasDueToSpell(2825);
2600 playerTarget->RemoveAurasDueToSpell(32182);
2601 }
2602 }
2603
2604 break;
2605 }
2607 {
2610 {
2611 if (targets.empty())
2612 break;
2613
2615 {
2617 {
2619 {
2620 unitTarget->AI()->DoAction(actionId);
2621 }
2622 }
2624 {
2625 gobjTarget->AI()->DoAction(actionId);
2626 }
2627 }
2628
2629 }
2630 else
2631 {
2634 {
2635 instanceScript = baseObj->GetInstanceScript();
2636 }
2637
2639 {
2641 }
2642
2643 if (instanceScript)
2644 {
2645 instanceScript->
DoAction(actionId);
2646 }
2647 }
2648 break;
2649 }
2651 {
2653 break;
2654
2656 break;
2657 }
2659 {
2661 {
2664 }
2665 break;
2666 }
2668 {
2672 break;
2673 }
2675 {
2678 float speed = float(speedInteger) + float(speedFraction) / std::pow(10, std::floor(std::log10(float(speedFraction ? speedFraction : 1)) + 1));
2679
2683
2684 break;
2685 }
2687 {
2689 {
2691 continue;
2692
2694 }
2695 break;
2696 }
2697 default:
2699 break;
2700 }
2701
2703 {
2706 ProcessEvent(linked, unit, var0, var1, bvar, spell, gob);
2707 else
2709 }
2710}
#define DEFAULT_LOCALE
Definition: Common.h:88
std::int8_t int8
Definition: Define.h:106
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition: Duration.h:27
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:30
float frand(float min, float max)
Definition: Random.cpp:57
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
#define CAST_AI(a, b)
Definition: ScriptedCreature.h:28
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const guid)
Definition: ScriptedGossip.cpp:45
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
SMARTAI_TARGETS
Definition: SmartScriptMgr.h:1387
@ SMART_TARGET_RANDOM_POINT
Definition: SmartScriptMgr.h:1426
#define sSmartWaypointMgr
Definition: SmartScriptMgr.h:2057
SMART_ACTION
Definition: SmartScriptMgr.h:524
@ SMART_ACTION_REMOVE_TIMED_EVENT
Definition: SmartScriptMgr.h:599
@ SMART_ACTION_NONE
Definition: SmartScriptMgr.h:525
@ SMART_ACTION_SET_GO_FLAG
Definition: SmartScriptMgr.h:629
@ SMART_ACTION_WP_RESUME
Definition: SmartScriptMgr.h:590
@ SMART_ACTION_UPDATE_TEMPLATE
Definition: SmartScriptMgr.h:561
@ SMART_ACTION_SET_HEALTH_REGEN
Definition: SmartScriptMgr.h:627
@ SMART_ACTION_ACTIVATE_GOBJECT
Definition: SmartScriptMgr.h:534
@ SMART_ACTION_GAME_EVENT_START
Definition: SmartScriptMgr.h:637
@ SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST
Definition: SmartScriptMgr.h:613
@ SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1
Definition: SmartScriptMgr.h:616
@ SMART_ACTION_SET_INST_DATA64
Definition: SmartScriptMgr.h:560
@ SMART_ACTION_SET_FACTION
Definition: SmartScriptMgr.h:527
@ SMART_ACTION_THREAT_SINGLE_PCT
Definition: SmartScriptMgr.h:538
@ SMART_ACTION_OFFER_QUEST
Definition: SmartScriptMgr.h:532
@ SMART_ACTION_REMOVE_ALL_GAMEOBJECTS
Definition: SmartScriptMgr.h:651
@ SMART_ACTION_RISE_UP
Definition: SmartScriptMgr.h:639
@ SMART_ACTION_SET_INGAME_PHASE_MASK
Definition: SmartScriptMgr.h:569
@ SMART_ACTION_SET_UNIT_FIELD_BYTES_1
Definition: SmartScriptMgr.h:615
@ SMART_ACTION_CLOSE_GOSSIP
Definition: SmartScriptMgr.h:597
@ SMART_ACTION_DISABLE_EVADE
Definition: SmartScriptMgr.h:642
@ SMART_ACTION_CONE_SUMMON
Definition: SmartScriptMgr.h:689
@ SMART_ACTION_ADD_GO_FLAG
Definition: SmartScriptMgr.h:630
@ SMART_ACTION_ADD_DYNAMIC_FLAG
Definition: SmartScriptMgr.h:620
@ SMART_ACTION_KILL_UNIT
Definition: SmartScriptMgr.h:576
@ SMART_ACTION_LOAD_EQUIPMENT
Definition: SmartScriptMgr.h:649
@ SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS
Definition: SmartScriptMgr.h:540
@ SMART_ACTION_ATTACK_START
Definition: SmartScriptMgr.h:574
@ SMART_ACTION_SET_UNIT_FLAG
Definition: SmartScriptMgr.h:543
@ SMART_ACTION_NO_ENVIRONMENT_UPDATE
Definition: SmartScriptMgr.h:682
@ SMART_ACTION_CALL_GROUPEVENTHAPPENS
Definition: SmartScriptMgr.h:551
@ SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL
Definition: SmartScriptMgr.h:568
@ SMART_ACTION_INVOKER_CAST
Definition: SmartScriptMgr.h:610
@ SMART_ACTION_JUMP_TO_POS
Definition: SmartScriptMgr.h:622
@ SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST
Definition: SmartScriptMgr.h:612
@ SMART_ACTION_SEND_GOSSIP_MENU
Definition: SmartScriptMgr.h:623
@ SMART_ACTION_SET_COUNTER
Definition: SmartScriptMgr.h:588
@ SMART_ACTION_FLEE_FOR_ASSIST
Definition: SmartScriptMgr.h:550
@ SMART_ACTION_EQUIP
Definition: SmartScriptMgr.h:596
@ SMART_ACTION_SET_ROOT
Definition: SmartScriptMgr.h:628
@ SMART_ACTION_ATTACK_STOP
Definition: SmartScriptMgr.h:694
@ SMART_ACTION_SUMMON_GO
Definition: SmartScriptMgr.h:575
@ SMART_ACTION_SET_HOVER
Definition: SmartScriptMgr.h:676
@ SMART_ACTION_WP_PAUSE
Definition: SmartScriptMgr.h:579
@ SMART_ACTION_SIMPLE_TALK
Definition: SmartScriptMgr.h:609
@ SMART_ACTION_STOP_MOTION
Definition: SmartScriptMgr.h:681
@ SMART_ACTION_VORTEX_SUMMON
Definition: SmartScriptMgr.h:691
@ SMART_ACTION_MUSIC
Definition: SmartScriptMgr.h:685
@ SMART_ACTION_SET_UNIT_MOVEMENT_FLAGS
Definition: SmartScriptMgr.h:673
@ SMART_ACTION_ADD_AURA
Definition: SmartScriptMgr.h:600
@ SMART_ACTION_THREAT_ALL_PCT
Definition: SmartScriptMgr.h:539
@ SMART_ACTION_RESPAWN_TARGET
Definition: SmartScriptMgr.h:595
@ SMART_ACTION_SOUND
Definition: SmartScriptMgr.h:529
@ SMART_ACTION_MOVE_TO_POS_TARGET
Definition: SmartScriptMgr.h:670
@ SMART_ACTION_SET_MOVEMENT_SPEED
Definition: SmartScriptMgr.h:661
@ SMART_ACTION_PLAY_CINEMATIC
Definition: SmartScriptMgr.h:660
@ SMART_ACTION_SET_GO_STATE
Definition: SmartScriptMgr.h:671
@ SMART_ACTION_ADD_NPC_FLAG
Definition: SmartScriptMgr.h:607
@ SMART_ACTION_EVADE
Definition: SmartScriptMgr.h:549
@ SMART_ACTION_FAIL_QUEST
Definition: SmartScriptMgr.h:531
@ SMART_ACTION_INTERRUPT_SPELL
Definition: SmartScriptMgr.h:617
@ SMART_ACTION_ADD_POWER
Definition: SmartScriptMgr.h:634
@ SMART_ACTION_REMOVE_DYNAMIC_FLAG
Definition: SmartScriptMgr.h:621
@ SMART_ACTION_RANDOM_SOUND
Definition: SmartScriptMgr.h:640
@ SMART_ACTION_RANDOM_MUSIC
Definition: SmartScriptMgr.h:686
@ SMART_ACTION_SET_COMBAT_DISTANCE
Definition: SmartScriptMgr.h:674
@ SMART_ACTION_SET_POWER
Definition: SmartScriptMgr.h:633
@ SMART_ACTION_SEND_TARGET_TO_TARGET
Definition: SmartScriptMgr.h:625
@ SMART_ACTION_REMOVE_POWER
Definition: SmartScriptMgr.h:635
@ SMART_ACTION_ADD_IMMUNITY
Definition: SmartScriptMgr.h:677
@ SMART_ACTION_SET_DYNAMIC_FLAG
Definition: SmartScriptMgr.h:619
@ SMART_ACTION_FALL
Definition: SmartScriptMgr.h:679
@ SMART_ACTION_GO_SET_GO_STATE
Definition: SmartScriptMgr.h:643
@ SMART_ACTION_CUSTOM_CAST
Definition: SmartScriptMgr.h:688
@ SMART_ACTION_REMOVE_ITEM
Definition: SmartScriptMgr.h:582
@ SMART_ACTION_SEND_GO_CUSTOM_ANIM
Definition: SmartScriptMgr.h:618
@ SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL
Definition: SmartScriptMgr.h:528
@ SMART_ACTION_REMOVE_UNIT_FLAG
Definition: SmartScriptMgr.h:544
@ SMART_ACTION_RANDOM_PHASE
Definition: SmartScriptMgr.h:555
@ SMART_ACTION_SET_EMOTE_STATE
Definition: SmartScriptMgr.h:542
@ SMART_ACTION_CROSS_CAST
Definition: SmartScriptMgr.h:611
@ SMART_ACTION_WP_STOP
Definition: SmartScriptMgr.h:580
@ SMART_ACTION_GAME_EVENT_STOP
Definition: SmartScriptMgr.h:636
@ SMART_ACTION_CALL_SCRIPT_RESET
Definition: SmartScriptMgr.h:603
@ SMART_ACTION_CU_ENCOUNTER_START
Definition: SmartScriptMgr.h:692
@ SMART_ACTION_WP_START
Definition: SmartScriptMgr.h:578
@ SMART_ACTION_COMBAT_STOP
Definition: SmartScriptMgr.h:552
@ SMART_ACTION_EXIT_VEHICLE
Definition: SmartScriptMgr.h:672
@ SMART_ACTION_SET_HEALTH_PCT
Definition: SmartScriptMgr.h:663
@ SMART_ACTION_AUTO_ATTACK
Definition: SmartScriptMgr.h:545
@ SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL
Definition: SmartScriptMgr.h:567
@ SMART_ACTION_SET_VISIBILITY
Definition: SmartScriptMgr.h:572
@ SMART_ACTION_RANDOM_PHASE_RANGE
Definition: SmartScriptMgr.h:556
@ SMART_ACTION_GO_SET_LOOT_STATE
Definition: SmartScriptMgr.h:624
@ SMART_ACTION_PLAYER_TALK
Definition: SmartScriptMgr.h:690
@ SMART_ACTION_SET_SWIM
Definition: SmartScriptMgr.h:586
@ SMART_ACTION_SET_SIGHT_DIST
Definition: SmartScriptMgr.h:646
@ SMART_ACTION_SET_INST_DATA
Definition: SmartScriptMgr.h:559
@ SMART_ACTION_REMOVE_GO_FLAG
Definition: SmartScriptMgr.h:631
@ SMART_ACTION_LOAD_GRID
Definition: SmartScriptMgr.h:684
@ SMART_ACTION_CALL_FOR_HELP
Definition: SmartScriptMgr.h:564
@ SMART_ACTION_ADD_THREAT
Definition: SmartScriptMgr.h:648
@ SMART_ACTION_TELEPORT
Definition: SmartScriptMgr.h:587
@ SMART_ACTION_PLAYMOVIE
Definition: SmartScriptMgr.h:593
@ SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT
Definition: SmartScriptMgr.h:650
@ SMART_ACTION_FOLLOW
Definition: SmartScriptMgr.h:554
@ SMART_ACTION_PLAY_EMOTE
Definition: SmartScriptMgr.h:530
@ SMART_ACTION_SET_CORPSE_DELAY
Definition: SmartScriptMgr.h:641
@ SMART_ACTION_SET_SHEATH
Definition: SmartScriptMgr.h:565
@ SMART_ACTION_SET_ORIENTATION
Definition: SmartScriptMgr.h:591
@ SMART_ACTION_SET_NPC_FLAG
Definition: SmartScriptMgr.h:606
@ SMART_ACTION_MOVE_TO_POS
Definition: SmartScriptMgr.h:594
@ SMART_ACTION_RANDOM_EMOTE
Definition: SmartScriptMgr.h:535
@ SMART_ACTION_INC_EVENT_PHASE
Definition: SmartScriptMgr.h:548
@ SMART_ACTION_CREATE_TIMED_EVENT
Definition: SmartScriptMgr.h:592
@ SMART_ACTION_SET_EVENT_FLAG_RESET
Definition: SmartScriptMgr.h:680
@ SMART_ACTION_DIE
Definition: SmartScriptMgr.h:562
@ SMART_ACTION_RESET_SCRIPT_BASE_OBJECT
Definition: SmartScriptMgr.h:602
@ SMART_ACTION_REMOVE_NPC_FLAG
Definition: SmartScriptMgr.h:608
@ SMART_ACTION_SET_FLY
Definition: SmartScriptMgr.h:585
@ SMART_ACTION_INSTALL_AI_TEMPLATE
Definition: SmartScriptMgr.h:583
@ SMART_ACTION_SUMMON_CREATURE
Definition: SmartScriptMgr.h:537
@ SMART_ACTION_CALL_TIMED_ACTIONLIST
Definition: SmartScriptMgr.h:605
@ SMART_ACTION_SET_IN_COMBAT_WITH_ZONE
Definition: SmartScriptMgr.h:563
@ SMART_ACTION_DO_ACTION
Definition: SmartScriptMgr.h:693
@ SMART_ACTION_SET_HOME_POS
Definition: SmartScriptMgr.h:626
@ SMART_ACTION_ADD_ITEM
Definition: SmartScriptMgr.h:581
@ SMART_ACTION_SET_ACTIVE
Definition: SmartScriptMgr.h:573
@ SMART_ACTION_SET_RANGED_MOVEMENT
Definition: SmartScriptMgr.h:604
@ SMART_ACTION_ACTIVATE_TAXI
Definition: SmartScriptMgr.h:577
@ SMART_ACTION_START_CLOSEST_WAYPOINT
Definition: SmartScriptMgr.h:638
@ SMART_ACTION_SET_CASTER_COMBAT_DIST
Definition: SmartScriptMgr.h:675
@ SMART_ACTION_SUMMON_CREATURE_GROUP
Definition: SmartScriptMgr.h:632
@ SMART_ACTION_REMOVE_IMMUNITY
Definition: SmartScriptMgr.h:678
@ SMART_ACTION_SET_REACT_STATE
Definition: SmartScriptMgr.h:533
@ SMART_ACTION_RANDOM_MOVE
Definition: SmartScriptMgr.h:614
@ SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT
Definition: SmartScriptMgr.h:601
@ SMART_ACTION_TRIGGER_TIMED_EVENT
Definition: SmartScriptMgr.h:598
@ SMART_ACTION_REMOVEAURASFROMSPELL
Definition: SmartScriptMgr.h:553
@ SMART_ACTION_FLEE
Definition: SmartScriptMgr.h:647
@ SMART_ACTION_ZONE_UNDER_ATTACK
Definition: SmartScriptMgr.h:683
SMART_EVENT
Definition: SmartScriptMgr.h:117
@ SMART_EVENT_TIMED_EVENT_TRIGGERED
Definition: SmartScriptMgr.h:177
@ SMART_EVENT_LINK
Definition: SmartScriptMgr.h:179
@ SMART_EVENT_WAYPOINT_REACHED
Definition: SmartScriptMgr.h:158
SmartActionSummonCreatureFlags
Definition: SmartScriptMgr.h:700
@ SMART_ESCORT_TARGETS
Definition: SmartScriptMgr.h:59
std::unordered_map< uint32, WayPoint * > WPPath
Definition: SmartScriptMgr.h:1821
@ SMARTCAST_TRIGGERED
Definition: SmartScriptMgr.h:1785
@ SMARTCAST_INTERRUPT_PREVIOUS
Definition: SmartScriptMgr.h:1784
@ SMARTCAST_AURA_NOT_PRESENT
Definition: SmartScriptMgr.h:1789
npc
Definition: BattlegroundSA.h:75
#define MAX_EQUIPMENT_ITEMS
Definition: CreatureData.h:39
LootState
Definition: GameObject.h:111
@ GO_READY
Definition: GameObject.h:113
GOState
Definition: GameObjectData.h:689
TempSummonType
Definition: Object.h:41
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:44
@ TEMPSUMMON_CORPSE_DESPAWN
Definition: Object.h:46
@ UNIT_NPC_FLAGS
Definition: UpdateFields.h:139
@ UNIT_FIELD_FLAGS_2
Definition: UpdateFields.h:118
@ UNIT_VIRTUAL_ITEM_SLOT_ID
Definition: UpdateFields.h:116
@ UNIT_FIELD_FLAGS
Definition: UpdateFields.h:117
@ UNIT_NPC_EMOTESTATE
Definition: UpdateFields.h:140
@ UNIT_FIELD_BYTES_1
Definition: UpdateFields.h:131
@ UNIT_DYNAMIC_FLAGS
Definition: UpdateFields.h:136
@ GAMEOBJECT_FLAGS
Definition: UpdateFields.h:399
@ MOVEMENTFLAG_ONTRANSPORT
Definition: Unit.h:561
ReactStates
Definition: Unit.h:1022
SheathState
Definition: Unit.h:125
@ UNIT_STATE_LOST_CONTROL
Definition: Unit.h:366
@ UNIT_STATE_ROOT
Definition: Unit.h:335
@ UNIT_STATE_NO_ENVIRONMENT_UPD
Definition: Unit.h:353
UnitMoveType
Definition: Unit.h:377
@ MOVE_RUN
Definition: Unit.h:379
@ UNIT_FLAG_SILENCED
Definition: Unit.h:461
#define sGameEventMgr
Definition: GameEventMgr.h:186
#define sObjectMgr
Definition: ObjectMgr.h:1640
EncounterState
Definition: InstanceScript.h:55
@ BROADCAST_TEXT_CALL_FOR_HELP
Definition: Language.h:24
@ BROADCAST_TEXT_FLEE_FOR_ASSIST
Definition: Language.h:25
@ MOTION_SLOT_CONTROLLED
Definition: MotionMaster.h:63
@ MOTION_SLOT_ACTIVE
Definition: MotionMaster.h:62
@ CHASE_MOTION_TYPE
Definition: MotionMaster.h:43
@ AURA_REMOVE_BY_EXPIRE
Definition: SpellAuraDefines.h:395
@ SPELLVALUE_BASE_POINT1
Definition: SpellDefines.h:115
@ SPELLVALUE_BASE_POINT2
Definition: SpellDefines.h:116
@ SPELLVALUE_BASE_POINT0
Definition: SpellDefines.h:114
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
Definition: SpellDefines.h:148
@ TRIGGERED_NONE
Definition: SpellDefines.h:131
@ TEXT_RANGE_NORMAL
Definition: CreatureTextMgr.h:30
phase
Definition: boss_skadi.cpp:102
@ GAMEOBJECT_TYPE_DOOR
Definition: SharedDefines.h:1532
@ CHAT_MSG_MONSTER_EMOTE
Definition: SharedDefines.h:3140
@ CHAT_MSG_ADDON
Definition: SharedDefines.h:3123
@ LANG_UNIVERSAL
Definition: SharedDefines.h:707
@ LANG_ADDON
Definition: SharedDefines.h:725
@ TEAM_NEUTRAL
Definition: SharedDefines.h:734
std::string ToString(Type &&val, Params &&... params)
Definition: StringConvert.h:250
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition: Containers.h:135
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:225
bool IsEmpty() const
Definition: LinkedList.h:97
Definition: LinkedList.h:139
Definition: EnumFlag.h:54
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:28
SmartScript * GetScript()
Definition: SmartAI.h:73
void SetInvincibilityHpLevel(uint32 level)
Definition: SmartAI.h:181
Definition: SmartAI.h:253
void IncPhase(uint32 p)
Definition: SmartScript.cpp:4588
void SetActualCombatDist(uint32 dist)
Definition: SmartScript.h:220
bool IsSmart(Creature *c=nullptr)
Definition: SmartScript.h:86
bool IsSmartGO(GameObject *g=nullptr)
Definition: SmartScript.h:101
void ProcessEvent(SmartScriptHolder &e, Unit *unit=nullptr, uint32 var0=0, uint32 var1=0, bool bvar=false, SpellInfo const *spell=nullptr, GameObject *gob=nullptr)
Definition: SmartScript.cpp:3415
void StoreTargetList(ObjectVector const &targets, uint32 id)
Definition: SmartScript.h:79
SmartScriptHolder FindLinkedEvent(uint32 link)
Definition: SmartScript.h:297
static bool IsUnit(WorldObject *obj)
Definition: SmartScript.cpp:4557
float GetCasterActualDist() const
Definition: SmartScript.h:229
void StoreCounter(uint32 id, uint32 value, uint32 reset, uint32 subtract)
Definition: SmartScript.h:123
float GetCasterMaxDist() const
Definition: SmartScript.h:230
void SetPhaseReset(bool allow)
Definition: SmartScript.h:233
void GetTargets(ObjectVector &targets, SmartScriptHolder const &e, Unit *invoker=nullptr) const
Definition: SmartScript.cpp:2838
uint32 GetMaxCombatDist() const
Definition: SmartScript.h:223
void SetCasterActualDist(float dist)
Definition: SmartScript.h:226
void OnReset()
Definition: SmartScript.cpp:71
void InstallTemplate(SmartScriptHolder const &e)
Definition: SmartScript.cpp:2727
ObjectGuid goOrigGUID
Definition: SmartScript.h:251
Powers GetCasterPowerType() const
Definition: SmartScript.h:228
void DecPhase(uint32 p)
Definition: SmartScript.cpp:4594
ObjectGuid meOrigGUID
Definition: SmartScript.h:249
Definition: SmartScriptMgr.h:33
uint32 id
Definition: SmartScriptMgr.h:44
Definition: SmartScriptMgr.h:216
uint32 repeatMin
Definition: SmartScriptMgr.h:227
uint32 repeatMax
Definition: SmartScriptMgr.h:228
Definition: SmartScriptMgr.h:711
struct SmartAction::@73::@119 wpStart
struct SmartAction::@73::@110 forceDespawn
struct SmartAction::@73::@179 cinematic
uint32 targetParam2
Definition: SmartScriptMgr.h:813
std::array< uint32, SMART_ACTION_PARAM_COUNT > emotes
Definition: SmartScriptMgr.h:797
struct SmartAction::@73::@92 summonCreature
struct SmartAction::@73::@116 setActive
struct SmartAction::@73::@163 setHomePos
uint32 repeatMax
Definition: SmartScriptMgr.h:1066
uint32 phaseMin
Definition: SmartScriptMgr.h:898
uint32 targetsLimit
Definition: SmartScriptMgr.h:804
struct SmartAction::@73::@155 creatureGroup
SAIBool transport
Definition: SmartScriptMgr.h:1160
uint32 newPower
Definition: SmartScriptMgr.h:1217
SAIBool reset
Definition: SmartScriptMgr.h:1051
std::array< uint32, SMART_ACTION_PARAM_COUNT > actionLists
Definition: SmartScriptMgr.h:1114
uint32 delay
Definition: SmartScriptMgr.h:938
uint32 random
Definition: SmartScriptMgr.h:1283
uint32 quickChange
Definition: SmartScriptMgr.h:1282
struct SmartAction::@73::@100 removeAura
SAIBool root
Definition: SmartScriptMgr.h:1194
uint32 dist
Definition: SmartScriptMgr.h:883
uint32 group
Definition: SmartScriptMgr.h:1209
SAIBool disable
Definition: SmartScriptMgr.h:1336
struct SmartAction::@73::@148 setGoLootState
struct SmartAction::@73::@146 moveToPos
uint32 spell
Definition: SmartScriptMgr.h:802
struct SmartAction::@73::@178 setHealthPct
std::array< uint32, SMART_ACTION_PARAM_COUNT > wps
Definition: SmartScriptMgr.h:1232
struct SmartAction::@73::@112 ingamePhaseMask
uint32 minHP
Definition: SmartScriptMgr.h:944
SAIBool force
Definition: SmartScriptMgr.h:1259
struct SmartAction::@73::@165 randomTimedEvent
uint32 flags
Definition: SmartScriptMgr.h:803
uint32 distanceBetweenSummons
Definition: SmartScriptMgr.h:1297
uint32 data
Definition: SmartScriptMgr.h:910
uint32 powerType
Definition: SmartScriptMgr.h:1216
SAIBool regenHealth
Definition: SmartScriptMgr.h:1189
uint32 entry
Definition: SmartScriptMgr.h:885
struct SmartAction::@73::@170 coneSummon
uint32 quest
Definition: SmartScriptMgr.h:781
uint32 bp1
Definition: SmartScriptMgr.h:1312
uint32 distance
Definition: SmartScriptMgr.h:744
struct SmartAction::@73::@102 randomPhase
uint32 min
Definition: SmartScriptMgr.h:1063
struct SmartAction::@73::@129 storeTargets
struct SmartAction::@73::@150 setRangedMovement
SAIBool withDelayed
Definition: SmartScriptMgr.h:1125
SAIBool withInstant
Definition: SmartScriptMgr.h:1127
uint32 subtract
Definition: SmartScriptMgr.h:1052
struct SmartAction::@73::@151 setHealthRegen
struct SmartAction::@73::@104 killedMonster
uint32 a
Definition: SmartScriptMgr.h:1321
struct SmartAction::@73::@173 summonVortex
uint32 percent
Definition: SmartScriptMgr.h:945
uint32 dec
Definition: SmartScriptMgr.h:867
struct SmartAction::@73::@89 crossCast
struct SmartAction::@73::@176 corpseDelay
uint32 summonEntry
Definition: SmartScriptMgr.h:1294
struct SmartAction::@73::@169 stopMotion
struct SmartAction::@73::@131 movie
uint32 instanceTarget
Definition: SmartScriptMgr.h:1331
uint32 credit
Definition: SmartScriptMgr.h:886
uint32 controlled
Definition: SmartScriptMgr.h:1161
uint32 alternative
Definition: SmartScriptMgr.h:819
uint32 targetParam1
Definition: SmartScriptMgr.h:812
uint32 mapID
Definition: SmartScriptMgr.h:1044
uint32 stopMovement
Definition: SmartScriptMgr.h:1288
struct SmartAction::@73::@103 randomPhaseRange
uint32 charges
Definition: SmartScriptMgr.h:878
struct SmartAction::@73::@98 incEventPhase
uint32 model
Definition: SmartScriptMgr.h:737
struct SmartAction::@73::@122 item
struct SmartAction::@73::@137 timedActionList
struct SmartAction::@73::@147 sendGossipMenu
struct SmartAction::@73::@171 playerTalk
struct SmartAction::@73::@174 doAction
struct SmartAction::@73::@168 orientation
uint32 duration
Definition: SmartScriptMgr.h:719
struct SmartAction::@73::@111 invincHP
SAIBool attackInvoker
Definition: SmartScriptMgr.h:832
SAIBool useTalkTarget
Definition: SmartScriptMgr.h:720
SAIBool run
Definition: SmartScriptMgr.h:989
struct SmartAction::@73::@125 setFly
uint32 value
Definition: SmartScriptMgr.h:1050
uint32 movementExpired
Definition: SmartScriptMgr.h:1289
struct SmartAction::@73::@109 setSheath
struct SmartAction::@73::@106 setInstanceData64
uint32 targetParam3
Definition: SmartScriptMgr.h:814
SAIBool swim
Definition: SmartScriptMgr.h:1039
uint32 sound2
Definition: SmartScriptMgr.h:750
struct SmartAction::@73::@136 delunitByte
uint32 spawnPos
Definition: SmartScriptMgr.h:1253
struct SmartAction::@73::@138 randTimedActionList
uint32 creature
Definition: SmartScriptMgr.h:736
struct SmartAction::@73::@164 loadEquipment
struct SmartAction::@73::@132 equip
struct SmartAction::@73::@97 setEventPhase
struct SmartAction::@73::@115 visibility
struct SmartAction::@73::@157 gameEventStop
struct SmartAction::@73::@86 react
struct SmartAction::@73::@113 setData
struct SmartAction::@73::@126 setSwim
uint32 angle
Definition: SmartScriptMgr.h:884
uint32 field
Definition: SmartScriptMgr.h:909
struct SmartAction::@73::@90 activateObject
uint32 range
Definition: SmartScriptMgr.h:824
struct SmartAction::@73::@158 gameEventStart
uint32 flag
Definition: SmartScriptMgr.h:1084
struct SmartAction::@73::@96 combatMove
struct SmartAction::@73::@142 jump
struct SmartAction::@73::@177 movementSpeed
struct SmartAction::@73::@141 sendGoCustomAnim
uint32 sound3
Definition: SmartScriptMgr.h:751
uint32 targetsummon
Definition: SmartScriptMgr.h:978
struct SmartAction::@73::@156 power
uint32 chance
Definition: SmartScriptMgr.h:1067
struct SmartAction::@73::@144 flee
uint32 state
Definition: SmartScriptMgr.h:792
uint32 byte1
Definition: SmartScriptMgr.h:1095
uint32 sound1
Definition: SmartScriptMgr.h:749
struct SmartAction::@73::@121 wpStop
SAIBool updateLevel
Definition: SmartScriptMgr.h:922
struct SmartAction::@73::@114 moveRandom
uint32 forceRespawnTimer
Definition: SmartScriptMgr.h:939
uint32 speed
Definition: SmartScriptMgr.h:1033
struct SmartAction::@73::@82 randomMusic
uint32 sound4
Definition: SmartScriptMgr.h:752
uint32 targetType
Definition: SmartScriptMgr.h:811
struct SmartAction::@73::@80 randomSound
struct SmartAction::@73::@120 wpPause
struct SmartAction::@73::@175 disableEvade
uint32 aliveState
Definition: SmartScriptMgr.h:888
struct SmartAction::@73::@161 sightDistance
SAIBool onlySelf
Definition: SmartScriptMgr.h:743
uint32 attackScriptOwner
Definition: SmartScriptMgr.h:833
uint32 speedxy
Definition: SmartScriptMgr.h:1137
struct SmartAction::@73::@118 taxi
uint32 pointId
Definition: SmartScriptMgr.h:1159
SAIBool attack
Definition: SmartScriptMgr.h:851
uint32 repeatMin
Definition: SmartScriptMgr.h:1065
uint32 anim
Definition: SmartScriptMgr.h:1132
struct SmartAction::@73::@152 setRoot
SAIBool fly
Definition: SmartScriptMgr.h:1032
uint32 textGroupID
Definition: SmartScriptMgr.h:718
std::array< uint32, SMART_ACTION_PARAM_COUNT > phases
Definition: SmartScriptMgr.h:893
uint32 spell_id
Definition: SmartScriptMgr.h:1126
struct SmartAction::@73::@153 goFlag
uint32 textId
Definition: SmartScriptMgr.h:1304
uint32 gossipMenuId
Definition: SmartScriptMgr.h:1167
struct SmartAction::@73::@172 castCustom
uint32 speedz
Definition: SmartScriptMgr.h:1138
struct SmartAction::@73::@154 goState
SAIBool repeat
Definition: SmartScriptMgr.h:991
uint32 gossipNpcTextId
Definition: SmartScriptMgr.h:1168
struct SmartAction::@73::@88 cast
uint32 mask
Definition: SmartScriptMgr.h:950
struct SmartAction::@73::@162 casterDistance
uint32 phi_delta
Definition: SmartScriptMgr.h:1324
uint32 count
Definition: SmartScriptMgr.h:1012
uint32 inc
Definition: SmartScriptMgr.h:866
struct SmartAction::@73::@101 follow
uint32 phaseMax
Definition: SmartScriptMgr.h:899
uint32 timer
Definition: SmartScriptMgr.h:1341
uint32 ContactDistance
Definition: SmartScriptMgr.h:1162
struct SmartAction::@73::@128 setCounter
uint32 k
Definition: SmartScriptMgr.h:1322
uint32 distanceBetweenRings
Definition: SmartScriptMgr.h:1296
uint32 coneLength
Definition: SmartScriptMgr.h:1298
struct SmartAction::@73::@75 talk
uint32 counterId
Definition: SmartScriptMgr.h:1049
struct SmartAction::@73::@166 setHover
SAIBool withEmote
Definition: SmartScriptMgr.h:928
uint32 max
Definition: SmartScriptMgr.h:1064
uint32 selfJump
Definition: SmartScriptMgr.h:1139
uint32 maxId
Definition: SmartScriptMgr.h:1265
struct SmartAction::@73::@95 autoAttack
uint32 r_max
Definition: SmartScriptMgr.h:1323
struct SmartAction::@73::@127 teleport
uint32 speedFraction
Definition: SmartScriptMgr.h:1348
struct SmartAction::@73::@78 morphOrMount
struct SmartAction::@73::@108 callHelp
SAIBool fail
Definition: SmartScriptMgr.h:1006
struct SmartAction::@73::@85 questOffer
SAIBool directAdd
Definition: SmartScriptMgr.h:787
uint32 bp2
Definition: SmartScriptMgr.h:1313
uint32 disableGravity
Definition: SmartScriptMgr.h:1034
uint32 sound
Definition: SmartScriptMgr.h:742
uint32 threatINC
Definition: SmartScriptMgr.h:839
struct SmartAction::@73::@124 setRun
uint32 coneAngle
Definition: SmartScriptMgr.h:1299
uint32 summonDuration
Definition: SmartScriptMgr.h:1295
struct SmartAction::@73::@167 immunity
uint32 threatDEC
Definition: SmartScriptMgr.h:840
struct SmartAction::@73::@87 randomEmote
struct SmartAction::@73::@159 closestWaypointFromList
uint32 reactState
Definition: SmartScriptMgr.h:994
struct SmartAction::@73::@93 threatPCT
struct SmartAction::@73::@130 timeEvent
uint32 speedInteger
Definition: SmartScriptMgr.h:1347
struct SmartAction::@73::@105 setInstanceData
struct SmartAction::@73::@145 RespawnTarget
struct SmartAction::@73::@160 combatDistance
uint32 actionId
Definition: SmartScriptMgr.h:1329
uint32 despawnTime
Definition: SmartScriptMgr.h:977
struct SmartAction::@73::@149 sendTargetToTarget
uint32 goRespawnTime
Definition: SmartScriptMgr.h:1154
uint32 factionID
Definition: SmartScriptMgr.h:731
struct SmartAction::@73::@77 faction
struct SmartAction::@73::@107 updateTemplate
SAIBool move
Definition: SmartScriptMgr.h:856
struct SmartAction::@73::@140 interruptSpellCasting
struct SmartAction::@73::@143 movementFlag
struct SmartAction::@73::@117 summonGO
std::array< uint32, MAX_EQUIPMENT_ITEMS > slots
Definition: SmartScriptMgr.h:1079
struct SmartAction::@73::@133 unitFlag
uint32 movementType
Definition: SmartScriptMgr.h:1346
uint32 questID
Definition: SmartScriptMgr.h:786
uint32 bp3
Definition: SmartScriptMgr.h:1314
uint32 pathID
Definition: SmartScriptMgr.h:990
uint32 emote
Definition: SmartScriptMgr.h:776
struct SmartAction::@73::@76 simpleTalk
uint32 id
Definition: SmartScriptMgr.h:984
uint32 minId
Definition: SmartScriptMgr.h:1264
uint32 phase
Definition: SmartScriptMgr.h:861
struct SmartAction::@73::@135 setunitByte
uint32 sheath
Definition: SmartScriptMgr.h:933
struct SmartAction::@73::@81 music
uint32 isNegative
Definition: SmartScriptMgr.h:1330
uint32 creditType
Definition: SmartScriptMgr.h:887
struct SmartTarget::@181::@185 unitRange
float o
Definition: SmartScriptMgr.h:1449
uint32 maxDist
Definition: SmartScriptMgr.h:1455
uint32 range
Definition: SmartScriptMgr.h:1574
float x
Definition: SmartScriptMgr.h:1449
uint32 self
Definition: SmartScriptMgr.h:1576
uint32 amount
Definition: SmartScriptMgr.h:1575
struct SmartTarget::@181::@202 randomPoint
float y
Definition: SmartScriptMgr.h:1449
float z
Definition: SmartScriptMgr.h:1449
bool runOnce
Definition: SmartScriptMgr.h:1817
uint32 link
Definition: SmartScriptMgr.h:1803
uint32 event_id
Definition: SmartScriptMgr.h:1802
int32 entryOrGuid
Definition: SmartScriptMgr.h:1800
uint32 GetScriptType() const
Definition: SmartScriptMgr.h:1810
uint32 GetTargetType() const
Definition: SmartScriptMgr.h:1813
uint32 GetActionType() const
Definition: SmartScriptMgr.h:1812
void ModifyThreatByPercent(Unit *victim, int32 percent)
Definition: ThreatMgr.cpp:509
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:328
void Respawn(bool force=false)
Definition: Creature.cpp:2005
void GetRespawnPosition(float &x, float &y, float &z, float *ori=nullptr, float *dist=nullptr) const
Definition: Creature.cpp:2844
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Definition: Creature.cpp:3092
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:330
void LoadEquipment(int8 id=1, bool force=false)
Definition: Creature.cpp:1777
void SendZoneUnderAttackMessage(Player *attacker)
Send a message to LocalDefense channel for players opposition team in the zone.
Definition: Creature.cpp:2716
void SetRegeneratingHealth(bool c)
Definition: Creature.h:310
void GetTransportHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:335
void SetReactState(ReactStates st)
Definition: Creature.h:89
float m_SightDistance
Definition: Creature.h:363
void DoFleeToGetAssistance()
Definition: Creature.cpp:1031
float m_CombatDistance
Definition: Creature.h:363
void SetCorpseDelay(uint32 delay)
Definition: Creature.h:72
bool IsSpellProhibited(SpellSchoolMask idSchoolMask) const
Definition: Creature.cpp:2740
Definition: CreatureData.h:176
Definition: CreatureData.h:349
uint32 ItemEntry[MAX_EQUIPMENT_ITEMS]
Definition: CreatureData.h:350
Definition: GossipDef.h:258
void SendCloseGossip()
Definition: GossipDef.cpp:240
void SetGoState(GOState state)
Definition: GameObject.cpp:2467
void UseDoorOrButton(uint32 time_to_restore=0, bool alternative=false, Unit *user=nullptr)
Definition: GameObject.cpp:1427
bool isSpawnedByDefault() const
Definition: GameObject.h:197
void SetLootState(LootState s, Unit *unit=nullptr)
Definition: GameObject.cpp:2432
GameObjectAI * AI() const
Definition: GameObject.h:310
void SetRespawnTime(int32 respawn)
Definition: GameObject.cpp:1301
GameobjectTypes GetGoType() const
Definition: GameObject.h:205
void Respawn()
Definition: GameObject.cpp:1316
void SendCustomAnim(uint32 anim)
Definition: GameObject.cpp:2138
void DespawnOrUnsummon(Milliseconds delay=0ms, Seconds forcedRespawnTime=0s)
Definition: GameObject.cpp:930
void CastSpell(Unit *target, uint32 spell)
Definition: GameObject.cpp:2073
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:845
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:860
void RemoveByteFlag(uint16 index, uint8 offset, uint8 newFlag)
Definition: Object.cpp:930
bool HasFlag(uint16 index, uint32 flag) const
Definition: Object.cpp:889
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:650
Unit * ToUnit()
Definition: Object.h:200
void SetByteFlag(uint16 index, uint8 offset, uint8 newFlag)
Definition: Object.cpp:911
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2318
Map * FindMap() const
Definition: Object.h:518
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
bool IsWithinLOSInMap(WorldObject const *obj, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
Definition: Object.cpp:1347
bool GetClosePoint(float &x, float &y, float &z, float size, float distance2d=0, float angle=0, WorldObject const *forWho=nullptr, bool force=false) const
Definition: Object.cpp:2662
std::string const & GetName() const
Definition: Object.h:446
void GetContactPoint(WorldObject const *obj, float &x, float &y, float &z, float distance2d=CONTACT_DISTANCE) const
Definition: Object.cpp:2705
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1245
uint32 GetAreaId() const
Definition: Object.cpp:3083
uint32 GetZoneId() const
Definition: Object.cpp:3075
float GetObjectSize() const
Definition: Object.cpp:2734
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition: Object.cpp:2332
void GetRandomPoint(const Position &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const
Definition: Object.cpp:1502
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition: Object.cpp:2395
Creature * SummonTrigger(float x, float y, float z, float ang, uint32 dur, bool setLevel=false, CreatureAI *(*GetAI)(Creature *)=nullptr)
Definition: Object.cpp:2367
static ObjectGuid const Empty
Definition: ObjectGuid.h:122
std::string ToString() const
Definition: ObjectGuid.cpp:47
Definition: Position.h:28
float m_positionZ
Definition: Position.h:58
float m_positionX
Definition: Position.h:56
float GetPositionZ() const
Definition: Position.h:119
float m_positionY
Definition: Position.h:57
float GetOrientation() const
Definition: Position.h:120
void SetOrientation(float orientation)
Definition: Position.h:112
float GetPositionX() const
Definition: Position.h:117
void GetPosition(float &x, float &y) const
Definition: Position.h:122
float GetPositionY() const
Definition: Position.h:118
float GetAngle(const Position *pos) const
Definition: Position.cpp:77
void GroupEventHappens(uint32 questId, WorldObject const *pEventObject)
Definition: PlayerQuest.cpp:1802
bool ActivateTaxiPathTo(std::vector< uint32 > const &nodes, Creature *npc=nullptr, uint32 spellid=1)
Definition: Player.cpp:10128
void SendCinematicStart(uint32 CinematicSequenceId) const
Definition: Player.cpp:5599
void Yell(std::string_view text, Language language, WorldObject const *=nullptr) override
Handles yelled message in regular chat based on declared language and in config pre-defined Range.
Definition: Player.cpp:9250
void Say(std::string_view text, Language language, WorldObject const *=nullptr) override
Handles said message in regular chat based on declared language and in config pre-defined Range.
Definition: Player.cpp:9230
void PrepareGossipMenu(WorldObject *source, uint32 menuId=0, bool showQuests=false)
Definition: PlayerGossip.cpp:31
PlayerMenu * PlayerTalkClass
Definition: Player.h:2188
void RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject *pRewardSource)
Definition: Player.cpp:12627
uint8 getGender() const
Definition: Unit.h:1428
void SetFacingTo(float ori)
Definition: Unit.cpp:20782
void CombatStop(bool includingCast=false)
Definition: Unit.cpp:10401
float GetSpeed(UnitMoveType mtype) const
Definition: Unit.cpp:14318
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition: Unit.cpp:13300
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4069
void RemoveAllGameObjects()
Definition: Unit.cpp:6175
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition: Unit.cpp:14548
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition: Unit.cpp:10576
static void Kill(Unit *killer, Unit *victim, bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition: Unit.cpp:17862
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool fromRegenerate=false)
Definition: Unit.cpp:15458
MotionMaster * GetMotionMaster()
Definition: Unit.h:2262
void SetUnitMovementFlags(uint32 f)
Definition: Unit.h:2276
SpellCastResult CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1226
void SetInCombatWith(Unit *enemy, uint32 duration=0)
Definition: Unit.cpp:13492
void SetFacingToObject(WorldObject *object)
Definition: Unit.cpp:20792
bool IsAlive() const
Definition: Unit.h:1808
void StopMoving()
Definition: Unit.cpp:16824
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5610
void AddUnitState(uint32 f)
Definition: Unit.h:1397
virtual void SetSheath(SheathState sheathed)
Definition: Unit.h:1492
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition: Unit.cpp:18192
bool HasUnitMovementFlag(uint32 f) const
Definition: Unit.h:2274
uint32 GetMaxPower(Powers power) const
Definition: Unit.h:1462
TransportBase * GetDirectTransport() const
Returns the transport this unit is on directly (if on vehicle and transport, return vehicle)
Definition: Unit.cpp:18935
void SendMovementFlagUpdate(bool self=false)
Definition: Unit.cpp:16878
virtual bool SetHover(bool enable, bool packetOnly=false, bool updateAnimationTier=true)
Definition: Unit.cpp:20918
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1169
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:14323
ObjectGuid GetTransGUID() const override
Definition: Unit.cpp:18924
bool IsAIEnabled
Definition: Unit.h:2350
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1398
float GetPowerPct(Powers power) const
Definition: Unit.h:1451
uint32 GetPower(Powers power) const
Definition: Unit.h:1461
void KillSelf(bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition: Unit.h:1551
void SetInFront(WorldObject const *target)
Definition: Unit.cpp:20776
bool AttackStop()
Definition: Unit.cpp:10368
bool isDead() const
Definition: Unit.h:1810
void ExitVehicle(Position const *exitPosition=nullptr)
Definition: Unit.cpp:19896
Definition: VehicleDefines.h:107
static uint32 ChooseDisplayId(CreatureTemplate const *cinfo, CreatureData const *data=nullptr)
Definition: ObjectMgr.cpp:1717
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:317
virtual void DoAction(int32)
Definition: InstanceScript.h:262
static std::string GetBossStateName(uint8 state)
Definition: InstanceScript.cpp:701
void LoadGrid(float x, float y)
Definition: Map.cpp:494
PlayerList const & GetPlayers() const
Definition: Map.h:484
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53
virtual void SetGuidData(uint32, ObjectGuid)
Definition: ZoneScript.h:46
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Definition: MotionMaster.cpp:299
MovementGeneratorType GetCurrentMovementGeneratorType() const
Definition: MotionMaster.cpp:817
void MovementExpired(bool reset=true)
Definition: MotionMaster.h:178
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:210
void MoveJump(Position const &pos, float speedXY, float speedZ, uint32 id=0)
Definition: MotionMaster.h:225
void MoveIdle()
Definition: MotionMaster.cpp:231
void MoveFall(uint32 id=0, bool addFlagForNPC=false)
Definition: MotionMaster.cpp:545
void MoveFleeing(Unit *enemy, uint32 time=0)
Definition: MotionMaster.cpp:657
void MoveRandom(float wanderDistance=0.0f)
Definition: MotionMaster.cpp:238
Definition: QuestDef.h:207
Player session in the World.
Definition: WorldSession.h:330
Definition: SpellAuras.h:87
Definition: SpellDefines.h:162
void AddSpellMod(SpellValueMod mod, int32 value)
Definition: SpellDefines.h:164
float GetMinRange(bool positive=false) const
Definition: SpellInfo.cpp:2297
SpellSchoolMask GetSchoolMask() const
Definition: SpellInfo.cpp:1972
float GetMaxRange(bool positive=false, Unit *caster=nullptr, Spell *spell=nullptr) const
Definition: SpellInfo.cpp:2306
Definition: ChatTextBuilder.h:31