164{
166
167
169 {
172 return;
173 }
174
175
177
178 if (unit)
180 else if (gob)
182
184 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: Invoker: {} ({})", tempInvoker->GetName(), tempInvoker->GetGUID().ToString());
185
187
190 if (unit)
191 invoker = unit;
192 else if (gob)
193 invoker = gob;
194
196
198 {
200 {
203
205 {
206 if (
IsCreature((target)) && !target->ToCreature()->IsPet())
207 {
209 {
212 }
213 else
215 break;
216 }
218 {
221 break;
222 }
223 }
224
225 if (!talkTarget)
227
228 if (!talker)
229 break;
230
232 {
234 break;
235 }
236
243 break;
244 }
246 {
248 {
252 {
255 }
256
257 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_SIMPLE_TALK: talker: {} ({}), textGroupId: {}",
259 }
260 break;
261 }
263 {
265 {
267 {
268 target->ToUnit()->HandleEmoteCommand(e.
action.
emote.emote);
269 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_PLAY_EMOTE: target: {} ({}), emote: {}",
270 target->GetName(), target->GetGUID().ToString(), e.
action.
emote.emote);
271 }
272 }
273 break;
274 }
276 {
278 {
280 {
283 else
285 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_SOUND: target: {} ({}), sound: {}, onlyself: {}",
287 }
288 }
289 break;
290 }
292 {
300 for (unsigned int sound : sounds)
301 {
302 if (sound)
303 {
304 temp[count] = sound;
305 ++count;
306 }
307 }
308
309 if (count == 0)
310 {
311 break;
312 }
313
315 {
317 {
320 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_RANDOM_SOUND: target: {} ({}), sound: {}, onlyself: {}",
322 }
323 }
324
325 break;
326 }
328 {
330
332 {
334 {
336
338 {
340 if (
Player* player = i->GetSource())
341 {
343 {
345 {
347 targets.push_back(player);
348 }
349 else
350 targets.push_back(player);
351 }
352 }
353 }
354 }
355 }
356 else
358
359 if (!targets.empty())
360 {
362 {
364 {
366 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_MUSIC: target: {} ({}), sound: {}, onlySelf: {}, type: {}",
368 }
369 }
370 }
371 break;
372 }
374 {
376
378 {
380 {
382
384 {
386 if (
Player* player = i->GetSource())
387 {
389 {
391 {
393 targets.push_back(player);
394 }
395 else
396 targets.push_back(player);
397 }
398 }
399 }
400 }
401 }
402 else
404
405 if (targets.empty())
406 break;
407
415 for (unsigned int sound : sounds)
416 {
417 if (sound)
418 {
419 temp[count] = sound;
420 ++count;
421 }
422 }
423
424 if (count == 0)
425 {
426 break;
427 }
428
430 {
432 {
435 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_RANDOM_MUSIC: target: {} ({}), sound: {}, onlyself: {}, type: {}",
437 }
438 }
439
440 break;
441 }
443 {
445 {
447 {
449 {
451 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry {}, GuidLow {} set faction to {}",
453 }
454 else
455 {
457 {
458 if (target->ToCreature()->GetFaction() != ci->faction)
459 {
460 target->ToCreature()->SetFaction(ci->faction);
461 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry {}, GuidLow {} set faction to {}",
462 target->GetEntry(), target->GetGUID().ToString(), ci->faction);
463 }
464 }
465 }
466 }
467 }
468 break;
469 }
471 {
473 {
475 continue;
476
478 {
479
481 {
483 {
486 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry {}, GuidLow {} set displayid to {}",
488 }
489 }
490
491 else
492 {
494 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry {}, GuidLow {} set displayid to {}",
496 }
497 }
498 else
499 {
500 target->ToCreature()->DeMorph();
501 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry {}, GuidLow {} demorphs.",
502 target->GetEntry(), target->GetGUID().ToString());
503 }
504 }
505 break;
506 }
508 {
510 {
512 {
513 target->ToPlayer()->FailQuest(e.
action.
quest.quest);
514 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_FAIL_QUEST: Player guidLow {} fails quest {}",
515 target->GetGUID().ToString(), e.
action.
quest.quest);
516 }
517 }
518 break;
519 }
521 {
523 {
525 {
527 {
529 {
530 if (player->CanTakeQuest(q, true))
531 {
533 {
535 menu.SendQuestGiverQuestDetails(q,
me->
GetGUID(),
true);
536 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_OFFER_QUEST: Player guidLow {} - offering quest {}",
538 }
539 }
540 }
541 else
542 {
543 player->AddQuestAndCheckCompletion(q, nullptr);
544 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_OFFER_QUEST: Player guidLow {} - quest {} added",
546 }
547 }
548 }
549 }
550 break;
551 }
553 {
555 {
557 continue;
558
560 }
561 break;
562 }
564 {
565 std::vector<uint32> emotes;
567 std::back_inserter(emotes), [](
uint32 emote) { return emote != 0; });
568
570 {
572 {
574 target->ToUnit()->HandleEmoteCommand(emote);
575 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_RANDOM_EMOTE: Creature guidLow {} handle random emote {}",
576 target->GetGUID().ToString(), emote);
577 }
578 }
579 break;
580 }
582 {
584 break;
585
587 for (ThreatContainer::StorageType::const_iterator i = threatList.begin(); i != threatList.end(); ++i)
588 {
590 {
592 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_THREAT_ALL_PCT: Creature {} modify threat for unit {}, value {}",
594 }
595 }
596 break;
597 }
599 {
601 break;
602
604 {
606 {
608 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_THREAT_SINGLE_PCT: Creature guidLow {} modify threat for unit {}, value {}",
610 }
611 }
612 break;
613 }
615 {
617 {
618
620 if (
Vehicle* vehicle = target->ToUnit()->GetVehicleKit())
621 for (
auto & Seat : vehicle->
Seats)
623 player->AreaExploredOrEventHappens(e.action.quest.quest);
624
626 {
627 target->ToPlayer()->AreaExploredOrEventHappens(e.
action.
quest.quest);
628
629 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS: Player guidLow {} credited quest {}",
630 target->GetGUID().ToString(), e.
action.
quest.quest);
631 }
632 }
633 break;
634 }
636 {
637 if (targets.empty())
638 break;
639
641
644
647
648 bool failedSpellCast = false, successfulSpellCast = false;
649
651 {
652
655
657 continue;
658
659 if (caster && caster !=
me)
660 {
662 }
664 {
665
667 continue;
668
669
672 break;
673
674
676 continue;
677
678
681
687
689 bool isWithinMeleeRange = distanceToTarget <= meleeRange;
692
695
696
697 if (isWithinLOSInMap && isWithinMeleeRange && isRangedAttack && isTargetRooted && canCastSpell && !
me->
IsVehicle())
698 {
699 failedSpellCast = true;
700
702 continue;
703
704 float minDistance = std::max(meleeRange, spellMinRange) - distanceToTarget +
NOMINAL_MELEE_RANGE;
706 continue;
707 }
708
709
710 if (distanceToTarget > spellMaxRange && isWithinLOSInMap)
711 {
712 failedSpellCast = true;
713
715 continue;
716
718 continue;
719 }
720 else if (distanceToTarget < spellMinRange || !(isWithinLOSInMap || isSpellIgnoreLOS))
721 {
722 failedSpellCast = true;
723
725 continue;
726
728 continue;
729 }
730
733 {
736 else
738 }
739
742
744 {
746 {
747
749
751 else
752
754 }
755 }
756
757 if (spellCastFailed)
758 failedSpellCast = true;
759 else
760 successfulSpellCast = true;
761
762 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_CAST: Unit {} casts spell {} on target {} with castflags {}",
764 }
765 }
766
767
768 if (failedSpellCast && !successfulSpellCast)
769 {
771
772 return;
773 }
774
775 break;
776 }
778 {
779 if (targets.empty())
780 break;
781
784
787 {
789 {
791 }
792 else
793 {
795 }
796 }
797
799 {
801 if (!uTarget)
802 continue;
803
805 {
807 {
809 }
810
812 }
813 }
814 break;
815 }
817 {
818
820 if (!tempLastInvoker)
821 break;
822
823 if (targets.empty())
824 break;
825
828
830 {
832 continue;
833
834 if (!
IsUnit(tempLastInvoker))
835 continue;
836
838 {
840 {
842 }
843
846 {
848 {
850 }
851 else
852 {
854 }
855 }
856
858 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_INVOKER_CAST: Invoker {} casts spell {} on target {} with castflags {}",
860 }
861 else
862 {
863 LOG_DEBUG(
"scripts.ai",
"Spell {} not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target {} already has the aura",
865 }
866 }
867 break;
868 }
870 {
872 {
874 {
876 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_ADD_AURA: Adding aura {} to unit {}",
878 }
879 }
880 break;
881 }
883 {
885 {
887 {
889
890
892 {
894 }
895
897 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_ACTIVATE_GOBJECT. Gameobject {} activated",
go->
GetGUID().
ToString());
898 }
899 }
900
901 break;
902 }
904 {
906 {
908 {
909 target->ToGameObject()->ResetDoorOrButton();
910 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_RESET_GOBJECT. Gameobject {} (entry: {}) reset",
911 target->GetGUID().ToString(), target->GetEntry());
912 }
913 }
914 break;
915 }
917 {
919 {
921 {
923 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_EMOTE_STATE. Unit {} set emotestate to {}",
924 target->GetGUID().ToString(), e.
action.
emote.emote);
925 }
926 }
927 break;
928 }
930 {
932 {
934 {
936 {
938 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit {} added flag {} to UNIT_FIELD_FLAGS",
940 }
941 else
942 {
944 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit {} added flag {} to UNIT_FIELD_FLAGS_2",
946 }
947 }
948 }
949 break;
950 }
952 {
954 {
956 {
958 {
960 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit {} removed flag {} to UNIT_FIELD_FLAGS",
962 }
963 else
964 {
966 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit {} removed flag {} to UNIT_FIELD_FLAGS_2",
968 }
969 }
970 }
971 break;
972 }
974 {
976 break;
977
979 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_AUTO_ATTACK: Creature: {} bool on = {}",
981 break;
982 }
984 {
986 break;
987
990 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_ALLOW_COMBAT_MOVEMENT: Creature {} bool on = {}",
992 break;
993 }
995 {
997 break;
998
1000 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_SET_EVENT_PHASE: Creature {} set event phase {}",
1002 break;
1003 }
1005 {
1007 break;
1008
1011 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_INC_EVENT_PHASE: Creature {} inc event phase by {}, "
1013 break;
1014 }
1016 {
1018 break;
1019
1022 if (target->ToCreature()->IsAIEnabled)
1023 target->ToCreature()->AI()->EnterEvadeMode();
1024
1025 break;
1026 }
1028 {
1029
1031 break;
1032
1035 {
1038 }
1039 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_FLEE_FOR_ASSIST: Creature {} DoFleeToGetAssistance",
me->
GetGUID().
ToString());
1040 break;
1041 }
1043 {
1045 break;
1046
1048 break;
1049 }
1051 {
1053 {
1055 continue;
1056
1058
1061 {
1063 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_CALL_GROUPEVENTHAPPENS: Player {}, group credit for quest {}",
1065 }
1066
1067
1069 {
1070 for (
auto& Seat : vehicle->
Seats)
1071 {
1073 {
1075 }
1076 }
1077 }
1078 }
1079 break;
1080 }
1082 {
1084 {
1086 continue;
1087
1089 {
1091 {
1094 }
1095 else
1097 }
1098 else
1099 target->ToUnit()->RemoveAllAuras();
1100
1101 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_REMOVEAURASFROMSPELL: Unit {}, spell {}",
1103 }
1104 break;
1105 }
1107 {
1109 break;
1110
1112 {
1114 break;
1115 }
1116
1118 {
1120 {
1123 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_FOLLOW: Creature {} following target {}",
1125 break;
1126 }
1127 }
1128 break;
1129 }
1131 {
1133 break;
1134
1135 std::vector<uint32> phases;
1137 std::back_inserter(phases), [](
uint32 phase) { return phase != 0; });
1138
1141 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE: Creature {} sets event phase to {}",
1143 break;
1144 }
1146 {
1148 break;
1149
1152 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE_RANGE: Creature {} sets event phase to {}",
1154 break;
1155 }
1157 {
1159 {
1161 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: (trigger == true) Player {}, Killcredit: {}",
1163 }
1165 {
1167 break;
1168
1170 {
1172 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player {}, Killcredit: {}",
1174 }
1175 }
1176 else
1177 {
1179 {
1181 continue;
1182
1184 if (!player)
1185 continue;
1186
1188 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player {}, Killcredit: {}",
1190 }
1191 }
1192 break;
1193 }
1195 {
1197 if (!obj)
1198 obj = unit;
1199
1200 if (!obj)
1201 break;
1202
1204 if (!instance)
1205 {
1206 LOG_ERROR(
"scripts.ai.sai",
"SmartScript: Event {} attempt to set instance data without instance script. EntryOrGuid {}", e.
GetEventType(), e.
entryOrGuid);
1207 break;
1208 }
1209
1211 {
1212 case 0:
1213 {
1216 } break;
1217 case 1:
1218 {
1221 } break;
1222 default:
1223 {
1224 break;
1225 }
1226 }
1227 break;
1228 }
1230 {
1232 if (!obj)
1233 obj = unit;
1234
1235 if (!obj)
1236 break;
1237
1239 if (!instance)
1240 {
1242 break;
1243 }
1244
1245 if (targets.empty())
1246 break;
1247
1249 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: {}, data: {}",
1251 break;
1252 }
1254 {
1257 target->ToCreature()->UpdateEntry(e.action.updateTemplate.creature, target->ToCreature()->GetCreatureData(), e.action.updateTemplate.updateLevel != 0);
1258 break;
1259 }
1261 {
1263 {
1265 {
1267 {
1268
1270 {
1271 me->KillSelf();
1272 LOG_DEBUG("sql.sql", "SmartScript::ProcessAction: SMART_ACTION_DIE: Creature {}", me->GetGUID().ToString());
1273 }
1275 }
1276 }
1278 {
1281 }
1282 break;
1283 }
1285 {
1286 if (targets.empty())
1287 break;
1288
1290 {
1293
1296 if (
IsPlayer(unit) && !unit->ToPlayer()->isDead())
1297 {
1301 }
1302 }
1303 else
1304 {
1306 {
1308 {
1309 target->ToCreature()->SetInCombatWithZone();
1310 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_SET_IN_COMBAT_WITH_ZONE: Creature {}, target: {}",
1312 }
1313 }
1314 }
1315
1316 break;
1317 }
1319 {
1321 {
1323 {
1326 {
1329 }
1330 LOG_DEBUG(
"scripts.ai",
"SmartScript::ProcessAction: SMART_ACTION_CALL_FOR_HELP: Creature {}, target: {}",
1332 }
1333 }
1334 break;
1335 }
1337 {
1339 {
1341 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction: SMART_ACTION_SET_SHEATH: Creature {}, State: {}",
1343 }
1344 break;
1345 }
1347 {
1349 {
1351 {
1353 LOG_ERROR(
"sql.sql",
"SmartScript: SMART_ACTION_FORCE_DESPAWN has removeObjectFromWorld set. delay and forceRespawnTimer ignored.");
1354
1356 creature->AddObjectToRemoveList();
1359 }
1360 else
1361 {
1363
1364
1365 if (despawnDelay <= 0ms)
1366 despawnDelay = 1ms;
1367
1370 creature->DespawnOrUnsummon(despawnDelay, forceRespawnTimer);
1373 }
1374 }
1375
1376 break;
1377 }
1379 {
1381 {
1386 }
1387 break;
1388 }
1390 {
1392 {
1394 continue;
1395
1397 {
1399 {
1402 }
1403 else
1405 }
1406 else
1407 target->ToUnit()->Dismount();
1408 }
1409 break;
1410 }
1412 {
1414 {
1416 {
1418 if (!ai)
1419 continue;
1420
1423 else
1425 }
1426 }
1427 break;
1428 }
1430 {
1432 {
1434 {
1436
1438 {
1441 else
1443 }
1444 else
1446 }
1448 {
1450
1452 {
1455 else
1457 }
1458 else
1460 }
1461 }
1462 break;
1463 }
1465 {
1467 break;
1468
1469 float x, y, z;
1472 break;
1473 }
1475 {
1477 break;
1478
1480 break;
1481 }
1483 {
1486 target->ToUnit()->SetVisible(!!e.action.visibility.state);
1487
1488 break;
1489 }
1491 {
1493 target->setActive(!!e.action.setActive.state);
1494 break;
1495 }
1497 {
1499 break;
1500
1501 if (targets.empty())
1502 break;
1503
1504
1507 break;
1508 }
1510 {
1512 if (
Unit* unitTarget = target->ToUnit())
1513 unitTarget->AttackStop();
1514 break;
1515 }
1517 {
1521 if (!summoner)
1522 break;
1523
1525
1527 {
1532 {
1535 else
1538 {
1540 summon->AI()->AttackStart(unit);
1542 summon->AI()->AttackStart(
me);
1543 }
1544 }
1545 break;
1546 }
1547
1548 float x, y, z, o;
1550 {
1551 target->GetPosition(x, y, z, o);
1557 {
1559 summon->AI()->AttackStart(unit);
1561 summon->AI()->AttackStart(target->ToUnit());
1563 summon->AI()->AttackStart(
me);
1564 }
1565 }
1566
1568 break;
1569
1571 {
1573 summon->AI()->AttackStart(unit);
1575 summon->AI()->AttackStart(
me);
1576 }
1577 break;
1578 }
1580 {
1582 break;
1583
1584 if (!targets.empty())
1585 {
1586 float x, y, z, o;
1588 {
1589
1590
1591
1592
1593 target->GetPosition(x, y, z, o);
1600 else
1602 }
1603 }
1604
1606 break;
1607
1609 break;
1610 }
1612 {
1614 {
1616 continue;
1617
1618 Unit::Kill(target->ToUnit(), target->ToUnit());
1619 }
1620
1621 break;
1622 }
1624 {
1626 break;
1627 }
1629 {
1631 {
1633 continue;
1634
1636 }
1637 break;
1638 }
1640 {
1642 {
1644 continue;
1645
1647 }
1648 break;
1649 }
1651 {
1653 break;
1654 }
1656 {
1658 {
1663 }
1664 break;
1665 }
1667 {
1669 break;
1670
1672
1675
1676
1678 break;
1679 }
1681 {
1683 {
1685 {
1686 if (
IsSmart(target->ToCreature()))
1688 else
1690 }
1691 }
1692
1693 break;
1694 }
1696 {
1698 break;
1699
1701 break;
1702 }
1704 {
1705 if (!targets.empty())
1706 {
1708 {
1710 {
1713 else
1714 LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SET_COUNTER is not using SmartAI, skipping");
1715 }
1717 {
1720 else
1721 LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SET_COUNTER is not using SmartGameObjectAI, skipping");
1722 }
1723 }
1724 }
1725 else
1727 break;
1728 }
1730 {
1732 break;
1733
1737
1739 {
1741 {
1743 break;
1744 }
1745 }
1746
1749
1754 break;
1755 }
1757 {
1759 break;
1760
1763 break;
1764 }
1766 {
1768 break;
1769
1774 break;
1775 }
1777 {
1779 break;
1780
1782 break;
1783 }
1785 {
1787 break;
1788
1790 {
1791 float randomOri =
frand(0.0f, 2 * M_PI);
1795 break;
1796 }
1797
1799 {
1804 break;
1805 }
1806
1808 {
1812 }
1814 {
1818 }
1819 else if (!targets.empty())
1820 {
1824 }
1825
1826 break;
1827 }
1829 {
1831 {
1833 continue;
1834
1836 }
1837 break;
1838 }
1840 {
1842 break;
1843
1845
1847 {
1849 {
1853 trans->CalculatePassengerPosition(dest.x, dest.y, dest.z);
1854
1857
1858 break;
1859 }
1861 {
1863 {
1872 true,
1873 true,
1875 );
1876
1877 }
1878
1879 break;
1880 }
1881
1882 default:
1883 {
1884
1885 if (targets.empty())
1886 return;
1887 else
1889
1890 float x, y, z;
1892
1897
1899
1900 break;
1901 }
1902 }
1903
1904 break;
1905 }
1907 {
1909 {
1911 {
1914 }
1915 }
1916
1917 break;
1918 }
1920 {
1922 {
1926 {
1927
1930 else
1932 }
1933 }
1934 break;
1935 }
1937 {
1940 target->ToPlayer()->PlayerTalkClass->SendCloseGossip();
1941 break;
1942 }
1944 {
1946 {
1948 {
1949 std::array<uint32, MAX_EQUIPMENT_ITEMS> slot;
1951 {
1953 if (!eInfo)
1954 {
1955 LOG_ERROR(
"sql.sql",
"SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info id {} for creature {}", equipId,
npc->GetEntry());
1956 break;
1957 }
1958
1959 npc->SetCurrentEquipmentId(equipId);
1960
1961 std::copy(std::begin(eInfo->
ItemEntry), std::end(eInfo->
ItemEntry), std::begin(slot));
1962 }
1963 else
1965
1969 }
1970 }
1971 break;
1972 }
1974 {
1979
1984
1988
1992
2000 break;
2001 }
2004
2005
2008 break;
2011 break;
2013 {
2015 {
2017 {
2024 break;
2025 }
2027 {
2034 break;
2035 }
2036 }
2037
2038 break;
2039 }
2042 break;
2045 break;
2047 {
2049 break;
2050
2053
2055 if (
Creature* creature = target->ToCreature())
2056 if (
IsSmart(creature) && creature->GetVictim())
2058 creature->GetMotionMaster()->MoveChase(creature->GetVictim(), attackDistance, attackAngle);
2059
2060 break;
2061 }
2063 {
2065 {
2067 break;
2068 }
2069
2071 {
2073 {
2076 }
2078 {
2081 }
2082 }
2083 break;
2084 }
2086 {
2089 target->ToUnit()->ReplaceAllNpcFlags(
NPCFlags(e.action.unitFlag.flag));
2090 break;
2091 }
2093 {
2096 target->ToUnit()->SetNpcFlag(
NPCFlags(e.action.unitFlag.flag));
2097 break;
2098 }
2100 {
2103 target->ToUnit()->RemoveNpcFlag(
NPCFlags(e.action.unitFlag.flag));
2104 break;
2105 }
2107 {
2108 if (targets.empty())
2109 break;
2110
2112 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);
2113
2115 {
2117 continue;
2118
2120
2121 bool interruptedSpell = false;
2122
2124 {
2126 continue;
2127
2129 {
2131 {
2133 interruptedSpell = true;
2134 }
2135
2137 }
2138 else
2140 }
2141 }
2142 break;
2143 }
2145 {
2146 std::vector<uint32> actionLists;
2148 std::back_inserter(actionLists), [](
uint32 actionList) { return actionList != 0; });
2149
2152 {
2154 break;
2155 }
2156
2158 {
2160 {
2163 }
2165 {
2168 }
2169 }
2170 break;
2171 }
2173 {
2176 {
2178 break;
2179 }
2180
2182 {
2184 {
2187 }
2189 {
2192 }
2193 }
2194 break;
2195 }
2197 {
2200 target->ToPlayer()->ActivateTaxiPathTo(e.action.taxi.id);
2201 break;
2202 }
2204 {
2205 bool foundTarget = false;
2206
2208 {
2210 {
2211 foundTarget = true;
2212
2215 else
2217 }
2218 }
2219
2221 {
2224 else
2226 }
2227 break;
2228 }
2230 {
2233 target->ToUnit()->SetByteFlag(
UNIT_FIELD_BYTES_1, e.action.setunitByte.type, e.action.setunitByte.byte1);
2234 break;
2235 }
2237 {
2240 target->ToUnit()->RemoveByteFlag(
UNIT_FIELD_BYTES_1, e.action.delunitByte.type, e.action.delunitByte.byte1);
2241 break;
2242 }
2244 {
2247 target->ToUnit()->InterruptNonMeleeSpells(e.action.interruptSpellCasting.withDelayed != 0, e.action.interruptSpellCasting.spell_id, e.action.interruptSpellCasting.withInstant != 0);
2248 break;
2249 }
2251 {
2254 target->ToGameObject()->SendCustomAnim(e.action.sendGoCustomAnim.anim);
2255 break;
2256 }
2258 {
2262 break;
2263 }
2265 {
2269 break;
2270 }
2272 {
2276 break;
2277 }
2279 {
2281 {
2283 {
2288 }
2289
2290 break;
2291 }
2292
2293 if (targets.empty())
2294 break;
2295
2296
2298 {
2302 }
2303 else
2304 {
2307 {
2310 }
2311 }
2312
2313 break;
2314 }
2316 {
2319 target->ToGameObject()->SetLootState((
LootState)e.action.setGoLootState.state);
2320 break;
2321 }
2323 {
2326 target->ToGameObject()->SetGoState((
GOState)e.action.goState.state);
2327 break;
2328 }
2330 {
2332
2333 if (!ref)
2334 ref = unit;
2335
2336 if (!ref)
2337 break;
2338
2340 if (!storedTargets)
2341 break;
2342
2344 {
2346 {
2349 else
2350 LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartAI, skipping");
2351 }
2353 {
2356 else
2357 LOG_ERROR(
"sql.sql",
"SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartGameObjectAI, skipping");
2358 }
2359 }
2360 break;
2361 }
2363 {
2365 break;
2366
2367 LOG_DEBUG(
"sql.sql",
"SmartScript::ProcessAction:: SMART_ACTION_SEND_GOSSIP_MENU: gossipMenuId {}, gossipNpcTextId {}",
2369
2371 if (
Player* player = target->ToPlayer())
2372 {
2375 else
2377
2379 }
2380
2381 break;
2382 }
2384 {
2385 if (!targets.empty())
2386 {
2387 float x, y, z, o;
2390 {
2392 {
2395 }
2396 else
2398 }
2399 }
2401 {
2403 {
2404 float x, y, z, o;
2407 }
2408 else
2410 }
2411 break;
2412 }
2414 {
2417 target->ToCreature()->SetRegeneratingHealth(e.action.setHealthRegen.regenHealth);
2418
2419 break;
2420 }
2422 {
2425 target->ToCreature()->SetControlled(e.action.setRoot.root != 0,
UNIT_STATE_ROOT);
2426 break;
2427 }
2429 {
2432 target->ToGameObject()->SetUInt32Value(
GAMEOBJECT_FLAGS, e.action.goFlag.flag);
2433 break;
2434 }
2436 {
2440 break;
2441 }
2443 {
2446 target->ToGameObject()->RemoveFlag(
GAMEOBJECT_FLAGS, e.action.goFlag.flag);
2447 break;
2448 }
2450 {
2451 std::list<TempSummon*> summonList;
2453
2454 for (std::list<TempSummon*>::const_iterator itr = summonList.begin(); itr != summonList.end(); ++itr)
2455 {
2457 (*itr)->AI()->AttackStart(unit);
2459 (*itr)->AI()->AttackStart(
me);
2460 }
2461
2462 break;
2463 }
2465 {
2468 target->ToUnit()->SetPower(
Powers(e.action.power.powerType), e.action.power.newPower);
2469 break;
2470 }
2472 {
2475 target->ToUnit()->SetPower(
Powers(e.action.power.powerType), target->ToUnit()->GetPower(
Powers(e.action.power.powerType)) + e.action.power.newPower);
2476 break;
2477 }
2479 {
2482 target->ToUnit()->SetPower(
Powers(e.action.power.powerType), target->ToUnit()->GetPower(
Powers(e.action.power.powerType)) - e.action.power.newPower);
2483 break;
2484 }
2486 {
2489 {
2490 LOG_ERROR(
"scripts.ai.sai",
"SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_STOP, inactive event (id: {})", eventId);
2491 break;
2492 }
2494 break;
2495 }
2497 {
2500 {
2501 LOG_ERROR(
"scripts.ai.sai",
"SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_START, already activated event (id: {})", eventId);
2502 break;
2503 }
2505 break;
2506 }
2508 {
2509 std::vector<uint32> waypoints;
2511 std::back_inserter(waypoints), [](
uint32 wp) { return wp != 0; });
2512
2513 float distanceToClosest = std::numeric_limits<float>::max();
2515
2517 {
2519 {
2521 {
2522 for (
uint32 wp : waypoints)
2523 {
2525 if (!path || path->empty())
2526 continue;
2527
2528 auto itrWp = path->find(0);
2529 if (itrWp != path->end())
2530 {
2532 {
2533 float distToThisPath = creature->GetDistance(wp->x, wp->y, wp->z);
2534 if (distToThisPath < distanceToClosest)
2535 {
2536 distanceToClosest = distToThisPath;
2537 closestWp = wp;
2538 }
2539 }
2540 }
2541 }
2542
2543 if (closestWp)
2545 }
2546 }
2547 }
2548 break;
2549 }
2551 {
2554 target->ToUnit()->ExitVehicle();
2555
2556 break;
2557 }
2559 {
2562 {
2565 }
2566
2567 break;
2568 }
2570 {
2573 target->ToCreature()->m_CombatDistance = e.action.combatDistance.dist;
2574
2575 break;
2576 }
2578 {
2581 target->ToCreature()->m_SightDistance = e.action.sightDistance.dist;
2582 break;
2583 }
2585 {
2588 target->ToCreature()->GetMotionMaster()->MoveFleeing(
me, e.action.flee.withEmote);
2589 break;
2590 }
2592 {
2595 me->AddThreat(target->ToUnit(), float(e.action.threatPCT.threatINC) - float(e.action.threatPCT.threatDEC));
2596 break;
2597 }
2599 {
2602 target->ToCreature()->LoadEquipment(e.action.loadEquipment.id, e.action.loadEquipment.force != 0);
2603 break;
2604 }
2606 {
2609 break;
2610 }
2612 {
2615 target->ToUnit()->Dismount();
2616 break;
2617 }
2619 {
2622 target->ToUnit()->SetHover(e.action.setHover.state);
2623 break;
2624 }
2626 {
2629 target->ToUnit()->ApplySpellImmune(e.action.immunity.id, e.action.immunity.type, e.action.immunity.value, true);
2630
2631 break;
2632 }
2634 {
2637 target->ToUnit()->ApplySpellImmune(e.action.immunity.id, e.action.immunity.type, e.action.immunity.value, false);
2638 break;
2639 }
2641 {
2644 target->ToUnit()->GetMotionMaster()->MoveFall();
2645
2646 break;
2647 }
2649 {
2651 break;
2652 }
2654 {
2657 target->ToUnit()->RemoveAllGameObjects();
2658 break;
2659 }
2661 {
2663 {
2665 {
2670 }
2671 }
2672 break;
2673 }
2675 {
2679
2680 break;
2681 }
2683 {
2686 if (
Player* player = target->ToUnit()->GetCharmerOrOwnerPlayerOrPlayerItself())
2687 {
2689 break;
2690 }
2691
2692 break;
2693 }
2695 {
2698 break;
2699 }
2701 {
2703
2704 if (!targets.empty())
2708
2709 break;
2710 }
2712 {
2714 break;
2715
2717 {
2719 {
2721 {
2723 }
2724
2726 {
2727
2728
2729
2730 bool _allowMove = false;
2733
2738 _allowMove = true;
2739
2741 }
2742
2744 {
2753 }
2754 }
2755 }
2756 break;
2757 }
2759 {
2761 break;
2762
2763 if (targets.empty())
2764 break;
2765
2767
2772
2773
2774
2775
2776
2777 float factor = std::exp(k * delta_phi);
2778
2779
2780 float summonRadius = a;
2781
2783 {
2784
2785
2787
2788 do
2789 {
2791 summonPosition.RelocatePolarOffset(phi, summonRadius);
2792
2794
2795 phi += delta_phi;
2796 summonRadius *= factor;
2797 } while (summonRadius <= r_max);
2798 }
2799
2800 break;
2801 }
2803 {
2805 break;
2806
2808
2811
2813 {
2814 float deltaAngle = 0.0f;
2815 if (radius > 0)
2816 deltaAngle = distInARow / radius;
2817
2819 if (deltaAngle > 0)
2820 count += coneAngle / deltaAngle;
2821
2822 float currentAngle = -static_cast<float>(count) * deltaAngle / 2.0f;
2823
2826 else if (!targets.empty())
2827 {
2829 }
2830
2831 for (
uint32 index = 0; index < count; ++index)
2832 {
2834 spawnPosition.RelocatePolarOffset(currentAngle, radius);
2835 currentAngle += deltaAngle;
2836
2838 }
2839 }
2840
2841 break;
2842 }
2844 {
2846 {
2848 {
2849 playerTarget->RemoveArenaSpellCooldowns();
2851 playerTarget->RemoveAurasDueToSpell(57723);
2852 playerTarget->RemoveAurasDueToSpell(2825);
2853 playerTarget->RemoveAurasDueToSpell(32182);
2854 }
2855 }
2856
2857 break;
2858 }
2860 {
2863 {
2864 if (targets.empty())
2865 break;
2866
2868 {
2870 {
2872 {
2873 unitTarget->AI()->DoAction(actionId);
2874 }
2875 }
2877 {
2878 gobjTarget->AI()->DoAction(actionId);
2879 }
2880 }
2881
2882 }
2883 else
2884 {
2887 {
2888 instanceScript = baseObj->GetInstanceScript();
2889 }
2890
2892 {
2894 }
2895
2896 if (instanceScript)
2897 {
2898 instanceScript->
DoAction(actionId);
2899 }
2900 }
2901 break;
2902 }
2904 {
2906 break;
2907
2909 break;
2910 }
2912 {
2914 {
2917 }
2918 break;
2919 }
2921 {
2923 if (
Unit* targetUnit = target->ToUnit())
2924 targetUnit->SetHealth(targetUnit->CountPctFromMaxHealth(e.action.setHealthPct.percent));
2925 break;
2926 }
2928 {
2931 float speed = float(speedInteger) + float(speedFraction) / std::pow(10, std::floor(std::log10(float(speedFraction ? speedFraction : 1)) + 1));
2932
2935 target->ToCreature()->SetSpeed(
UnitMoveType(e.action.movementSpeed.movementType), speed);
2936
2937 break;
2938 }
2940 {
2942 {
2944 continue;
2945
2947 }
2948 break;
2949 }
2951 {
2953 {
2955
2957 {
2959 {
2960 guidToSend = invoker->
GetGUID();
2961 }
2962 }
2963
2965 {
2967 }
2969 {
2971 }
2972 }
2973 break;
2974 }
2976 {
2977
2979 {
2980 case 0:
2981 {
2983 {
2985 {
2988 c->DespawnOrUnsummon();
2989 }
2990 }
2991 break;
2992 }
2993 case 1:
2994 {
2996 {
2998 {
3000 c->Respawn(true);
3002 }
3003 }
3004 break;
3005 }
3006 case 2:
3007 {
3009 {
3011 {
3013
3014
3017 else
3018 c->Respawn(true);
3019
3020
3023
3024
3027 }
3028 }
3029 break;
3030 }
3031 default:
3032 break;
3033 }
3034 break;
3035 }
3037 {
3039
3041 {
3043 {
3045 }
3046 }
3047 break;
3048 }
3050 {
3052 break;
3053
3055
3058
3060 {
3062 {
3066 }
3067 break;
3068 }
3069
3071 {
3072 float currentAngle = startAngle + (itr * stepAngle);
3074 }
3075
3076 break;
3077 }
3079 {
3081 {
3083 {
3086 }
3087 }
3088 break;
3089 }
3091 {
3093 {
3096 target->ToCreature()->GetMotionMaster()->MoveIdle();
3097
3098 break;
3099 }
3100
3101 uint8 membCount = targets.size();
3105 {
3107 {
3108 float angle = (membCount > 4 ? (M_PI * 2)/membCount : (M_PI / 2));
3110 {
3112 {
3114 itr++;
3115 }
3116 }
3117 break;
3118 }
3120 {
3122 {
3124 {
3126 itr++;
3127 }
3128 }
3129 break;
3130 }
3132 {
3134 {
3136 {
3138 itr++;
3139 }
3140 }
3141 break;
3142 }
3144 {
3146 {
3148 {
3150 itr++;
3151 }
3152 }
3153 break;
3154 }
3156 {
3158 {
3160 {
3162 itr++;
3163 }
3164 }
3165 break;
3166 }
3168 {
3170 {
3172 {
3174 itr++;
3175 }
3176 }
3177 break;
3178 }
3179 default:
3180 break;
3181 }
3182
3183 break;
3184 }
3186 {
3188 {
3189 case 0:
3190 {
3192 target->ToCreature()->SetFacingTo((target->ToCreature()->HasUnitMovementFlag(
MOVEMENTFLAG_ONTRANSPORT) && target->ToCreature()->GetTransGUID() ? target->ToCreature()->GetTransportHomePosition() : target->ToCreature()->GetHomePosition()).GetOrientation());
3193
3194 break;
3195 }
3196 case 1:
3197 {
3199 target->ToCreature()->SetFacingTo(e.target.o);
3200
3201 break;
3202 }
3203 case 2:
3204 {
3206 target->ToCreature()->SetFacingToObject(
me);
3207
3208 break;
3209 }
3210 case 3:
3211 {
3213 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);
3214
3217 target->ToCreature()->SetFacingToObject(facingTarget);
3218
3219 break;
3220 }
3221 default:
3222 break;
3223 }
3224 break;
3225 }
3227 {
3229 {
3231 {
3233 {
3236 }
3237 }
3238 }
3239
3240 break;
3241 }
3243 {
3245 {
3247 {
3249 {
3253 }
3254 }
3255 }
3256
3257 break;
3258 }
3260 {
3263 target->ToUnit()->StopMoving();
3264
3265 break;
3266 }
3268 {
3271 target->ToUnit()->PauseMovement(e.action.move.timer);
3272
3273 break;
3274 }
3276 {
3279 target->ToUnit()->ResumeMovement(e.action.move.timer);
3280
3281 break;
3282 }
3284 {
3286 break;
3287 }
3289 {
3292 {
3295 }
3296 break;
3297 }
3298 default:
3300 break;
3301 }
3302
3304 {
3306 if (linked.has_value())
3307 {
3308 auto& linkedEvent = linked.value().get();
3310 executionStack.emplace_back(SmartScriptFrame{ linkedEvent, unit, var0, var1, bvar, spell, gob });
3311 else
3312 LOG_ERROR(
"sql.sql",
"SmartScript::ProcessAction: Entry {} SourceType {}, Event {}, Link Event {} found but has wrong type (should be 61, is {}).", e.
entryOrGuid, e.
GetScriptType(), e.
event_id, e.
link, linkedEvent.GetEventType());
3313 }
3314 else
3316 }
3317}
npc
Definition BattlegroundSA.h:47
#define DEFAULT_LOCALE
Definition Common.h:79
#define MAX_EQUIPMENT_ITEMS
Definition CreatureData.h:35
@ TEXT_RANGE_NORMAL
Definition CreatureTextMgr.h:30
std::int8_t int8
Definition Define.h:105
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:27
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition Duration.h:30
#define sGameEventMgr
Definition GameEventMgr.h:201
GOState
Definition GameObjectData.h:688
LootState
Definition GameObject.h:109
@ GO_READY
Definition GameObject.h:111
EncounterState
Definition InstanceScript.h:57
@ BROADCAST_TEXT_CALL_FOR_HELP
Definition Language.h:24
@ BROADCAST_TEXT_FLEE_FOR_ASSIST
Definition Language.h:25
@ MOTION_SLOT_CONTROLLED
Definition MotionMaster.h:65
@ MOTION_SLOT_ACTIVE
Definition MotionMaster.h:64
#define NOMINAL_MELEE_RANGE
Definition ObjectDefines.h:48
#define sObjectMgr
Definition ObjectMgr.h:1650
TempSummonType
Definition Object.h:46
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:49
@ TEMPSUMMON_CORPSE_DESPAWN
Definition Object.h:51
float frand(float min, float max)
Definition Random.cpp:57
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const guid)
Definition ScriptedGossip.cpp:45
void ClearGossipMenuFor(Player *player)
Definition ScriptedGossip.cpp:22
@ 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
@ SMART_EVENT_FLAG_TEMP_IGNORE_CHANCE_ROLL
Definition SmartScriptMgr.h:1936
SMARTAI_TARGETS
Definition SmartScriptMgr.h:1526
@ SMART_TARGET_RANDOM_POINT
Definition SmartScriptMgr.h:1565
#define sSmartWaypointMgr
Definition SmartScriptMgr.h:2237
SMART_ACTION
Definition SmartScriptMgr.h:557
@ SMART_ACTION_REMOVE_TIMED_EVENT
Definition SmartScriptMgr.h:632
@ SMART_ACTION_NONE
Definition SmartScriptMgr.h:558
@ SMART_ACTION_SET_GO_FLAG
Definition SmartScriptMgr.h:662
@ SMART_ACTION_WP_RESUME
Definition SmartScriptMgr.h:623
@ SMART_ACTION_UPDATE_TEMPLATE
Definition SmartScriptMgr.h:594
@ SMART_ACTION_SET_HEALTH_REGEN
Definition SmartScriptMgr.h:660
@ SMART_ACTION_ACTIVATE_GOBJECT
Definition SmartScriptMgr.h:567
@ SMART_ACTION_GAME_EVENT_START
Definition SmartScriptMgr.h:670
@ SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST
Definition SmartScriptMgr.h:646
@ SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1
Definition SmartScriptMgr.h:649
@ SMART_ACTION_SET_INST_DATA64
Definition SmartScriptMgr.h:593
@ SMART_ACTION_SET_FACTION
Definition SmartScriptMgr.h:560
@ SMART_ACTION_THREAT_SINGLE_PCT
Definition SmartScriptMgr.h:571
@ SMART_ACTION_OFFER_QUEST
Definition SmartScriptMgr.h:565
@ SMART_ACTION_REMOVE_ALL_GAMEOBJECTS
Definition SmartScriptMgr.h:684
@ SMART_ACTION_RISE_UP
Definition SmartScriptMgr.h:672
@ SMART_ACTION_SET_INGAME_PHASE_MASK
Definition SmartScriptMgr.h:602
@ SMART_ACTION_SET_UNIT_FIELD_BYTES_1
Definition SmartScriptMgr.h:648
@ SMART_ACTION_CLOSE_GOSSIP
Definition SmartScriptMgr.h:630
@ SMART_ACTION_DISABLE_EVADE
Definition SmartScriptMgr.h:675
@ SMART_ACTION_CONE_SUMMON
Definition SmartScriptMgr.h:722
@ SMART_ACTION_ADD_GO_FLAG
Definition SmartScriptMgr.h:663
@ SMART_ACTION_ADD_DYNAMIC_FLAG
Definition SmartScriptMgr.h:653
@ SMART_ACTION_KILL_UNIT
Definition SmartScriptMgr.h:609
@ SMART_ACTION_LOAD_EQUIPMENT
Definition SmartScriptMgr.h:682
@ SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS
Definition SmartScriptMgr.h:573
@ SMART_ACTION_ATTACK_START
Definition SmartScriptMgr.h:607
@ SMART_ACTION_MOVEMENT_RESUME
Definition SmartScriptMgr.h:739
@ SMART_ACTION_SET_UNIT_FLAG
Definition SmartScriptMgr.h:576
@ SMART_ACTION_NO_ENVIRONMENT_UPDATE
Definition SmartScriptMgr.h:715
@ SMART_ACTION_CALL_GROUPEVENTHAPPENS
Definition SmartScriptMgr.h:584
@ SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL
Definition SmartScriptMgr.h:601
@ SMART_ACTION_INVOKER_CAST
Definition SmartScriptMgr.h:692
@ SMART_ACTION_MOVEMENT_STOP
Definition SmartScriptMgr.h:737
@ SMART_ACTION_SET_SCALE
Definition SmartScriptMgr.h:730
@ SMART_ACTION_JUMP_TO_POS
Definition SmartScriptMgr.h:655
@ SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST
Definition SmartScriptMgr.h:645
@ SMART_ACTION_SEND_GOSSIP_MENU
Definition SmartScriptMgr.h:656
@ SMART_ACTION_SET_COUNTER
Definition SmartScriptMgr.h:621
@ SMART_ACTION_FLEE_FOR_ASSIST
Definition SmartScriptMgr.h:583
@ SMART_ACTION_EQUIP
Definition SmartScriptMgr.h:629
@ SMART_ACTION_SET_ROOT
Definition SmartScriptMgr.h:661
@ SMART_ACTION_ATTACK_STOP
Definition SmartScriptMgr.h:727
@ SMART_ACTION_SUMMON_GO
Definition SmartScriptMgr.h:608
@ SMART_ACTION_SET_HOVER
Definition SmartScriptMgr.h:709
@ SMART_ACTION_WP_PAUSE
Definition SmartScriptMgr.h:612
@ SMART_ACTION_SIMPLE_TALK
Definition SmartScriptMgr.h:642
@ SMART_ACTION_STOP_MOTION
Definition SmartScriptMgr.h:714
@ SMART_ACTION_VORTEX_SUMMON
Definition SmartScriptMgr.h:724
@ SMART_ACTION_WORLD_SCRIPT
Definition SmartScriptMgr.h:740
@ SMART_ACTION_MUSIC
Definition SmartScriptMgr.h:718
@ SMART_ACTION_SET_ORIENTATION_TARGET
Definition SmartScriptMgr.h:734
@ SMART_ACTION_SET_UNIT_MOVEMENT_FLAGS
Definition SmartScriptMgr.h:706
@ SMART_ACTION_ADD_AURA
Definition SmartScriptMgr.h:633
@ SMART_ACTION_THREAT_ALL_PCT
Definition SmartScriptMgr.h:572
@ SMART_ACTION_RESPAWN_TARGET
Definition SmartScriptMgr.h:628
@ SMART_ACTION_FOLLOW_GROUP
Definition SmartScriptMgr.h:733
@ SMART_ACTION_SOUND
Definition SmartScriptMgr.h:562
@ SMART_ACTION_MOVE_TO_POS_TARGET
Definition SmartScriptMgr.h:703
@ SMART_ACTION_SET_MOVEMENT_SPEED
Definition SmartScriptMgr.h:694
@ SMART_ACTION_PLAY_CINEMATIC
Definition SmartScriptMgr.h:693
@ SMART_ACTION_ADD_NPC_FLAG
Definition SmartScriptMgr.h:640
@ SMART_ACTION_EVADE
Definition SmartScriptMgr.h:582
@ SMART_ACTION_FAIL_QUEST
Definition SmartScriptMgr.h:564
@ SMART_ACTION_INTERRUPT_SPELL
Definition SmartScriptMgr.h:650
@ SMART_ACTION_ADD_POWER
Definition SmartScriptMgr.h:667
@ SMART_ACTION_REMOVE_DYNAMIC_FLAG
Definition SmartScriptMgr.h:654
@ SMART_ACTION_WAYPOINT_DATA_START
Definition SmartScriptMgr.h:735
@ SMART_ACTION_RANDOM_SOUND
Definition SmartScriptMgr.h:673
@ SMART_ACTION_RANDOM_MUSIC
Definition SmartScriptMgr.h:719
@ SMART_ACTION_SET_COMBAT_DISTANCE
Definition SmartScriptMgr.h:707
@ SMART_ACTION_SET_POWER
Definition SmartScriptMgr.h:666
@ SMART_ACTION_SEND_TARGET_TO_TARGET
Definition SmartScriptMgr.h:658
@ SMART_ACTION_REMOVE_POWER
Definition SmartScriptMgr.h:668
@ SMART_ACTION_ADD_IMMUNITY
Definition SmartScriptMgr.h:710
@ SMART_ACTION_SET_DYNAMIC_FLAG
Definition SmartScriptMgr.h:652
@ SMART_ACTION_FALL
Definition SmartScriptMgr.h:712
@ SMART_ACTION_GO_SET_GO_STATE
Definition SmartScriptMgr.h:676
@ SMART_ACTION_CUSTOM_CAST
Definition SmartScriptMgr.h:721
@ SMART_ACTION_REMOVE_ITEM
Definition SmartScriptMgr.h:615
@ SMART_ACTION_SEND_GO_CUSTOM_ANIM
Definition SmartScriptMgr.h:651
@ SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL
Definition SmartScriptMgr.h:561
@ SMART_ACTION_REMOVE_UNIT_FLAG
Definition SmartScriptMgr.h:577
@ SMART_ACTION_RANDOM_PHASE
Definition SmartScriptMgr.h:588
@ SMART_ACTION_SET_EMOTE_STATE
Definition SmartScriptMgr.h:575
@ SMART_ACTION_CROSS_CAST
Definition SmartScriptMgr.h:644
@ SMART_ACTION_WP_STOP
Definition SmartScriptMgr.h:613
@ SMART_ACTION_GAME_EVENT_STOP
Definition SmartScriptMgr.h:669
@ SMART_ACTION_SCRIPTED_SPAWN
Definition SmartScriptMgr.h:729
@ SMART_ACTION_CALL_SCRIPT_RESET
Definition SmartScriptMgr.h:636
@ SMART_ACTION_CU_ENCOUNTER_START
Definition SmartScriptMgr.h:725
@ SMART_ACTION_WP_START
Definition SmartScriptMgr.h:611
@ SMART_ACTION_COMBAT_STOP
Definition SmartScriptMgr.h:585
@ SMART_ACTION_EXIT_VEHICLE
Definition SmartScriptMgr.h:705
@ SMART_ACTION_SET_HEALTH_PCT
Definition SmartScriptMgr.h:696
@ SMART_ACTION_AUTO_ATTACK
Definition SmartScriptMgr.h:578
@ SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL
Definition SmartScriptMgr.h:600
@ SMART_ACTION_SET_VISIBILITY
Definition SmartScriptMgr.h:605
@ SMART_ACTION_RANDOM_PHASE_RANGE
Definition SmartScriptMgr.h:589
@ SMART_ACTION_MOVEMENT_PAUSE
Definition SmartScriptMgr.h:738
@ SMART_ACTION_GO_SET_LOOT_STATE
Definition SmartScriptMgr.h:657
@ SMART_ACTION_PLAYER_TALK
Definition SmartScriptMgr.h:723
@ SMART_ACTION_SELF_CAST
Definition SmartScriptMgr.h:643
@ SMART_ACTION_SET_SWIM
Definition SmartScriptMgr.h:619
@ SMART_ACTION_SET_SIGHT_DIST
Definition SmartScriptMgr.h:679
@ SMART_ACTION_SET_INST_DATA
Definition SmartScriptMgr.h:592
@ SMART_ACTION_REMOVE_GO_FLAG
Definition SmartScriptMgr.h:664
@ SMART_ACTION_LOAD_GRID
Definition SmartScriptMgr.h:717
@ SMART_ACTION_CALL_FOR_HELP
Definition SmartScriptMgr.h:597
@ SMART_ACTION_SUMMON_RADIAL
Definition SmartScriptMgr.h:731
@ SMART_ACTION_ADD_THREAT
Definition SmartScriptMgr.h:681
@ SMART_ACTION_DISMOUNT
Definition SmartScriptMgr.h:708
@ SMART_ACTION_TELEPORT
Definition SmartScriptMgr.h:620
@ SMART_ACTION_PLAYMOVIE
Definition SmartScriptMgr.h:626
@ SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT
Definition SmartScriptMgr.h:683
@ SMART_ACTION_FOLLOW
Definition SmartScriptMgr.h:587
@ SMART_ACTION_PLAY_EMOTE
Definition SmartScriptMgr.h:563
@ SMART_ACTION_SET_CORPSE_DELAY
Definition SmartScriptMgr.h:674
@ SMART_ACTION_WAYPOINT_DATA_RANDOM
Definition SmartScriptMgr.h:736
@ SMART_ACTION_SET_GUID
Definition SmartScriptMgr.h:728
@ SMART_ACTION_SET_SHEATH
Definition SmartScriptMgr.h:598
@ SMART_ACTION_SET_ORIENTATION
Definition SmartScriptMgr.h:624
@ SMART_ACTION_SET_NPC_FLAG
Definition SmartScriptMgr.h:639
@ SMART_ACTION_MOVE_TO_POS
Definition SmartScriptMgr.h:627
@ SMART_ACTION_RANDOM_EMOTE
Definition SmartScriptMgr.h:568
@ SMART_ACTION_INC_EVENT_PHASE
Definition SmartScriptMgr.h:581
@ SMART_ACTION_CREATE_TIMED_EVENT
Definition SmartScriptMgr.h:625
@ SMART_ACTION_SET_EVENT_FLAG_RESET
Definition SmartScriptMgr.h:713
@ SMART_ACTION_DIE
Definition SmartScriptMgr.h:595
@ SMART_ACTION_RESET_SCRIPT_BASE_OBJECT
Definition SmartScriptMgr.h:635
@ SMART_ACTION_REMOVE_NPC_FLAG
Definition SmartScriptMgr.h:641
@ SMART_ACTION_SET_FLY
Definition SmartScriptMgr.h:618
@ SMART_ACTION_INSTALL_AI_TEMPLATE
Definition SmartScriptMgr.h:616
@ SMART_ACTION_SUMMON_CREATURE
Definition SmartScriptMgr.h:570
@ SMART_ACTION_CALL_TIMED_ACTIONLIST
Definition SmartScriptMgr.h:638
@ SMART_ACTION_SET_IN_COMBAT_WITH_ZONE
Definition SmartScriptMgr.h:596
@ SMART_ACTION_DO_ACTION
Definition SmartScriptMgr.h:726
@ SMART_ACTION_SET_HOME_POS
Definition SmartScriptMgr.h:659
@ SMART_ACTION_ADD_ITEM
Definition SmartScriptMgr.h:614
@ SMART_ACTION_SET_ACTIVE
Definition SmartScriptMgr.h:606
@ SMART_ACTION_SET_RANGED_MOVEMENT
Definition SmartScriptMgr.h:637
@ SMART_ACTION_ACTIVATE_TAXI
Definition SmartScriptMgr.h:610
@ SMART_ACTION_START_CLOSEST_WAYPOINT
Definition SmartScriptMgr.h:671
@ SMART_ACTION_SUMMON_CREATURE_GROUP
Definition SmartScriptMgr.h:665
@ SMART_ACTION_REMOVE_IMMUNITY
Definition SmartScriptMgr.h:711
@ SMART_ACTION_PLAY_SPELL_VISUAL
Definition SmartScriptMgr.h:732
@ SMART_ACTION_SET_REACT_STATE
Definition SmartScriptMgr.h:566
@ SMART_ACTION_DISABLE_REWARD
Definition SmartScriptMgr.h:741
@ SMART_ACTION_RANDOM_MOVE
Definition SmartScriptMgr.h:647
@ SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT
Definition SmartScriptMgr.h:634
@ SMART_ACTION_TRIGGER_TIMED_EVENT
Definition SmartScriptMgr.h:631
@ SMART_ACTION_REMOVEAURASFROMSPELL
Definition SmartScriptMgr.h:586
@ SMART_ACTION_FLEE
Definition SmartScriptMgr.h:680
@ SMART_ACTION_ZONE_UNDER_ATTACK
Definition SmartScriptMgr.h:716
@ FOLLOW_TYPE_CIRCLE
Definition SmartScriptMgr.h:1954
@ FOLLOW_TYPE_SEMI_CIRCLE_BEHIND
Definition SmartScriptMgr.h:1955
@ FOLLOW_TYPE_SEMI_CIRCLE_FRONT
Definition SmartScriptMgr.h:1956
@ FOLLOW_TYPE_COLUMN
Definition SmartScriptMgr.h:1958
@ FOLLOW_TYPE_ANGULAR
Definition SmartScriptMgr.h:1959
@ FOLLOW_TYPE_LINE
Definition SmartScriptMgr.h:1957
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:747
@ SMART_ESCORT_TARGETS
Definition SmartScriptMgr.h:59
std::unordered_map< uint32, WayPoint * > WPPath
Definition SmartScriptMgr.h:1999
@ SMARTCAST_TRIGGERED
Definition SmartScriptMgr.h:1942
@ SMARTCAST_COMBAT_MOVE
Definition SmartScriptMgr.h:1947
@ SMARTCAST_INTERRUPT_PREVIOUS
Definition SmartScriptMgr.h:1941
@ SMARTCAST_AURA_NOT_PRESENT
Definition SmartScriptMgr.h:1946
@ SMARTCAST_THREATLIST_NOT_SINGLE
Definition SmartScriptMgr.h:1948
@ SMARTCAST_TARGET_POWER_MANA
Definition SmartScriptMgr.h:1949
@ AURA_REMOVE_BY_EXPIRE
Definition SpellAuraDefines.h:395
@ SPELLVALUE_BASE_POINT1
Definition SpellDefines.h:114
@ SPELLVALUE_BASE_POINT2
Definition SpellDefines.h:115
@ SPELLVALUE_BASE_POINT0
Definition SpellDefines.h:113
TriggerCastFlags
Definition SpellDefines.h:132
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
Definition SpellDefines.h:150
@ TRIGGERED_NONE
Definition SpellDefines.h:133
#define sSpellMgr
Definition SpellMgr.h:825
#define CAST_AI(a, b)
Definition UnitAI.h:26
#define ENSURE_AI(a, b)
Definition UnitAI.h:27
@ MOVEMENTFLAG_ONTRANSPORT
Definition UnitDefines.h:374
NPCFlags
Non Player Character flags.
Definition UnitDefines.h:313
SheathState
Definition UnitDefines.h:125
@ UNIT_STATE_LOST_CONTROL
Definition UnitDefines.h:212
@ UNIT_STATE_ROOT
Definition UnitDefines.h:180
@ UNIT_STATE_NO_ENVIRONMENT_UPD
Definition UnitDefines.h:198
UnitMoveType
Definition UnitDefines.h:348
@ MOVE_RUN
Definition UnitDefines.h:350
@ UNIT_FLAG_SILENCED
Definition UnitDefines.h:263
ReactStates
Definition Unit.h:548
@ 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
#define sWorldState
Definition WorldState.h:202
WorldStateEvent
Definition WorldState.h:41
Say
Definition boss_broodlord_lashlayer.cpp:29
Seats
Definition boss_flame_leviathan.cpp:168
phase
Definition boss_skadi.cpp:103
Definition ChatTextBuilder.h:31
Definition SpellAuras.h:87
Definition CreatureAI.h:70
void SetReputationRewardDisabled(bool disable)
Definition Creature.h:363
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:340
void Respawn(bool force=false)
Definition Creature.cpp:2038
void GetRespawnPosition(float &x, float &y, float &z, float *ori=nullptr, float *dist=nullptr) const
Definition Creature.cpp:2955
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:3220
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition Creature.h:342
void SendZoneUnderAttackMessage(Player *attacker)
Send a message to LocalDefense channel for players opposition team in the zone.
Definition Creature.cpp:2816
void GetTransportHomePosition(float &x, float &y, float &z, float &ori) const
Definition Creature.h:347
void DoFleeToGetAssistance()
Definition Creature.cpp:1061
bool IsRooted() const
Definition Creature.h:84
void SetCorpseDelay(uint32 delay)
Definition Creature.h:70
void SetLootRewardDisabled(bool disable)
Definition Creature.h:365
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:95
void LoadPath(uint32 pathid)
Definition Creature.h:351
Definition SpellDefines.h:165
void AddSpellMod(SpellValueMod mod, int32 value)
Definition SpellDefines.h:167
void AddEventAtOffset(BasicEvent *event, Milliseconds offset)
Definition EventProcessor.h:107
Definition GameObjectAI.h:33
virtual void SetData(uint32, uint32)
Definition GameObjectAI.h:62
void UseDoorOrButton(uint32 time_to_restore=0, bool alternative=false, Unit *user=nullptr)
Definition GameObject.cpp:1414
bool isSpawnedByDefault() const
Definition GameObject.h:195
void SetLootState(LootState s, Unit *unit=nullptr)
Definition GameObject.cpp:2427
void SetRespawnTime(int32 respawn)
Definition GameObject.cpp:1288
GameobjectTypes GetGoType() const
Definition GameObject.h:202
void Respawn()
Definition GameObject.cpp:1303
void DespawnOrUnsummon(Milliseconds delay=0ms, Seconds forcedRespawnTime=0s)
Definition GameObject.cpp:936
void CastSpell(Unit *target, uint32 spell)
Definition GameObject.cpp:2070
virtual bool SetBossState(uint32 id, EncounterState state)
Definition InstanceScript.cpp:385
virtual void DoAction(int32)
Definition InstanceScript.h:274
static std::string GetBossStateName(uint8 state)
Definition InstanceScript.cpp:826
Definition LinkedList.h:139
bool IsEmpty() const
Definition LinkedList.h:97
Definition MapRefMgr.h:26
iterator begin()
Definition MapRefMgr.h:36
iterator end()
Definition MapRefMgr.h:37
void LoadGrid(float x, float y)
Definition Map.cpp:301
PlayerList const & GetPlayers() const
Definition Map.h:333
void MovementExpired(bool reset=true)
Definition MotionMaster.h:180
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition MotionMaster.h:213
void MoveJump(Position const &pos, float speedXY, float speedZ, uint32 id=0)
Definition MotionMaster.h:229
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:852
void MoveIdle()
Definition MotionMaster.cpp:232
void MoveFollow(Unit *target, float dist, float angle, MovementSlot slot=MOTION_SLOT_ACTIVE, bool inheritWalkState=true, bool inheritSpeed=true)
The unit will follow this target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:409
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
static ObjectGuid const Empty
Definition ObjectGuid.h:120
std::string ToString() const
Definition ObjectGuid.cpp:47
static CreatureModel const * ChooseDisplayId(CreatureTemplate const *cinfo, CreatureData const *data=nullptr)
Definition ObjectMgr.cpp:1647
bool HasFlag(uint16 index, uint32 flag) const
Definition Object.cpp:889
virtual void SetObjectScale(float scale)
Definition Object.h:120
void GroupEventHappens(uint32 questId, WorldObject const *pEventObject)
Definition PlayerQuest.cpp:1818
void SendCinematicStart(uint32 CinematicSequenceId) const
Definition Player.cpp:5717
void PrepareGossipMenu(WorldObject *source, uint32 menuId=0, bool showQuests=false)
Definition PlayerGossip.cpp:32
void RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject *pRewardSource)
Definition Player.cpp:12677
Definition QuestDef.h:210
void SetInvincibilityHpLevel(uint32 level)
Definition SmartAI.h:185
void SetData(uint32 id, uint32 value) override
Definition SmartAI.h:161
void IncPhase(uint32 p)
Definition SmartScript.cpp:5382
void StoreTargetList(ObjectVector const &targets, uint32 id)
Definition SmartScript.h:93
void RetryLater(SmartScriptHolder &e, bool ignoreChanceRoll=false)
Definition SmartScript.cpp:5070
void StoreCounter(uint32 id, uint32 value, uint32 reset, uint32 subtract)
Definition SmartScript.h:108
std::optional< std::reference_wrapper< SmartScriptHolder > > FindLinkedEvent(uint32 link)
Definition SmartScript.h:267
std::deque< SmartScriptFrame > executionStack
Definition SmartScript.h:284
void SetPhaseReset(bool allow)
Definition SmartScript.h:205
void GetTargets(ObjectVector &targets, SmartScriptHolder const &e, WorldObject *invoker=nullptr) const
Definition SmartScript.cpp:3446
void OnReset()
Definition SmartScript.cpp:109
void InstallTemplate(SmartScriptHolder const &e)
Definition SmartScript.cpp:3334
ObjectGuid goOrigGUID
Definition SmartScript.h:227
void DecPhase(uint32 p)
Definition SmartScript.cpp:5388
ObjectGuid meOrigGUID
Definition SmartScript.h:225
Definition SpellInfo.h:316
float GetMinRange(bool positive=false) const
Definition SpellInfo.cpp:2315
SpellSchoolMask GetSchoolMask() const
Definition SpellInfo.cpp:1987
bool HasAttribute(SpellAttr0 attribute) const
Definition SpellInfo.h:415
float GetMaxRange(bool positive=false, Unit *caster=nullptr, Spell *spell=nullptr) const
Definition SpellInfo.cpp:2324
int32 CalcPowerCost(Unit const *caster, SpellSchoolMask schoolMask, Spell *spell=nullptr) const
Definition SpellInfo.cpp:2402
float GetThreatListSize() const
Definition ThreatMgr.h:221
void ModifyThreatByPercent(Unit *victim, int32 percent)
Definition ThreatMgr.cpp:508
Definition VehicleDefines.h:130
virtual void SetData(uint32, uint32)
Definition UnitAI.h:218
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:27
uint8 getGender() const
Definition Unit.h:798
void SetFacingTo(float ori)
Definition Unit.cpp:20327
void CombatStop(bool includingCast=false)
Definition Unit.cpp:10480
float GetSpeed(UnitMoveType mtype) const
Definition Unit.cpp:14475
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4162
float GetSpellMinRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
Definition Unit.cpp:15218
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition Unit.cpp:14704
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition Unit.cpp:10660
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:17749
MotionMaster * GetMotionMaster()
Definition Unit.h:1664
void SetUnitMovementFlags(uint32 f)
Definition Unit.h:731
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:1236
void SetInCombatWith(Unit *enemy, uint32 duration=0)
Definition Unit.cpp:13625
void SetFacingToObject(WorldObject *object)
Definition Unit.cpp:20337
bool IsAlive() const
Definition Unit.h:1698
void StopMoving()
Definition Unit.cpp:16683
void SendPlaySpellVisual(uint32 id)
Definition Unit.cpp:18958
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5754
virtual void SetSheath(SheathState sheathed)
Definition Unit.h:1683
float GetSpellMaxRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
Definition Unit.cpp:15198
bool HasUnitMovementFlag(uint32 f) const
Definition Unit.h:729
TransportBase * GetDirectTransport() const
Definition Unit.cpp:18814
void SendMovementFlagUpdate(bool self=false)
Definition Unit.cpp:16737
bool isMoving() const
Definition Unit.h:1619
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:1179
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4942
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition Unit.cpp:14480
ObjectGuid GetTransGUID() const override
Definition Unit.cpp:18803
bool IsAIEnabled
Definition Unit.h:2003
bool HasUnitState(const uint32 f) const
Definition Unit.h:691
float GetPowerPct(Powers power) const
Definition Unit.h:1058
float GetMeleeRange(Unit const *target) const
Definition Unit.cpp:680
uint32 GetPower(Powers power) const
Definition Unit.h:1056
void KillSelf(bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition Unit.h:1159
void SetInFront(WorldObject const *target)
Definition Unit.cpp:20321
bool isDead() const
Definition Unit.h:1700
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:2368
Map * FindMap() const
Definition Object.h:538
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1203
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:1358
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:2639
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:2712
std::string const & GetName() const
Definition Object.h:464
void AddObjectToRemoveList()
Definition Object.cpp:2160
EventProcessor m_Events
Definition Object.h:640
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1256
uint32 GetAreaId() const
Definition Object.cpp:3156
uint32 GetZoneId() const
Definition Object.cpp:3148
float GetObjectSize() const
Definition Object.cpp:2784
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:2382
void GetRandomPoint(const Position &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const
Definition Object.cpp:1513
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:2445
virtual float GetCombatReach() const
Definition Object.h:442
Creature * SummonTrigger(float x, float y, float z, float ang, uint32 dur, bool setLevel=false, CreatureAI *(*GetAI)(Creature *)=nullptr)
Definition Object.cpp:2417
Player session in the World.
Definition WorldSession.h:330
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
virtual void SetGuidData(uint32, ObjectGuid)
Definition ZoneScript.h:45
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition Containers.h:133
std::string ToString(Type &&val, Params &&... params)
Definition StringConvert.h:250
Definition ObjectAccessor.h:61
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition ObjectAccessor.cpp:220
Definition CreatureData.h:169
uint32 CreatureDisplayID
Definition CreatureData.h:179
float DisplayScale
Definition CreatureData.h:180
Definition CreatureData.h:360
uint32 ItemEntry[MAX_EQUIPMENT_ITEMS]
Definition CreatureData.h:361
float m_positionZ
Definition Position.h:57
float m_positionX
Definition Position.h:55
float GetPositionZ() const
Definition Position.h:123
float m_positionY
Definition Position.h:56
float GetOrientation() const
Definition Position.h:124
void SetOrientation(float orientation)
Definition Position.h:116
float GetPositionX() const
Definition Position.h:121
void GetPosition(float &x, float &y) const
Definition Position.h:126
float GetPositionY() const
Definition Position.h:122
void RelocatePolarOffset(float angle, float dist, float z=0.0f)
Definition Position.cpp:34
float GetAngle(const Position *pos) const
Definition Position.cpp:78
Definition SmartScriptMgr.h:758
struct SmartAction::@75::@193 worldStateScript
struct SmartAction::@75::@98 combatMove
uint32 followState
Definition SmartScriptMgr.h:1455
uint32 visualId
Definition SmartScriptMgr.h:1450
uint32 targetParam2
Definition SmartScriptMgr.h:861
struct SmartAction::@75::@100 incEventPhase
struct SmartAction::@75::@106 killedMonster
std::array< uint32, SMART_ACTION_PARAM_COUNT > emotes
Definition SmartScriptMgr.h:844
struct SmartAction::@75::@166 setHomePos
uint32 repeatMax
Definition SmartScriptMgr.h:1120
uint32 phaseMin
Definition SmartScriptMgr.h:946
uint32 targetsLimit
Definition SmartScriptMgr.h:852
SAIBool transport
Definition SmartScriptMgr.h:1214
struct SmartAction::@75::@82 randomSound
struct SmartAction::@75::@120 summonGO
uint32 startAngle
Definition SmartScriptMgr.h:1443
SAIBool reset
Definition SmartScriptMgr.h:1105
std::array< uint32, SMART_ACTION_PARAM_COUNT > actionLists
Definition SmartScriptMgr.h:1168
uint32 delay
Definition SmartScriptMgr.h:991
uint32 random
Definition SmartScriptMgr.h:1338
struct SmartAction::@75::@182 cinematic
uint32 quickChange
Definition SmartScriptMgr.h:1337
uint32 targetParam4
Definition SmartScriptMgr.h:1467
uint32 dist
Definition SmartScriptMgr.h:931
uint32 group
Definition SmartScriptMgr.h:1264
SAIBool disable
Definition SmartScriptMgr.h:1392
struct SmartAction::@75::@111 callHelp
uint32 spell
Definition SmartScriptMgr.h:849
std::array< uint32, SMART_ACTION_PARAM_COUNT > wps
Definition SmartScriptMgr.h:1287
uint32 minHP
Definition SmartScriptMgr.h:998
uint32 flags
Definition SmartScriptMgr.h:858
struct SmartAction::@75::@97 autoAttack
SAIBool loot
Definition SmartScriptMgr.h:1509
uint32 distanceBetweenSummons
Definition SmartScriptMgr.h:1353
uint32 data
Definition SmartScriptMgr.h:958
struct SmartAction::@75::@105 randomPhaseRange
struct SmartAction::@75::@168 randomTimedEvent
uint32 entry
Definition SmartScriptMgr.h:933
struct SmartAction::@75::@184 scriptSpawn
struct SmartAction::@75::@177 doAction
struct SmartAction::@75::@91 crossCast
struct SmartAction::@75::@129 setSwim
uint32 quest
Definition SmartScriptMgr.h:828
struct SmartAction::@75::@78 simpleTalk
struct SmartAction::@75::@175 castCustom
uint32 triggerFlags
Definition SmartScriptMgr.h:851
struct SmartAction::@75::@87 questOffer
uint32 bp1
Definition SmartScriptMgr.h:1368
uint32 distance
Definition SmartScriptMgr.h:791
SAIBool removeObjectFromWorld
Definition SmartScriptMgr.h:993
uint32 min
Definition SmartScriptMgr.h:1117
uint32 spawnTimerMax
Definition SmartScriptMgr.h:1427
uint32 subtract
Definition SmartScriptMgr.h:1106
struct SmartAction::@75::@110 die
uint32 a
Definition SmartScriptMgr.h:1377
struct SmartAction::@75::@104 randomPhase
struct SmartAction::@75::@133 timeEvent
SAIBool invokerGUID
Definition SmartScriptMgr.h:1419
uint32 percent
Definition SmartScriptMgr.h:999
uint32 dec
Definition SmartScriptMgr.h:915
uint32 milliseconds
Definition SmartScriptMgr.h:975
struct SmartAction::@75::@125 item
uint32 summonEntry
Definition SmartScriptMgr.h:1350
struct SmartAction::@75::@84 randomMusic
struct SmartAction::@75::@152 sendTargetToTarget
uint32 followType
Definition SmartScriptMgr.h:1456
uint32 instanceTarget
Definition SmartScriptMgr.h:1387
uint32 credit
Definition SmartScriptMgr.h:934
uint32 controlled
Definition SmartScriptMgr.h:1215
uint32 alternative
Definition SmartScriptMgr.h:867
uint32 targetParam1
Definition SmartScriptMgr.h:860
uint32 mapID
Definition SmartScriptMgr.h:1098
uint32 stopMovement
Definition SmartScriptMgr.h:1344
struct SmartAction::@75::@134 movie
struct SmartAction::@75::@94 summonCreature
uint32 charges
Definition SmartScriptMgr.h:926
struct SmartAction::@75::@113 forceDespawn
struct SmartAction::@75::@185 setScale
struct SmartAction::@75::@103 follow
struct SmartAction::@75::@173 coneSummon
struct SmartAction::@75::@187 spellVisual
uint32 model
Definition SmartScriptMgr.h:784
struct SmartAction::@75::@191 wpDataRandom
uint32 duration
Definition SmartScriptMgr.h:766
SAIBool attackInvoker
Definition SmartScriptMgr.h:880
SAIBool useTalkTarget
Definition SmartScriptMgr.h:767
SAIBool run
Definition SmartScriptMgr.h:1043
uint32 value
Definition SmartScriptMgr.h:1104
struct SmartAction::@75::@140 timedActionList
uint32 movementExpired
Definition SmartScriptMgr.h:1345
struct SmartAction::@75::@117 moveRandom
struct SmartAction::@75::@150 sendGossipMenu
uint32 targetParam3
Definition SmartScriptMgr.h:862
uint32 respawnDelay
Definition SmartScriptMgr.h:1428
SAIBool swim
Definition SmartScriptMgr.h:1093
uint32 combatReach
Definition SmartScriptMgr.h:1217
uint32 sound2
Definition SmartScriptMgr.h:797
uint32 spawnPos
Definition SmartScriptMgr.h:1308
struct SmartAction::@75::@92 activateObject
struct SmartAction::@75::@161 gameEventStart
struct SmartAction::@75::@186 radialSummon
struct SmartAction::@75::@179 corpseDelay
struct SmartAction::@75::@183 setGuid
uint32 pathId2
Definition SmartScriptMgr.h:1479
uint32 creature
Definition SmartScriptMgr.h:783
struct SmartAction::@75::@190 wpData
uint32 spawnTimerMin
Definition SmartScriptMgr.h:1426
struct SmartAction::@75::@132 storeTargets
struct SmartAction::@75::@114 invincHP
uint32 angle
Definition SmartScriptMgr.h:932
uint32 field
Definition SmartScriptMgr.h:957
uint32 range
Definition SmartScriptMgr.h:872
struct SmartAction::@75::@95 threatPCT
struct SmartAction::@75::@89 randomEmote
uint32 flag
Definition SmartScriptMgr.h:1138
uint32 sound3
Definition SmartScriptMgr.h:798
uint32 targetsummon
Definition SmartScriptMgr.h:1032
struct SmartAction::@75::@145 jump
struct SmartAction::@75::@188 followGroup
uint32 chance
Definition SmartScriptMgr.h:1121
struct SmartAction::@75::@131 setCounter
uint32 state
Definition SmartScriptMgr.h:839
struct SmartAction::@75::@90 cast
struct SmartAction::@75::@108 setInstanceData64
struct SmartAction::@75::@180 movementSpeed
uint32 sound1
Definition SmartScriptMgr.h:796
struct SmartAction::@75::@80 morphOrMount
struct SmartAction::@75::@116 setData
uint32 forceRespawnTimer
Definition SmartScriptMgr.h:992
uint32 speed
Definition SmartScriptMgr.h:1087
uint32 sound4
Definition SmartScriptMgr.h:799
struct SmartAction::@75::@147 flee
uint32 targetType
Definition SmartScriptMgr.h:859
uint32 repetitions
Definition SmartScriptMgr.h:1442
uint32 aliveState
Definition SmartScriptMgr.h:936
SAIBool onlySelf
Definition SmartScriptMgr.h:790
uint32 attackScriptOwner
Definition SmartScriptMgr.h:881
uint32 speedxy
Definition SmartScriptMgr.h:1191
uint32 pointId
Definition SmartScriptMgr.h:1213
SAIBool attack
Definition SmartScriptMgr.h:899
uint32 repeatMin
Definition SmartScriptMgr.h:1119
struct SmartAction::@75::@122 wpStart
uint32 scale
Definition SmartScriptMgr.h:1435
SAIBool fly
Definition SmartScriptMgr.h:1086
struct SmartAction::@75::@189 orientationTarget
uint32 textGroupID
Definition SmartScriptMgr.h:765
uint32 castFlags
Definition SmartScriptMgr.h:850
std::array< uint32, SMART_ACTION_PARAM_COUNT > phases
Definition SmartScriptMgr.h:941
SAIBool dontDespawn
Definition SmartScriptMgr.h:1430
struct SmartAction::@75::@172 stopMotion
struct SmartAction::@75::@174 playerTalk
uint32 turnAngle
Definition SmartScriptMgr.h:1339
uint32 textId
Definition SmartScriptMgr.h:1360
uint32 gossipMenuId
Definition SmartScriptMgr.h:1222
uint32 speedz
Definition SmartScriptMgr.h:1192
SAIBool repeat
Definition SmartScriptMgr.h:1045
uint32 gossipNpcTextId
Definition SmartScriptMgr.h:1223
uint32 mask
Definition SmartScriptMgr.h:1004
uint32 pathId1
Definition SmartScriptMgr.h:1478
struct SmartAction::@75::@162 closestWaypointFromList
uint32 phi_delta
Definition SmartScriptMgr.h:1380
uint32 count
Definition SmartScriptMgr.h:1066
struct SmartAction::@75::@112 setSheath
uint32 inc
Definition SmartScriptMgr.h:914
uint32 phaseMax
Definition SmartScriptMgr.h:947
struct SmartAction::@75::@130 teleport
uint32 timer
Definition SmartScriptMgr.h:1397
struct SmartAction::@75::@176 summonVortex
uint32 ContactDistance
Definition SmartScriptMgr.h:1216
struct SmartAction::@75::@79 faction
struct SmartAction::@75::@135 equip
uint32 k
Definition SmartScriptMgr.h:1378
uint32 distanceBetweenRings
Definition SmartScriptMgr.h:1352
struct SmartAction::@75::@171 orientation
uint32 coneLength
Definition SmartScriptMgr.h:1354
uint32 counterId
Definition SmartScriptMgr.h:1103
SAIBool withEmote
Definition SmartScriptMgr.h:981
struct SmartAction::@75::@146 movementFlag
uint32 param
Definition SmartScriptMgr.h:1491
uint32 max
Definition SmartScriptMgr.h:1118
uint32 selfJump
Definition SmartScriptMgr.h:1193
uint32 maxId
Definition SmartScriptMgr.h:1320
uint32 r_max
Definition SmartScriptMgr.h:1379
struct SmartAction::@75::@136 unitFlag
uint32 speedFraction
Definition SmartScriptMgr.h:1404
struct SmartAction::@75::@153 setRangedMovement
struct SmartAction::@75::@88 react
struct SmartAction::@75::@119 setActive
SAIBool fail
Definition SmartScriptMgr.h:1060
struct SmartAction::@75::@124 wpStop
SAIBool directAdd
Definition SmartScriptMgr.h:834
uint32 bp2
Definition SmartScriptMgr.h:1369
uint32 disableGravity
Definition SmartScriptMgr.h:1088
uint32 sound
Definition SmartScriptMgr.h:789
struct SmartAction::@75::@195 reward
uint32 threatINC
Definition SmartScriptMgr.h:887
struct SmartAction::@75::@178 disableEvade
struct SmartAction::@75::@158 creatureGroup
struct SmartAction::@75::@160 gameEventStop
uint32 coneAngle
Definition SmartScriptMgr.h:1355
uint32 summonDuration
Definition SmartScriptMgr.h:1351
struct SmartAction::@75::@148 RespawnTarget
uint32 threatDEC
Definition SmartScriptMgr.h:888
SAIBool reputation
Definition SmartScriptMgr.h:1508
uint32 stepAngle
Definition SmartScriptMgr.h:1444
uint32 reactState
Definition SmartScriptMgr.h:1048
uint32 speedInteger
Definition SmartScriptMgr.h:1403
struct SmartAction::@75::@77 talk
uint32 index
Definition SmartScriptMgr.h:1420
struct SmartAction::@75::@123 wpPause
struct SmartAction::@75::@83 music
uint32 actionId
Definition SmartScriptMgr.h:1385
uint32 despawnTime
Definition SmartScriptMgr.h:1031
struct SmartAction::@75::@128 setFly
uint32 goRespawnTime
Definition SmartScriptMgr.h:1208
struct SmartAction::@75::@115 ingamePhaseMask
uint32 factionID
Definition SmartScriptMgr.h:778
uint32 eventId
Definition SmartScriptMgr.h:1490
uint32 pathId
Definition SmartScriptMgr.h:1472
SAIBool move
Definition SmartScriptMgr.h:904
struct SmartAction::@75::@149 moveToPos
std::array< uint32, MAX_EQUIPMENT_ITEMS > slots
Definition SmartScriptMgr.h:1133
struct SmartAction::@75::@127 setRun
struct SmartAction::@75::@99 setEventPhase
struct SmartAction::@75::@107 setInstanceData
uint32 questID
Definition SmartScriptMgr.h:833
uint32 bp3
Definition SmartScriptMgr.h:1370
uint32 pathID
Definition SmartScriptMgr.h:1044
uint32 emote
Definition SmartScriptMgr.h:823
struct SmartAction::@75::@102 removeAura
uint32 id
Definition SmartScriptMgr.h:1038
uint32 minId
Definition SmartScriptMgr.h:1319
uint32 phase
Definition SmartScriptMgr.h:909
uint32 sheath
Definition SmartScriptMgr.h:986
uint32 isNegative
Definition SmartScriptMgr.h:1386
uint32 creditType
Definition SmartScriptMgr.h:935
struct SmartAction::@75::@141 randTimedActionList
Definition SmartScriptMgr.h:224
uint32 repeatMin
Definition SmartScriptMgr.h:235
uint32 repeatMax
Definition SmartScriptMgr.h:236
bool runOnce
Definition SmartScriptMgr.h:1987
uint32 link
Definition SmartScriptMgr.h:1972
uint32 event_id
Definition SmartScriptMgr.h:1971
int32 entryOrGuid
Definition SmartScriptMgr.h:1969
uint32 GetScriptType() const
Definition SmartScriptMgr.h:1979
uint32 GetTargetType() const
Definition SmartScriptMgr.h:1982
uint32 GetActionType() const
Definition SmartScriptMgr.h:1981
float o
Definition SmartScriptMgr.h:1588
uint32 maxDist
Definition SmartScriptMgr.h:1594
uint32 range
Definition SmartScriptMgr.h:1715
float x
Definition SmartScriptMgr.h:1588
uint32 self
Definition SmartScriptMgr.h:1717
struct SmartTarget::@196::@217 randomPoint
uint32 amount
Definition SmartScriptMgr.h:1716
struct SmartTarget::@196::@200 unitRange
float y
Definition SmartScriptMgr.h:1588
float z
Definition SmartScriptMgr.h:1588
Definition SmartScriptMgr.h:33
uint32 id
Definition SmartScriptMgr.h:44