154{
156
157
159 {
162 return;
163 }
164
165
167
168 if (unit)
170 else if (gob)
172
174 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: Invoker: {} ({})", tempInvoker->GetName(), tempInvoker->GetGUID().ToString());
175
177
180 if (unit)
181 invoker = unit;
182 else if (gob)
183 invoker = gob;
184
186
188 {
190 {
193
195 {
196 if (
IsCreature((target)) && !target->ToCreature()->IsPet())
197 {
199 {
202 }
203 else
205 break;
206 }
208 {
211 break;
212 }
213 }
214
215 if (!talkTarget)
217
218 if (!talker)
219 break;
220
222 {
224 break;
225 }
226
233 break;
234 }
236 {
238 {
242 {
245 }
246
247 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_SIMPLE_TALK: talker: {} ({}), textGroupId: {}",
249 }
250 break;
251 }
253 {
255 {
257 {
258 target->ToUnit()->HandleEmoteCommand(e.
action.
emote.emote);
259 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_PLAY_EMOTE: target: {} ({}), emote: {}",
260 target->GetName(), target->GetGUID().ToString(), e.
action.
emote.emote);
261 }
262 }
263 break;
264 }
266 {
268 {
270 {
273 else
275 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_SOUND: target: {} ({}), sound: {}, onlyself: {}",
277 }
278 }
279 break;
280 }
282 {
290 for (unsigned int sound : sounds)
291 {
292 if (sound)
293 {
294 temp[count] = sound;
295 ++count;
296 }
297 }
298
299 if (count == 0)
300 {
301 break;
302 }
303
305 {
307 {
310 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_RANDOM_SOUND: target: {} ({}), sound: {}, onlyself: {}",
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 {
352 {
354 {
356 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_MUSIC: target: {} ({}), sound: {}, onlySelf: {}, type: {}",
358 }
359 }
360 }
361 break;
362 }
364 {
366
368 {
370 {
372
374 {
376 if (
Player* player = i->GetSource())
377 {
379 {
381 {
383 targets.push_back(player);
384 }
385 else
386 targets.push_back(player);
387 }
388 }
389 }
390 }
391 }
392 else
394
395 if (targets.empty())
396 break;
397
405 for (unsigned int sound : sounds)
406 {
407 if (sound)
408 {
409 temp[count] = sound;
410 ++count;
411 }
412 }
413
414 if (count == 0)
415 {
416 break;
417 }
418
420 {
422 {
425 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_RANDOM_MUSIC: target: {} ({}), sound: {}, onlyself: {}, type: {}",
427 }
428 }
429
430 break;
431 }
433 {
435 {
437 {
439 {
441 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry {}, GuidLow {} set faction to {}",
443 }
444 else
445 {
447 {
448 if (target->ToCreature()->GetFaction() != ci->faction)
449 {
450 target->ToCreature()->SetFaction(ci->faction);
451 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry {}, GuidLow {} set faction to {}",
452 target->GetEntry(), target->GetGUID().ToString(), ci->faction);
453 }
454 }
455 }
456 }
457 }
458 break;
459 }
461 {
463 {
465 continue;
466
468 {
469
471 {
473 {
476 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry {}, GuidLow {} set displayid to {}",
478 }
479 }
480
481 else
482 {
484 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry {}, GuidLow {} set displayid to {}",
486 }
487 }
488 else
489 {
490 target->ToCreature()->DeMorph();
491 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry {}, GuidLow {} demorphs.",
492 target->GetEntry(), target->GetGUID().ToString());
493 }
494 }
495 break;
496 }
498 {
500 {
502 {
503 target->ToPlayer()->FailQuest(e.
action.
quest.quest);
504 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_FAIL_QUEST: Player guidLow {} fails quest {}",
505 target->GetGUID().ToString(), e.
action.
quest.quest);
506 }
507 }
508 break;
509 }
511 {
513 {
515 {
517 {
519 {
520 if (player->CanTakeQuest(q, true))
521 {
523 {
525 menu.SendQuestGiverQuestDetails(q,
me->
GetGUID(),
true);
526 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_OFFER_QUEST: Player guidLow {} - offering quest {}",
528 }
529 }
530 }
531 else
532 {
533 player->AddQuestAndCheckCompletion(q, nullptr);
534 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_OFFER_QUEST: Player guidLow {} - quest {} added",
536 }
537 }
538 }
539 }
540 break;
541 }
543 {
545 {
547 continue;
548
550 }
551 break;
552 }
554 {
555 std::vector<uint32> emotes;
557 std::back_inserter(emotes), [](
uint32 emote) { return emote != 0; });
558
560 {
562 {
564 target->ToUnit()->HandleEmoteCommand(emote);
565 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_RANDOM_EMOTE: Creature guidLow {} handle random emote {}",
566 target->GetGUID().ToString(), emote);
567 }
568 }
569 break;
570 }
572 {
574 break;
575
577 for (ThreatContainer::StorageType::const_iterator i = threatList.begin(); i != threatList.end(); ++i)
578 {
580 {
582 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_THREAT_ALL_PCT: Creature {} modify threat for unit {}, value {}",
584 }
585 }
586 break;
587 }
589 {
591 break;
592
594 {
596 {
598 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_THREAT_SINGLE_PCT: Creature guidLow {} modify threat for unit {}, value {}",
600 }
601 }
602 break;
603 }
605 {
607 {
608
610 if (
Vehicle* vehicle = target->ToUnit()->GetVehicleKit())
611 for (auto & Seat : vehicle->Seats)
613 player->AreaExploredOrEventHappens(e.
action.
quest.quest);
614
616 {
617 target->ToPlayer()->AreaExploredOrEventHappens(e.
action.
quest.quest);
618
619 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS: Player guidLow {} credited quest {}",
620 target->GetGUID().ToString(), e.
action.
quest.quest);
621 }
622 }
623 break;
624 }
626 {
627 if (targets.empty())
628 break;
629
631
634
637
638 bool failedSpellCast = false, successfulSpellCast = false;
639
641 {
642
645
647 continue;
648
649 if (caster && caster !=
me)
650 {
652 }
654 {
655
657 continue;
658
659
662 break;
663
664
666 continue;
667
668
671
677
679 bool isWithinMeleeRange = distanceToTarget <= meleeRange;
682
685
686
687 if (isWithinLOSInMap && isWithinMeleeRange && isRangedAttack && isTargetRooted && canCastSpell)
688 {
689 failedSpellCast = true;
690 float minDistance = std::max(meleeRange, spellMinRange) - distanceToTarget +
NOMINAL_MELEE_RANGE;
692 continue;
693 }
694
695
696 if (distanceToTarget > spellMaxRange && isWithinLOSInMap)
697 {
698 failedSpellCast = true;
700 continue;
701 }
702 else if (distanceToTarget < spellMinRange || !(isWithinLOSInMap || isSpellIgnoreLOS))
703 {
704 failedSpellCast = true;
706 continue;
707 }
708
711 {
714 else
716 }
717
720
722 {
723
725
727 else
728
730 }
731
732 if (spellCastFailed)
733 failedSpellCast = true;
734 else
735 successfulSpellCast = true;
736
737 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_CAST: Unit {} casts spell {} on target {} with castflags {}",
739 }
740 }
741
742
743 if (failedSpellCast && !successfulSpellCast)
744 {
746
747 return;
748 }
749
750 break;
751 }
753 {
754 if (targets.empty())
755 break;
756
759
762 {
764 {
766 }
767 else
768 {
770 }
771 }
772
774 {
776 if (!uTarget)
777 continue;
778
780 {
782 {
784 }
785
787 }
788 }
789 break;
790 }
792 {
793
795 if (!tempLastInvoker)
796 break;
797
798 if (targets.empty())
799 break;
800
803
805 {
807 continue;
808
809 if (!
IsUnit(tempLastInvoker))
810 continue;
811
813 {
815 {
817 }
818
821 {
823 {
825 }
826 else
827 {
829 }
830 }
831
833 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_INVOKER_CAST: Invoker {} casts spell {} on target {} with castflags {}",
835 }
836 else
837 {
838 LOG_DEBUG(
"scripts.ai",
"Spell {} not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target {} already has the aura",
840 }
841 }
842 break;
843 }
845 {
847 {
849 {
851 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_ADD_AURA: Adding aura {} to unit {}",
853 }
854 }
855 break;
856 }
858 {
860 {
862 {
864
865
867 {
869 }
870
872 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_ACTIVATE_GOBJECT. Gameobject {} activated",
go->
GetGUID().
ToString());
873 }
874 }
875
876 break;
877 }
879 {
881 {
883 {
884 target->ToGameObject()->ResetDoorOrButton();
885 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_RESET_GOBJECT. Gameobject {} (entry: {}) reset",
886 target->GetGUID().ToString(), target->GetEntry());
887 }
888 }
889 break;
890 }
892 {
894 {
896 {
898 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_EMOTE_STATE. Unit {} set emotestate to {}",
899 target->GetGUID().ToString(), e.
action.
emote.emote);
900 }
901 }
902 break;
903 }
905 {
907 {
909 {
911 {
913 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit {} added flag {} to UNIT_FIELD_FLAGS",
915 }
916 else
917 {
919 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit {} added flag {} to UNIT_FIELD_FLAGS_2",
921 }
922 }
923 }
924 break;
925 }
927 {
929 {
931 {
933 {
935 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit {} removed flag {} to UNIT_FIELD_FLAGS",
937 }
938 else
939 {
941 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit {} removed flag {} to UNIT_FIELD_FLAGS_2",
943 }
944 }
945 }
946 break;
947 }
949 {
951 break;
952
954 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_AUTO_ATTACK: Creature: {} bool on = {}",
956 break;
957 }
959 {
961 break;
962
965 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_ALLOW_COMBAT_MOVEMENT: Creature {} bool on = {}",
967 break;
968 }
970 {
972 break;
973
975 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_SET_EVENT_PHASE: Creature {} set event phase {}",
977 break;
978 }
980 {
982 break;
983
986 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_INC_EVENT_PHASE: Creature {} inc event phase by {}, "
988 break;
989 }
991 {
993 break;
994
997 if (target->ToCreature()->IsAIEnabled)
998 target->ToCreature()->AI()->EnterEvadeMode();
999
1000 break;
1001 }
1003 {
1004
1006 break;
1007
1010 {
1013 }
1014 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_FLEE_FOR_ASSIST: Creature {} DoFleeToGetAssistance",
me->
GetGUID().
ToString());
1015 break;
1016 }
1018 {
1020 break;
1021
1023 break;
1024 }
1026 {
1028 {
1030 continue;
1031
1033
1036 {
1038 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_CALL_GROUPEVENTHAPPENS: Player {}, group credit for quest {}",
1040 }
1041
1042
1044 {
1045 for (auto& Seat : vehicle->Seats)
1046 {
1048 {
1050 }
1051 }
1052 }
1053 }
1054 break;
1055 }
1057 {
1059 {
1061 continue;
1062
1064 {
1066 {
1069 }
1070 else
1072 }
1073 else
1074 target->ToUnit()->RemoveAllAuras();
1075
1076 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_REMOVEAURASFROMSPELL: Unit {}, spell {}",
1078 }
1079 break;
1080 }
1082 {
1084 break;
1085
1087 {
1089 break;
1090 }
1091
1093 {
1095 {
1098 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_FOLLOW: Creature {} following target {}",
1100 break;
1101 }
1102 }
1103 break;
1104 }
1106 {
1108 break;
1109
1110 std::vector<uint32> phases;
1112 std::back_inserter(phases), [](
uint32 phase) { return phase != 0; });
1113
1116 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE: Creature {} sets event phase to {}",
1118 break;
1119 }
1121 {
1123 break;
1124
1127 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE_RANGE: Creature {} sets event phase to {}",
1129 break;
1130 }
1132 {
1134 {
1136 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: (trigger == true) Player {}, Killcredit: {}",
1138 }
1140 {
1142 break;
1143
1145 {
1147 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player {}, Killcredit: {}",
1149 }
1150 }
1151 else
1152 {
1154 {
1156 continue;
1157
1159 if (!player)
1160 continue;
1161
1163 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player {}, Killcredit: {}",
1165 }
1166 }
1167 break;
1168 }
1170 {
1172 if (!obj)
1173 obj = unit;
1174
1175 if (!obj)
1176 break;
1177
1179 if (!instance)
1180 {
1181 LOG_ERROR(
"scripts.ai.sai",
"SmartScript: Event {} attempt to set instance data without instance script. EntryOrGuid {}", e.
GetEventType(), e.
entryOrGuid);
1182 break;
1183 }
1184
1186 {
1187 case 0:
1188 {
1191 } break;
1192 case 1:
1193 {
1196 } break;
1197 default:
1198 {
1199 break;
1200 }
1201 }
1202 break;
1203 }
1205 {
1207 if (!obj)
1208 obj = unit;
1209
1210 if (!obj)
1211 break;
1212
1214 if (!instance)
1215 {
1217 break;
1218 }
1219
1220 if (targets.empty())
1221 break;
1222
1224 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: {}, data: {}",
1226 break;
1227 }
1229 {
1233 break;
1234 }
1236 {
1238 {
1240 {
1242 {
1243
1245 {
1246 me->KillSelf();
1247 LOG_DEBUG("sql.sql", "SmartScript::ProcessAction: SMART_ACTION_DIE: Creature {}", me->GetGUID().ToString());
1248 }
1250 }
1251 }
1253 {
1256 }
1257 break;
1258 }
1260 {
1261 if (targets.empty())
1262 break;
1263
1265 {
1268
1272 {
1276 }
1277 }
1278 else
1279 {
1281 {
1283 {
1284 target->ToCreature()->SetInCombatWithZone();
1285 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_SET_IN_COMBAT_WITH_ZONE: Creature {}, target: {}",
1287 }
1288 }
1289 }
1290
1291 break;
1292 }
1294 {
1296 {
1298 {
1301 {
1304 }
1305 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_CALL_FOR_HELP: Creature {}, target: {}",
1307 }
1308 }
1309 break;
1310 }
1312 {
1314 {
1316 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_SET_SHEATH: Creature {}, State: {}",
1318 }
1319 break;
1320 }
1322 {
1324 {
1326 {
1328 LOG_ERROR(
"sql.sql",
"SmartScript: SMART_ACTION_FORCE_DESPAWN has removeObjectFromWorld set. delay and forceRespawnTimer ignored.");
1329
1331 creature->AddObjectToRemoveList();
1334 }
1335 else
1336 {
1338
1339
1340 if (despawnDelay <= 0ms)
1341 despawnDelay = 1ms;
1342
1345 creature->DespawnOrUnsummon(despawnDelay, forceRespawnTimer);
1348 }
1349 }
1350
1351 break;
1352 }
1354 {
1356 {
1361 }
1362 break;
1363 }
1365 {
1367 {
1369 continue;
1370
1372 {
1374 {
1377 }
1378 else
1380 }
1381 else
1382 target->ToUnit()->Dismount();
1383 }
1384 break;
1385 }
1387 {
1389 {
1391 {
1393 if (!ai)
1394 continue;
1395
1398 else
1400 }
1401 }
1402 break;
1403 }
1405 {
1407 {
1409 {
1411
1413 {
1416 else
1418 }
1419 else
1421 }
1423 {
1425
1427 {
1430 else
1432 }
1433 else
1435 }
1436 }
1437 break;
1438 }
1440 {
1442 break;
1443
1444 float x, y, z;
1447 break;
1448 }
1450 {
1452 break;
1453
1455 break;
1456 }
1458 {
1462
1463 break;
1464 }
1466 {
1469 break;
1470 }
1472 {
1474 break;
1475
1476 if (targets.empty())
1477 break;
1478
1479
1482 break;
1483 }
1485 {
1489 break;
1490 }
1492 {
1494 bool preferUnit = flags.HasFlag(SmartActionSummonCreatureFlags::PreferUnit);
1496 if (!summoner)
1497 break;
1498
1499 bool personalSpawn = flags.HasFlag(SmartActionSummonCreatureFlags::PersonalSpawn);
1500
1502 {
1507 {
1510 else
1513 {
1515 summon->AI()->AttackStart(unit);
1517 summon->AI()->AttackStart(
me);
1518 }
1519 }
1520 break;
1521 }
1522
1523 float x, y, z, o;
1525 {
1526 target->GetPosition(x, y, z, o);
1532 {
1534 summon->AI()->AttackStart(unit);
1536 summon->AI()->AttackStart(target->ToUnit());
1538 summon->AI()->AttackStart(
me);
1539 }
1540 }
1541
1543 break;
1544
1546 {
1548 summon->AI()->AttackStart(unit);
1550 summon->AI()->AttackStart(
me);
1551 }
1552 break;
1553 }
1555 {
1557 break;
1558
1559 if (!targets.empty())
1560 {
1561 float x, y, z, o;
1563 {
1564
1565
1566
1567
1568 target->GetPosition(x, y, z, o);
1575 else
1577 }
1578 }
1579
1581 break;
1582
1584 break;
1585 }
1587 {
1589 {
1591 continue;
1592
1593 Unit::Kill(target->ToUnit(), target->ToUnit());
1594 }
1595
1596 break;
1597 }
1599 {
1601 break;
1602 }
1604 {
1606 {
1608 continue;
1609
1611 }
1612 break;
1613 }
1615 {
1617 {
1619 continue;
1620
1622 }
1623 break;
1624 }
1626 {
1628 break;
1629 }
1631 {
1633 {
1638 }
1639 break;
1640 }
1642 {
1644 break;
1645
1647
1650
1651
1653 break;
1654 }
1656 {
1658 {
1660 {
1661 if (
IsSmart(target->ToCreature()))
1663 else
1665 }
1666 }
1667
1668 break;
1669 }
1671 {
1673 break;
1674
1676 break;
1677 }
1679 {
1680 if (!targets.empty())
1681 {
1683 {
1685 {
1688 else
1689 LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SET_COUNTER is not using SmartAI, skipping");
1690 }
1692 {
1695 else
1696 LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SET_COUNTER is not using SmartGameObjectAI, skipping");
1697 }
1698 }
1699 }
1700 else
1702 break;
1703 }
1705 {
1707 break;
1708
1712
1714 {
1716 {
1718 break;
1719 }
1720 }
1721
1724
1729 break;
1730 }
1732 {
1734 break;
1735
1738 break;
1739 }
1741 {
1743 break;
1744
1749 break;
1750 }
1752 {
1754 break;
1755
1757 break;
1758 }
1760 {
1762 break;
1763
1765 {
1766 float randomOri =
frand(0.0f, 2 * M_PI);
1770 break;
1771 }
1772
1774 {
1779 break;
1780 }
1781
1783 {
1787 }
1789 {
1793 }
1794 else if (!targets.empty())
1795 {
1799 }
1800
1801 break;
1802 }
1804 {
1806 {
1808 continue;
1809
1811 }
1812 break;
1813 }
1815 {
1817 break;
1818
1820
1822 {
1824 {
1828 trans->CalculatePassengerPosition(dest.x, dest.y, dest.z);
1829
1832
1833 break;
1834 }
1836 {
1838 {
1847 true,
1848 true,
1850 );
1851
1852 }
1853
1854 break;
1855 }
1856
1857 default:
1858 {
1859
1860 if (targets.empty())
1861 return;
1862 else
1864
1865 float x, y, z;
1867
1872
1874
1875 break;
1876 }
1877 }
1878
1879 break;
1880 }
1882 {
1884 {
1886 {
1889 }
1890 }
1891
1892 break;
1893 }
1895 {
1897 {
1901 {
1902
1905 else
1907 }
1908 }
1909 break;
1910 }
1912 {
1916 break;
1917 }
1919 {
1921 {
1923 {
1924 std::array<uint32, MAX_EQUIPMENT_ITEMS> slot;
1926 {
1928 if (!eInfo)
1929 {
1930 LOG_ERROR(
"sql.sql",
"SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info id {} for creature {}", equipId,
npc->GetEntry());
1931 break;
1932 }
1933
1934 npc->SetCurrentEquipmentId(equipId);
1935
1936 std::copy(std::begin(eInfo->
ItemEntry), std::end(eInfo->
ItemEntry), std::begin(slot));
1937 }
1938 else
1940
1944 }
1945 }
1946 break;
1947 }
1949 {
1954
1959
1963
1967
1975 break;
1976 }
1979
1980
1983 break;
1986 break;
1988 {
1990 {
1992 {
1999 break;
2000 }
2002 {
2009 break;
2010 }
2011 }
2012
2013 break;
2014 }
2017 break;
2020 break;
2022 {
2024 break;
2025
2028
2031 if (
IsSmart(creature) && creature->GetVictim())
2033 creature->GetMotionMaster()->MoveChase(creature->GetVictim(), attackDistance, attackAngle);
2034
2035 break;
2036 }
2038 {
2040 {
2042 break;
2043 }
2044
2046 {
2048 {
2051 }
2053 {
2056 }
2057 }
2058 break;
2059 }
2061 {
2065 break;
2066 }
2068 {
2072 break;
2073 }
2075 {
2079 break;
2080 }
2082 {
2083 if (targets.empty())
2084 break;
2085
2087 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);
2088
2090 {
2092 continue;
2093
2095
2096 bool interruptedSpell = false;
2097
2099 {
2101 continue;
2102
2104 {
2106 {
2108 interruptedSpell = true;
2109 }
2110
2112 }
2113 else
2115 }
2116 }
2117 break;
2118 }
2120 {
2121 std::vector<uint32> actionLists;
2123 std::back_inserter(actionLists), [](
uint32 actionList) { return actionList != 0; });
2124
2127 {
2129 break;
2130 }
2131
2133 {
2135 {
2138 }
2140 {
2143 }
2144 }
2145 break;
2146 }
2148 {
2151 {
2153 break;
2154 }
2155
2157 {
2159 {
2162 }
2164 {
2167 }
2168 }
2169 break;
2170 }
2172 {
2176 break;
2177 }
2179 {
2180 bool foundTarget = false;
2181
2183 {
2185 {
2186 foundTarget = true;
2187
2190 else
2192 }
2193 }
2194
2196 {
2199 else
2201 }
2202 break;
2203 }
2205 {
2209 break;
2210 }
2212 {
2216 break;
2217 }
2219 {
2223 break;
2224 }
2226 {
2230 break;
2231 }
2233 {
2237 break;
2238 }
2240 {
2244 break;
2245 }
2247 {
2251 break;
2252 }
2254 {
2256 {
2258 {
2263 }
2264
2265 break;
2266 }
2267
2268 if (targets.empty())
2269 break;
2270
2271
2273 {
2277 }
2278 else
2279 {
2282 {
2285 }
2286 }
2287
2288 break;
2289 }
2291 {
2295 break;
2296 }
2298 {
2302 break;
2303 }
2305 {
2307
2308 if (!ref)
2309 ref = unit;
2310
2311 if (!ref)
2312 break;
2313
2315 if (!storedTargets)
2316 break;
2317
2319 {
2321 {
2324 else
2325 LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartAI, skipping");
2326 }
2328 {
2331 else
2332 LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartGameObjectAI, skipping");
2333 }
2334 }
2335 break;
2336 }
2338 {
2340 break;
2341
2342 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_SEND_GOSSIP_MENU: gossipMenuId {}, gossipNpcTextId {}",
2344
2347 {
2350 else
2352
2354 }
2355
2356 break;
2357 }
2359 {
2360 if (!targets.empty())
2361 {
2362 float x, y, z, o;
2365 {
2367 {
2370 }
2371 else
2373 }
2374 }
2376 {
2378 {
2379 float x, y, z, o;
2382 }
2383 else
2385 }
2386 break;
2387 }
2389 {
2393
2394 break;
2395 }
2397 {
2401 break;
2402 }
2404 {
2408 break;
2409 }
2411 {
2415 break;
2416 }
2418 {
2422 break;
2423 }
2425 {
2426 std::list<TempSummon*> summonList;
2428
2429 for (std::list<TempSummon*>::const_iterator itr = summonList.begin(); itr != summonList.end(); ++itr)
2430 {
2432 (*itr)->AI()->AttackStart(unit);
2434 (*itr)->AI()->AttackStart(
me);
2435 }
2436
2437 break;
2438 }
2440 {
2444 break;
2445 }
2447 {
2451 break;
2452 }
2454 {
2458 break;
2459 }
2461 {
2464 {
2465 LOG_ERROR(
"scripts.ai.sai",
"SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_STOP, inactive event (id: {})", eventId);
2466 break;
2467 }
2469 break;
2470 }
2472 {
2475 {
2476 LOG_ERROR(
"scripts.ai.sai",
"SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_START, already activated event (id: {})", eventId);
2477 break;
2478 }
2480 break;
2481 }
2483 {
2484 std::vector<uint32> waypoints;
2486 std::back_inserter(waypoints), [](
uint32 wp) { return wp != 0; });
2487
2488 float distanceToClosest = std::numeric_limits<float>::max();
2490
2492 {
2494 {
2496 {
2497 for (
uint32 wp : waypoints)
2498 {
2500 if (!path || path->empty())
2501 continue;
2502
2503 auto itrWp = path->find(0);
2504 if (itrWp != path->end())
2505 {
2507 {
2508 float distToThisPath = creature->GetDistance(wp->x, wp->y, wp->z);
2509 if (distToThisPath < distanceToClosest)
2510 {
2511 distanceToClosest = distToThisPath;
2512 closestWp = wp;
2513 }
2514 }
2515 }
2516 }
2517
2518 if (closestWp)
2520 }
2521 }
2522 }
2523 break;
2524 }
2526 {
2530
2531 break;
2532 }
2534 {
2537 {
2540 }
2541
2542 break;
2543 }
2545 {
2549
2550 break;
2551 }
2553 {
2557 break;
2558 }
2560 {
2564 break;
2565 }
2567 {
2571 break;
2572 }
2574 {
2578 break;
2579 }
2581 {
2584 break;
2585 }
2587 {
2591 break;
2592 }
2594 {
2598
2599 break;
2600 }
2602 {
2606 break;
2607 }
2609 {
2613
2614 break;
2615 }
2617 {
2619 break;
2620 }
2622 {
2626 break;
2627 }
2629 {
2631 {
2633 {
2638 }
2639 }
2640 break;
2641 }
2643 {
2647
2648 break;
2649 }
2651 {
2655 {
2657 break;
2658 }
2659
2660 break;
2661 }
2663 {
2666 break;
2667 }
2669 {
2671
2672 if (!targets.empty())
2676
2677 break;
2678 }
2680 {
2682 break;
2683
2685 {
2687 {
2689 {
2691 }
2692
2694 {
2695
2696
2697
2698 bool _allowMove = false;
2701
2706 _allowMove = true;
2707
2709 }
2710
2712 {
2721 }
2722 }
2723 }
2724 break;
2725 }
2727 {
2729 break;
2730
2731 if (targets.empty())
2732 break;
2733
2735
2740
2741
2742
2743
2744
2745 float factor = std::exp(k * delta_phi);
2746
2747
2748 float summonRadius = a;
2749
2751 {
2752
2753
2755
2756 do
2757 {
2759 summonPosition.RelocatePolarOffset(phi, summonRadius);
2760
2762
2763 phi += delta_phi;
2764 summonRadius *= factor;
2765 } while (summonRadius <= r_max);
2766 }
2767
2768 break;
2769 }
2771 {
2773 break;
2774
2776
2779
2781 {
2782 float deltaAngle = 0.0f;
2783 if (radius > 0)
2784 deltaAngle = distInARow / radius;
2785
2787 if (deltaAngle > 0)
2788 count += coneAngle / deltaAngle;
2789
2790 float currentAngle = -static_cast<float>(count) * deltaAngle / 2.0f;
2791
2794 else if (!targets.empty())
2795 {
2797 }
2798
2799 for (
uint32 index = 0; index < count; ++index)
2800 {
2802 spawnPosition.RelocatePolarOffset(currentAngle, radius);
2803 currentAngle += deltaAngle;
2804
2806 }
2807 }
2808
2809 break;
2810 }
2812 {
2814 {
2816 {
2817 playerTarget->RemoveArenaSpellCooldowns();
2818 playerTarget->RemoveAurasDueToSpell(57724);
2819 playerTarget->RemoveAurasDueToSpell(57723);
2820 playerTarget->RemoveAurasDueToSpell(2825);
2821 playerTarget->RemoveAurasDueToSpell(32182);
2822 }
2823 }
2824
2825 break;
2826 }
2828 {
2831 {
2832 if (targets.empty())
2833 break;
2834
2836 {
2838 {
2840 {
2841 unitTarget->AI()->DoAction(actionId);
2842 }
2843 }
2845 {
2846 gobjTarget->AI()->DoAction(actionId);
2847 }
2848 }
2849
2850 }
2851 else
2852 {
2855 {
2856 instanceScript = baseObj->GetInstanceScript();
2857 }
2858
2860 {
2862 }
2863
2864 if (instanceScript)
2865 {
2866 instanceScript->
DoAction(actionId);
2867 }
2868 }
2869 break;
2870 }
2872 {
2874 break;
2875
2877 break;
2878 }
2880 {
2882 {
2885 }
2886 break;
2887 }
2889 {
2893 break;
2894 }
2896 {
2899 float speed = float(speedInteger) + float(speedFraction) / std::pow(10, std::floor(std::log10(float(speedFraction ? speedFraction : 1)) + 1));
2900
2904
2905 break;
2906 }
2908 {
2910 {
2912 continue;
2913
2915 }
2916 break;
2917 }
2919 {
2921 {
2923
2925 {
2927 {
2928 guidToSend = invoker->
GetGUID();
2929 }
2930 }
2931
2933 {
2935 }
2937 {
2939 }
2940 }
2941 break;
2942 }
2944 {
2945
2947 {
2948 case 0:
2949 {
2951 {
2953 {
2956 c->DespawnOrUnsummon();
2957 }
2958 }
2959 break;
2960 }
2961 case 1:
2962 {
2964 {
2966 {
2968 c->Respawn(true);
2970 }
2971 }
2972 break;
2973 }
2974 case 2:
2975 {
2977 {
2979 {
2981
2982
2985 else
2986 c->Respawn(true);
2987
2988
2991
2992
2995 }
2996 }
2997 break;
2998 }
2999 default:
3000 break;
3001 }
3002 break;
3003 }
3005 {
3007
3009 {
3011 {
3013 }
3014 }
3015 break;
3016 }
3018 {
3020 break;
3021
3023
3026
3028 {
3030 {
3034 }
3035 break;
3036 }
3037
3039 {
3040 float currentAngle = startAngle + (itr * stepAngle);
3042 }
3043
3044 break;
3045 }
3047 {
3049 {
3051 {
3054 }
3055 }
3056 break;
3057 }
3059 {
3061 {
3065
3066 break;
3067 }
3068
3069 uint8 membCount = targets.size();
3073 {
3075 {
3076 float angle = (membCount > 4 ? (M_PI * 2)/membCount : (M_PI / 2));
3078 {
3080 {
3082 itr++;
3083 }
3084 }
3085 break;
3086 }
3088 {
3090 {
3092 {
3094 itr++;
3095 }
3096 }
3097 break;
3098 }
3100 {
3102 {
3104 {
3106 itr++;
3107 }
3108 }
3109 break;
3110 }
3112 {
3114 {
3116 {
3118 itr++;
3119 }
3120 }
3121 break;
3122 }
3124 {
3126 {
3128 {
3130 itr++;
3131 }
3132 }
3133 break;
3134 }
3136 {
3138 {
3140 {
3142 itr++;
3143 }
3144 }
3145 break;
3146 }
3147 default:
3148 break;
3149 }
3150
3151 break;
3152 }
3154 {
3156 {
3157 case 0:
3158 {
3161
3162 break;
3163 }
3164 case 1:
3165 {
3168
3169 break;
3170 }
3171 case 2:
3172 {
3175
3176 break;
3177 }
3178 case 3:
3179 {
3181 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);
3182
3186
3187 break;
3188 }
3189 default:
3190 break;
3191 }
3192 break;
3193 }
3195 {
3197 {
3199 {
3201 {
3204 }
3205 }
3206 }
3207
3208 break;
3209 }
3211 {
3213 {
3215 {
3217 {
3221 }
3222 }
3223 }
3224
3225 break;
3226 }
3228 {
3232
3233 break;
3234 }
3236 {
3240
3241 break;
3242 }
3244 {
3248
3249 break;
3250 }
3251 default:
3253 break;
3254 }
3255
3257 {
3260 ProcessEvent(linked, unit, var0, var1, bvar, spell, gob);
3261 else
3263 }
3264}
#define DEFAULT_LOCALE
Definition: Common.h:79
float frand(float min, float max)
Definition: Random.cpp:57
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition: Duration.h:27
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:30
std::int8_t int8
Definition: Define.h:105
EncounterState
Definition: InstanceScript.h:56
npc
Definition: BattlegroundSA.h:75
#define sObjectMgr
Definition: ObjectMgr.h:1623
#define sGameEventMgr
Definition: GameEventMgr.h:186
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const guid)
Definition: ScriptedGossip.cpp:45
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
#define CAST_AI(a, b)
Definition: UnitAI.h:26
#define ENSURE_AI(a, b)
Definition: UnitAI.h:27
@ SMART_EVENT_FLAG_TEMP_IGNORE_CHANCE_ROLL
Definition: SmartScriptMgr.h:1906
SMARTAI_TARGETS
Definition: SmartScriptMgr.h:1502
@ SMART_TARGET_RANDOM_POINT
Definition: SmartScriptMgr.h:1541
#define sSmartWaypointMgr
Definition: SmartScriptMgr.h:2205
SMART_ACTION
Definition: SmartScriptMgr.h:547
@ SMART_ACTION_REMOVE_TIMED_EVENT
Definition: SmartScriptMgr.h:622
@ SMART_ACTION_NONE
Definition: SmartScriptMgr.h:548
@ SMART_ACTION_SET_GO_FLAG
Definition: SmartScriptMgr.h:652
@ SMART_ACTION_WP_RESUME
Definition: SmartScriptMgr.h:613
@ SMART_ACTION_UPDATE_TEMPLATE
Definition: SmartScriptMgr.h:584
@ SMART_ACTION_SET_HEALTH_REGEN
Definition: SmartScriptMgr.h:650
@ SMART_ACTION_ACTIVATE_GOBJECT
Definition: SmartScriptMgr.h:557
@ SMART_ACTION_GAME_EVENT_START
Definition: SmartScriptMgr.h:660
@ SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST
Definition: SmartScriptMgr.h:636
@ SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1
Definition: SmartScriptMgr.h:639
@ SMART_ACTION_SET_INST_DATA64
Definition: SmartScriptMgr.h:583
@ SMART_ACTION_SET_FACTION
Definition: SmartScriptMgr.h:550
@ SMART_ACTION_THREAT_SINGLE_PCT
Definition: SmartScriptMgr.h:561
@ SMART_ACTION_OFFER_QUEST
Definition: SmartScriptMgr.h:555
@ SMART_ACTION_REMOVE_ALL_GAMEOBJECTS
Definition: SmartScriptMgr.h:674
@ SMART_ACTION_RISE_UP
Definition: SmartScriptMgr.h:662
@ SMART_ACTION_SET_INGAME_PHASE_MASK
Definition: SmartScriptMgr.h:592
@ SMART_ACTION_SET_UNIT_FIELD_BYTES_1
Definition: SmartScriptMgr.h:638
@ SMART_ACTION_CLOSE_GOSSIP
Definition: SmartScriptMgr.h:620
@ SMART_ACTION_DISABLE_EVADE
Definition: SmartScriptMgr.h:665
@ SMART_ACTION_CONE_SUMMON
Definition: SmartScriptMgr.h:712
@ SMART_ACTION_ADD_GO_FLAG
Definition: SmartScriptMgr.h:653
@ SMART_ACTION_ADD_DYNAMIC_FLAG
Definition: SmartScriptMgr.h:643
@ SMART_ACTION_KILL_UNIT
Definition: SmartScriptMgr.h:599
@ SMART_ACTION_LOAD_EQUIPMENT
Definition: SmartScriptMgr.h:672
@ SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS
Definition: SmartScriptMgr.h:563
@ SMART_ACTION_ATTACK_START
Definition: SmartScriptMgr.h:597
@ SMART_ACTION_MOVEMENT_RESUME
Definition: SmartScriptMgr.h:729
@ SMART_ACTION_SET_UNIT_FLAG
Definition: SmartScriptMgr.h:566
@ SMART_ACTION_NO_ENVIRONMENT_UPDATE
Definition: SmartScriptMgr.h:705
@ SMART_ACTION_CALL_GROUPEVENTHAPPENS
Definition: SmartScriptMgr.h:574
@ SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL
Definition: SmartScriptMgr.h:591
@ SMART_ACTION_INVOKER_CAST
Definition: SmartScriptMgr.h:682
@ SMART_ACTION_MOVEMENT_STOP
Definition: SmartScriptMgr.h:727
@ SMART_ACTION_SET_SCALE
Definition: SmartScriptMgr.h:720
@ SMART_ACTION_JUMP_TO_POS
Definition: SmartScriptMgr.h:645
@ SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST
Definition: SmartScriptMgr.h:635
@ SMART_ACTION_SEND_GOSSIP_MENU
Definition: SmartScriptMgr.h:646
@ SMART_ACTION_SET_COUNTER
Definition: SmartScriptMgr.h:611
@ SMART_ACTION_FLEE_FOR_ASSIST
Definition: SmartScriptMgr.h:573
@ SMART_ACTION_EQUIP
Definition: SmartScriptMgr.h:619
@ SMART_ACTION_SET_ROOT
Definition: SmartScriptMgr.h:651
@ SMART_ACTION_ATTACK_STOP
Definition: SmartScriptMgr.h:717
@ SMART_ACTION_SUMMON_GO
Definition: SmartScriptMgr.h:598
@ SMART_ACTION_SET_HOVER
Definition: SmartScriptMgr.h:699
@ SMART_ACTION_WP_PAUSE
Definition: SmartScriptMgr.h:602
@ SMART_ACTION_SIMPLE_TALK
Definition: SmartScriptMgr.h:632
@ SMART_ACTION_STOP_MOTION
Definition: SmartScriptMgr.h:704
@ SMART_ACTION_VORTEX_SUMMON
Definition: SmartScriptMgr.h:714
@ SMART_ACTION_MUSIC
Definition: SmartScriptMgr.h:708
@ SMART_ACTION_SET_ORIENTATION_TARGET
Definition: SmartScriptMgr.h:724
@ SMART_ACTION_SET_UNIT_MOVEMENT_FLAGS
Definition: SmartScriptMgr.h:696
@ SMART_ACTION_ADD_AURA
Definition: SmartScriptMgr.h:623
@ SMART_ACTION_THREAT_ALL_PCT
Definition: SmartScriptMgr.h:562
@ SMART_ACTION_RESPAWN_TARGET
Definition: SmartScriptMgr.h:618
@ SMART_ACTION_FOLLOW_GROUP
Definition: SmartScriptMgr.h:723
@ SMART_ACTION_SOUND
Definition: SmartScriptMgr.h:552
@ SMART_ACTION_MOVE_TO_POS_TARGET
Definition: SmartScriptMgr.h:693
@ SMART_ACTION_SET_MOVEMENT_SPEED
Definition: SmartScriptMgr.h:684
@ SMART_ACTION_PLAY_CINEMATIC
Definition: SmartScriptMgr.h:683
@ SMART_ACTION_ADD_NPC_FLAG
Definition: SmartScriptMgr.h:630
@ SMART_ACTION_EVADE
Definition: SmartScriptMgr.h:572
@ SMART_ACTION_FAIL_QUEST
Definition: SmartScriptMgr.h:554
@ SMART_ACTION_INTERRUPT_SPELL
Definition: SmartScriptMgr.h:640
@ SMART_ACTION_ADD_POWER
Definition: SmartScriptMgr.h:657
@ SMART_ACTION_REMOVE_DYNAMIC_FLAG
Definition: SmartScriptMgr.h:644
@ SMART_ACTION_WAYPOINT_DATA_START
Definition: SmartScriptMgr.h:725
@ SMART_ACTION_RANDOM_SOUND
Definition: SmartScriptMgr.h:663
@ SMART_ACTION_RANDOM_MUSIC
Definition: SmartScriptMgr.h:709
@ SMART_ACTION_SET_COMBAT_DISTANCE
Definition: SmartScriptMgr.h:697
@ SMART_ACTION_SET_POWER
Definition: SmartScriptMgr.h:656
@ SMART_ACTION_SEND_TARGET_TO_TARGET
Definition: SmartScriptMgr.h:648
@ SMART_ACTION_REMOVE_POWER
Definition: SmartScriptMgr.h:658
@ SMART_ACTION_ADD_IMMUNITY
Definition: SmartScriptMgr.h:700
@ SMART_ACTION_SET_DYNAMIC_FLAG
Definition: SmartScriptMgr.h:642
@ SMART_ACTION_FALL
Definition: SmartScriptMgr.h:702
@ SMART_ACTION_GO_SET_GO_STATE
Definition: SmartScriptMgr.h:666
@ SMART_ACTION_CUSTOM_CAST
Definition: SmartScriptMgr.h:711
@ SMART_ACTION_REMOVE_ITEM
Definition: SmartScriptMgr.h:605
@ SMART_ACTION_SEND_GO_CUSTOM_ANIM
Definition: SmartScriptMgr.h:641
@ SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL
Definition: SmartScriptMgr.h:551
@ SMART_ACTION_REMOVE_UNIT_FLAG
Definition: SmartScriptMgr.h:567
@ SMART_ACTION_RANDOM_PHASE
Definition: SmartScriptMgr.h:578
@ SMART_ACTION_SET_EMOTE_STATE
Definition: SmartScriptMgr.h:565
@ SMART_ACTION_CROSS_CAST
Definition: SmartScriptMgr.h:634
@ SMART_ACTION_WP_STOP
Definition: SmartScriptMgr.h:603
@ SMART_ACTION_GAME_EVENT_STOP
Definition: SmartScriptMgr.h:659
@ SMART_ACTION_SCRIPTED_SPAWN
Definition: SmartScriptMgr.h:719
@ SMART_ACTION_CALL_SCRIPT_RESET
Definition: SmartScriptMgr.h:626
@ SMART_ACTION_CU_ENCOUNTER_START
Definition: SmartScriptMgr.h:715
@ SMART_ACTION_WP_START
Definition: SmartScriptMgr.h:601
@ SMART_ACTION_COMBAT_STOP
Definition: SmartScriptMgr.h:575
@ SMART_ACTION_EXIT_VEHICLE
Definition: SmartScriptMgr.h:695
@ SMART_ACTION_SET_HEALTH_PCT
Definition: SmartScriptMgr.h:686
@ SMART_ACTION_AUTO_ATTACK
Definition: SmartScriptMgr.h:568
@ SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL
Definition: SmartScriptMgr.h:590
@ SMART_ACTION_SET_VISIBILITY
Definition: SmartScriptMgr.h:595
@ SMART_ACTION_RANDOM_PHASE_RANGE
Definition: SmartScriptMgr.h:579
@ SMART_ACTION_MOVEMENT_PAUSE
Definition: SmartScriptMgr.h:728
@ SMART_ACTION_GO_SET_LOOT_STATE
Definition: SmartScriptMgr.h:647
@ SMART_ACTION_PLAYER_TALK
Definition: SmartScriptMgr.h:713
@ SMART_ACTION_SELF_CAST
Definition: SmartScriptMgr.h:633
@ SMART_ACTION_SET_SWIM
Definition: SmartScriptMgr.h:609
@ SMART_ACTION_SET_SIGHT_DIST
Definition: SmartScriptMgr.h:669
@ SMART_ACTION_SET_INST_DATA
Definition: SmartScriptMgr.h:582
@ SMART_ACTION_REMOVE_GO_FLAG
Definition: SmartScriptMgr.h:654
@ SMART_ACTION_LOAD_GRID
Definition: SmartScriptMgr.h:707
@ SMART_ACTION_CALL_FOR_HELP
Definition: SmartScriptMgr.h:587
@ SMART_ACTION_SUMMON_RADIAL
Definition: SmartScriptMgr.h:721
@ SMART_ACTION_ADD_THREAT
Definition: SmartScriptMgr.h:671
@ SMART_ACTION_TELEPORT
Definition: SmartScriptMgr.h:610
@ SMART_ACTION_PLAYMOVIE
Definition: SmartScriptMgr.h:616
@ SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT
Definition: SmartScriptMgr.h:673
@ SMART_ACTION_FOLLOW
Definition: SmartScriptMgr.h:577
@ SMART_ACTION_PLAY_EMOTE
Definition: SmartScriptMgr.h:553
@ SMART_ACTION_SET_CORPSE_DELAY
Definition: SmartScriptMgr.h:664
@ SMART_ACTION_WAYPOINT_DATA_RANDOM
Definition: SmartScriptMgr.h:726
@ SMART_ACTION_SET_GUID
Definition: SmartScriptMgr.h:718
@ SMART_ACTION_SET_SHEATH
Definition: SmartScriptMgr.h:588
@ SMART_ACTION_SET_ORIENTATION
Definition: SmartScriptMgr.h:614
@ SMART_ACTION_SET_NPC_FLAG
Definition: SmartScriptMgr.h:629
@ SMART_ACTION_MOVE_TO_POS
Definition: SmartScriptMgr.h:617
@ SMART_ACTION_RANDOM_EMOTE
Definition: SmartScriptMgr.h:558
@ SMART_ACTION_INC_EVENT_PHASE
Definition: SmartScriptMgr.h:571
@ SMART_ACTION_CREATE_TIMED_EVENT
Definition: SmartScriptMgr.h:615
@ SMART_ACTION_SET_EVENT_FLAG_RESET
Definition: SmartScriptMgr.h:703
@ SMART_ACTION_DIE
Definition: SmartScriptMgr.h:585
@ SMART_ACTION_RESET_SCRIPT_BASE_OBJECT
Definition: SmartScriptMgr.h:625
@ SMART_ACTION_REMOVE_NPC_FLAG
Definition: SmartScriptMgr.h:631
@ SMART_ACTION_SET_FLY
Definition: SmartScriptMgr.h:608
@ SMART_ACTION_INSTALL_AI_TEMPLATE
Definition: SmartScriptMgr.h:606
@ SMART_ACTION_SUMMON_CREATURE
Definition: SmartScriptMgr.h:560
@ SMART_ACTION_CALL_TIMED_ACTIONLIST
Definition: SmartScriptMgr.h:628
@ SMART_ACTION_SET_IN_COMBAT_WITH_ZONE
Definition: SmartScriptMgr.h:586
@ SMART_ACTION_DO_ACTION
Definition: SmartScriptMgr.h:716
@ SMART_ACTION_SET_HOME_POS
Definition: SmartScriptMgr.h:649
@ SMART_ACTION_ADD_ITEM
Definition: SmartScriptMgr.h:604
@ SMART_ACTION_SET_ACTIVE
Definition: SmartScriptMgr.h:596
@ SMART_ACTION_SET_RANGED_MOVEMENT
Definition: SmartScriptMgr.h:627
@ SMART_ACTION_ACTIVATE_TAXI
Definition: SmartScriptMgr.h:600
@ SMART_ACTION_START_CLOSEST_WAYPOINT
Definition: SmartScriptMgr.h:661
@ SMART_ACTION_SUMMON_CREATURE_GROUP
Definition: SmartScriptMgr.h:655
@ SMART_ACTION_REMOVE_IMMUNITY
Definition: SmartScriptMgr.h:701
@ SMART_ACTION_PLAY_SPELL_VISUAL
Definition: SmartScriptMgr.h:722
@ SMART_ACTION_SET_REACT_STATE
Definition: SmartScriptMgr.h:556
@ SMART_ACTION_RANDOM_MOVE
Definition: SmartScriptMgr.h:637
@ SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT
Definition: SmartScriptMgr.h:624
@ SMART_ACTION_TRIGGER_TIMED_EVENT
Definition: SmartScriptMgr.h:621
@ SMART_ACTION_REMOVEAURASFROMSPELL
Definition: SmartScriptMgr.h:576
@ SMART_ACTION_FLEE
Definition: SmartScriptMgr.h:670
@ SMART_ACTION_ZONE_UNDER_ATTACK
Definition: SmartScriptMgr.h:706
@ FOLLOW_TYPE_CIRCLE
Definition: SmartScriptMgr.h:1924
@ FOLLOW_TYPE_SEMI_CIRCLE_BEHIND
Definition: SmartScriptMgr.h:1925
@ FOLLOW_TYPE_SEMI_CIRCLE_FRONT
Definition: SmartScriptMgr.h:1926
@ FOLLOW_TYPE_COLUMN
Definition: SmartScriptMgr.h:1928
@ FOLLOW_TYPE_ANGULAR
Definition: SmartScriptMgr.h:1929
@ FOLLOW_TYPE_LINE
Definition: SmartScriptMgr.h:1927
SMART_EVENT
Definition: SmartScriptMgr.h:118
@ SMART_EVENT_TIMED_EVENT_TRIGGERED
Definition: SmartScriptMgr.h:178
@ SMART_EVENT_LINK
Definition: SmartScriptMgr.h:180
@ SMART_EVENT_WAYPOINT_REACHED
Definition: SmartScriptMgr.h:159
SmartActionSummonCreatureFlags
Definition: SmartScriptMgr.h:735
@ SMART_ESCORT_TARGETS
Definition: SmartScriptMgr.h:60
std::unordered_map< uint32, WayPoint * > WPPath
Definition: SmartScriptMgr.h:1969
@ SMARTCAST_TRIGGERED
Definition: SmartScriptMgr.h:1912
@ SMARTCAST_COMBAT_MOVE
Definition: SmartScriptMgr.h:1917
@ SMARTCAST_INTERRUPT_PREVIOUS
Definition: SmartScriptMgr.h:1911
@ SMARTCAST_AURA_NOT_PRESENT
Definition: SmartScriptMgr.h:1916
@ SMARTCAST_THREATLIST_NOT_SINGLE
Definition: SmartScriptMgr.h:1918
@ SMARTCAST_TARGET_POWER_MANA
Definition: SmartScriptMgr.h:1919
@ MOTION_SLOT_CONTROLLED
Definition: MotionMaster.h:63
@ MOTION_SLOT_ACTIVE
Definition: MotionMaster.h:62
@ TEXT_RANGE_NORMAL
Definition: CreatureTextMgr.h:30
@ BROADCAST_TEXT_CALL_FOR_HELP
Definition: Language.h:24
@ BROADCAST_TEXT_FLEE_FOR_ASSIST
Definition: Language.h:25
ReactStates
Definition: Unit.h:547
@ MOVEMENTFLAG_ONTRANSPORT
Definition: UnitDefines.h:353
NPCFlags
Non Player Character flags.
Definition: UnitDefines.h:292
SheathState
Definition: UnitDefines.h:104
@ UNIT_STATE_LOST_CONTROL
Definition: UnitDefines.h:191
@ UNIT_STATE_ROOT
Definition: UnitDefines.h:159
@ UNIT_STATE_NO_ENVIRONMENT_UPD
Definition: UnitDefines.h:177
UnitMoveType
Definition: UnitDefines.h:327
@ MOVE_RUN
Definition: UnitDefines.h:329
@ UNIT_FLAG_SILENCED
Definition: UnitDefines.h:242
@ 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
TempSummonType
Definition: Object.h:44
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:47
@ TEMPSUMMON_CORPSE_DESPAWN
Definition: Object.h:49
#define NOMINAL_MELEE_RANGE
Definition: ObjectDefines.h:48
#define MAX_EQUIPMENT_ITEMS
Definition: CreatureData.h:36
LootState
Definition: GameObject.h:110
@ GO_READY
Definition: GameObject.h:112
GOState
Definition: GameObjectData.h:689
@ 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
#define sSpellMgr
Definition: SpellMgr.h:825
phase
Definition: boss_skadi.cpp:103
@ GAMEOBJECT_TYPE_DOOR
Definition: SharedDefines.h:1560
@ POWER_MANA
Definition: SharedDefines.h:269
@ 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
@ SPELL_ATTR2_IGNORE_LINE_OF_SIGHT
Definition: SharedDefines.h:458
@ TEAM_NEUTRAL
Definition: SharedDefines.h:762
SpellCastResult
Definition: SharedDefines.h:948
@ SPELL_FAILED_OUT_OF_RANGE
Definition: SharedDefines.h:1046
@ SPELL_CAST_OK
Definition: SharedDefines.h:1138
@ SPELL_FAILED_SPELL_IN_PROGRESS
Definition: SharedDefines.h:1054
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:133
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:107
Definition: GameObjectAI.h:34
virtual void SetData(uint32, uint32)
Definition: GameObjectAI.h:63
virtual void SetData(uint32, uint32)
Definition: UnitAI.h:214
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:27
Definition: CreatureAI.h:71
void SetInvincibilityHpLevel(uint32 level)
Definition: SmartAI.h:186
void IncPhase(uint32 p)
Definition: SmartScript.cpp:5301
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:3973
void StoreTargetList(ObjectVector const &targets, uint32 id)
Definition: SmartScript.h:83
SmartScriptHolder FindLinkedEvent(uint32 link)
Definition: SmartScript.h:256
void RetryLater(SmartScriptHolder &e, bool ignoreChanceRoll=false)
Definition: SmartScript.cpp:4989
void StoreCounter(uint32 id, uint32 value, uint32 reset, uint32 subtract)
Definition: SmartScript.h:98
void SetPhaseReset(bool allow)
Definition: SmartScript.h:195
void GetTargets(ObjectVector &targets, SmartScriptHolder const &e, WorldObject *invoker=nullptr) const
Definition: SmartScript.cpp:3393
void OnReset()
Definition: SmartScript.cpp:108
void InstallTemplate(SmartScriptHolder const &e)
Definition: SmartScript.cpp:3281
ObjectGuid goOrigGUID
Definition: SmartScript.h:217
void DecPhase(uint32 p)
Definition: SmartScript.cpp:5307
ObjectGuid meOrigGUID
Definition: SmartScript.h:215
Definition: SmartScriptMgr.h:34
uint32 id
Definition: SmartScriptMgr.h:45
Definition: SmartScriptMgr.h:224
uint32 repeatMin
Definition: SmartScriptMgr.h:235
uint32 repeatMax
Definition: SmartScriptMgr.h:236
Definition: SmartScriptMgr.h:746
uint32 followState
Definition: SmartScriptMgr.h:1443
uint32 visualId
Definition: SmartScriptMgr.h:1438
uint32 targetParam2
Definition: SmartScriptMgr.h:849
std::array< uint32, SMART_ACTION_PARAM_COUNT > emotes
Definition: SmartScriptMgr.h:832
struct SmartAction::@74::@162 combatDistance
uint32 repeatMax
Definition: SmartScriptMgr.h:1108
uint32 phaseMin
Definition: SmartScriptMgr.h:934
uint32 targetsLimit
Definition: SmartScriptMgr.h:840
SAIBool transport
Definition: SmartScriptMgr.h:1202
struct SmartAction::@74::@90 crossCast
struct SmartAction::@74::@106 setInstanceData
uint32 newPower
Definition: SmartScriptMgr.h:1260
uint32 startAngle
Definition: SmartScriptMgr.h:1431
SAIBool reset
Definition: SmartScriptMgr.h:1093
std::array< uint32, SMART_ACTION_PARAM_COUNT > actionLists
Definition: SmartScriptMgr.h:1156
struct SmartAction::@74::@167 randomTimedEvent
struct SmartAction::@74::@120 taxi
uint32 delay
Definition: SmartScriptMgr.h:979
uint32 random
Definition: SmartScriptMgr.h:1326
struct SmartAction::@74::@181 cinematic
uint32 quickChange
Definition: SmartScriptMgr.h:1325
uint32 targetParam4
Definition: SmartScriptMgr.h:1455
SAIBool root
Definition: SmartScriptMgr.h:1237
uint32 dist
Definition: SmartScriptMgr.h:919
uint32 group
Definition: SmartScriptMgr.h:1252
struct SmartAction::@74::@116 moveRandom
SAIBool disable
Definition: SmartScriptMgr.h:1380
struct SmartAction::@74::@160 gameEventStart
uint32 spell
Definition: SmartScriptMgr.h:837
struct SmartAction::@74::@115 setData
std::array< uint32, SMART_ACTION_PARAM_COUNT > wps
Definition: SmartScriptMgr.h:1275
struct SmartAction::@74::@133 movie
uint32 minHP
Definition: SmartScriptMgr.h:986
SAIBool force
Definition: SmartScriptMgr.h:1302
struct SmartAction::@74::@182 setGuid
struct SmartAction::@74::@126 setRun
struct SmartAction::@74::@150 setGoLootState
uint32 flags
Definition: SmartScriptMgr.h:846
struct SmartAction::@74::@149 sendGossipMenu
struct SmartAction::@74::@186 spellVisual
uint32 distanceBetweenSummons
Definition: SmartScriptMgr.h:1341
uint32 data
Definition: SmartScriptMgr.h:946
uint32 powerType
Definition: SmartScriptMgr.h:1259
SAIBool regenHealth
Definition: SmartScriptMgr.h:1232
uint32 entry
Definition: SmartScriptMgr.h:921
uint32 quest
Definition: SmartScriptMgr.h:816
struct SmartAction::@74::@83 randomMusic
uint32 triggerFlags
Definition: SmartScriptMgr.h:839
uint32 bp1
Definition: SmartScriptMgr.h:1356
uint32 distance
Definition: SmartScriptMgr.h:779
SAIBool removeObjectFromWorld
Definition: SmartScriptMgr.h:981
uint32 min
Definition: SmartScriptMgr.h:1105
SAIBool withDelayed
Definition: SmartScriptMgr.h:1167
SAIBool withInstant
Definition: SmartScriptMgr.h:1169
uint32 spawnTimerMax
Definition: SmartScriptMgr.h:1415
struct SmartAction::@74::@87 react
struct SmartAction::@74::@153 setHealthRegen
uint32 subtract
Definition: SmartScriptMgr.h:1094
struct SmartAction::@74::@102 follow
struct SmartAction::@74::@179 movementSpeed
struct SmartAction::@74::@171 stopMotion
uint32 a
Definition: SmartScriptMgr.h:1365
struct SmartAction::@74::@78 faction
SAIBool invokerGUID
Definition: SmartScriptMgr.h:1407
uint32 percent
Definition: SmartScriptMgr.h:987
uint32 dec
Definition: SmartScriptMgr.h:903
uint32 milliseconds
Definition: SmartScriptMgr.h:963
struct SmartAction::@74::@152 setRangedMovement
uint32 summonEntry
Definition: SmartScriptMgr.h:1338
uint32 followType
Definition: SmartScriptMgr.h:1444
uint32 instanceTarget
Definition: SmartScriptMgr.h:1375
struct SmartAction::@74::@122 wpPause
uint32 credit
Definition: SmartScriptMgr.h:922
uint32 controlled
Definition: SmartScriptMgr.h:1203
uint32 alternative
Definition: SmartScriptMgr.h:855
struct SmartAction::@74::@107 setInstanceData64
struct SmartAction::@74::@172 coneSummon
uint32 targetParam1
Definition: SmartScriptMgr.h:848
struct SmartAction::@74::@169 immunity
uint32 mapID
Definition: SmartScriptMgr.h:1086
struct SmartAction::@74::@158 power
uint32 stopMovement
Definition: SmartScriptMgr.h:1332
struct SmartAction::@74::@98 setEventPhase
uint32 charges
Definition: SmartScriptMgr.h:914
struct SmartAction::@74::@131 storeTargets
struct SmartAction::@74::@161 closestWaypointFromList
struct SmartAction::@74::@121 wpStart
struct SmartAction::@74::@190 wpDataRandom
uint32 model
Definition: SmartScriptMgr.h:772
struct SmartAction::@74::@113 invincHP
struct SmartAction::@74::@97 combatMove
uint32 duration
Definition: SmartScriptMgr.h:754
struct SmartAction::@74::@109 die
SAIBool attackInvoker
Definition: SmartScriptMgr.h:868
struct SmartAction::@74::@156 goState
SAIBool useTalkTarget
Definition: SmartScriptMgr.h:755
SAIBool run
Definition: SmartScriptMgr.h:1031
struct SmartAction::@74::@174 castCustom
struct SmartAction::@74::@132 timeEvent
uint32 value
Definition: SmartScriptMgr.h:1092
uint32 movementExpired
Definition: SmartScriptMgr.h:1333
struct SmartAction::@74::@76 talk
uint32 targetParam3
Definition: SmartScriptMgr.h:850
uint32 respawnDelay
Definition: SmartScriptMgr.h:1416
struct SmartAction::@74::@148 moveToPos
SAIBool swim
Definition: SmartScriptMgr.h:1081
struct SmartAction::@74::@112 forceDespawn
uint32 combatReach
Definition: SmartScriptMgr.h:1205
uint32 sound2
Definition: SmartScriptMgr.h:785
struct SmartAction::@74::@89 cast
struct SmartAction::@74::@163 sightDistance
uint32 spawnPos
Definition: SmartScriptMgr.h:1296
struct SmartAction::@74::@108 updateTemplate
struct SmartAction::@74::@101 removeAura
struct SmartAction::@74::@189 wpData
struct SmartAction::@74::@117 visibility
uint32 pathId2
Definition: SmartScriptMgr.h:1467
uint32 creature
Definition: SmartScriptMgr.h:771
uint32 spawnTimerMin
Definition: SmartScriptMgr.h:1414
struct SmartAction::@74::@77 simpleTalk
uint32 angle
Definition: SmartScriptMgr.h:920
uint32 field
Definition: SmartScriptMgr.h:945
struct SmartAction::@74::@114 ingamePhaseMask
struct SmartAction::@74::@103 randomPhase
uint32 range
Definition: SmartScriptMgr.h:860
uint32 flag
Definition: SmartScriptMgr.h:1126
struct SmartAction::@74::@187 followGroup
uint32 sound3
Definition: SmartScriptMgr.h:786
uint32 targetsummon
Definition: SmartScriptMgr.h:1020
struct SmartAction::@74::@175 summonVortex
struct SmartAction::@74::@104 randomPhaseRange
struct SmartAction::@74::@110 callHelp
uint32 chance
Definition: SmartScriptMgr.h:1109
uint32 state
Definition: SmartScriptMgr.h:827
struct SmartAction::@74::@147 RespawnTarget
uint32 byte1
Definition: SmartScriptMgr.h:1137
struct SmartAction::@74::@157 creatureGroup
uint32 sound1
Definition: SmartScriptMgr.h:784
struct SmartAction::@74::@173 playerTalk
SAIBool updateLevel
Definition: SmartScriptMgr.h:958
struct SmartAction::@74::@96 autoAttack
struct SmartAction::@74::@124 item
uint32 forceRespawnTimer
Definition: SmartScriptMgr.h:980
struct SmartAction::@74::@146 flee
struct SmartAction::@74::@137 setunitByte
uint32 speed
Definition: SmartScriptMgr.h:1075
struct SmartAction::@74::@119 summonGO
struct SmartAction::@74::@82 music
struct SmartAction::@74::@145 movementFlag
uint32 sound4
Definition: SmartScriptMgr.h:787
uint32 targetType
Definition: SmartScriptMgr.h:847
uint32 repetitions
Definition: SmartScriptMgr.h:1430
struct SmartAction::@74::@118 setActive
struct SmartAction::@74::@123 wpStop
struct SmartAction::@74::@183 scriptSpawn
uint32 aliveState
Definition: SmartScriptMgr.h:924
SAIBool onlySelf
Definition: SmartScriptMgr.h:778
uint32 attackScriptOwner
Definition: SmartScriptMgr.h:869
struct SmartAction::@74::@138 delunitByte
uint32 speedxy
Definition: SmartScriptMgr.h:1179
struct SmartAction::@74::@139 timedActionList
uint32 pointId
Definition: SmartScriptMgr.h:1201
SAIBool attack
Definition: SmartScriptMgr.h:887
uint32 repeatMin
Definition: SmartScriptMgr.h:1107
struct SmartAction::@74::@144 jump
uint32 anim
Definition: SmartScriptMgr.h:1174
uint32 scale
Definition: SmartScriptMgr.h:1423
SAIBool fly
Definition: SmartScriptMgr.h:1074
struct SmartAction::@74::@105 killedMonster
uint32 textGroupID
Definition: SmartScriptMgr.h:753
uint32 castFlags
Definition: SmartScriptMgr.h:838
std::array< uint32, SMART_ACTION_PARAM_COUNT > phases
Definition: SmartScriptMgr.h:929
uint32 spell_id
Definition: SmartScriptMgr.h:1168
SAIBool dontDespawn
Definition: SmartScriptMgr.h:1418
struct SmartAction::@74::@165 setHomePos
uint32 turnAngle
Definition: SmartScriptMgr.h:1327
uint32 textId
Definition: SmartScriptMgr.h:1348
uint32 gossipMenuId
Definition: SmartScriptMgr.h:1210
uint32 speedz
Definition: SmartScriptMgr.h:1180
SAIBool repeat
Definition: SmartScriptMgr.h:1033
uint32 gossipNpcTextId
Definition: SmartScriptMgr.h:1211
uint32 mask
Definition: SmartScriptMgr.h:992
uint32 pathId1
Definition: SmartScriptMgr.h:1466
struct SmartAction::@74::@140 randTimedActionList
uint32 phi_delta
Definition: SmartScriptMgr.h:1368
uint32 count
Definition: SmartScriptMgr.h:1054
struct SmartAction::@74::@177 disableEvade
uint32 inc
Definition: SmartScriptMgr.h:902
uint32 phaseMax
Definition: SmartScriptMgr.h:935
struct SmartAction::@74::@93 summonCreature
uint32 timer
Definition: SmartScriptMgr.h:1385
uint32 ContactDistance
Definition: SmartScriptMgr.h:1204
struct SmartAction::@74::@154 setRoot
uint32 k
Definition: SmartScriptMgr.h:1366
struct SmartAction::@74::@128 setSwim
uint32 distanceBetweenRings
Definition: SmartScriptMgr.h:1340
struct SmartAction::@74::@180 setHealthPct
struct SmartAction::@74::@111 setSheath
uint32 coneLength
Definition: SmartScriptMgr.h:1342
struct SmartAction::@74::@127 setFly
struct SmartAction::@74::@151 sendTargetToTarget
uint32 counterId
Definition: SmartScriptMgr.h:1091
struct SmartAction::@74::@129 teleport
SAIBool withEmote
Definition: SmartScriptMgr.h:969
uint32 max
Definition: SmartScriptMgr.h:1106
uint32 selfJump
Definition: SmartScriptMgr.h:1181
uint32 maxId
Definition: SmartScriptMgr.h:1308
struct SmartAction::@74::@86 questOffer
uint32 r_max
Definition: SmartScriptMgr.h:1367
uint32 speedFraction
Definition: SmartScriptMgr.h:1392
SAIBool fail
Definition: SmartScriptMgr.h:1048
struct SmartAction::@74::@79 morphOrMount
struct SmartAction::@74::@143 sendGoCustomAnim
SAIBool directAdd
Definition: SmartScriptMgr.h:822
struct SmartAction::@74::@185 radialSummon
struct SmartAction::@74::@81 randomSound
uint32 bp2
Definition: SmartScriptMgr.h:1357
uint32 disableGravity
Definition: SmartScriptMgr.h:1076
uint32 sound
Definition: SmartScriptMgr.h:777
struct SmartAction::@74::@134 equip
uint32 threatINC
Definition: SmartScriptMgr.h:875
uint32 coneAngle
Definition: SmartScriptMgr.h:1343
uint32 summonDuration
Definition: SmartScriptMgr.h:1339
uint32 threatDEC
Definition: SmartScriptMgr.h:876
struct SmartAction::@74::@176 doAction
struct SmartAction::@74::@135 unitFlag
uint32 stepAngle
Definition: SmartScriptMgr.h:1432
struct SmartAction::@74::@159 gameEventStop
struct SmartAction::@74::@170 orientation
uint32 reactState
Definition: SmartScriptMgr.h:1036
uint32 speedInteger
Definition: SmartScriptMgr.h:1391
struct SmartAction::@74::@99 incEventPhase
struct SmartAction::@74::@178 corpseDelay
struct SmartAction::@74::@168 setHover
struct SmartAction::@74::@130 setCounter
uint32 index
Definition: SmartScriptMgr.h:1408
struct SmartAction::@74::@142 interruptSpellCasting
uint32 actionId
Definition: SmartScriptMgr.h:1373
uint32 despawnTime
Definition: SmartScriptMgr.h:1019
uint32 goRespawnTime
Definition: SmartScriptMgr.h:1196
uint32 factionID
Definition: SmartScriptMgr.h:766
struct SmartAction::@74::@155 goFlag
uint32 pathId
Definition: SmartScriptMgr.h:1460
SAIBool move
Definition: SmartScriptMgr.h:892
struct SmartAction::@74::@166 loadEquipment
std::array< uint32, MAX_EQUIPMENT_ITEMS > slots
Definition: SmartScriptMgr.h:1121
struct SmartAction::@74::@184 setScale
uint32 movementType
Definition: SmartScriptMgr.h:1390
uint32 questID
Definition: SmartScriptMgr.h:821
uint32 bp3
Definition: SmartScriptMgr.h:1358
uint32 pathID
Definition: SmartScriptMgr.h:1032
uint32 emote
Definition: SmartScriptMgr.h:811
struct SmartAction::@74::@91 activateObject
uint32 id
Definition: SmartScriptMgr.h:1026
uint32 minId
Definition: SmartScriptMgr.h:1307
uint32 phase
Definition: SmartScriptMgr.h:897
struct SmartAction::@74::@88 randomEmote
uint32 sheath
Definition: SmartScriptMgr.h:974
uint32 isNegative
Definition: SmartScriptMgr.h:1374
uint32 creditType
Definition: SmartScriptMgr.h:923
struct SmartAction::@74::@188 orientationTarget
struct SmartAction::@74::@94 threatPCT
float o
Definition: SmartScriptMgr.h:1564
uint32 maxDist
Definition: SmartScriptMgr.h:1570
uint32 range
Definition: SmartScriptMgr.h:1691
float x
Definition: SmartScriptMgr.h:1564
uint32 self
Definition: SmartScriptMgr.h:1693
uint32 amount
Definition: SmartScriptMgr.h:1692
float y
Definition: SmartScriptMgr.h:1564
struct SmartTarget::@193::@197 unitRange
float z
Definition: SmartScriptMgr.h:1564
struct SmartTarget::@193::@214 randomPoint
bool runOnce
Definition: SmartScriptMgr.h:1957
uint32 link
Definition: SmartScriptMgr.h:1942
uint32 event_id
Definition: SmartScriptMgr.h:1941
int32 entryOrGuid
Definition: SmartScriptMgr.h:1939
uint32 GetScriptType() const
Definition: SmartScriptMgr.h:1949
uint32 GetTargetType() const
Definition: SmartScriptMgr.h:1952
uint32 GetActionType() const
Definition: SmartScriptMgr.h:1951
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:337
void Respawn(bool force=false)
Definition: Creature.cpp:2030
void GetRespawnPosition(float &x, float &y, float &z, float *ori=nullptr, float *dist=nullptr) const
Definition: Creature.cpp:2935
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Enable or disable the creature's fly mode by adding or removing: MOVEMENTFLAG_FLYING....
Definition: Creature.cpp:3192
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:339
void LoadEquipment(int8 id=1, bool force=false)
Definition: Creature.cpp:1793
void SendZoneUnderAttackMessage(Player *attacker)
Send a message to LocalDefense channel for players opposition team in the zone.
Definition: Creature.cpp:2796
void GetTransportHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:344
float m_SightDistance
Definition: Creature.h:372
void DoFleeToGetAssistance()
Definition: Creature.cpp:1053
float m_CombatDistance
Definition: Creature.h:372
void SetCorpseDelay(uint32 delay)
Definition: Creature.h:73
void SetRegeneratingHealth(bool enable)
Definition: Creature.h:319
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition: Creature.h:97
void LoadPath(uint32 pathid)
Definition: Creature.h:348
Definition: CreatureData.h:172
uint32 CreatureDisplayID
Definition: CreatureData.h:182
float DisplayScale
Definition: CreatureData.h:183
Definition: CreatureData.h:363
uint32 ItemEntry[MAX_EQUIPMENT_ITEMS]
Definition: CreatureData.h:364
Definition: GossipDef.h:258
void SendCloseGossip()
Definition: GossipDef.cpp:239
void SetGoState(GOState state)
Definition: GameObject.cpp:2477
void UseDoorOrButton(uint32 time_to_restore=0, bool alternative=false, Unit *user=nullptr)
Definition: GameObject.cpp:1429
bool isSpawnedByDefault() const
Definition: GameObject.h:196
void SetLootState(LootState s, Unit *unit=nullptr)
Definition: GameObject.cpp:2442
void SetRespawnTime(int32 respawn)
Definition: GameObject.cpp:1303
GameobjectTypes GetGoType() const
Definition: GameObject.h:204
void Respawn()
Definition: GameObject.cpp:1318
void SendCustomAnim(uint32 anim)
Definition: GameObject.cpp:2150
void DespawnOrUnsummon(Milliseconds delay=0ms, Seconds forcedRespawnTime=0s)
Definition: GameObject.cpp:933
void CastSpell(Unit *target, uint32 spell)
Definition: GameObject.cpp:2085
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:116
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:650
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:2355
Map * FindMap() const
Definition: Object.h:532
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:2626
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:2699
std::string const & GetName() const
Definition: Object.h:458
void AddObjectToRemoveList()
Definition: Object.cpp:2149
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1245
uint32 GetAreaId() const
Definition: Object.cpp:3152
uint32 GetZoneId() const
Definition: Object.cpp:3144
float GetObjectSize() const
Definition: Object.cpp:2771
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:2369
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:2432
virtual float GetCombatReach() const
Definition: Object.h:436
Creature * SummonTrigger(float x, float y, float z, float ang, uint32 dur, bool setLevel=false, CreatureAI *(*GetAI)(Creature *)=nullptr)
Definition: Object.cpp:2404
static ObjectGuid const Empty
Definition: ObjectGuid.h:120
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:1812
bool ActivateTaxiPathTo(std::vector< uint32 > const &nodes, Creature *npc=nullptr, uint32 spellid=1)
Definition: Player.cpp:10230
void SendCinematicStart(uint32 CinematicSequenceId) const
Definition: Player.cpp:5697
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:9358
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:9338
void PrepareGossipMenu(WorldObject *source, uint32 menuId=0, bool showQuests=false)
Definition: PlayerGossip.cpp:32
PlayerMenu * PlayerTalkClass
Definition: Player.h:2219
void RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject *pRewardSource)
Definition: Player.cpp:12733
uint8 getGender() const
Definition: Unit.h:752
void SetFacingTo(float ori)
Definition: Unit.cpp:20483
void CombatStop(bool includingCast=false)
Definition: Unit.cpp:10398
float GetSpeed(UnitMoveType mtype) const
Definition: Unit.cpp:14378
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition: Unit.cpp:13346
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4111
void RemoveAllGameObjects()
Definition: Unit.cpp:6234
float GetSpellMinRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
Definition: Unit.cpp:15122
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition: Unit.cpp:14608
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition: Unit.cpp:10578
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:17658
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool fromRegenerate=false)
Definition: Unit.cpp:15521
MotionMaster * GetMotionMaster()
Definition: Unit.h:1601
void SetUnitMovementFlags(uint32 f)
Definition: Unit.h:1615
void ResumeMovement(uint32 timer=0, uint8 slot=0)
Definition: Unit.cpp:16636
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:1225
void SetInCombatWith(Unit *enemy, uint32 duration=0)
Definition: Unit.cpp:13538
void SetFacingToObject(WorldObject *object)
Definition: Unit.cpp:20493
bool IsAlive() const
Definition: Unit.h:1204
void StopMoving()
Definition: Unit.cpp:16606
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:696
void SendPlaySpellVisual(uint32 id)
Definition: Unit.cpp:18867
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5669
void AddUnitState(uint32 f)
Definition: Unit.h:672
virtual void SetSheath(SheathState sheathed)
Definition: Unit.h:945
float GetSpellMaxRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
Definition: Unit.cpp:15102
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition: Unit.cpp:17990
EventProcessor m_Events
Definition: Unit.h:1792
bool HasUnitMovementFlag(uint32 f) const
Definition: Unit.h:1613
TransportBase * GetDirectTransport() const
Returns the transport this unit is on directly (if on vehicle and transport, return vehicle)
Definition: Unit.cpp:18723
void SendMovementFlagUpdate(bool self=false)
Definition: Unit.cpp:16660
void SetNpcFlag(NPCFlags flags)
Definition: Unit.h:695
virtual bool SetHover(bool enable, bool packetOnly=false, bool updateAnimationTier=true)
Definition: Unit.cpp:20629
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:1168
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:14383
ObjectGuid GetTransGUID() const override
Definition: Unit.cpp:18712
bool IsAIEnabled
Definition: Unit.h:1801
bool HasUnitState(const uint32 f) const
Definition: Unit.h:673
float GetPowerPct(Powers power) const
Definition: Unit.h:880
void SetUInt32Value(uint16 index, uint32 value)
Definition: Unit.cpp:21256
float GetMeleeRange(Unit const *target) const
Definition: Unit.cpp:680
virtual void PauseMovement(uint32 timer=0, uint8 slot=0)
Disable the unit movement by clearing UNIT_STATE_MOVING and stopping the spline.
Definition: Unit.cpp:16625
uint32 GetPower(Powers power) const
Definition: Unit.h:891
void KillSelf(bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition: Unit.h:999
void SetInFront(WorldObject const *target)
Definition: Unit.cpp:20477
void ReplaceAllNpcFlags(NPCFlags flags)
Definition: Unit.h:697
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition: Unit.cpp:10365
bool isDead() const
Definition: Unit.h:1206
void ExitVehicle(Position const *exitPosition=nullptr)
Definition: Unit.cpp:19681
Definition: VehicleDefines.h:106
static CreatureModel const * ChooseDisplayId(CreatureTemplate const *cinfo, CreatureData const *data=nullptr)
Definition: ObjectMgr.cpp:1645
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:351
virtual void DoAction(int32)
Definition: InstanceScript.h:267
static std::string GetBossStateName(uint8 state)
Definition: InstanceScript.cpp:782
void LoadGrid(float x, float y)
Definition: Map.cpp:492
PlayerList const & GetPlayers() const
Definition: Map.h:486
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 MoveFollow(Unit *target, float dist, float angle, MovementSlot slot=MOTION_SLOT_ACTIVE, bool inheritWalkState=true)
The unit will follow this target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:409
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 MovePath(uint32 path_id, bool repeatable)
Move the unit following a specific path. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:849
void MoveIdle()
Definition: MotionMaster.cpp:232
void MoveFall(uint32 id=0, bool addFlagForNPC=false)
The unit will fall. Used when in the air. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:624
void MoveFleeing(Unit *enemy, uint32 time=0)
Enable the target's fleeing movement. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:743
void MoveRandom(float wanderDistance=0.0f)
Enable a random movement in desired range around the unit. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:242
Definition: QuestDef.h:210
Player session in the World.
Definition: WorldSession.h:330
Definition: SpellAuras.h:87
Definition: SpellDefines.h:163
void AddSpellMod(SpellValueMod mod, int32 value)
Definition: SpellDefines.h:165
Definition: SpellInfo.h:316
float GetMinRange(bool positive=false) const
Definition: SpellInfo.cpp:2313
SpellSchoolMask GetSchoolMask() const
Definition: SpellInfo.cpp:1986
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:415
float GetMaxRange(bool positive=false, Unit *caster=nullptr, Spell *spell=nullptr) const
Definition: SpellInfo.cpp:2322
int32 CalcPowerCost(Unit const *caster, SpellSchoolMask schoolMask, Spell *spell=nullptr) const
Definition: SpellInfo.cpp:2400
Definition: ChatTextBuilder.h:31