120{
121
123 {
126 return;
127 }
129
130 if (unit)
132
134 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: Invoker: {} ({})", tempInvoker->GetName(), tempInvoker->GetGUID().ToString());
135
137
140
142 {
144 {
146 Unit* talkTarget =
nullptr;
147
149 {
150 if (
IsCreature((target)) && !target->ToCreature()->IsPet())
151 {
153 {
156 }
157 else
159 break;
160 }
162 {
165 break;
166 }
167 }
168
169 if (!talkTarget)
171
172 if (!talker)
173 break;
174
176 {
178 break;
179 }
180
187 break;
188 }
190 {
192 {
196 {
199 }
200
201 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_SIMPLE_TALK: talker: {} ({}), textGroupId: {}",
203 }
204 break;
205 }
207 {
209 {
211 {
212 target->ToUnit()->HandleEmoteCommand(e.
action.
emote.emote);
213 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_PLAY_EMOTE: target: {} ({}), emote: {}",
214 target->GetName(), target->GetGUID().ToString(), e.
action.
emote.emote);
215 }
216 }
217 break;
218 }
220 {
222 {
224 {
227 else
229 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_SOUND: target: {} ({}), sound: {}, onlyself: {}",
231 }
232 }
233 break;
234 }
236 {
244 for (unsigned int sound : sounds)
245 {
246 if (sound)
247 {
248 temp[count] = sound;
249 ++count;
250 }
251 }
252
253 if (count == 0)
254 {
255 break;
256 }
257
259 {
261 {
264 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_RANDOM_SOUND: target: {} ({}), sound: {}, onlyself: {}",
266 }
267 }
268
269 break;
270 }
272 {
274
276 {
278 {
280
282 {
284 if (
Player* player = i->GetSource())
285 {
287 {
289 {
291 targets.push_back(player);
292 }
293 else
294 targets.push_back(player);
295 }
296 }
297 }
298 }
299 }
300 else
302
303 if (!targets.empty())
304 {
306 {
308 {
310 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_MUSIC: target: {} ({}), sound: {}, onlySelf: {}, type: {}",
312 }
313 }
314 }
315 break;
316 }
318 {
320
322 {
324 {
326
328 {
330 if (
Player* player = i->GetSource())
331 {
333 {
335 {
337 targets.push_back(player);
338 }
339 else
340 targets.push_back(player);
341 }
342 }
343 }
344 }
345 }
346 else
348
349 if (targets.empty())
350 break;
351
359 for (unsigned int sound : sounds)
360 {
361 if (sound)
362 {
363 temp[count] = sound;
364 ++count;
365 }
366 }
367
368 if (count == 0)
369 {
370 break;
371 }
372
374 {
376 {
379 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_RANDOM_MUSIC: target: {} ({}), sound: {}, onlyself: {}, type: {}",
381 }
382 }
383
384 break;
385 }
387 {
389 {
391 {
393 {
395 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry {}, GuidLow {} set faction to {}",
397 }
398 else
399 {
401 {
402 if (target->ToCreature()->GetFaction() != ci->faction)
403 {
404 target->ToCreature()->SetFaction(ci->faction);
405 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry {}, GuidLow {} set faction to {}",
406 target->GetEntry(), target->GetGUID().ToString(), ci->faction);
407 }
408 }
409 }
410 }
411 }
412 break;
413 }
415 {
417 {
419 continue;
420
422 {
423
425 {
427 {
429 target->ToCreature()->SetDisplayId(displayId);
430 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry {}, GuidLow {} set displayid to {}",
431 target->GetEntry(), target->GetGUID().ToString(), displayId);
432 }
433 }
434
435 else
436 {
438 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry {}, GuidLow {} set displayid to {}",
440 }
441 }
442 else
443 {
444 target->ToCreature()->DeMorph();
445 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry {}, GuidLow {} demorphs.",
446 target->GetEntry(), target->GetGUID().ToString());
447 }
448 }
449 break;
450 }
452 {
454 {
456 {
457 target->ToPlayer()->FailQuest(e.
action.
quest.quest);
458 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_FAIL_QUEST: Player guidLow {} fails quest {}",
459 target->GetGUID().ToString(), e.
action.
quest.quest);
460 }
461 }
462 break;
463 }
465 {
467 {
469 {
471 {
473 {
474 if (player->CanTakeQuest(q, true))
475 {
477 {
479 menu.SendQuestGiverQuestDetails(q,
me->
GetGUID(),
true);
480 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_OFFER_QUEST: Player guidLow {} - offering quest {}",
482 }
483 }
484 }
485 else
486 {
487 player->AddQuestAndCheckCompletion(q, nullptr);
488 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_OFFER_QUEST: Player guidLow {} - quest {} added",
490 }
491 }
492 }
493 }
494 break;
495 }
497 {
499 {
501 continue;
502
504 }
505 break;
506 }
508 {
509 std::vector<uint32> emotes;
511 std::back_inserter(emotes), [](
uint32 emote) { return emote != 0; });
512
514 {
516 {
518 target->ToUnit()->HandleEmoteCommand(emote);
519 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_RANDOM_EMOTE: Creature guidLow {} handle random emote {}",
520 target->GetGUID().ToString(), emote);
521 }
522 }
523 break;
524 }
526 {
528 break;
529
531 for (ThreatContainer::StorageType::const_iterator i = threatList.begin(); i != threatList.end(); ++i)
532 {
534 {
536 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_THREAT_ALL_PCT: Creature {} modify threat for unit {}, value {}",
538 }
539 }
540 break;
541 }
543 {
545 break;
546
548 {
550 {
552 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_THREAT_SINGLE_PCT: Creature guidLow {} modify threat for unit {}, value {}",
554 }
555 }
556 break;
557 }
559 {
561 {
562
564 if (
Vehicle* vehicle = target->ToUnit()->GetVehicleKit())
565 for (auto & Seat : vehicle->Seats)
567 player->AreaExploredOrEventHappens(e.
action.
quest.quest);
568
570 {
571 target->ToPlayer()->AreaExploredOrEventHappens(e.
action.
quest.quest);
572
573 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS: Player guidLow {} credited quest {}",
574 target->GetGUID().ToString(), e.
action.
quest.quest);
575 }
576 }
577 break;
578 }
580 {
581 if (targets.empty())
582 break;
583
585
588
591
593 {
594
597
599 continue;
600
601 if (caster && caster !=
me)
602 {
604 }
606 {
607
609 continue;
610
611
614 break;
615
616
618 continue;
619
620
623
624
626 {
627
630
632 {
635 }
637 {
640 }
641 }
642
645 {
648 else
650 }
651
653 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_CAST: Unit {} casts spell {} on target {} with castflags {}",
655 }
656 }
657 break;
658 }
660 {
661 if (targets.empty())
662 break;
663
666
669 {
671 {
673 }
674 else
675 {
677 }
678 }
679
681 {
683 if (!uTarget)
684 continue;
685
687 {
689 {
691 }
692
694 }
695 }
696 break;
697 }
699 {
700
702 if (!tempLastInvoker)
703 break;
704
705 if (targets.empty())
706 break;
707
710
712 {
714 continue;
715
717 {
719 {
721 }
722
725 {
727 {
729 }
730 else
731 {
733 }
734 }
735
737 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_INVOKER_CAST: Invoker {} casts spell {} on target {} with castflags {}",
739 }
740 else
741 {
742 LOG_DEBUG(
"scripts.ai",
"Spell {} not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target {} already has the aura",
744 }
745 }
746 break;
747 }
749 {
751 {
753 {
755 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_ADD_AURA: Adding aura {} to unit {}",
757 }
758 }
759 break;
760 }
762 {
764 {
766 {
768
769
771 {
773 }
774
776 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_ACTIVATE_GOBJECT. Gameobject {} activated",
go->
GetGUID().
ToString());
777 }
778 }
779
780 break;
781 }
783 {
785 {
787 {
788 target->ToGameObject()->ResetDoorOrButton();
789 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_RESET_GOBJECT. Gameobject {} (entry: {}) reset",
790 target->GetGUID().ToString(), target->GetEntry());
791 }
792 }
793 break;
794 }
796 {
798 {
800 {
802 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_EMOTE_STATE. Unit {} set emotestate to {}",
803 target->GetGUID().ToString(), e.
action.
emote.emote);
804 }
805 }
806 break;
807 }
809 {
811 {
813 {
815 {
817 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit {} added flag {} to UNIT_FIELD_FLAGS",
819 }
820 else
821 {
823 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit {} added flag {} to UNIT_FIELD_FLAGS_2",
825 }
826 }
827 }
828 break;
829 }
831 {
833 {
835 {
837 {
839 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit {} removed flag {} to UNIT_FIELD_FLAGS",
841 }
842 else
843 {
845 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit {} removed flag {} to UNIT_FIELD_FLAGS_2",
847 }
848 }
849 }
850 break;
851 }
853 {
855 break;
856
858 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_AUTO_ATTACK: Creature: {} bool on = {}",
860 break;
861 }
863 {
865 break;
866
867
870 {
873 }
874 else
876 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_ALLOW_COMBAT_MOVEMENT: Creature {} bool on = {}",
878 break;
879 }
881 {
883 break;
884
886 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_SET_EVENT_PHASE: Creature {} set event phase {}",
888 break;
889 }
891 {
893 break;
894
897 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_INC_EVENT_PHASE: Creature {} inc event phase by {}, "
899 break;
900 }
902 {
904 break;
905
908 if (target->ToCreature()->IsAIEnabled)
909 target->ToCreature()->AI()->EnterEvadeMode();
910
911 break;
912 }
914 {
915
917 break;
918
921 {
924 }
925 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_FLEE_FOR_ASSIST: Creature {} DoFleeToGetAssistance",
me->
GetGUID().
ToString());
926 break;
927 }
929 {
931 break;
932
934 break;
935 }
937 {
939 {
941 continue;
942
944
947 {
949 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_CALL_GROUPEVENTHAPPENS: Player {}, group credit for quest {}",
951 }
952
953
955 {
956 for (auto& Seat : vehicle->Seats)
957 {
959 {
961 }
962 }
963 }
964 }
965 break;
966 }
968 {
970 {
972 continue;
973
975 {
977 {
980 }
981 else
983 }
984 else
985 target->ToUnit()->RemoveAllAuras();
986
987 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_REMOVEAURASFROMSPELL: Unit {}, spell {}",
989 }
990 break;
991 }
993 {
995 break;
996
998 {
1000 break;
1001 }
1002
1004 {
1006 {
1009 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_FOLLOW: Creature {} following target {}",
1011 break;
1012 }
1013 }
1014 break;
1015 }
1017 {
1019 break;
1020
1021 std::vector<uint32> phases;
1023 std::back_inserter(phases), [](
uint32 phase) { return phase != 0; });
1024
1027 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE: Creature {} sets event phase to {}",
1029 break;
1030 }
1032 {
1034 break;
1035
1038 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE_RANGE: Creature {} sets event phase to {}",
1040 break;
1041 }
1043 {
1045 {
1047 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: (trigger == true) Player {}, Killcredit: {}",
1049 }
1051 {
1053 break;
1054
1056 {
1058 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player {}, Killcredit: {}",
1060 }
1061 }
1062 else
1063 {
1065 {
1067 continue;
1068
1070 if (!player)
1071 continue;
1072
1074 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player {}, Killcredit: {}",
1076 }
1077 }
1078 break;
1079 }
1081 {
1083 if (!obj)
1084 obj = unit;
1085
1086 if (!obj)
1087 break;
1088
1090 if (!instance)
1091 {
1092 LOG_ERROR(
"scripts.ai.sai",
"SmartScript: Event {} attempt to set instance data without instance script. EntryOrGuid {}", e.
GetEventType(), e.
entryOrGuid);
1093 break;
1094 }
1095
1097 {
1098 case 0:
1099 {
1102 } break;
1103 case 1:
1104 {
1107 } break;
1108 default:
1109 {
1110 break;
1111 }
1112 }
1113 break;
1114 }
1116 {
1118 if (!obj)
1119 obj = unit;
1120
1121 if (!obj)
1122 break;
1123
1125 if (!instance)
1126 {
1128 break;
1129 }
1130
1131 if (targets.empty())
1132 break;
1133
1135 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: {}, data: {}",
1137 break;
1138 }
1140 {
1144 break;
1145 }
1147 {
1149 {
1151 {
1153 {
1154
1156 {
1157 me->KillSelf();
1158 LOG_DEBUG("sql.sql", "SmartScript::ProcessAction: SMART_ACTION_DIE: Creature {}", me->GetGUID().ToString());
1159 }
1161 }
1162 }
1164 {
1167 }
1168 break;
1169 }
1171 {
1172 if (targets.empty())
1173 break;
1174
1176 {
1179
1183 {
1187 }
1188 }
1189 else
1190 {
1192 {
1194 {
1195 target->ToCreature()->SetInCombatWithZone();
1196 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_SET_IN_COMBAT_WITH_ZONE: Creature {}, target: {}",
1198 }
1199 }
1200 }
1201
1202 break;
1203 }
1205 {
1207 {
1209 {
1212 {
1215 }
1216 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_CALL_FOR_HELP: Creature {}, target: {}",
1218 }
1219 }
1220 break;
1221 }
1223 {
1225 {
1227 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_SET_SHEATH: Creature {}, State: {}",
1229 }
1230 break;
1231 }
1233 {
1235 {
1237
1238
1239 if (despawnDelay <= 0ms)
1240 {
1241 despawnDelay = 1ms;
1242 }
1243
1246 {
1247 creature->DespawnOrUnsummon(despawnDelay, forceRespawnTimer);
1248 }
1250 {
1252 }
1253 }
1254
1255 break;
1256 }
1258 {
1260 {
1265 }
1266 break;
1267 }
1269 {
1271 {
1273 continue;
1274
1276 {
1278 {
1281 }
1282 else
1284 }
1285 else
1286 target->ToUnit()->Dismount();
1287 }
1288 break;
1289 }
1291 {
1293 {
1295 {
1297 if (!ai)
1298 continue;
1299
1302 else
1304 }
1305 }
1306 break;
1307 }
1309 {
1311 {
1316 }
1317 break;
1318 }
1320 {
1322 break;
1323
1324 float x, y, z;
1327 break;
1328 }
1330 {
1332 break;
1333
1335 break;
1336 }
1338 {
1342
1343 break;
1344 }
1346 {
1349 break;
1350 }
1352 {
1354 break;
1355
1356 if (targets.empty())
1357 break;
1358
1359
1362 break;
1363 }
1365 {
1369 break;
1370 }
1372 {
1374 bool preferUnit = flags.HasFlag(SmartActionSummonCreatureFlags::PreferUnit);
1376 if (!summoner)
1377 break;
1378
1379 bool personalSpawn = flags.HasFlag(SmartActionSummonCreatureFlags::PersonalSpawn);
1380
1382 {
1387 {
1390 else
1393 {
1395 summon->AI()->AttackStart(unit);
1397 summon->AI()->AttackStart(
me);
1398 }
1399 }
1400 break;
1401 }
1402
1403 float x, y, z, o;
1405 {
1406 target->GetPosition(x, y, z, o);
1412 {
1414 summon->AI()->AttackStart(unit);
1416 summon->AI()->AttackStart(target->ToUnit());
1418 summon->AI()->AttackStart(
me);
1419 }
1420 }
1421
1423 break;
1424
1426 {
1428 summon->AI()->AttackStart(unit);
1430 summon->AI()->AttackStart(
me);
1431 }
1432 break;
1433 }
1435 {
1437 break;
1438
1439 if (!targets.empty())
1440 {
1441 float x, y, z, o;
1443 {
1444
1445
1446
1447
1448 target->GetPosition(x, y, z, o);
1455 else
1457 }
1458 }
1459
1461 break;
1462
1464 break;
1465 }
1467 {
1469 {
1471 continue;
1472
1473 Unit::Kill(target->ToUnit(), target->ToUnit());
1474 }
1475
1476 break;
1477 }
1479 {
1481 break;
1482 }
1484 {
1486 {
1488 continue;
1489
1491 }
1492 break;
1493 }
1495 {
1497 {
1499 continue;
1500
1502 }
1503 break;
1504 }
1506 {
1508 break;
1509 }
1511 {
1513 {
1518 }
1519 break;
1520 }
1522 {
1524 break;
1525
1527
1530
1531
1533 break;
1534 }
1536 {
1538 {
1540 {
1541 if (
IsSmart(target->ToCreature()))
1543 else
1545 }
1546 }
1547
1548 break;
1549 }
1551 {
1553 break;
1554
1556 break;
1557 }
1559 {
1560 if (!targets.empty())
1561 {
1563 {
1565 {
1568 else
1569 LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SET_COUNTER is not using SmartAI, skipping");
1570 }
1572 {
1575 else
1576 LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SET_COUNTER is not using SmartGameObjectAI, skipping");
1577 }
1578 }
1579 }
1580 else
1582 break;
1583 }
1585 {
1587 break;
1588
1592
1594 {
1596 {
1598 break;
1599 }
1600 }
1601
1604
1609 break;
1610 }
1612 {
1614 break;
1615
1618 break;
1619 }
1621 {
1623 break;
1624
1629 break;
1630 }
1632 {
1634 break;
1635
1637 break;
1638 }
1640 {
1642 break;
1643
1645 {
1646 float randomOri =
frand(0.0f, 2 * M_PI);
1650 break;
1651 }
1652
1654 {
1659 break;
1660 }
1661
1663 {
1667 }
1669 {
1673 }
1674 else if (!targets.empty())
1675 {
1679 }
1680
1681 break;
1682 }
1684 {
1686 {
1688 continue;
1689
1691 }
1692 break;
1693 }
1695 {
1697 break;
1698
1700
1702 {
1704 {
1713 true,
1714 true,
1716 );
1717 }
1718
1719 break;
1720 }
1721
1722
1723
1724
1725
1726
1727
1728
1729 {
1730
1731 if (!targets.empty())
1733 }
1734
1735 if (!target)
1736 {
1740 trans->CalculatePassengerPosition(dest.x, dest.y, dest.z);
1741
1744 }
1745 else
1746 {
1747 float x, y, z;
1750 {
1752 }
1754 }
1755 break;
1756 }
1758 {
1760 {
1762 {
1765 }
1766 }
1767
1768 break;
1769 }
1771 {
1773 {
1777 {
1778
1781 else
1783 }
1784 }
1785 break;
1786 }
1788 {
1792 break;
1793 }
1795 {
1797 {
1799 {
1800 std::array<uint32, MAX_EQUIPMENT_ITEMS> slot;
1802 {
1804 if (!eInfo)
1805 {
1806 LOG_ERROR(
"sql.sql",
"SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info id {} for creature {}", equipId,
npc->GetEntry());
1807 break;
1808 }
1809
1810 npc->SetCurrentEquipmentId(equipId);
1811
1812 std::copy(std::begin(eInfo->
ItemEntry), std::end(eInfo->
ItemEntry), std::begin(slot));
1813 }
1814 else
1816
1820 }
1821 }
1822 break;
1823 }
1825 {
1830
1835
1839
1843
1851 break;
1852 }
1855
1856
1859 break;
1862 break;
1864 {
1866 {
1868 {
1875 break;
1876 }
1878 {
1885 break;
1886 }
1887 }
1888
1889 break;
1890 }
1893 break;
1896 break;
1898 {
1900 break;
1901
1904
1907 if (
IsSmart(creature) && creature->GetVictim())
1909 creature->GetMotionMaster()->MoveChase(creature->GetVictim(), attackDistance, attackAngle);
1910
1911 break;
1912 }
1914 {
1916 {
1918 break;
1919 }
1920
1922 {
1924 {
1927 }
1929 {
1932 }
1933 }
1934 break;
1935 }
1937 {
1941 break;
1942 }
1944 {
1948 break;
1949 }
1951 {
1955 break;
1956 }
1958 {
1959 if (targets.empty())
1960 break;
1961
1963 GetTargets(casters,
CreateSmartEvent(
SMART_EVENT_UPDATE_IC, 0, 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);
1964
1966 {
1968 continue;
1969
1971
1972 bool interruptedSpell = false;
1973
1975 {
1977 continue;
1978
1980 {
1982 {
1984 interruptedSpell = true;
1985 }
1986
1988 }
1989 else
1991 }
1992 }
1993 break;
1994 }
1996 {
1997 std::vector<uint32> actionLists;
1999 std::back_inserter(actionLists), [](
uint32 actionList) { return actionList != 0; });
2000
2003 {
2005 break;
2006 }
2007
2009 {
2011 {
2014 }
2016 {
2019 }
2020 }
2021 break;
2022 }
2024 {
2027 {
2029 break;
2030 }
2031
2033 {
2035 {
2038 }
2040 {
2043 }
2044 }
2045 break;
2046 }
2048 {
2052 break;
2053 }
2055 {
2056 bool foundTarget = false;
2057
2059 {
2061 {
2062 foundTarget = true;
2063
2066 else
2068 }
2069 }
2070
2072 {
2075 else
2077 }
2078 break;
2079 }
2081 {
2085 break;
2086 }
2088 {
2092 break;
2093 }
2095 {
2099 break;
2100 }
2102 {
2106 break;
2107 }
2109 {
2113 break;
2114 }
2116 {
2120 break;
2121 }
2123 {
2127 break;
2128 }
2130 {
2132 {
2134 {
2139 }
2140
2141 break;
2142 }
2143
2144 if (targets.empty())
2145 break;
2146
2147
2149 {
2153 }
2154 else
2155 {
2158 {
2161 }
2162 }
2163
2164 break;
2165 }
2167 {
2171 break;
2172 }
2174 {
2178 break;
2179 }
2181 {
2183
2184 if (!ref)
2185 ref = unit;
2186
2187 if (!ref)
2188 break;
2189
2191 if (!storedTargets)
2192 break;
2193
2195 {
2197 {
2200 else
2201 LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartAI, skipping");
2202 }
2204 {
2207 else
2208 LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartGameObjectAI, skipping");
2209 }
2210 }
2211 break;
2212 }
2214 {
2216 break;
2217
2218 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_SEND_GOSSIP_MENU: gossipMenuId {}, gossipNpcTextId {}",
2220
2223 {
2226 else
2228
2230 }
2231
2232 break;
2233 }
2235 {
2236 if (!targets.empty())
2237 {
2238 float x, y, z, o;
2241 {
2243 {
2246 }
2247 else
2249 }
2250 }
2252 {
2254 {
2255 float x, y, z, o;
2258 }
2259 else
2261 }
2262 break;
2263 }
2265 {
2269
2270 break;
2271 }
2273 {
2277 break;
2278 }
2280 {
2284 break;
2285 }
2287 {
2291 break;
2292 }
2294 {
2298 break;
2299 }
2301 {
2302 std::list<TempSummon*> summonList;
2304
2305 for (std::list<TempSummon*>::const_iterator itr = summonList.begin(); itr != summonList.end(); ++itr)
2306 {
2308 (*itr)->AI()->AttackStart(unit);
2310 (*itr)->AI()->AttackStart(
me);
2311 }
2312
2313 break;
2314 }
2316 {
2320 break;
2321 }
2323 {
2327 break;
2328 }
2330 {
2334 break;
2335 }
2337 {
2340 {
2341 LOG_ERROR(
"scripts.ai.sai",
"SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_STOP, inactive event (id: {})", eventId);
2342 break;
2343 }
2345 break;
2346 }
2348 {
2351 {
2352 LOG_ERROR(
"scripts.ai.sai",
"SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_START, already activated event (id: {})", eventId);
2353 break;
2354 }
2356 break;
2357 }
2359 {
2360 std::vector<uint32> waypoints;
2362 std::back_inserter(waypoints), [](
uint32 wp) { return wp != 0; });
2363
2364 float distanceToClosest = std::numeric_limits<float>::max();
2366
2368 {
2370 {
2372 {
2373 for (
uint32 wp : waypoints)
2374 {
2376 if (!path || path->empty())
2377 continue;
2378
2379 auto itrWp = path->find(0);
2380 if (itrWp != path->end())
2381 {
2383 {
2384 float distToThisPath = creature->GetDistance(wp->x, wp->y, wp->z);
2385 if (distToThisPath < distanceToClosest)
2386 {
2387 distanceToClosest = distToThisPath;
2388 closestWp = wp;
2389 }
2390 }
2391 }
2392 }
2393
2394 if (closestWp)
2396 }
2397 }
2398 }
2399 break;
2400 }
2402 {
2406
2407 break;
2408 }
2410 {
2413 {
2416 }
2417
2418 break;
2419 }
2421 {
2425
2426 break;
2427 }
2429 {
2432 else
2434
2437 break;
2438 }
2440 {
2444 break;
2445 }
2447 {
2451 break;
2452 }
2454 {
2458 break;
2459 }
2461 {
2465 break;
2466 }
2468 {
2471 break;
2472 }
2474 {
2478 break;
2479 }
2481 {
2485
2486 break;
2487 }
2489 {
2493 break;
2494 }
2496 {
2500
2501 break;
2502 }
2504 {
2506 break;
2507 }
2509 {
2513 break;
2514 }
2516 {
2518 {
2520 {
2525 }
2526 }
2527 break;
2528 }
2530 {
2534
2535 break;
2536 }
2538 {
2542 {
2544 break;
2545 }
2546
2547 break;
2548 }
2550 {
2553 break;
2554 }
2556 {
2558
2559 if (!targets.empty())
2563
2564 break;
2565 }
2567 {
2569 break;
2570
2572 {
2574 {
2576 {
2578 }
2579
2581 {
2582
2583
2584
2585 bool _allowMove = false;
2588
2593 _allowMove = true;
2594
2596 }
2597
2599 {
2608 }
2609 }
2610 }
2611 break;
2612 }
2614 {
2616 break;
2617
2618 if (targets.empty())
2619 break;
2620
2622
2627
2628
2629
2630
2631
2632 float factor = std::exp(k * delta_phi);
2633
2634
2635 float summonRadius = a;
2636
2638 {
2639
2640
2642
2643 do
2644 {
2646 summonPosition.RelocatePolarOffset(phi, summonRadius);
2647
2649
2650 phi += delta_phi;
2651 summonRadius *= factor;
2652 } while (summonRadius <= r_max);
2653 }
2654
2655 break;
2656 }
2658 {
2660 break;
2661
2663
2666
2668 {
2669 float deltaAngle = 0.0f;
2670 if (radius > 0)
2671 deltaAngle = distInARow / radius;
2672
2674 if (deltaAngle > 0)
2675 count += coneAngle / deltaAngle;
2676
2677 float currentAngle = -static_cast<float>(count) * deltaAngle / 2.0f;
2678
2681 else if (!targets.empty())
2682 {
2684 }
2685
2686 for (
uint32 index = 0; index < count; ++index)
2687 {
2689 spawnPosition.RelocatePolarOffset(currentAngle, radius);
2690 currentAngle += deltaAngle;
2691
2693 }
2694 }
2695
2696 break;
2697 }
2699 {
2701 {
2703 {
2704 playerTarget->RemoveArenaSpellCooldowns();
2705 playerTarget->RemoveAurasDueToSpell(57724);
2706 playerTarget->RemoveAurasDueToSpell(57723);
2707 playerTarget->RemoveAurasDueToSpell(2825);
2708 playerTarget->RemoveAurasDueToSpell(32182);
2709 }
2710 }
2711
2712 break;
2713 }
2715 {
2718 {
2719 if (targets.empty())
2720 break;
2721
2723 {
2725 {
2727 {
2728 unitTarget->AI()->DoAction(actionId);
2729 }
2730 }
2732 {
2733 gobjTarget->AI()->DoAction(actionId);
2734 }
2735 }
2736
2737 }
2738 else
2739 {
2742 {
2743 instanceScript = baseObj->GetInstanceScript();
2744 }
2745
2747 {
2749 }
2750
2751 if (instanceScript)
2752 {
2753 instanceScript->
DoAction(actionId);
2754 }
2755 }
2756 break;
2757 }
2759 {
2761 break;
2762
2764 break;
2765 }
2767 {
2769 {
2772 }
2773 break;
2774 }
2776 {
2780 break;
2781 }
2783 {
2786 float speed = float(speedInteger) + float(speedFraction) / std::pow(10, std::floor(std::log10(float(speedFraction ? speedFraction : 1)) + 1));
2787
2791
2792 break;
2793 }
2795 {
2797 {
2799 continue;
2800
2802 }
2803 break;
2804 }
2806 {
2808 {
2810
2812 {
2814 {
2815 guidToSend = invoker->GetGUID();
2816 }
2817 }
2818
2820 {
2822 }
2824 {
2826 }
2827 }
2828 break;
2829 }
2831 {
2833 {
2835 {
2838 }
2839 }
2840 break;
2841 }
2843 {
2845
2847 {
2849 {
2851 }
2852 }
2853 break;
2854 }
2856 {
2858 break;
2859
2861
2864
2866 {
2868 {
2872 }
2873 break;
2874 }
2875
2877 {
2878 float currentAngle = startAngle + (itr * stepAngle);
2880 }
2881
2882 break;
2883 }
2885 {
2887 {
2889 {
2892 }
2893 }
2894 break;
2895 }
2897 {
2899 {
2903
2904 break;
2905 }
2906
2907 uint8 membCount = targets.size();
2911 {
2913 {
2914 float angle = (membCount > 4 ? (M_PI * 2)/membCount : (M_PI / 2));
2916 {
2918 {
2920 itr++;
2921 }
2922 }
2923 break;
2924 }
2926 {
2928 {
2930 {
2932 itr++;
2933 }
2934 }
2935 break;
2936 }
2938 {
2940 {
2942 {
2944 itr++;
2945 }
2946 }
2947 break;
2948 }
2950 {
2952 {
2954 {
2956 itr++;
2957 }
2958 }
2959 break;
2960 }
2962 {
2964 {
2966 {
2968 itr++;
2969 }
2970 }
2971 break;
2972 }
2974 {
2976 {
2978 {
2980 itr++;
2981 }
2982 }
2983 break;
2984 }
2985 default:
2986 break;
2987 }
2988
2989 break;
2990 }
2992 {
2994 {
2995 case 0:
2996 {
2999
3000 break;
3001 }
3002 case 1:
3003 {
3006
3007 break;
3008 }
3009 case 2:
3010 {
3013
3014 break;
3015 }
3016 case 3:
3017 {
3019 GetTargets(facingTargets,
CreateSmartEvent(
SMART_EVENT_UPDATE_IC, 0, 0, 0, 0, 0, 0, 0,
SMART_ACTION_NONE, 0, 0, 0, 0, 0, 0, (
SMARTAI_TARGETS)e.
action.
orientationTarget.
targetType, e.
action.
orientationTarget.
targetParam1, e.
action.
orientationTarget.
targetParam2, e.
action.
orientationTarget.
targetParam3, e.
action.
orientationTarget.
targetParam4, 0), unit);
3020
3024
3025 break;
3026 }
3027 default:
3028 break;
3029 }
3030 break;
3031 }
3032 default:
3034 break;
3035 }
3036
3038 {
3041 ProcessEvent(linked, unit, var0, var1, bvar, spell, gob);
3042 else
3044 }
3045}
#define DEFAULT_LOCALE
Definition: Common.h:81
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:1462
@ SMART_TARGET_RANDOM_POINT
Definition: SmartScriptMgr.h:1501
#define sSmartWaypointMgr
Definition: SmartScriptMgr.h:2149
SMART_ACTION
Definition: SmartScriptMgr.h:537
@ SMART_ACTION_REMOVE_TIMED_EVENT
Definition: SmartScriptMgr.h:612
@ SMART_ACTION_NONE
Definition: SmartScriptMgr.h:538
@ SMART_ACTION_SET_GO_FLAG
Definition: SmartScriptMgr.h:642
@ SMART_ACTION_WP_RESUME
Definition: SmartScriptMgr.h:603
@ SMART_ACTION_UPDATE_TEMPLATE
Definition: SmartScriptMgr.h:574
@ SMART_ACTION_SET_HEALTH_REGEN
Definition: SmartScriptMgr.h:640
@ SMART_ACTION_ACTIVATE_GOBJECT
Definition: SmartScriptMgr.h:547
@ SMART_ACTION_GAME_EVENT_START
Definition: SmartScriptMgr.h:650
@ SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST
Definition: SmartScriptMgr.h:626
@ SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1
Definition: SmartScriptMgr.h:629
@ SMART_ACTION_SET_INST_DATA64
Definition: SmartScriptMgr.h:573
@ SMART_ACTION_SET_FACTION
Definition: SmartScriptMgr.h:540
@ SMART_ACTION_THREAT_SINGLE_PCT
Definition: SmartScriptMgr.h:551
@ SMART_ACTION_OFFER_QUEST
Definition: SmartScriptMgr.h:545
@ SMART_ACTION_REMOVE_ALL_GAMEOBJECTS
Definition: SmartScriptMgr.h:664
@ SMART_ACTION_RISE_UP
Definition: SmartScriptMgr.h:652
@ SMART_ACTION_SET_INGAME_PHASE_MASK
Definition: SmartScriptMgr.h:582
@ SMART_ACTION_SET_UNIT_FIELD_BYTES_1
Definition: SmartScriptMgr.h:628
@ SMART_ACTION_CLOSE_GOSSIP
Definition: SmartScriptMgr.h:610
@ SMART_ACTION_DISABLE_EVADE
Definition: SmartScriptMgr.h:655
@ SMART_ACTION_CONE_SUMMON
Definition: SmartScriptMgr.h:702
@ SMART_ACTION_ADD_GO_FLAG
Definition: SmartScriptMgr.h:643
@ SMART_ACTION_ADD_DYNAMIC_FLAG
Definition: SmartScriptMgr.h:633
@ SMART_ACTION_KILL_UNIT
Definition: SmartScriptMgr.h:589
@ SMART_ACTION_LOAD_EQUIPMENT
Definition: SmartScriptMgr.h:662
@ SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS
Definition: SmartScriptMgr.h:553
@ SMART_ACTION_ATTACK_START
Definition: SmartScriptMgr.h:587
@ SMART_ACTION_SET_UNIT_FLAG
Definition: SmartScriptMgr.h:556
@ SMART_ACTION_NO_ENVIRONMENT_UPDATE
Definition: SmartScriptMgr.h:695
@ SMART_ACTION_CALL_GROUPEVENTHAPPENS
Definition: SmartScriptMgr.h:564
@ SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL
Definition: SmartScriptMgr.h:581
@ SMART_ACTION_INVOKER_CAST
Definition: SmartScriptMgr.h:672
@ SMART_ACTION_SET_SCALE
Definition: SmartScriptMgr.h:710
@ SMART_ACTION_JUMP_TO_POS
Definition: SmartScriptMgr.h:635
@ SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST
Definition: SmartScriptMgr.h:625
@ SMART_ACTION_SEND_GOSSIP_MENU
Definition: SmartScriptMgr.h:636
@ SMART_ACTION_SET_COUNTER
Definition: SmartScriptMgr.h:601
@ SMART_ACTION_FLEE_FOR_ASSIST
Definition: SmartScriptMgr.h:563
@ SMART_ACTION_EQUIP
Definition: SmartScriptMgr.h:609
@ SMART_ACTION_SET_ROOT
Definition: SmartScriptMgr.h:641
@ SMART_ACTION_ATTACK_STOP
Definition: SmartScriptMgr.h:707
@ SMART_ACTION_SUMMON_GO
Definition: SmartScriptMgr.h:588
@ SMART_ACTION_SET_HOVER
Definition: SmartScriptMgr.h:689
@ SMART_ACTION_WP_PAUSE
Definition: SmartScriptMgr.h:592
@ SMART_ACTION_SIMPLE_TALK
Definition: SmartScriptMgr.h:622
@ SMART_ACTION_STOP_MOTION
Definition: SmartScriptMgr.h:694
@ SMART_ACTION_VORTEX_SUMMON
Definition: SmartScriptMgr.h:704
@ SMART_ACTION_MUSIC
Definition: SmartScriptMgr.h:698
@ SMART_ACTION_SET_ORIENTATION_TARGET
Definition: SmartScriptMgr.h:714
@ SMART_ACTION_SET_UNIT_MOVEMENT_FLAGS
Definition: SmartScriptMgr.h:686
@ SMART_ACTION_ADD_AURA
Definition: SmartScriptMgr.h:613
@ SMART_ACTION_THREAT_ALL_PCT
Definition: SmartScriptMgr.h:552
@ SMART_ACTION_RESPAWN_TARGET
Definition: SmartScriptMgr.h:608
@ SMART_ACTION_FOLLOW_GROUP
Definition: SmartScriptMgr.h:713
@ SMART_ACTION_SOUND
Definition: SmartScriptMgr.h:542
@ SMART_ACTION_MOVE_TO_POS_TARGET
Definition: SmartScriptMgr.h:683
@ SMART_ACTION_SET_MOVEMENT_SPEED
Definition: SmartScriptMgr.h:674
@ SMART_ACTION_PLAY_CINEMATIC
Definition: SmartScriptMgr.h:673
@ SMART_ACTION_ADD_NPC_FLAG
Definition: SmartScriptMgr.h:620
@ SMART_ACTION_EVADE
Definition: SmartScriptMgr.h:562
@ SMART_ACTION_FAIL_QUEST
Definition: SmartScriptMgr.h:544
@ SMART_ACTION_INTERRUPT_SPELL
Definition: SmartScriptMgr.h:630
@ SMART_ACTION_ADD_POWER
Definition: SmartScriptMgr.h:647
@ SMART_ACTION_REMOVE_DYNAMIC_FLAG
Definition: SmartScriptMgr.h:634
@ SMART_ACTION_RANDOM_SOUND
Definition: SmartScriptMgr.h:653
@ SMART_ACTION_RANDOM_MUSIC
Definition: SmartScriptMgr.h:699
@ SMART_ACTION_SET_COMBAT_DISTANCE
Definition: SmartScriptMgr.h:687
@ SMART_ACTION_SET_POWER
Definition: SmartScriptMgr.h:646
@ SMART_ACTION_SEND_TARGET_TO_TARGET
Definition: SmartScriptMgr.h:638
@ SMART_ACTION_REMOVE_POWER
Definition: SmartScriptMgr.h:648
@ SMART_ACTION_ADD_IMMUNITY
Definition: SmartScriptMgr.h:690
@ SMART_ACTION_SET_DYNAMIC_FLAG
Definition: SmartScriptMgr.h:632
@ SMART_ACTION_FALL
Definition: SmartScriptMgr.h:692
@ SMART_ACTION_GO_SET_GO_STATE
Definition: SmartScriptMgr.h:656
@ SMART_ACTION_CUSTOM_CAST
Definition: SmartScriptMgr.h:701
@ SMART_ACTION_REMOVE_ITEM
Definition: SmartScriptMgr.h:595
@ SMART_ACTION_SEND_GO_CUSTOM_ANIM
Definition: SmartScriptMgr.h:631
@ SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL
Definition: SmartScriptMgr.h:541
@ SMART_ACTION_REMOVE_UNIT_FLAG
Definition: SmartScriptMgr.h:557
@ SMART_ACTION_RANDOM_PHASE
Definition: SmartScriptMgr.h:568
@ SMART_ACTION_SET_EMOTE_STATE
Definition: SmartScriptMgr.h:555
@ SMART_ACTION_CROSS_CAST
Definition: SmartScriptMgr.h:624
@ SMART_ACTION_WP_STOP
Definition: SmartScriptMgr.h:593
@ SMART_ACTION_GAME_EVENT_STOP
Definition: SmartScriptMgr.h:649
@ SMART_ACTION_CALL_SCRIPT_RESET
Definition: SmartScriptMgr.h:616
@ SMART_ACTION_CU_ENCOUNTER_START
Definition: SmartScriptMgr.h:705
@ SMART_ACTION_WP_START
Definition: SmartScriptMgr.h:591
@ SMART_ACTION_COMBAT_STOP
Definition: SmartScriptMgr.h:565
@ SMART_ACTION_EXIT_VEHICLE
Definition: SmartScriptMgr.h:685
@ SMART_ACTION_SET_HEALTH_PCT
Definition: SmartScriptMgr.h:676
@ SMART_ACTION_AUTO_ATTACK
Definition: SmartScriptMgr.h:558
@ SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL
Definition: SmartScriptMgr.h:580
@ SMART_ACTION_SET_VISIBILITY
Definition: SmartScriptMgr.h:585
@ SMART_ACTION_RANDOM_PHASE_RANGE
Definition: SmartScriptMgr.h:569
@ SMART_ACTION_GO_SET_LOOT_STATE
Definition: SmartScriptMgr.h:637
@ SMART_ACTION_PLAYER_TALK
Definition: SmartScriptMgr.h:703
@ SMART_ACTION_SELF_CAST
Definition: SmartScriptMgr.h:623
@ SMART_ACTION_SET_SWIM
Definition: SmartScriptMgr.h:599
@ SMART_ACTION_SET_SIGHT_DIST
Definition: SmartScriptMgr.h:659
@ SMART_ACTION_SET_INST_DATA
Definition: SmartScriptMgr.h:572
@ SMART_ACTION_REMOVE_GO_FLAG
Definition: SmartScriptMgr.h:644
@ SMART_ACTION_LOAD_GRID
Definition: SmartScriptMgr.h:697
@ SMART_ACTION_CALL_FOR_HELP
Definition: SmartScriptMgr.h:577
@ SMART_ACTION_SUMMON_RADIAL
Definition: SmartScriptMgr.h:711
@ SMART_ACTION_ADD_THREAT
Definition: SmartScriptMgr.h:661
@ SMART_ACTION_TELEPORT
Definition: SmartScriptMgr.h:600
@ SMART_ACTION_PLAYMOVIE
Definition: SmartScriptMgr.h:606
@ SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT
Definition: SmartScriptMgr.h:663
@ SMART_ACTION_FOLLOW
Definition: SmartScriptMgr.h:567
@ SMART_ACTION_PLAY_EMOTE
Definition: SmartScriptMgr.h:543
@ SMART_ACTION_SET_CORPSE_DELAY
Definition: SmartScriptMgr.h:654
@ SMART_ACTION_SET_GUID
Definition: SmartScriptMgr.h:708
@ SMART_ACTION_SET_SHEATH
Definition: SmartScriptMgr.h:578
@ SMART_ACTION_SET_ORIENTATION
Definition: SmartScriptMgr.h:604
@ SMART_ACTION_SET_NPC_FLAG
Definition: SmartScriptMgr.h:619
@ SMART_ACTION_MOVE_TO_POS
Definition: SmartScriptMgr.h:607
@ SMART_ACTION_RANDOM_EMOTE
Definition: SmartScriptMgr.h:548
@ SMART_ACTION_INC_EVENT_PHASE
Definition: SmartScriptMgr.h:561
@ SMART_ACTION_CREATE_TIMED_EVENT
Definition: SmartScriptMgr.h:605
@ SMART_ACTION_SET_EVENT_FLAG_RESET
Definition: SmartScriptMgr.h:693
@ SMART_ACTION_DIE
Definition: SmartScriptMgr.h:575
@ SMART_ACTION_RESET_SCRIPT_BASE_OBJECT
Definition: SmartScriptMgr.h:615
@ SMART_ACTION_REMOVE_NPC_FLAG
Definition: SmartScriptMgr.h:621
@ SMART_ACTION_SET_FLY
Definition: SmartScriptMgr.h:598
@ SMART_ACTION_INSTALL_AI_TEMPLATE
Definition: SmartScriptMgr.h:596
@ SMART_ACTION_SUMMON_CREATURE
Definition: SmartScriptMgr.h:550
@ SMART_ACTION_CALL_TIMED_ACTIONLIST
Definition: SmartScriptMgr.h:618
@ SMART_ACTION_SET_IN_COMBAT_WITH_ZONE
Definition: SmartScriptMgr.h:576
@ SMART_ACTION_DO_ACTION
Definition: SmartScriptMgr.h:706
@ SMART_ACTION_SET_HOME_POS
Definition: SmartScriptMgr.h:639
@ SMART_ACTION_ADD_ITEM
Definition: SmartScriptMgr.h:594
@ SMART_ACTION_SET_ACTIVE
Definition: SmartScriptMgr.h:586
@ SMART_ACTION_SET_RANGED_MOVEMENT
Definition: SmartScriptMgr.h:617
@ SMART_ACTION_ACTIVATE_TAXI
Definition: SmartScriptMgr.h:590
@ SMART_ACTION_DISABLE
Definition: SmartScriptMgr.h:709
@ SMART_ACTION_START_CLOSEST_WAYPOINT
Definition: SmartScriptMgr.h:651
@ SMART_ACTION_SET_CASTER_COMBAT_DIST
Definition: SmartScriptMgr.h:688
@ SMART_ACTION_SUMMON_CREATURE_GROUP
Definition: SmartScriptMgr.h:645
@ SMART_ACTION_REMOVE_IMMUNITY
Definition: SmartScriptMgr.h:691
@ SMART_ACTION_PLAY_SPELL_VISUAL
Definition: SmartScriptMgr.h:712
@ SMART_ACTION_SET_REACT_STATE
Definition: SmartScriptMgr.h:546
@ SMART_ACTION_RANDOM_MOVE
Definition: SmartScriptMgr.h:627
@ SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT
Definition: SmartScriptMgr.h:614
@ SMART_ACTION_TRIGGER_TIMED_EVENT
Definition: SmartScriptMgr.h:611
@ SMART_ACTION_REMOVEAURASFROMSPELL
Definition: SmartScriptMgr.h:566
@ SMART_ACTION_FLEE
Definition: SmartScriptMgr.h:660
@ SMART_ACTION_ZONE_UNDER_ATTACK
Definition: SmartScriptMgr.h:696
@ FOLLOW_TYPE_CIRCLE
Definition: SmartScriptMgr.h:1877
@ FOLLOW_TYPE_SEMI_CIRCLE_BEHIND
Definition: SmartScriptMgr.h:1878
@ FOLLOW_TYPE_SEMI_CIRCLE_FRONT
Definition: SmartScriptMgr.h:1879
@ FOLLOW_TYPE_COLUMN
Definition: SmartScriptMgr.h:1881
@ FOLLOW_TYPE_ANGULAR
Definition: SmartScriptMgr.h:1882
@ FOLLOW_TYPE_LINE
Definition: SmartScriptMgr.h:1880
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:720
@ SMART_ESCORT_TARGETS
Definition: SmartScriptMgr.h:59
std::unordered_map< uint32, WayPoint * > WPPath
Definition: SmartScriptMgr.h:1913
@ SMARTCAST_TRIGGERED
Definition: SmartScriptMgr.h:1865
@ SMARTCAST_INTERRUPT_PREVIOUS
Definition: SmartScriptMgr.h:1864
@ SMARTCAST_AURA_NOT_PRESENT
Definition: SmartScriptMgr.h:1869
@ SMARTCAST_THREATLIST_NOT_SINGLE
Definition: SmartScriptMgr.h:1871
@ SMARTCAST_TARGET_POWER_MANA
Definition: SmartScriptMgr.h:1872
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:1034
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:56
@ 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
TriggerCastFlags
Definition: SpellDefines.h:130
@ 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:103
@ GAMEOBJECT_TYPE_DOOR
Definition: SharedDefines.h:1560
@ CHAT_MSG_MONSTER_EMOTE
Definition: SharedDefines.h:3168
@ CHAT_MSG_ADDON
Definition: SharedDefines.h:3151
@ LANG_UNIVERSAL
Definition: SharedDefines.h:735
@ LANG_ADDON
Definition: SharedDefines.h:753
@ TEAM_NEUTRAL
Definition: SharedDefines.h:762
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:223
bool IsEmpty() const
Definition: LinkedList.h:97
Definition: LinkedList.h:139
Definition: EnumFlag.h:66
void AddEventAtOffset(BasicEvent *event, Milliseconds offset)
Definition: EventProcessor.h:108
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:27
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:5050
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:3751
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:5019
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:3174
uint32 GetMaxCombatDist() const
Definition: SmartScript.h:223
void SetCasterActualDist(float dist)
Definition: SmartScript.h:226
void OnReset()
Definition: SmartScript.cpp:76
void InstallTemplate(SmartScriptHolder const &e)
Definition: SmartScript.cpp:3062
ObjectGuid goOrigGUID
Definition: SmartScript.h:251
Powers GetCasterPowerType() const
Definition: SmartScript.h:228
void DecPhase(uint32 p)
Definition: SmartScript.cpp:5056
ObjectGuid meOrigGUID
Definition: SmartScript.h:249
Definition: SmartScriptMgr.h:33
uint32 id
Definition: SmartScriptMgr.h:44
Definition: SmartScriptMgr.h:220
uint32 repeatMin
Definition: SmartScriptMgr.h:231
uint32 repeatMax
Definition: SmartScriptMgr.h:232
Definition: SmartScriptMgr.h:731
uint32 followState
Definition: SmartScriptMgr.h:1421
uint32 visualId
Definition: SmartScriptMgr.h:1416
struct SmartAction::@73::@147 moveToPos
uint32 targetParam2
Definition: SmartScriptMgr.h:834
struct SmartAction::@73::@131 timeEvent
struct SmartAction::@73::@133 equip
std::array< uint32, SMART_ACTION_PARAM_COUNT > emotes
Definition: SmartScriptMgr.h:817
struct SmartAction::@73::@92 summonCreature
struct SmartAction::@73::@163 casterDistance
struct SmartAction::@73::@153 setRoot
uint32 repeatMax
Definition: SmartScriptMgr.h:1092
uint32 phaseMin
Definition: SmartScriptMgr.h:919
uint32 targetsLimit
Definition: SmartScriptMgr.h:825
struct SmartAction::@73::@151 setRangedMovement
SAIBool transport
Definition: SmartScriptMgr.h:1186
struct SmartAction::@73::@164 setHomePos
struct SmartAction::@73::@127 setSwim
uint32 newPower
Definition: SmartScriptMgr.h:1243
struct SmartAction::@73::@120 wpStart
uint32 startAngle
Definition: SmartScriptMgr.h:1409
SAIBool reset
Definition: SmartScriptMgr.h:1077
std::array< uint32, SMART_ACTION_PARAM_COUNT > actionLists
Definition: SmartScriptMgr.h:1140
uint32 delay
Definition: SmartScriptMgr.h:964
struct SmartAction::@73::@173 castCustom
struct SmartAction::@73::@178 movementSpeed
uint32 random
Definition: SmartScriptMgr.h:1309
struct SmartAction::@73::@122 wpStop
uint32 quickChange
Definition: SmartScriptMgr.h:1308
struct SmartAction::@73::@100 removeAura
uint32 targetParam4
Definition: SmartScriptMgr.h:1433
SAIBool root
Definition: SmartScriptMgr.h:1220
uint32 dist
Definition: SmartScriptMgr.h:904
uint32 group
Definition: SmartScriptMgr.h:1235
SAIBool disable
Definition: SmartScriptMgr.h:1363
uint32 spell
Definition: SmartScriptMgr.h:822
std::array< uint32, SMART_ACTION_PARAM_COUNT > wps
Definition: SmartScriptMgr.h:1258
uint32 minHP
Definition: SmartScriptMgr.h:970
struct SmartAction::@73::@180 cinematic
SAIBool force
Definition: SmartScriptMgr.h:1285
uint32 flags
Definition: SmartScriptMgr.h:831
struct SmartAction::@73::@170 stopMotion
uint32 distanceBetweenSummons
Definition: SmartScriptMgr.h:1324
uint32 data
Definition: SmartScriptMgr.h:931
uint32 powerType
Definition: SmartScriptMgr.h:1242
SAIBool regenHealth
Definition: SmartScriptMgr.h:1215
uint32 entry
Definition: SmartScriptMgr.h:906
struct SmartAction::@73::@185 spellVisual
uint32 quest
Definition: SmartScriptMgr.h:801
struct SmartAction::@73::@126 setFly
struct SmartAction::@73::@137 delunitByte
uint32 triggerFlags
Definition: SmartScriptMgr.h:824
uint32 bp1
Definition: SmartScriptMgr.h:1339
uint32 distance
Definition: SmartScriptMgr.h:764
struct SmartAction::@73::@102 randomPhase
struct SmartAction::@73::@168 immunity
uint32 min
Definition: SmartScriptMgr.h:1089
SAIBool withDelayed
Definition: SmartScriptMgr.h:1151
SAIBool withInstant
Definition: SmartScriptMgr.h:1153
uint32 subtract
Definition: SmartScriptMgr.h:1078
struct SmartAction::@73::@104 killedMonster
uint32 a
Definition: SmartScriptMgr.h:1348
SAIBool invokerGUID
Definition: SmartScriptMgr.h:1390
uint32 percent
Definition: SmartScriptMgr.h:971
uint32 dec
Definition: SmartScriptMgr.h:888
struct SmartAction::@73::@150 sendTargetToTarget
uint32 milliseconds
Definition: SmartScriptMgr.h:948
struct SmartAction::@73::@89 crossCast
struct SmartAction::@73::@111 forceDespawn
struct SmartAction::@73::@114 setData
struct SmartAction::@73::@134 unitFlag
uint32 summonEntry
Definition: SmartScriptMgr.h:1321
uint32 followType
Definition: SmartScriptMgr.h:1422
uint32 instanceTarget
Definition: SmartScriptMgr.h:1358
uint32 credit
Definition: SmartScriptMgr.h:907
struct SmartAction::@73::@128 teleport
uint32 controlled
Definition: SmartScriptMgr.h:1187
uint32 alternative
Definition: SmartScriptMgr.h:840
uint32 targetParam1
Definition: SmartScriptMgr.h:833
uint32 mapID
Definition: SmartScriptMgr.h:1070
uint32 stopMovement
Definition: SmartScriptMgr.h:1315
struct SmartAction::@73::@181 setGuid
struct SmartAction::@73::@103 randomPhaseRange
uint32 charges
Definition: SmartScriptMgr.h:899
struct SmartAction::@73::@177 corpseDelay
struct SmartAction::@73::@98 incEventPhase
struct SmartAction::@73::@183 setScale
uint32 model
Definition: SmartScriptMgr.h:757
struct SmartAction::@73::@152 setHealthRegen
uint32 duration
Definition: SmartScriptMgr.h:739
struct SmartAction::@73::@141 interruptSpellCasting
SAIBool attackInvoker
Definition: SmartScriptMgr.h:853
SAIBool useTalkTarget
Definition: SmartScriptMgr.h:740
SAIBool run
Definition: SmartScriptMgr.h:1015
struct SmartAction::@73::@159 gameEventStart
struct SmartAction::@73::@142 sendGoCustomAnim
uint32 value
Definition: SmartScriptMgr.h:1076
uint32 movementExpired
Definition: SmartScriptMgr.h:1316
struct SmartAction::@73::@106 setInstanceData64
uint32 targetParam3
Definition: SmartScriptMgr.h:835
struct SmartAction::@73::@179 setHealthPct
SAIBool swim
Definition: SmartScriptMgr.h:1065
struct SmartAction::@73::@165 loadEquipment
uint32 sound2
Definition: SmartScriptMgr.h:770
struct SmartAction::@73::@176 disableEvade
struct SmartAction::@73::@109 callHelp
uint32 spawnPos
Definition: SmartScriptMgr.h:1279
uint32 creature
Definition: SmartScriptMgr.h:756
struct SmartAction::@73::@97 setEventPhase
struct SmartAction::@73::@86 react
uint32 angle
Definition: SmartScriptMgr.h:905
uint32 field
Definition: SmartScriptMgr.h:930
struct SmartAction::@73::@90 activateObject
uint32 range
Definition: SmartScriptMgr.h:845
uint32 flag
Definition: SmartScriptMgr.h:1110
struct SmartAction::@73::@96 combatMove
struct SmartAction::@73::@145 flee
uint32 sound3
Definition: SmartScriptMgr.h:771
struct SmartAction::@73::@156 creatureGroup
uint32 targetsummon
Definition: SmartScriptMgr.h:1004
uint32 chance
Definition: SmartScriptMgr.h:1093
uint32 state
Definition: SmartScriptMgr.h:812
uint32 byte1
Definition: SmartScriptMgr.h:1121
struct SmartAction::@73::@148 sendGossipMenu
struct SmartAction::@73::@125 setRun
uint32 sound1
Definition: SmartScriptMgr.h:769
SAIBool updateLevel
Definition: SmartScriptMgr.h:943
struct SmartAction::@73::@154 goFlag
uint32 forceRespawnTimer
Definition: SmartScriptMgr.h:965
uint32 speed
Definition: SmartScriptMgr.h:1059
struct SmartAction::@73::@82 randomMusic
struct SmartAction::@73::@167 setHover
uint32 sound4
Definition: SmartScriptMgr.h:772
uint32 targetType
Definition: SmartScriptMgr.h:832
uint32 repetitions
Definition: SmartScriptMgr.h:1408
struct SmartAction::@73::@80 randomSound
struct SmartAction::@73::@112 invincHP
uint32 aliveState
Definition: SmartScriptMgr.h:909
SAIBool onlySelf
Definition: SmartScriptMgr.h:763
uint32 attackScriptOwner
Definition: SmartScriptMgr.h:854
uint32 speedxy
Definition: SmartScriptMgr.h:1163
uint32 pointId
Definition: SmartScriptMgr.h:1185
SAIBool attack
Definition: SmartScriptMgr.h:872
uint32 repeatMin
Definition: SmartScriptMgr.h:1091
uint32 anim
Definition: SmartScriptMgr.h:1158
struct SmartAction::@73::@118 summonGO
struct SmartAction::@73::@121 wpPause
uint32 scale
Definition: SmartScriptMgr.h:1401
SAIBool fly
Definition: SmartScriptMgr.h:1058
uint32 textGroupID
Definition: SmartScriptMgr.h:738
uint32 castFlags
Definition: SmartScriptMgr.h:823
std::array< uint32, SMART_ACTION_PARAM_COUNT > phases
Definition: SmartScriptMgr.h:914
uint32 spell_id
Definition: SmartScriptMgr.h:1152
uint32 turnAngle
Definition: SmartScriptMgr.h:1310
uint32 textId
Definition: SmartScriptMgr.h:1331
uint32 gossipMenuId
Definition: SmartScriptMgr.h:1193
struct SmartAction::@73::@123 item
uint32 speedz
Definition: SmartScriptMgr.h:1164
SAIBool repeat
Definition: SmartScriptMgr.h:1017
uint32 gossipNpcTextId
Definition: SmartScriptMgr.h:1194
struct SmartAction::@73::@88 cast
uint32 mask
Definition: SmartScriptMgr.h:976
struct SmartAction::@73::@149 setGoLootState
uint32 phi_delta
Definition: SmartScriptMgr.h:1351
uint32 count
Definition: SmartScriptMgr.h:1038
struct SmartAction::@73::@160 closestWaypointFromList
uint32 inc
Definition: SmartScriptMgr.h:887
struct SmartAction::@73::@101 follow
uint32 phaseMax
Definition: SmartScriptMgr.h:920
struct SmartAction::@73::@143 jump
uint32 timer
Definition: SmartScriptMgr.h:1368
uint32 ContactDistance
Definition: SmartScriptMgr.h:1188
struct SmartAction::@73::@139 randTimedActionList
uint32 k
Definition: SmartScriptMgr.h:1349
uint32 distanceBetweenRings
Definition: SmartScriptMgr.h:1323
uint32 coneLength
Definition: SmartScriptMgr.h:1325
struct SmartAction::@73::@75 talk
struct SmartAction::@73::@186 followGroup
uint32 counterId
Definition: SmartScriptMgr.h:1075
SAIBool withEmote
Definition: SmartScriptMgr.h:954
struct SmartAction::@73::@175 doAction
uint32 max
Definition: SmartScriptMgr.h:1090
uint32 selfJump
Definition: SmartScriptMgr.h:1165
struct SmartAction::@73::@169 orientation
uint32 maxId
Definition: SmartScriptMgr.h:1291
struct SmartAction::@73::@110 setSheath
struct SmartAction::@73::@172 playerTalk
struct SmartAction::@73::@95 autoAttack
struct SmartAction::@73::@130 storeTargets
uint32 r_max
Definition: SmartScriptMgr.h:1350
uint32 speedFraction
Definition: SmartScriptMgr.h:1375
struct SmartAction::@73::@78 morphOrMount
SAIBool fail
Definition: SmartScriptMgr.h:1032
struct SmartAction::@73::@85 questOffer
SAIBool directAdd
Definition: SmartScriptMgr.h:807
uint32 bp2
Definition: SmartScriptMgr.h:1340
uint32 disableGravity
Definition: SmartScriptMgr.h:1060
uint32 sound
Definition: SmartScriptMgr.h:762
uint32 threatINC
Definition: SmartScriptMgr.h:860
struct SmartAction::@73::@162 sightDistance
struct SmartAction::@73::@129 setCounter
struct SmartAction::@73::@136 setunitByte
uint32 coneAngle
Definition: SmartScriptMgr.h:1326
uint32 summonDuration
Definition: SmartScriptMgr.h:1322
struct SmartAction::@73::@171 coneSummon
struct SmartAction::@73::@117 setActive
uint32 threatDEC
Definition: SmartScriptMgr.h:861
struct SmartAction::@73::@113 ingamePhaseMask
struct SmartAction::@73::@87 randomEmote
uint32 stepAngle
Definition: SmartScriptMgr.h:1410
uint32 reactState
Definition: SmartScriptMgr.h:1020
struct SmartAction::@73::@174 summonVortex
struct SmartAction::@73::@93 threatPCT
struct SmartAction::@73::@157 power
uint32 speedInteger
Definition: SmartScriptMgr.h:1374
struct SmartAction::@73::@144 movementFlag
struct SmartAction::@73::@105 setInstanceData
struct SmartAction::@73::@115 moveRandom
struct SmartAction::@73::@146 RespawnTarget
uint32 index
Definition: SmartScriptMgr.h:1391
uint32 actionId
Definition: SmartScriptMgr.h:1356
uint32 despawnTime
Definition: SmartScriptMgr.h:1003
uint32 goRespawnTime
Definition: SmartScriptMgr.h:1180
struct SmartAction::@73::@155 goState
struct SmartAction::@73::@158 gameEventStop
uint32 factionID
Definition: SmartScriptMgr.h:751
struct SmartAction::@73::@77 faction
struct SmartAction::@73::@107 updateTemplate
SAIBool move
Definition: SmartScriptMgr.h:877
struct SmartAction::@73::@119 taxi
struct SmartAction::@73::@138 timedActionList
struct SmartAction::@73::@108 die
std::array< uint32, MAX_EQUIPMENT_ITEMS > slots
Definition: SmartScriptMgr.h:1105
uint32 movementType
Definition: SmartScriptMgr.h:1373
uint32 questID
Definition: SmartScriptMgr.h:806
uint32 bp3
Definition: SmartScriptMgr.h:1341
uint32 pathID
Definition: SmartScriptMgr.h:1016
struct SmartAction::@73::@132 movie
uint32 emote
Definition: SmartScriptMgr.h:796
struct SmartAction::@73::@76 simpleTalk
struct SmartAction::@73::@161 combatDistance
uint32 id
Definition: SmartScriptMgr.h:1010
uint32 minId
Definition: SmartScriptMgr.h:1290
uint32 phase
Definition: SmartScriptMgr.h:882
uint32 sheath
Definition: SmartScriptMgr.h:959
struct SmartAction::@73::@81 music
uint32 isNegative
Definition: SmartScriptMgr.h:1357
struct SmartAction::@73::@187 orientationTarget
uint32 creditType
Definition: SmartScriptMgr.h:908
struct SmartAction::@73::@116 visibility
struct SmartAction::@73::@184 radialSummon
struct SmartAction::@73::@166 randomTimedEvent
struct SmartTarget::@189::@210 randomPoint
float o
Definition: SmartScriptMgr.h:1524
uint32 maxDist
Definition: SmartScriptMgr.h:1530
uint32 range
Definition: SmartScriptMgr.h:1650
float x
Definition: SmartScriptMgr.h:1524
uint32 self
Definition: SmartScriptMgr.h:1652
uint32 amount
Definition: SmartScriptMgr.h:1651
float y
Definition: SmartScriptMgr.h:1524
float z
Definition: SmartScriptMgr.h:1524
struct SmartTarget::@189::@193 unitRange
bool runOnce
Definition: SmartScriptMgr.h:1909
uint32 link
Definition: SmartScriptMgr.h:1895
uint32 event_id
Definition: SmartScriptMgr.h:1894
int32 entryOrGuid
Definition: SmartScriptMgr.h:1892
uint32 GetScriptType() const
Definition: SmartScriptMgr.h:1902
uint32 GetTargetType() const
Definition: SmartScriptMgr.h:1905
uint32 GetActionType() const
Definition: SmartScriptMgr.h:1904
float GetThreatListSize() const
Definition: ThreatMgr.h:222
void ModifyThreatByPercent(Unit *victim, int32 percent)
Definition: ThreatMgr.cpp:508
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:330
void Respawn(bool force=false)
Definition: Creature.cpp:1974
void GetRespawnPosition(float &x, float &y, float &z, float *ori=nullptr, float *dist=nullptr) const
Definition: Creature.cpp:2861
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Definition: Creature.cpp:3109
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:332
void LoadEquipment(int8 id=1, bool force=false)
Definition: Creature.cpp:1746
void SendZoneUnderAttackMessage(Player *attacker)
Send a message to LocalDefense channel for players opposition team in the zone.
Definition: Creature.cpp:2725
void SetRegeneratingHealth(bool c)
Definition: Creature.h:312
void GetTransportHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:337
void SetReactState(ReactStates st)
Definition: Creature.h:90
float m_SightDistance
Definition: Creature.h:365
void DoFleeToGetAssistance()
Definition: Creature.cpp:997
float m_CombatDistance
Definition: Creature.h:365
void SetCorpseDelay(uint32 delay)
Definition: Creature.h:72
bool IsSpellProhibited(SpellSchoolMask idSchoolMask) const
Definition: Creature.cpp:2749
Definition: CreatureData.h:349
uint32 ItemEntry[MAX_EQUIPMENT_ITEMS]
Definition: CreatureData.h:350
Definition: GossipDef.h:258
void SendCloseGossip()
Definition: GossipDef.cpp:241
void SetGoState(GOState state)
Definition: GameObject.cpp:2477
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:2442
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:2141
void DespawnOrUnsummon(Milliseconds delay=0ms, Seconds forcedRespawnTime=0s)
Definition: GameObject.cpp:930
void CastSpell(Unit *target, uint32 spell)
Definition: GameObject.cpp:2076
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
virtual void SetObjectScale(float scale)
Definition: Object.h:113
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:2343
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
void GetNearPoint(WorldObject const *searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle, float controlZ=0, Position const *startPos=nullptr) const
Definition: Object.cpp:2614
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:2687
std::string const & GetName() const
Definition: Object.h:446
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1245
uint32 GetAreaId() const
Definition: Object.cpp:3108
uint32 GetZoneId() const
Definition: Object.cpp:3100
float GetObjectSize() const
Definition: Object.cpp:2759
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:2357
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:2420
Creature * SummonTrigger(float x, float y, float z, float ang, uint32 dur, bool setLevel=false, CreatureAI *(*GetAI)(Creature *)=nullptr)
Definition: Object.cpp:2392
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
void RelocatePolarOffset(float angle, float dist, float z=0.0f)
Definition: Position.cpp:33
float GetAngle(const Position *pos) const
Definition: Position.cpp:77
void GroupEventHappens(uint32 questId, WorldObject const *pEventObject)
Definition: PlayerQuest.cpp:1804
bool ActivateTaxiPathTo(std::vector< uint32 > const &nodes, Creature *npc=nullptr, uint32 spellid=1)
Definition: Player.cpp:10149
void SendCinematicStart(uint32 CinematicSequenceId) const
Definition: Player.cpp:5612
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:9271
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:9251
void PrepareGossipMenu(WorldObject *source, uint32 menuId=0, bool showQuests=false)
Definition: PlayerGossip.cpp:31
PlayerMenu * PlayerTalkClass
Definition: Player.h:2201
void RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject *pRewardSource)
Definition: Player.cpp:12650
void SetVisible(bool x)
Definition: Unit.cpp:14220
uint8 getGender() const
Definition: Unit.h:1440
void SetFacingTo(float ori)
Definition: Unit.cpp:20884
void CombatStop(bool includingCast=false)
Definition: Unit.cpp:10440
float GetSpeed(UnitMoveType mtype) const
Definition: Unit.cpp:14409
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition: Unit.cpp:13383
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4081
void RemoveAllGameObjects()
Definition: Unit.cpp:6201
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition: Unit.cpp:14639
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition: Unit.cpp:10615
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:17956
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool fromRegenerate=false)
Definition: Unit.cpp:15552
MotionMaster * GetMotionMaster()
Definition: Unit.h:2276
void SetUnitMovementFlags(uint32 f)
Definition: Unit.h:2290
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:13575
void SetFacingToObject(WorldObject *object)
Definition: Unit.cpp:20894
bool IsAlive() const
Definition: Unit.h:1822
void StopMoving()
Definition: Unit.cpp:16918
void SendPlaySpellVisual(uint32 id)
Definition: Unit.cpp:19175
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5636
void AddUnitState(uint32 f)
Definition: Unit.h:1409
virtual void SetSheath(SheathState sheathed)
Definition: Unit.h:1506
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition: Unit.cpp:18288
EventProcessor m_Events
Definition: Unit.h:2108
bool HasUnitMovementFlag(uint32 f) const
Definition: Unit.h:2288
uint32 GetMaxPower(Powers power) const
Definition: Unit.h:1476
TransportBase * GetDirectTransport() const
Returns the transport this unit is on directly (if on vehicle and transport, return vehicle)
Definition: Unit.cpp:19031
void SendMovementFlagUpdate(bool self=false)
Definition: Unit.cpp:16972
virtual bool SetHover(bool enable, bool packetOnly=false, bool updateAnimationTier=true)
Definition: Unit.cpp:21020
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:14414
ObjectGuid GetTransGUID() const override
Definition: Unit.cpp:19020
bool IsAIEnabled
Definition: Unit.h:2364
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1410
float GetPowerPct(Powers power) const
Definition: Unit.h:1465
uint32 GetPower(Powers power) const
Definition: Unit.h:1475
void KillSelf(bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition: Unit.h:1565
void SetInFront(WorldObject const *target)
Definition: Unit.cpp:20878
bool AttackStop()
Definition: Unit.cpp:10407
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:1692
bool isDead() const
Definition: Unit.h:1824
void ExitVehicle(Position const *exitPosition=nullptr)
Definition: Unit.cpp:19992
Definition: VehicleDefines.h:107
static uint32 ChooseDisplayId(CreatureTemplate const *cinfo, CreatureData const *data=nullptr)
Definition: ObjectMgr.cpp:1726
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:350
virtual void DoAction(int32)
Definition: InstanceScript.h:263
static std::string GetBossStateName(uint8 state)
Definition: InstanceScript.cpp:743
void LoadGrid(float x, float y)
Definition: Map.cpp:492
PlayerList const & GetPlayers() const
Definition: Map.h:485
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:300
MovementGeneratorType GetCurrentMovementGeneratorType() const
Definition: MotionMaster.cpp:859
void MoveFollow(Unit *target, float dist, float angle, MovementSlot slot=MOTION_SLOT_ACTIVE)
Definition: MotionMaster.cpp:394
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:211
void MoveJump(Position const &pos, float speedXY, float speedZ, uint32 id=0)
Definition: MotionMaster.h:227
void MoveIdle()
Definition: MotionMaster.cpp:232
void MoveFall(uint32 id=0, bool addFlagForNPC=false)
Definition: MotionMaster.cpp:587
void MoveFleeing(Unit *enemy, uint32 time=0)
Definition: MotionMaster.cpp:699
void MoveRandom(float wanderDistance=0.0f)
Definition: MotionMaster.cpp:239
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:2300
SpellSchoolMask GetSchoolMask() const
Definition: SpellInfo.cpp:1974
float GetMaxRange(bool positive=false, Unit *caster=nullptr, Spell *spell=nullptr) const
Definition: SpellInfo.cpp:2309
Definition: ChatTextBuilder.h:31