AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
debug_commandscript Class Reference
Inheritance diagram for debug_commandscript:
CommandScript ScriptObject

Classes

class  CreatureCountWorker
 

Public Member Functions

 debug_commandscript ()
 
ChatCommandTable GetCommands () const override
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 

Static Public Member Functions

static bool HandleDebugPlayCinematicCommand (ChatHandler *handler, uint32 cinematicId)
 
static bool HandleDebugPlayMovieCommand (ChatHandler *handler, uint32 movieId)
 
static bool HandleDebugPlaySoundCommand (ChatHandler *handler, uint32 soundId)
 
static bool HandleDebugPlayMusicCommand (ChatHandler *handler, uint32 musicId)
 
static bool HandleDebugVisualCommand (ChatHandler *handler, uint32 visualId)
 
static bool HandleDebugSendSpellFailCommand (ChatHandler *handler, SpellCastResult result, Optional< uint32 > failArg1, Optional< uint32 > failArg2)
 
static bool HandleDebugSendEquipErrorCommand (ChatHandler *handler, InventoryResult error)
 
static bool HandleDebugSendSellErrorCommand (ChatHandler *handler, SellResult error)
 
static bool HandleDebugSendBuyErrorCommand (ChatHandler *handler, BuyResult error)
 
static bool HandleDebugSendOpcodeCommand (ChatHandler *handler)
 
static bool HandleDebugUpdateWorldStateCommand (ChatHandler *handler, uint32 variable, uint32 value)
 
static bool HandleDebugAreaTriggersCommand (ChatHandler *handler)
 
static bool HandleDebugSendChannelNotifyCommand (ChatHandler *handler, ChatNotify type)
 
static bool HandleDebugSendChatMsgCommand (ChatHandler *handler, ChatMsg type)
 
static bool HandleDebugSendQuestPartyMsgCommand (ChatHandler *handler, QuestShareMessages msg)
 
static bool HandleDebugGetLootRecipientCommand (ChatHandler *handler)
 
static bool HandleDebugSendQuestInvalidMsgCommand (ChatHandler *handler, QuestFailedReason msg)
 
static bool HandleDebugGetItemStateCommand (ChatHandler *handler, std::string itemState)
 
static bool HandleDebugDungeonFinderCommand (ChatHandler *)
 
static bool HandleDebugBattlegroundCommand (ChatHandler *)
 
static bool HandleDebugCooldownCommand (ChatHandler *handler, uint32 spell_id, uint32 end_time, Optional< uint32 > item_id)
 
static bool HandleDebugArenaCommand (ChatHandler *)
 
static bool HandleDebugThreatListCommand (ChatHandler *handler)
 
static bool HandleDebugHostileRefListCommand (ChatHandler *handler)
 
static bool HandleDebugSetVehicleIdCommand (ChatHandler *handler, uint32 id)
 
static bool HandleDebugEnterVehicleCommand (ChatHandler *handler, uint32 entry, Optional< int8 > seatId)
 
static bool HandleDebugSpawnVehicleCommand (ChatHandler *handler, uint32 entry, Optional< uint32 > id)
 
static bool HandleDebugSendLargePacketCommand (ChatHandler *handler)
 
static bool HandleDebugSendSetPhaseShiftCommand (ChatHandler *handler, uint32 phaseShift)
 
static bool HandleDebugGetItemValueCommand (ChatHandler *handler, ObjectGuid::LowType guid, uint32 index)
 
static bool HandleDebugSetItemValueCommand (ChatHandler *handler, ObjectGuid::LowType guid, uint32 index, uint32 value)
 
static bool HandleDebugItemExpireCommand (ChatHandler *handler, ObjectGuid::LowType guid)
 
static bool HandleDebugAnimCommand (ChatHandler *handler, Emote emote)
 
static bool HandleDebugLoSCommand (ChatHandler *handler)
 
static bool HandleDebugSetAuraStateCommand (ChatHandler *handler, Optional< AuraStateType > state, bool apply)
 
static bool HandleDebugSetValueCommand (ChatHandler *handler, uint32 index, Variant< uint32, float > value)
 
static bool HandleDebugGetValueCommand (ChatHandler *handler, uint32 index, bool isInt)
 
static bool HandleDebugMod32ValueCommand (ChatHandler *handler, uint32 index, uint32 value)
 
static bool HandleDebugUpdateCommand (ChatHandler *handler, uint32 index, Optional< uint32 > value)
 
static bool HandleDebugSet32BitCommand (ChatHandler *handler, uint32 index, uint8 bit)
 
static bool HandleDebugMoveflagsCommand (ChatHandler *handler, Optional< uint32 > moveFlags, Optional< uint32 > moveFlagsExtra)
 
static bool HandleDebugUnitStateCommand (ChatHandler *handler, uint32 unitState)
 
static bool HandleWPGPSCommand (ChatHandler *handler, Optional< std::string > type)
 
static bool HandleDebugObjectCountCommand (ChatHandler *handler, Optional< uint32 > mapId)
 
static void HandleDebugObjectCountMap (ChatHandler *handler, Map *map)
 
static bool HandleDebugDummyCommand (ChatHandler *handler)
 
static bool HandleDebugMapDataCommand (ChatHandler *handler)
 
static bool HandleDebugBoundaryCommand (ChatHandler *handler, Optional< uint32 > durationArg, Optional< EXACT_SEQUENCE("fill")> fill, Optional< EXACT_SEQUENCE("z")> checkZ)
 

Additional Inherited Members

- Protected Member Functions inherited from CommandScript
 CommandScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ debug_commandscript()

debug_commandscript::debug_commandscript ( )
inline
43: CommandScript("debug_commandscript") { }
Definition CommandScript.h:25

Member Function Documentation

◆ GetCommands()

ChatCommandTable debug_commandscript::GetCommands ( ) const
inlineoverridevirtual

Implements CommandScript.

46 {
47 static ChatCommandTable debugPlayCommandTable =
48 {
49 { "cinematic", HandleDebugPlayCinematicCommand, SEC_ADMINISTRATOR, Console::No },
50 { "movie", HandleDebugPlayMovieCommand, SEC_ADMINISTRATOR, Console::No },
51 { "sound", HandleDebugPlaySoundCommand, SEC_ADMINISTRATOR, Console::No },
52 { "music", HandleDebugPlayMusicCommand, SEC_ADMINISTRATOR, Console::No },
53 { "visual", HandleDebugVisualCommand, SEC_ADMINISTRATOR, Console::No }
54 };
55 static ChatCommandTable debugSendCommandTable =
56 {
57 { "buyerror", HandleDebugSendBuyErrorCommand, SEC_ADMINISTRATOR, Console::No },
58 { "channelnotify", HandleDebugSendChannelNotifyCommand, SEC_ADMINISTRATOR, Console::No },
59 { "chatmessage", HandleDebugSendChatMsgCommand, SEC_ADMINISTRATOR, Console::No },
60 { "equiperror", HandleDebugSendEquipErrorCommand, SEC_ADMINISTRATOR, Console::No },
61 { "largepacket", HandleDebugSendLargePacketCommand, SEC_ADMINISTRATOR, Console::No },
62 { "opcode", HandleDebugSendOpcodeCommand, SEC_ADMINISTRATOR, Console::No },
63 { "qpartymsg", HandleDebugSendQuestPartyMsgCommand, SEC_ADMINISTRATOR, Console::No },
64 { "qinvalidmsg", HandleDebugSendQuestInvalidMsgCommand, SEC_ADMINISTRATOR, Console::No },
65 { "sellerror", HandleDebugSendSellErrorCommand, SEC_ADMINISTRATOR, Console::No },
66 { "setphaseshift", HandleDebugSendSetPhaseShiftCommand, SEC_ADMINISTRATOR, Console::No },
67 { "spellfail", HandleDebugSendSpellFailCommand, SEC_ADMINISTRATOR, Console::No }
68 };
69 static ChatCommandTable debugCommandTable =
70 {
71 { "setbit", HandleDebugSet32BitCommand, SEC_ADMINISTRATOR, Console::No },
72 { "threat", HandleDebugThreatListCommand, SEC_ADMINISTRATOR, Console::No },
73 { "hostile", HandleDebugHostileRefListCommand, SEC_ADMINISTRATOR, Console::No },
74 { "anim", HandleDebugAnimCommand, SEC_ADMINISTRATOR, Console::No },
75 { "arena", HandleDebugArenaCommand, SEC_ADMINISTRATOR, Console::No },
77 { "cooldown", HandleDebugCooldownCommand, SEC_ADMINISTRATOR, Console::No },
78 { "getitemstate", HandleDebugGetItemStateCommand, SEC_ADMINISTRATOR, Console::No },
79 { "lootrecipient", HandleDebugGetLootRecipientCommand, SEC_ADMINISTRATOR, Console::No },
80 { "getvalue", HandleDebugGetValueCommand, SEC_ADMINISTRATOR, Console::No },
81 { "getitemvalue", HandleDebugGetItemValueCommand, SEC_ADMINISTRATOR, Console::No },
82 { "Mod32Value", HandleDebugMod32ValueCommand, SEC_ADMINISTRATOR, Console::No },
83 { "play", debugPlayCommandTable },
84 { "send", debugSendCommandTable },
85 { "setaurastate", HandleDebugSetAuraStateCommand, SEC_ADMINISTRATOR, Console::No },
86 { "setitemvalue", HandleDebugSetItemValueCommand, SEC_ADMINISTRATOR, Console::No },
87 { "setvalue", HandleDebugSetValueCommand, SEC_ADMINISTRATOR, Console::No },
88 { "spawnvehicle", HandleDebugSpawnVehicleCommand, SEC_ADMINISTRATOR, Console::No },
89 { "setvid", HandleDebugSetVehicleIdCommand, SEC_ADMINISTRATOR, Console::No },
90 { "entervehicle", HandleDebugEnterVehicleCommand, SEC_ADMINISTRATOR, Console::No },
92 { "update", HandleDebugUpdateCommand, SEC_ADMINISTRATOR, Console::No },
93 { "itemexpire", HandleDebugItemExpireCommand, SEC_ADMINISTRATOR, Console::No },
94 { "areatriggers", HandleDebugAreaTriggersCommand, SEC_ADMINISTRATOR, Console::No },
96 { "los", HandleDebugLoSCommand, SEC_ADMINISTRATOR, Console::No },
97 { "moveflags", HandleDebugMoveflagsCommand, SEC_ADMINISTRATOR, Console::No },
98 { "unitstate", HandleDebugUnitStateCommand, SEC_ADMINISTRATOR, Console::No },
99 { "objectcount", HandleDebugObjectCountCommand, SEC_ADMINISTRATOR, Console::Yes},
100 { "dummy", HandleDebugDummyCommand, SEC_ADMINISTRATOR, Console::No },
101 { "mapdata", HandleDebugMapDataCommand, SEC_ADMINISTRATOR, Console::No },
102 { "boundary", HandleDebugBoundaryCommand, SEC_ADMINISTRATOR, Console::No }
103 };
104 static ChatCommandTable commandTable =
105 {
106 { "debug", debugCommandTable },
107 { "wpgps", HandleWPGPSCommand, SEC_ADMINISTRATOR, Console::No }
108 };
109 return commandTable;
110 }
@ SEC_ADMINISTRATOR
Definition Common.h:60
static bool HandleDebugSet32BitCommand(ChatHandler *handler, uint32 index, uint8 bit)
Definition cs_debug.cpp:1181
static bool HandleDebugSendSetPhaseShiftCommand(ChatHandler *handler, uint32 phaseShift)
Definition cs_debug.cpp:970
static bool HandleDebugThreatListCommand(ChatHandler *handler)
Definition cs_debug.cpp:815
static bool HandleDebugGetItemStateCommand(ChatHandler *handler, std::string itemState)
Definition cs_debug.cpp:505
static bool HandleDebugGetItemValueCommand(ChatHandler *handler, ObjectGuid::LowType guid, uint32 index)
Definition cs_debug.cpp:976
static bool HandleDebugSendLargePacketCommand(ChatHandler *handler)
Definition cs_debug.cpp:959
static bool HandleDebugSetValueCommand(ChatHandler *handler, uint32 index, Variant< uint32, float > value)
Definition cs_debug.cpp:1068
static bool HandleDebugMoveflagsCommand(ChatHandler *handler, Optional< uint32 > moveFlags, Optional< uint32 > moveFlagsExtra)
Definition cs_debug.cpp:1200
static bool HandleWPGPSCommand(ChatHandler *handler, Optional< std::string > type)
Definition cs_debug.cpp:1268
static bool HandleDebugSendChatMsgCommand(ChatHandler *handler, ChatMsg type)
Definition cs_debug.cpp:473
static bool HandleDebugAreaTriggersCommand(ChatHandler *handler)
Definition cs_debug.cpp:445
static bool HandleDebugSendSellErrorCommand(ChatHandler *handler, SellResult error)
Definition cs_debug.cpp:244
static bool HandleDebugGetValueCommand(ChatHandler *handler, uint32 index, bool isInt)
Definition cs_debug.cpp:1097
static bool HandleDebugUpdateCommand(ChatHandler *handler, uint32 index, Optional< uint32 > value)
Definition cs_debug.cpp:1146
static bool HandleDebugSetVehicleIdCommand(ChatHandler *handler, uint32 id)
Definition cs_debug.cpp:887
static bool HandleDebugGetLootRecipientCommand(ChatHandler *handler)
Definition cs_debug.cpp:487
static bool HandleDebugLoSCommand(ChatHandler *handler)
Definition cs_debug.cpp:1032
static bool HandleDebugPlayMovieCommand(ChatHandler *handler, uint32 movieId)
Definition cs_debug.cpp:140
static bool HandleDebugUnitStateCommand(ChatHandler *handler, uint32 unitState)
Definition cs_debug.cpp:1256
static bool HandleDebugMapDataCommand(ChatHandler *handler)
Definition cs_debug.cpp:1372
static bool HandleDebugPlaySoundCommand(ChatHandler *handler, uint32 soundId)
Definition cs_debug.cpp:153
static bool HandleDebugDungeonFinderCommand(ChatHandler *)
Definition cs_debug.cpp:770
static bool HandleDebugSendOpcodeCommand(ChatHandler *handler)
Definition cs_debug.cpp:256
static bool HandleDebugDummyCommand(ChatHandler *handler)
Definition cs_debug.cpp:1366
static bool HandleDebugSendEquipErrorCommand(ChatHandler *handler, InventoryResult error)
Definition cs_debug.cpp:238
static bool HandleDebugHostileRefListCommand(ChatHandler *handler)
Definition cs_debug.cpp:857
static bool HandleDebugSpawnVehicleCommand(ChatHandler *handler, uint32 entry, Optional< uint32 > id)
Definition cs_debug.cpp:926
static bool HandleDebugCooldownCommand(ChatHandler *handler, uint32 spell_id, uint32 end_time, Optional< uint32 > item_id)
Definition cs_debug.cpp:782
static bool HandleDebugPlayMusicCommand(ChatHandler *handler, uint32 musicId)
Definition cs_debug.cpp:180
static bool HandleDebugBattlegroundCommand(ChatHandler *)
Definition cs_debug.cpp:776
static bool HandleDebugSendBuyErrorCommand(ChatHandler *handler, BuyResult error)
Definition cs_debug.cpp:250
static bool HandleDebugBoundaryCommand(ChatHandler *handler, Optional< uint32 > durationArg, Optional< EXACT_SEQUENCE("fill")> fill, Optional< EXACT_SEQUENCE("z")> checkZ)
Definition cs_debug.cpp:1386
static bool HandleDebugObjectCountCommand(ChatHandler *handler, Optional< uint32 > mapId)
Definition cs_debug.cpp:1288
static bool HandleDebugSendChannelNotifyCommand(ChatHandler *handler, ChatNotify type)
Definition cs_debug.cpp:462
static bool HandleDebugEnterVehicleCommand(ChatHandler *handler, uint32 entry, Optional< int8 > seatId)
Definition cs_debug.cpp:898
static bool HandleDebugSetItemValueCommand(ChatHandler *handler, ObjectGuid::LowType guid, uint32 index, uint32 value)
Definition cs_debug.cpp:993
static bool HandleDebugMod32ValueCommand(ChatHandler *handler, uint32 index, uint32 value)
Definition cs_debug.cpp:1128
static bool HandleDebugItemExpireCommand(ChatHandler *handler, ObjectGuid::LowType guid)
Definition cs_debug.cpp:1008
static bool HandleDebugSendQuestInvalidMsgCommand(ChatHandler *handler, QuestFailedReason msg)
Definition cs_debug.cpp:499
static bool HandleDebugPlayCinematicCommand(ChatHandler *handler, uint32 cinematicId)
Definition cs_debug.cpp:113
static bool HandleDebugVisualCommand(ChatHandler *handler, uint32 visualId)
Definition cs_debug.cpp:196
static bool HandleDebugUpdateWorldStateCommand(ChatHandler *handler, uint32 variable, uint32 value)
Definition cs_debug.cpp:439
static bool HandleDebugArenaCommand(ChatHandler *)
Definition cs_debug.cpp:809
static bool HandleDebugAnimCommand(ChatHandler *handler, Emote emote)
Definition cs_debug.cpp:1022
static bool HandleDebugSendSpellFailCommand(ChatHandler *handler, SpellCastResult result, Optional< uint32 > failArg1, Optional< uint32 > failArg2)
Definition cs_debug.cpp:217
static bool HandleDebugSendQuestPartyMsgCommand(ChatHandler *handler, QuestShareMessages msg)
Definition cs_debug.cpp:481
static bool HandleDebugSetAuraStateCommand(ChatHandler *handler, Optional< AuraStateType > state, bool apply)
Definition cs_debug.cpp:1047
std::vector< ChatCommandBuilder > ChatCommandTable
Definition ChatCommand.h:46

References HandleDebugAnimCommand(), HandleDebugAreaTriggersCommand(), HandleDebugArenaCommand(), HandleDebugBattlegroundCommand(), HandleDebugBoundaryCommand(), HandleDebugCooldownCommand(), HandleDebugDummyCommand(), HandleDebugDungeonFinderCommand(), HandleDebugEnterVehicleCommand(), HandleDebugGetItemStateCommand(), HandleDebugGetItemValueCommand(), HandleDebugGetLootRecipientCommand(), HandleDebugGetValueCommand(), HandleDebugHostileRefListCommand(), HandleDebugItemExpireCommand(), HandleDebugLoSCommand(), HandleDebugMapDataCommand(), HandleDebugMod32ValueCommand(), HandleDebugMoveflagsCommand(), HandleDebugObjectCountCommand(), HandleDebugPlayCinematicCommand(), HandleDebugPlayMovieCommand(), HandleDebugPlayMusicCommand(), HandleDebugPlaySoundCommand(), HandleDebugSendBuyErrorCommand(), HandleDebugSendChannelNotifyCommand(), HandleDebugSendChatMsgCommand(), HandleDebugSendEquipErrorCommand(), HandleDebugSendLargePacketCommand(), HandleDebugSendOpcodeCommand(), HandleDebugSendQuestInvalidMsgCommand(), HandleDebugSendQuestPartyMsgCommand(), HandleDebugSendSellErrorCommand(), HandleDebugSendSetPhaseShiftCommand(), HandleDebugSendSpellFailCommand(), HandleDebugSet32BitCommand(), HandleDebugSetAuraStateCommand(), HandleDebugSetItemValueCommand(), HandleDebugSetValueCommand(), HandleDebugSetVehicleIdCommand(), HandleDebugSpawnVehicleCommand(), HandleDebugThreatListCommand(), HandleDebugUnitStateCommand(), HandleDebugUpdateCommand(), HandleDebugUpdateWorldStateCommand(), HandleDebugVisualCommand(), HandleWPGPSCommand(), and SEC_ADMINISTRATOR.

◆ HandleDebugAnimCommand()

static bool debug_commandscript::HandleDebugAnimCommand ( ChatHandler handler,
Emote  emote 
)
inlinestatic
1023 {
1024 if (Unit* unit = handler->getSelectedUnit())
1025 unit->HandleEmoteCommand(emote);
1026
1027 handler->PSendSysMessage("Playing emote {}", EnumUtils::ToConstant(emote));
1028
1029 return true;
1030 }
void PSendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition Chat.cpp:211
Unit * getSelectedUnit() const
Definition Chat.cpp:386
static char const * ToConstant(Enum value)
Definition SmartEnum.h:123
Definition Unit.h:620

References ChatHandler::getSelectedUnit(), ChatHandler::PSendSysMessage(), and EnumUtils::ToConstant().

Referenced by GetCommands().

◆ HandleDebugAreaTriggersCommand()

static bool debug_commandscript::HandleDebugAreaTriggersCommand ( ChatHandler handler)
inlinestatic
446 {
447 Player* player = handler->GetSession()->GetPlayer();
448 if (!player->isDebugAreaTriggers)
449 {
451 player->isDebugAreaTriggers = true;
452 }
453 else
454 {
456 player->isDebugAreaTriggers = false;
457 }
458
459 return true;
460 }
@ LANG_DEBUG_AREATRIGGER_ON
Definition Language.h:980
@ LANG_DEBUG_AREATRIGGER_OFF
Definition Language.h:981
WorldSession * GetSession()
Definition Chat.h:242
Definition Player.h:1082
bool isDebugAreaTriggers
Definition Player.h:2566
Player * GetPlayer() const
Definition WorldSession.h:376

References WorldSession::GetPlayer(), ChatHandler::GetSession(), Player::isDebugAreaTriggers, LANG_DEBUG_AREATRIGGER_OFF, LANG_DEBUG_AREATRIGGER_ON, and ChatHandler::PSendSysMessage().

Referenced by GetCommands().

◆ HandleDebugArenaCommand()

static bool debug_commandscript::HandleDebugArenaCommand ( ChatHandler )
inlinestatic
810 {
811 sBattlegroundMgr->ToggleArenaTesting();
812 return true;
813 }
#define sBattlegroundMgr
Definition BattlegroundMgr.h:187

References sBattlegroundMgr.

Referenced by GetCommands().

◆ HandleDebugBattlegroundCommand()

static bool debug_commandscript::HandleDebugBattlegroundCommand ( ChatHandler )
inlinestatic
777 {
778 sBattlegroundMgr->ToggleTesting();
779 return true;
780 }

References sBattlegroundMgr.

Referenced by GetCommands().

◆ HandleDebugBoundaryCommand()

static bool debug_commandscript::HandleDebugBoundaryCommand ( ChatHandler handler,
Optional< uint32 durationArg,
Optional< EXACT_SEQUENCE("fill")>  fill,
Optional< EXACT_SEQUENCE("z")>  checkZ 
)
inlinestatic
1387 {
1388 Player* player = handler->GetPlayer();
1389 if (!player)
1390 return false;
1391
1392 Creature* target = handler->getSelectedCreature();
1393 if (!target || !target->IsAIEnabled)
1394 return false;
1395
1396 uint32 duration = durationArg.value_or(5 * IN_MILLISECONDS);
1397 if (duration > 180 * IN_MILLISECONDS) // arbitrary upper limit
1398 duration = 180 * IN_MILLISECONDS;
1399
1400 int32 errMsg = target->AI()->VisualizeBoundary(duration, player, fill.has_value(), checkZ.has_value());
1401 if (errMsg > 0)
1402 handler->PSendSysMessage(errMsg);
1403
1404 return true;
1405 }
constexpr auto IN_MILLISECONDS
Definition Common.h:53
std::int32_t int32
Definition Define.h:103
std::uint32_t uint32
Definition Define.h:107
Player * GetPlayer() const
Definition Chat.cpp:36
Creature * getSelectedCreature() const
Definition Chat.cpp:410
int32 VisualizeBoundary(uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
Definition CreatureAI.cpp:388
Definition Creature.h:43
CreatureAI * AI() const
Definition Creature.h:141
bool IsAIEnabled
Definition Unit.h:2003

References Creature::AI(), ChatHandler::GetPlayer(), ChatHandler::getSelectedCreature(), IN_MILLISECONDS, Unit::IsAIEnabled, ChatHandler::PSendSysMessage(), and CreatureAI::VisualizeBoundary().

Referenced by GetCommands().

◆ HandleDebugCooldownCommand()

static bool debug_commandscript::HandleDebugCooldownCommand ( ChatHandler handler,
uint32  spell_id,
uint32  end_time,
Optional< uint32 item_id 
)
inlinestatic
783 {
784 Player* player = handler->GetPlayer();
785
786 if (!player || !spell_id || !end_time)
787 return false;
788
789 if (!sSpellMgr->GetSpellInfo(spell_id))
790 return false;
791
792 if (!item_id)
793 item_id = 0;
794 else if (!sItemStore.LookupEntry(*item_id))
795 return false;
796
797 if (end_time < player->GetSpellCooldownDelay(spell_id))
798 player->RemoveSpellCooldown(spell_id, true);
799
800 player->AddSpellCooldown(spell_id, *item_id, end_time, true, false);
801
802 WorldPacket data;
803 player->BuildCooldownPacket(data, SPELL_COOLDOWN_FLAG_NONE, spell_id, end_time);
804 player->SendDirectMessage(&data);
805
806 return true;
807 }
DBCStorage< ItemEntry > sItemStore(Itemfmt)
#define sSpellMgr
Definition SpellMgr.h:825
@ SPELL_COOLDOWN_FLAG_NONE
Definition Unit.h:606
void SendDirectMessage(WorldPacket const *data) const
Definition Player.cpp:5712
void AddSpellCooldown(uint32 spell_id, uint32 itemid, uint32 end_time, bool needSendToClient=false, bool forceSendToSpectator=false) override
Definition Player.cpp:11034
void RemoveSpellCooldown(uint32 spell_id, bool update=false)
Definition Player.cpp:3522
void BuildCooldownPacket(WorldPacket &data, uint8 flags, uint32 spellId, uint32 cooldown)
Definition Unit.cpp:20799
Definition WorldPacket.h:26

References Player::AddSpellCooldown(), Unit::BuildCooldownPacket(), ChatHandler::GetPlayer(), Player::RemoveSpellCooldown(), Player::SendDirectMessage(), sItemStore, SPELL_COOLDOWN_FLAG_NONE, and sSpellMgr.

Referenced by GetCommands().

◆ HandleDebugDummyCommand()

static bool debug_commandscript::HandleDebugDummyCommand ( ChatHandler handler)
inlinestatic
1367 {
1368 handler->SendSysMessage("This command does nothing right now. Edit your local core (cs_debug.cpp) to make it do whatever you need for testing.");
1369 return true;
1370 }
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition Chat.cpp:160

References ChatHandler::SendSysMessage().

Referenced by GetCommands().

◆ HandleDebugDungeonFinderCommand()

static bool debug_commandscript::HandleDebugDungeonFinderCommand ( ChatHandler )
inlinestatic
771 {
772 sLFGMgr->ToggleTesting();
773 return true;
774 }
#define sLFGMgr
Definition LFGMgr.h:641

References sLFGMgr.

Referenced by GetCommands().

◆ HandleDebugEnterVehicleCommand()

static bool debug_commandscript::HandleDebugEnterVehicleCommand ( ChatHandler handler,
uint32  entry,
Optional< int8 seatId 
)
inlinestatic
899 {
900 Unit* target = handler->getSelectedUnit();
901 if (!target || !target->IsVehicle())
902 return false;
903
904 if (!seatId)
905 seatId = -1;
906
907 if (!entry)
908 handler->GetPlayer()->EnterVehicle(target, *seatId);
909 else
910 {
911 Creature* passenger = nullptr;
912 Acore::AllCreaturesOfEntryInRange check(handler->GetPlayer(), entry, 20.0f);
913 Acore::CreatureSearcher<Acore::AllCreaturesOfEntryInRange> searcher(handler->GetPlayer(), passenger, check);
914 Cell::VisitAllObjects(handler->GetPlayer(), searcher, 30.0f);
915
916 if (!passenger || passenger == target)
917 return false;
918
919 passenger->EnterVehicle(target, *seatId);
920 }
921
922 handler->PSendSysMessage("Unit {} entered vehicle {:d}", entry, *seatId);
923 return true;
924 }
Definition GridNotifiers.h:1461
void EnterVehicle(Unit *base, int8 seatId=-1)
Definition Unit.cpp:19419
bool IsVehicle() const
Definition Unit.h:750
Definition GridNotifiers.h:442
static void VisitAllObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:185

References Unit::EnterVehicle(), ChatHandler::GetPlayer(), ChatHandler::getSelectedUnit(), Unit::IsVehicle(), ChatHandler::PSendSysMessage(), and Cell::VisitAllObjects().

Referenced by GetCommands().

◆ HandleDebugGetItemStateCommand()

static bool debug_commandscript::HandleDebugGetItemStateCommand ( ChatHandler handler,
std::string  itemState 
)
inlinestatic
506 {
508 bool listQueue = false;
509 bool checkAll = false;
510
511 if (itemState == "unchanged")
512 state = ITEM_UNCHANGED;
513 else if (itemState == "changed")
514 state = ITEM_CHANGED;
515 else if (itemState == "new")
516 state = ITEM_NEW;
517 else if (itemState == "removed")
518 state = ITEM_REMOVED;
519 else if (itemState == "queue")
520 listQueue = true;
521 else if (itemState == "check_all")
522 checkAll = true;
523 else
524 return false;
525
526 Player* player = handler->getSelectedPlayer();
527 if (!player)
528 player = handler->GetPlayer();
529
530 if (!listQueue && !checkAll)
531 {
532 itemState = "The player has the following " + itemState + " items: ";
533 handler->SendSysMessage(itemState.c_str());
534 for (uint8 i = PLAYER_SLOT_START; i < PLAYER_SLOT_END; ++i)
535 {
536 if (i >= BUYBACK_SLOT_START && i < BUYBACK_SLOT_END)
537 continue;
538
539 if (Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, i))
540 {
541 if (Bag* bag = item->ToBag())
542 {
543 for (uint8 j = 0; j < bag->GetBagSize(); ++j)
544 if (Item* item2 = bag->GetItemByPos(j))
545 if (item2->GetState() == state)
546 handler->PSendSysMessage("bag: 255 slot: {} {} owner: {}", item2->GetSlot(), item2->GetGUID().ToString(), item2->GetOwnerGUID().ToString());
547 }
548 else if (item->GetState() == state)
549 handler->PSendSysMessage("bag: 255 slot: {} {} owner: {}", item->GetSlot(), item->GetGUID().ToString(), item->GetOwnerGUID().ToString());
550 }
551 }
552 }
553
554 if (listQueue)
555 {
556 auto const& updateQueue = player->GetItemUpdateQueue();
557
558 for (auto const& item : updateQueue)
559 {
560 Bag* container = item->GetContainer();
561 uint8 bagSlot = container ? container->GetSlot() : uint8(INVENTORY_SLOT_BAG_0);
562
563 std::string st;
564 switch (item->GetState())
565 {
566 case ITEM_UNCHANGED:
567 st = "unchanged";
568 break;
569 case ITEM_CHANGED:
570 st = "changed";
571 break;
572 case ITEM_NEW:
573 st = "new";
574 break;
575 case ITEM_REMOVED:
576 st = "removed";
577 break;
578 }
579
580 handler->PSendSysMessage("bag: {} slot: {} guid: {} - state: {}", bagSlot, item->GetSlot(), item->GetGUID().ToString(), st);
581 }
582
583 if (updateQueue.empty())
584 handler->PSendSysMessage("The player's updatequeue is empty");
585 }
586
587 if (checkAll)
588 {
589 bool error = false;
590 auto const& updateQueue = player->GetItemUpdateQueue();
591 for (uint8 i = PLAYER_SLOT_START; i < PLAYER_SLOT_END; ++i)
592 {
593 if (i >= BUYBACK_SLOT_START && i < BUYBACK_SLOT_END)
594 continue;
595
596 Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
597 if (!item)
598 continue;
599
600 if (item->GetSlot() != i)
601 {
602 handler->PSendSysMessage("Item with slot {} and guid {} has an incorrect slot value: {}", i, item->GetGUID().ToString(), item->GetSlot());
603 error = true;
604 continue;
605 }
606
607 if (item->GetOwnerGUID() != player->GetGUID())
608 {
609 handler->PSendSysMessage("The item with slot {} {} does have non-matching owner guid {} and {}!", item->GetSlot(), item->GetGUID().ToString(), item->GetOwnerGUID().ToString(), player->GetGUID().ToString());
610 error = true;
611 continue;
612 }
613
614 if (Bag* container = item->GetContainer())
615 {
616 handler->PSendSysMessage("The item with slot {} {} has a container (slot: {}, {}) but shouldn't!", item->GetSlot(), item->GetGUID().ToString(), container->GetSlot(), container->GetGUID().ToString());
617 error = true;
618 continue;
619 }
620
621 if (item->IsInUpdateQueue())
622 {
623 uint16 qp = item->GetQueuePos();
624 if (qp > updateQueue.size())
625 {
626 handler->PSendSysMessage("The item with slot {} and guid {} has its queuepos ({}) larger than the update queue size! ", item->GetSlot(), item->GetGUID().ToString(), qp);
627 error = true;
628 continue;
629 }
630
631 if (!updateQueue[qp])
632 {
633 handler->PSendSysMessage("The item with slot {} and guid {} has its queuepos ({}) pointing to NULL in the queue!", item->GetSlot(), item->GetGUID().ToString(), qp);
634 error = true;
635 continue;
636 }
637
638 if (updateQueue[qp] != item)
639 {
640 handler->PSendSysMessage("The item with slot {} and guid {} has a queuepos ({}) that points to another item in the queue (bag: {}, slot: {}, guid: {})", item->GetSlot(), item->GetGUID().ToString(), qp, updateQueue[qp]->GetBagSlot(), updateQueue[qp]->GetSlot(), updateQueue[qp]->GetGUID().ToString());
641 error = true;
642 continue;
643 }
644 }
645 else if (item->GetState() != ITEM_UNCHANGED)
646 {
647 handler->PSendSysMessage("The item with slot {} and guid {} is not in queue but should be (state: {})!", item->GetSlot(), item->GetGUID().ToString(), item->GetState());
648 error = true;
649 continue;
650 }
651
652 if (Bag* bag = item->ToBag())
653 {
654 for (uint8 j = 0; j < bag->GetBagSize(); ++j)
655 {
656 Item* item2 = bag->GetItemByPos(j);
657 if (!item2)
658 continue;
659
660 if (item2->GetSlot() != j)
661 {
662 handler->PSendSysMessage("The item in bag {} and slot {} (guid: {}) has an incorrect slot value: {}", bag->GetSlot(), j, item2->GetGUID().ToString(), item2->GetSlot());
663 error = true;
664 continue;
665 }
666
667 if (item2->GetOwnerGUID() != player->GetGUID())
668 {
669 handler->PSendSysMessage("The item in bag {} at slot {} and {}, the owner ({}) and the player ({}) don't match!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString(), item2->GetOwnerGUID().ToString(), player->GetGUID().ToString());
670 error = true;
671 continue;
672 }
673
674 Bag* container = item2->GetContainer();
675 if (!container)
676 {
677 handler->PSendSysMessage("The item in bag {} at slot {} {} has no container!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString());
678 error = true;
679 continue;
680 }
681
682 if (container != bag)
683 {
684 handler->PSendSysMessage("The item in bag {} at slot {} {} has a different container(slot {} {})!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString(), container->GetSlot(), container->GetGUID().ToString());
685 error = true;
686 continue;
687 }
688
689 if (item2->IsInUpdateQueue())
690 {
691 uint16 qp = item2->GetQueuePos();
692 if (qp > updateQueue.size())
693 {
694 handler->PSendSysMessage("The item in bag {} at slot {} having guid {} has a queuepos ({}) larger than the update queue size! ", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString(), qp);
695 error = true;
696 continue;
697 }
698
699 if (!updateQueue[qp])
700 {
701 handler->PSendSysMessage("The item in bag {} at slot {} having guid {} has a queuepos ({}) that points to NULL in the queue!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString(), qp);
702 error = true;
703 continue;
704 }
705
706 if (updateQueue[qp] != item2)
707 {
708 handler->PSendSysMessage("The item in bag {} at slot {} having guid {} has a queuepos ({}) that points to another item in the queue (bag: {}, slot: {}, guid: {})", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString(), qp, updateQueue[qp]->GetBagSlot(), updateQueue[qp]->GetSlot(), updateQueue[qp]->GetGUID().ToString());
709 error = true;
710 continue;
711 }
712 }
713 else if (item2->GetState() != ITEM_UNCHANGED)
714 {
715 handler->PSendSysMessage("The item in bag {} at slot {} having guid {} is not in queue but should be (state: {})!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString(), item2->GetState());
716 error = true;
717 continue;
718 }
719 }
720 }
721 }
722
723 uint32 index = 0;
724
725 for (auto const& item : updateQueue)
726 {
727 index++;
728
729 if (item->GetOwnerGUID() != player->GetGUID())
730 {
731 handler->SendSysMessage(Acore::StringFormat("queue({}): For the item {}, the owner ({}) and the player ({}) don't match!", index, item->GetGUID().ToString(), item->GetOwnerGUID().ToString(), player->GetGUID().ToString()));
732 error = true;
733 continue;
734 }
735
736 if (item->GetQueuePos() != index)
737 {
738 handler->SendSysMessage(Acore::StringFormat("queue({}): For the item {}, the queuepos doesn't match it's position in the queue!", index, item->GetGUID().ToString()));
739 error = true;
740 continue;
741 }
742
743 if (item->GetState() == ITEM_REMOVED)
744 continue;
745
746 Item* test = player->GetItemByPos(item->GetBagSlot(), item->GetSlot());
747
748 if (!test)
749 {
750 handler->SendSysMessage(Acore::StringFormat("queue({}): The bag({}) and slot({}) values for {} are incorrect, the player doesn't have any item at that position!", index, item->GetBagSlot(), item->GetSlot(), item->GetGUID().ToString()));
751 error = true;
752 continue;
753 }
754
755 if (test != item)
756 {
757 handler->SendSysMessage(Acore::StringFormat("queue({}): The bag({}) and slot({}) values for the {} are incorrect, {} is there instead!", index, item->GetBagSlot(), item->GetSlot(), item->GetGUID().ToString(), test->GetGUID().ToString()));
758 error = true;
759 continue;
760 }
761 }
762
763 if (!error)
764 handler->SendSysMessage("All OK!");
765 }
766
767 return true;
768 }
std::uint8_t uint8
Definition Define.h:109
std::uint16_t uint16
Definition Define.h:108
ItemUpdateState
Definition Item.h:208
@ ITEM_CHANGED
Definition Item.h:210
@ ITEM_REMOVED
Definition Item.h:212
@ ITEM_NEW
Definition Item.h:211
@ ITEM_UNCHANGED
Definition Item.h:209
@ BUYBACK_SLOT_END
Definition Player.h:731
@ BUYBACK_SLOT_START
Definition Player.h:730
#define INVENTORY_SLOT_BAG_0
Definition Player.h:676
@ PLAYER_SLOT_START
Definition Player.h:670
@ PLAYER_SLOT_END
Definition Player.h:672
Definition Bag.h:28
Player * getSelectedPlayer() const
Definition Chat.cpp:374
Definition Item.h:220
uint8 GetSlot() const
Definition Item.h:281
Bag * GetContainer()
Definition Item.h:282
Bag * ToBag()
Definition Item.h:250
ItemUpdateState GetState() const
Definition Item.h:324
ObjectGuid GetOwnerGUID() const
Definition Item.h:231
uint32 GetQueuePos() const
Definition Item.h:329
uint8 GetBagSlot() const
Definition Item.cpp:784
bool IsInUpdateQueue() const
Definition Item.h:328
std::string ToString() const
Definition ObjectGuid.cpp:47
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:113
Item * GetItemByPos(uint16 pos) const
Definition PlayerStorage.cpp:441
std::vector< Item * > & GetItemUpdateQueue()
Definition Player.h:1273
std::string StringFormat(FormatString< Args... > fmt, Args &&... args)
Default AC string format function.
Definition StringFormat.h:34

References BUYBACK_SLOT_END, BUYBACK_SLOT_START, Item::GetContainer(), Object::GetGUID(), Player::GetItemByPos(), Player::GetItemUpdateQueue(), Item::GetOwnerGUID(), ChatHandler::GetPlayer(), Item::GetQueuePos(), ChatHandler::getSelectedPlayer(), Item::GetSlot(), Item::GetState(), INVENTORY_SLOT_BAG_0, Item::IsInUpdateQueue(), ITEM_CHANGED, ITEM_NEW, ITEM_REMOVED, ITEM_UNCHANGED, PLAYER_SLOT_END, PLAYER_SLOT_START, ChatHandler::PSendSysMessage(), ChatHandler::SendSysMessage(), Acore::StringFormat(), Item::ToBag(), and ObjectGuid::ToString().

Referenced by GetCommands().

◆ HandleDebugGetItemValueCommand()

static bool debug_commandscript::HandleDebugGetItemValueCommand ( ChatHandler handler,
ObjectGuid::LowType  guid,
uint32  index 
)
inlinestatic
977 {
978 Item* i = handler->GetPlayer()->GetItemByGuid(ObjectGuid(HighGuid::Item, 0, guid));
979
980 if (!i)
981 return false;
982
983 if (index >= i->GetValuesCount())
984 return false;
985
986 uint32 value = i->GetUInt32Value(index);
987
988 handler->PSendSysMessage("Item {}: value at {} is {}", guid, index, value);
989
990 return true;
991 }
Definition ObjectGuid.h:118
uint32 GetUInt32Value(uint16 index) const
Definition Object.cpp:305
uint16 GetValuesCount() const
Definition Object.h:188
Item * GetItemByGuid(ObjectGuid guid) const
Definition PlayerStorage.cpp:407

References Player::GetItemByGuid(), ChatHandler::GetPlayer(), Object::GetUInt32Value(), Object::GetValuesCount(), Item, and ChatHandler::PSendSysMessage().

Referenced by GetCommands().

◆ HandleDebugGetLootRecipientCommand()

static bool debug_commandscript::HandleDebugGetLootRecipientCommand ( ChatHandler handler)
inlinestatic
488 {
489 Creature* target = handler->getSelectedCreature();
490 if (!target)
491 return false;
492
493 handler->PSendSysMessage("Loot recipient for creature {} (GUID {}, SpawnID {}) is {}",
494 target->GetName(), target->GetGUID().ToString(), target->GetSpawnId(),
495 target->hasLootRecipient() ? (target->GetLootRecipient() ? target->GetLootRecipient()->GetName() : "offline") : "no loot recipient");
496 return true;
497 }
bool hasLootRecipient() const
Definition Creature.h:235
Player * GetLootRecipient() const
Definition Creature.cpp:1312
ObjectGuid::LowType GetSpawnId() const
Definition Creature.h:65
std::string const & GetName() const
Definition Object.h:464

References Object::GetGUID(), Creature::GetLootRecipient(), WorldObject::GetName(), ChatHandler::getSelectedCreature(), Creature::GetSpawnId(), Creature::hasLootRecipient(), ChatHandler::PSendSysMessage(), and ObjectGuid::ToString().

Referenced by GetCommands().

◆ HandleDebugGetValueCommand()

static bool debug_commandscript::HandleDebugGetValueCommand ( ChatHandler handler,
uint32  index,
bool  isInt 
)
inlinestatic
1098 {
1099 Unit* target = handler->getSelectedUnit();
1100 if (!target)
1101 {
1103 return false;
1104 }
1105
1106 ObjectGuid guid = target->GetGUID();
1107
1108 if (index >= target->GetValuesCount())
1109 {
1110 handler->PSendSysMessage(LANG_TOO_BIG_INDEX, index, guid.ToString(), target->GetValuesCount());
1111 return false;
1112 }
1113
1114 if (isInt)
1115 {
1116 uint32 value = target->GetUInt32Value(index);
1117 handler->PSendSysMessage(LANG_GET_UINT_FIELD, guid.ToString(), index, value);
1118 }
1119 else
1120 {
1121 float value = target->GetFloatValue(index);
1122 handler->PSendSysMessage(LANG_GET_FLOAT_FIELD, guid.ToString(), index, value);
1123 }
1124
1125 return true;
1126 }
@ LANG_TOO_BIG_INDEX
Definition Language.h:622
@ LANG_SELECT_CHAR_OR_CREATURE
Definition Language.h:31
@ LANG_GET_UINT_FIELD
Definition Language.h:628
@ LANG_GET_FLOAT_FIELD
Definition Language.h:630
void SendErrorMessage(uint32 entry)
Definition Chat.cpp:216
float GetFloatValue(uint16 index) const
Definition Object.cpp:317

References Object::GetFloatValue(), Object::GetGUID(), ChatHandler::getSelectedUnit(), Object::GetUInt32Value(), Object::GetValuesCount(), LANG_GET_FLOAT_FIELD, LANG_GET_UINT_FIELD, LANG_SELECT_CHAR_OR_CREATURE, LANG_TOO_BIG_INDEX, ChatHandler::PSendSysMessage(), ChatHandler::SendErrorMessage(), and ObjectGuid::ToString().

Referenced by GetCommands().

◆ HandleDebugHostileRefListCommand()

static bool debug_commandscript::HandleDebugHostileRefListCommand ( ChatHandler handler)
inlinestatic
858 {
859 Unit* target = handler->getSelectedUnit();
860 if (!target)
861 target = handler->GetSession()->GetPlayer();
862
863 HostileReference* ref = target->getHostileRefMgr().getFirst();
864 uint32 count = 0;
865
866 handler->PSendSysMessage("Hostile reference list of {} ({})", target->GetName(), target->GetGUID().ToString());
867
868 while (ref)
869 {
870 if (Unit* unit = ref->GetSource()->GetOwner())
871 {
872 handler->PSendSysMessage(" {}. {} {} ({}) - threat {}", ++count, (ref->IsOnline() ? "" : "[offline]"),
873 unit->GetName(), unit->GetGUID().ToString(), ref->GetThreat());
874 }
875 else
876 {
877 handler->PSendSysMessage(" {}. No Owner - threat {}", ++count, ref->GetThreat());
878 }
879
880 ref = ref->next();
881 }
882
883 handler->SendSysMessage("End of hostile reference list.");
884 return true;
885 }
HostileReference * getFirst()
Definition HostileRefMgr.h:59
Definition ThreatMgr.h:48
float GetThreat() const
Definition ThreatMgr.h:62
bool IsOnline() const
Definition ThreatMgr.h:66
HostileReference * next()
Definition ThreatMgr.h:115
FROM * GetSource() const
Definition Reference.h:97
const std::string & GetName() const
Definition ScriptObject.h:53
Unit * GetOwner() const
Definition ThreatMgr.h:236
HostileRefMgr & getHostileRefMgr()
Definition Unit.h:900
std::string ToString(Type &&val, Params &&... params)
Definition StringConvert.h:250

References HostileRefMgr::getFirst(), Object::GetGUID(), Unit::getHostileRefMgr(), WorldObject::GetName(), ThreatMgr::GetOwner(), WorldSession::GetPlayer(), ChatHandler::getSelectedUnit(), ChatHandler::GetSession(), Reference< TO, FROM >::GetSource(), HostileReference::GetThreat(), HostileReference::IsOnline(), HostileReference::next(), ChatHandler::PSendSysMessage(), ChatHandler::SendSysMessage(), and ObjectGuid::ToString().

Referenced by GetCommands().

◆ HandleDebugItemExpireCommand()

static bool debug_commandscript::HandleDebugItemExpireCommand ( ChatHandler handler,
ObjectGuid::LowType  guid 
)
inlinestatic
1009 {
1010 Item* i = handler->GetPlayer()->GetItemByGuid(ObjectGuid(HighGuid::Item, guid));
1011
1012 if (!i)
1013 return false;
1014
1015 handler->GetPlayer()->DestroyItem(i->GetBagSlot(), i->GetSlot(), true);
1016 sScriptMgr->OnItemExpire(handler->GetPlayer(), i->GetTemplate());
1017
1018 return true;
1019 }
#define sScriptMgr
Definition ScriptMgr.h:727
ItemTemplate const * GetTemplate() const
Definition Item.cpp:544
void DestroyItem(uint8 bag, uint8 slot, bool update)
Definition PlayerStorage.cpp:3023

References Player::DestroyItem(), Item::GetBagSlot(), Player::GetItemByGuid(), ChatHandler::GetPlayer(), Item::GetSlot(), Item::GetTemplate(), Item, and sScriptMgr.

Referenced by GetCommands().

◆ HandleDebugLoSCommand()

static bool debug_commandscript::HandleDebugLoSCommand ( ChatHandler handler)
inlinestatic
1033 {
1034 if (Unit* unit = handler->getSelectedUnit())
1035 {
1036 Player* player = handler->GetSession()->GetPlayer();
1037 handler->PSendSysMessage("Checking LoS {} -> {}:", player->GetName(), unit->GetName());
1038 handler->PSendSysMessage(" VMAP LoS: {}", player->IsWithinLOSInMap(unit, VMAP::ModelIgnoreFlags::Nothing, LINEOFSIGHT_CHECK_VMAP) ? "clear" : "obstructed");
1039 handler->PSendSysMessage(" GObj LoS: {}", player->IsWithinLOSInMap(unit, VMAP::ModelIgnoreFlags::Nothing, LINEOFSIGHT_CHECK_GOBJECT_ALL) ? "clear" : "obstructed");
1040 handler->PSendSysMessage("{} is {}in line of sight of {}.", unit->GetName(), (player->IsWithinLOSInMap(unit) ? "" : "not "), player->GetName());
1041 return true;
1042 }
1043
1044 return false;
1045 }
@ LINEOFSIGHT_CHECK_VMAP
Definition Map.h:100
@ LINEOFSIGHT_CHECK_GOBJECT_ALL
Definition Map.h:104
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

References WorldObject::GetName(), WorldSession::GetPlayer(), ChatHandler::getSelectedUnit(), ChatHandler::GetSession(), WorldObject::IsWithinLOSInMap(), LINEOFSIGHT_CHECK_GOBJECT_ALL, LINEOFSIGHT_CHECK_VMAP, VMAP::Nothing, and ChatHandler::PSendSysMessage().

Referenced by GetCommands().

◆ HandleDebugMapDataCommand()

static bool debug_commandscript::HandleDebugMapDataCommand ( ChatHandler handler)
inlinestatic
1373 {
1374 Cell cell(handler->GetPlayer()->GetPositionX(), handler->GetPlayer()->GetPositionY());
1375 Map* map = handler->GetPlayer()->GetMap();
1376
1377 handler->PSendSysMessage("GridX {} GridY {}", cell.GridX(), cell.GridY());
1378 handler->PSendSysMessage("CellX {} CellY {}", cell.CellX(), cell.CellY());
1379 handler->PSendSysMessage("Created Grids: {} / {}", map->GetCreatedGridsCount(), MAX_NUMBER_OF_GRIDS * MAX_NUMBER_OF_GRIDS);
1380 handler->PSendSysMessage("Loaded Grids: {} / {}", map->GetLoadedGridsCount(), MAX_NUMBER_OF_GRIDS * MAX_NUMBER_OF_GRIDS);
1381 handler->PSendSysMessage("Created Cells In Grid: {} / {}", map->GetCreatedCellsInGridCount(cell.GridX(), cell.GridY()), MAX_NUMBER_OF_CELLS * MAX_NUMBER_OF_CELLS);
1383 return true;
1384 }
#define TOTAL_NUMBER_OF_CELLS_PER_MAP
Definition GridDefines.h:47
#define MAX_NUMBER_OF_CELLS
Definition MapDefines.h:25
#define MAX_NUMBER_OF_GRIDS
Definition MapDefines.h:24
Definition Map.h:156
uint32 GetLoadedGridsCount()
Definition Map.cpp:3258
uint32 GetCreatedGridsCount()
Definition Map.cpp:3253
uint32 GetCreatedCellsInGridCount(uint16 const x, uint16 const y)
Definition Map.cpp:3263
uint32 GetCreatedCellsInMapCount()
Definition Map.cpp:3268
Map * GetMap() const
Definition Object.h:537
Definition Cell.h:45
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122

References Cell::CellX(), Cell::CellY(), Map::GetCreatedCellsInGridCount(), Map::GetCreatedCellsInMapCount(), Map::GetCreatedGridsCount(), Map::GetLoadedGridsCount(), WorldObject::GetMap(), ChatHandler::GetPlayer(), Position::GetPositionX(), Position::GetPositionY(), Cell::GridX(), Cell::GridY(), MAX_NUMBER_OF_CELLS, MAX_NUMBER_OF_GRIDS, ChatHandler::PSendSysMessage(), and TOTAL_NUMBER_OF_CELLS_PER_MAP.

Referenced by GetCommands().

◆ HandleDebugMod32ValueCommand()

static bool debug_commandscript::HandleDebugMod32ValueCommand ( ChatHandler handler,
uint32  index,
uint32  value 
)
inlinestatic
1129 {
1130 if (index >= handler->GetPlayer()->GetValuesCount())
1131 {
1132 handler->PSendSysMessage(LANG_TOO_BIG_INDEX, index, handler->GetPlayer()->GetGUID().ToString(), handler->GetPlayer()->GetValuesCount());
1133 return false;
1134 }
1135
1136 uint32 currentValue = handler->GetPlayer()->GetUInt32Value(index);
1137
1138 currentValue += value;
1139 handler->GetPlayer()->SetUInt32Value(index, currentValue);
1140
1141 handler->PSendSysMessage(LANG_CHANGE_32BIT_FIELD, index, currentValue);
1142
1143 return true;
1144 }
@ LANG_CHANGE_32BIT_FIELD
Definition Language.h:634
void SetUInt32Value(uint16 index, uint32 value)
Definition Unit.cpp:21136

References Object::GetGUID(), ChatHandler::GetPlayer(), Object::GetUInt32Value(), Object::GetValuesCount(), LANG_CHANGE_32BIT_FIELD, LANG_TOO_BIG_INDEX, ChatHandler::PSendSysMessage(), Unit::SetUInt32Value(), and ObjectGuid::ToString().

Referenced by GetCommands().

◆ HandleDebugMoveflagsCommand()

static bool debug_commandscript::HandleDebugMoveflagsCommand ( ChatHandler handler,
Optional< uint32 moveFlags,
Optional< uint32 moveFlagsExtra 
)
inlinestatic

Display case

1201 {
1202 Unit* target = handler->getSelectedUnit();
1203 if (!target)
1204 target = handler->GetPlayer();
1205
1206 if (!moveFlags)
1207 {
1210 }
1211 else
1212 {
1213 static uint32 const FlagsWithHandlers = MOVEMENTFLAG_MASK_HAS_PLAYER_STATUS_OPCODE |
1216
1217 bool unhandledFlag = ((*moveFlags ^ target->GetUnitMovementFlags()) & ~FlagsWithHandlers) != 0;
1218
1219 target->SetWalk((*moveFlags & MOVEMENTFLAG_WALKING) != 0);
1220 target->SetDisableGravity((*moveFlags & MOVEMENTFLAG_DISABLE_GRAVITY) != 0);
1221 target->SetSwim((*moveFlags & MOVEMENTFLAG_SWIMMING) != 0);
1222 target->SetCanFly((*moveFlags & MOVEMENTFLAG_CAN_FLY) != 0);
1223 target->SetWaterWalking((*moveFlags & MOVEMENTFLAG_WATERWALKING) != 0);
1224 target->SetFeatherFall((*moveFlags & MOVEMENTFLAG_FALLING_SLOW) != 0);
1225 target->SetHover((*moveFlags & MOVEMENTFLAG_HOVER) != 0);
1226
1228 *moveFlags &= ~MOVEMENTFLAG_FALLING;
1229
1230 if (*moveFlags & MOVEMENTFLAG_ROOT)
1231 {
1232 target->SetControlled(true, UNIT_STATE_ROOT);
1233 *moveFlags &= ~MOVEMENTFLAG_MASK_MOVING;
1234 }
1235
1237 target->StopMoving();
1238
1239 if (unhandledFlag)
1240 target->SetUnitMovementFlags(*moveFlags);
1241
1242 if (moveFlagsExtra)
1243 {
1244 target->SetExtraUnitMovementFlags(*moveFlagsExtra);
1245 }
1246
1247 if (moveFlagsExtra || unhandledFlag)
1248 target->SendMovementFlagUpdate();
1249
1251 }
1252
1253 return true;
1254 }
@ LANG_MOVEFLAGS_GET
Definition Language.h:933
@ LANG_MOVEFLAGS_SET
Definition Language.h:934
@ MOVEMENTFLAG_SPLINE_ENABLED
Definition UnitDefines.h:392
@ MOVEMENTFLAG_WATERWALKING
Definition UnitDefines.h:393
@ MOVEMENTFLAG_DISABLE_GRAVITY
Definition UnitDefines.h:375
@ MOVEMENTFLAG_FALLING_SLOW
Definition UnitDefines.h:394
@ MOVEMENTFLAG_CAN_FLY
Definition UnitDefines.h:389
@ MOVEMENTFLAG_ROOT
Definition UnitDefines.h:376
@ MOVEMENTFLAG_FALLING
Definition UnitDefines.h:377
@ MOVEMENTFLAG_MASK_HAS_PLAYER_STATUS_OPCODE
Movement flags that have change status opcodes associated for players.
Definition UnitDefines.h:414
@ MOVEMENTFLAG_SWIMMING
Definition UnitDefines.h:386
@ MOVEMENTFLAG_HOVER
Definition UnitDefines.h:395
@ MOVEMENTFLAG_WALKING
Definition UnitDefines.h:373
@ UNIT_STATE_ROOT
Definition UnitDefines.h:180
uint32 GetUnitMovementFlags() const
Definition Unit.h:730
void SetUnitMovementFlags(uint32 f)
Definition Unit.h:731
void SetExtraUnitMovementFlags(uint16 f)
Definition Unit.h:737
void StopMoving()
Definition Unit.cpp:16683
virtual bool SetSwim(bool enable)
Definition Unit.cpp:20400
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition Unit.cpp:18081
virtual bool SetCanFly(bool enable, bool packetOnly=false)
Add the movement flag: MOVEMENTFLAGCAN_FLY. Generaly only use by players, allowing them to fly by pre...
Definition Unit.cpp:20425
bool HasUnitMovementFlag(uint32 f) const
Definition Unit.h:729
virtual bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true)
Definition Unit.cpp:20382
void SendMovementFlagUpdate(bool self=false)
Definition Unit.cpp:16737
virtual bool SetFeatherFall(bool enable, bool packetOnly=false)
Definition Unit.cpp:20469
virtual bool SetWalk(bool enable)
Definition Unit.cpp:20368
virtual bool SetHover(bool enable, bool packetOnly=false, bool updateAnimationTier=true)
Definition Unit.cpp:20491
uint16 GetExtraUnitMovementFlags() const
Definition Unit.h:736
virtual bool SetWaterWalking(bool enable, bool packetOnly=false)
Allow to walk on water. Doesn't inform the client. Need to use SendMovementWaterWalking() if it's for...
Definition Unit.cpp:20447

References Unit::GetExtraUnitMovementFlags(), ChatHandler::GetPlayer(), ChatHandler::getSelectedUnit(), Unit::GetUnitMovementFlags(), Unit::HasUnitMovementFlag(), LANG_MOVEFLAGS_GET, LANG_MOVEFLAGS_SET, MOVEMENTFLAG_CAN_FLY, MOVEMENTFLAG_DISABLE_GRAVITY, MOVEMENTFLAG_FALLING, MOVEMENTFLAG_FALLING_SLOW, MOVEMENTFLAG_HOVER, MOVEMENTFLAG_MASK_HAS_PLAYER_STATUS_OPCODE, MOVEMENTFLAG_ROOT, MOVEMENTFLAG_SPLINE_ENABLED, MOVEMENTFLAG_SWIMMING, MOVEMENTFLAG_WALKING, MOVEMENTFLAG_WATERWALKING, ChatHandler::PSendSysMessage(), Unit::SendMovementFlagUpdate(), Unit::SetCanFly(), Unit::SetControlled(), Unit::SetDisableGravity(), Unit::SetExtraUnitMovementFlags(), Unit::SetFeatherFall(), Unit::SetHover(), Unit::SetSwim(), Unit::SetUnitMovementFlags(), Unit::SetWalk(), Unit::SetWaterWalking(), Unit::StopMoving(), and UNIT_STATE_ROOT.

Referenced by GetCommands().

◆ HandleDebugObjectCountCommand()

static bool debug_commandscript::HandleDebugObjectCountCommand ( ChatHandler handler,
Optional< uint32 mapId 
)
inlinestatic
1289 {
1290 if (mapId)
1291 {
1292 sMapMgr->DoForAllMapsWithMapId(mapId.value(),
1293 [handler](Map* map) -> void
1294 {
1295 HandleDebugObjectCountMap(handler, map);
1296 }
1297 );
1298 }
1299 else
1300 {
1301 sMapMgr->DoForAllMaps(
1302 [handler](Map* map) -> void
1303 {
1304 HandleDebugObjectCountMap(handler, map);
1305 }
1306 );
1307 }
1308
1309 return true;
1310 }
#define sMapMgr
Definition MapMgr.h:220
static void HandleDebugObjectCountMap(ChatHandler *handler, Map *map)
Definition cs_debug.cpp:1348

References HandleDebugObjectCountMap(), and sMapMgr.

Referenced by GetCommands().

◆ HandleDebugObjectCountMap()

static void debug_commandscript::HandleDebugObjectCountMap ( ChatHandler handler,
Map map 
)
inlinestatic
1349 {
1350 handler->PSendSysMessage("Map Id: {} Name: '{}' Instance Id: {} Creatures: {} GameObjects: {} SetActive Objects: {}",
1351 map->GetId(), map->GetMapName(), map->GetInstanceId(),
1355
1356 CreatureCountWorker worker;
1358 visitor.Visit(map->GetObjectsStore());
1359
1360 handler->PSendSysMessage("Top Creatures count:");
1361
1362 for (auto&& p : worker.GetTopCreatureCount(5))
1363 handler->PSendSysMessage("Entry: {} Count: {}", p.first, p.second);
1364 }
std::uint64_t uint64
Definition Define.h:106
Definition GameObject.h:120
std::size_t GetActiveNonPlayersCount() const
Definition Map.h:503
MapStoredObjectTypesContainer & GetObjectsStore()
Definition Map.h:364
uint32 GetId() const
Definition Map.h:229
const char * GetMapName() const
Definition Map.cpp:1680
uint32 GetInstanceId() const
Definition Map.h:266
Definition TypeContainerVisitor.h:84
std::size_t Size() const
Definition TypeContainer.h:150

References Map::GetActiveNonPlayersCount(), Map::GetId(), Map::GetInstanceId(), Map::GetMapName(), Map::GetObjectsStore(), debug_commandscript::CreatureCountWorker::GetTopCreatureCount(), ChatHandler::PSendSysMessage(), TypeUnorderedMapContainer< OBJECT_TYPES, KEY_TYPE >::Size(), and TypeContainerVisitor< VISITOR, TYPE_CONTAINER >::Visit().

Referenced by HandleDebugObjectCountCommand().

◆ HandleDebugPlayCinematicCommand()

static bool debug_commandscript::HandleDebugPlayCinematicCommand ( ChatHandler handler,
uint32  cinematicId 
)
inlinestatic
114 {
115 CinematicSequencesEntry const* cineSeq = sCinematicSequencesStore.LookupEntry(cinematicId);
116 if (!cineSeq)
117 {
118 handler->SendErrorMessage(LANG_CINEMATIC_NOT_EXIST, cinematicId);
119 return false;
120 }
121
122 // Dump camera locations
123 if (std::vector<FlyByCamera> const* flyByCameras = GetFlyByCameras(cineSeq->cinematicCamera))
124 {
125 handler->PSendSysMessage("Waypoints for sequence {}, camera {}", cinematicId, cineSeq->cinematicCamera);
126 uint32 count = 1;
127 for (FlyByCamera const& cam : *flyByCameras)
128 {
129 handler->PSendSysMessage("{} - {}ms [{} ({} degrees)]", count, cam.timeStamp, cam.locations.ToString(), cam.locations.GetOrientation() * (180 / M_PI));
130 ++count;
131 }
132 handler->PSendSysMessage("{} waypoints dumped", flyByCameras->size());
133 }
134
135 handler->GetPlayer()->SendCinematicStart(cinematicId);
136 return true;
137 }
DBCStorage< CinematicSequencesEntry > sCinematicSequencesStore(CinematicSequencesEntryfmt)
@ LANG_CINEMATIC_NOT_EXIST
Definition Language.h:978
std::vector< FlyByCamera > const * GetFlyByCameras(uint32 cinematicCameraId)
Definition M2Stores.cpp:254
void SendCinematicStart(uint32 CinematicSequenceId) const
Definition Player.cpp:5717
Definition DBCStructure.h:713
uint32 cinematicCamera
Definition DBCStructure.h:716
Definition M2Stores.h:26

References CinematicSequencesEntry::cinematicCamera, GetFlyByCameras(), ChatHandler::GetPlayer(), LANG_CINEMATIC_NOT_EXIST, ChatHandler::PSendSysMessage(), sCinematicSequencesStore, Player::SendCinematicStart(), and ChatHandler::SendErrorMessage().

Referenced by GetCommands().

◆ HandleDebugPlayMovieCommand()

static bool debug_commandscript::HandleDebugPlayMovieCommand ( ChatHandler handler,
uint32  movieId 
)
inlinestatic
141 {
142 if (!sMovieStore.LookupEntry(movieId))
143 {
144 handler->SendErrorMessage(LANG_MOVIE_NOT_EXIST, movieId);
145 return false;
146 }
147
148 handler->GetPlayer()->SendMovieStart(movieId);
149 return true;
150 }
DBCStorage< MovieEntry > sMovieStore(MovieEntryfmt)
@ LANG_MOVIE_NOT_EXIST
Definition Language.h:979
void SendMovieStart(uint32 MovieId)
Definition Player.cpp:5728

References ChatHandler::GetPlayer(), LANG_MOVIE_NOT_EXIST, ChatHandler::SendErrorMessage(), Player::SendMovieStart(), and sMovieStore.

Referenced by GetCommands().

◆ HandleDebugPlayMusicCommand()

static bool debug_commandscript::HandleDebugPlayMusicCommand ( ChatHandler handler,
uint32  musicId 
)
inlinestatic
181 {
182 if (!sSoundEntriesStore.LookupEntry(musicId))
183 {
184 handler->SendErrorMessage(LANG_SOUND_NOT_EXIST, musicId);
185 return false;
186 }
187
188 Player* player = handler->GetPlayer();
189
190 player->PlayDirectMusic(musicId, player);
191
192 handler->PSendSysMessage(LANG_YOU_HEAR_SOUND, musicId);
193 return true;
194 }
DBCStorage< SoundEntriesEntry > sSoundEntriesStore(SoundEntriesfmt)
@ LANG_YOU_HEAR_SOUND
Definition Language.h:197
@ LANG_SOUND_NOT_EXIST
Definition Language.h:211
void PlayDirectMusic(uint32 music_id, Player *target=nullptr)
Definition Object.cpp:2927

References ChatHandler::GetPlayer(), LANG_SOUND_NOT_EXIST, LANG_YOU_HEAR_SOUND, WorldObject::PlayDirectMusic(), ChatHandler::PSendSysMessage(), ChatHandler::SendErrorMessage(), and sSoundEntriesStore.

Referenced by GetCommands().

◆ HandleDebugPlaySoundCommand()

static bool debug_commandscript::HandleDebugPlaySoundCommand ( ChatHandler handler,
uint32  soundId 
)
inlinestatic
154 {
155 if (!sSoundEntriesStore.LookupEntry(soundId))
156 {
157 handler->SendErrorMessage(LANG_SOUND_NOT_EXIST, soundId);
158 return false;
159 }
160
161 Player* player = handler->GetPlayer();
162
163 Unit* unit = handler->getSelectedUnit();
164 if (!unit)
165 {
167 return false;
168 }
169
170 if (player->GetTarget())
171 unit->PlayDistanceSound(soundId, player);
172 else
173 unit->PlayDirectSound(soundId, player);
174
175 handler->PSendSysMessage(LANG_YOU_HEAR_SOUND, soundId);
176 return true;
177 }
ObjectGuid GetTarget() const
Definition Unit.h:811
void PlayDirectSound(uint32 sound_id, Player *target=nullptr)
Definition Object.cpp:2903
void PlayDistanceSound(uint32 sound_id, Player *target=nullptr)
Definition Object.cpp:2895

References ChatHandler::GetPlayer(), ChatHandler::getSelectedUnit(), Unit::GetTarget(), LANG_SELECT_CHAR_OR_CREATURE, LANG_SOUND_NOT_EXIST, LANG_YOU_HEAR_SOUND, WorldObject::PlayDirectSound(), WorldObject::PlayDistanceSound(), ChatHandler::PSendSysMessage(), ChatHandler::SendErrorMessage(), and sSoundEntriesStore.

Referenced by GetCommands().

◆ HandleDebugSendBuyErrorCommand()

static bool debug_commandscript::HandleDebugSendBuyErrorCommand ( ChatHandler handler,
BuyResult  error 
)
inlinestatic
251 {
252 handler->GetPlayer()->SendBuyError(BuyResult(error), nullptr, 0, 0);
253 return true;
254 }
BuyResult
Definition Item.h:140
void SendBuyError(BuyResult msg, Creature *creature, uint32 item, uint32 param)
Definition PlayerStorage.cpp:4064

References ChatHandler::GetPlayer(), and Player::SendBuyError().

Referenced by GetCommands().

◆ HandleDebugSendChannelNotifyCommand()

static bool debug_commandscript::HandleDebugSendChannelNotifyCommand ( ChatHandler handler,
ChatNotify  type 
)
inlinestatic
463 {
464 WorldPacket data(SMSG_CHANNEL_NOTIFY, (1 + 10));
465 data << type;
466 data << "test";
467 data << uint32(0);
468 data << uint32(0);
469 handler->GetSession()->SendPacket(&data);
470 return true;
471 }
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
Definition WorldSession.cpp:226
@ SMSG_CHANNEL_NOTIFY
Definition Opcodes.h:183

References ChatHandler::GetSession(), WorldSession::SendPacket(), and SMSG_CHANNEL_NOTIFY.

Referenced by GetCommands().

◆ HandleDebugSendChatMsgCommand()

static bool debug_commandscript::HandleDebugSendChatMsgCommand ( ChatHandler handler,
ChatMsg  type 
)
inlinestatic
474 {
475 WorldPacket data;
476 ChatHandler::BuildChatPacket(data, type, LANG_UNIVERSAL, handler->GetPlayer(), handler->GetPlayer(), "testtest", 0, "chan");
477 handler->GetSession()->SendPacket(&data);
478 return true;
479 }
@ LANG_UNIVERSAL
Definition SharedDefines.h:735
static std::size_t BuildChatPacket(WorldPacket &data, ChatMsg chatType, Language language, ObjectGuid senderGUID, ObjectGuid receiverGUID, std::string_view message, uint8 chatTag, std::string const &senderName="", std::string const &receiverName="", uint32 achievementId=0, bool gmMessage=false, std::string const &channelName="")
Definition Chat.cpp:265

References ChatHandler::BuildChatPacket(), ChatHandler::GetPlayer(), ChatHandler::GetSession(), LANG_UNIVERSAL, and WorldSession::SendPacket().

Referenced by GetCommands().

◆ HandleDebugSendEquipErrorCommand()

static bool debug_commandscript::HandleDebugSendEquipErrorCommand ( ChatHandler handler,
InventoryResult  error 
)
inlinestatic
239 {
240 handler->GetPlayer()->SendEquipError(InventoryResult(error), nullptr, nullptr);
241 return true;
242 }
InventoryResult
Definition Item.h:46
void SendEquipError(InventoryResult msg, Item *pItem, Item *pItem2=nullptr, uint32 itemid=0)
Definition PlayerStorage.cpp:4021

References ChatHandler::GetPlayer(), and Player::SendEquipError().

Referenced by GetCommands().

◆ HandleDebugSendLargePacketCommand()

static bool debug_commandscript::HandleDebugSendLargePacketCommand ( ChatHandler handler)
inlinestatic
960 {
961 std::ostringstream ss;
962
963 while (ss.str().size() < 128000)
964 ss << "This is a dummy string to push the packet's size beyond 128000 bytes. ";
965
966 handler->SendSysMessage(ss.str().c_str());
967 return true;
968 }

References ChatHandler::SendSysMessage().

Referenced by GetCommands().

◆ HandleDebugSendOpcodeCommand()

static bool debug_commandscript::HandleDebugSendOpcodeCommand ( ChatHandler handler)
inlinestatic
257 {
258 Unit* unit = handler->getSelectedUnit();
259 Player* player = nullptr;
260
261 if (!unit || (!unit->IsPlayer()))
262 {
263 player = handler->GetSession()->GetPlayer();
264 }
265 else
266 {
267 player = unit->ToPlayer();
268 }
269
270 if (!unit)
271 {
272 unit = player;
273 }
274
275 std::ifstream ifs("opcode.txt");
276 if (!ifs.is_open())
277 {
279 return false;
280 }
281
282 // remove comments from file
283 std::stringstream parsedStream;
284 while (!ifs.eof())
285 {
286 char commentToken[2];
287 ifs.get(commentToken[0]);
288 if (commentToken[0] == '/' && !ifs.eof())
289 {
290 ifs.get(commentToken[1]);
291 // /* comment
292 if (commentToken[1] == '*')
293 {
294 while (!ifs.eof())
295 {
296 ifs.get(commentToken[0]);
297 if (commentToken[0] == '*' && !ifs.eof())
298 {
299 ifs.get(commentToken[1]);
300 if (commentToken[1] == '/')
301 break;
302 else
303 ifs.putback(commentToken[1]);
304 }
305 }
306 continue;
307 }
308 // line comment
309 else if (commentToken[1] == '/')
310 {
311 std::string str;
312 getline(ifs, str);
313 continue;
314 }
315 // regular data
316 else
317 {
318 ifs.putback(commentToken[1]);
319 }
320 }
321
322 parsedStream.put(commentToken[0]);
323 }
324
325 ifs.close();
326
327 uint32 opcode;
328 parsedStream >> opcode;
329
330 WorldPacket data(opcode, 0);
331
332 while (!parsedStream.eof())
333 {
334 std::string type;
335 parsedStream >> type;
336
337 if (type.empty())
338 break;
339
340 if (type == "uint8")
341 {
342 uint16 val1;
343 parsedStream >> val1;
344 data << uint8(val1);
345 }
346 else if (type == "uint16")
347 {
348 uint16 val2;
349 parsedStream >> val2;
350 data << val2;
351 }
352 else if (type == "uint32")
353 {
354 uint32 val3;
355 parsedStream >> val3;
356 data << val3;
357 }
358 else if (type == "uint64")
359 {
360 uint64 val4;
361 parsedStream >> val4;
362 data << val4;
363 }
364 else if (type == "float")
365 {
366 float val5;
367 parsedStream >> val5;
368 data << val5;
369 }
370 else if (type == "string")
371 {
372 std::string val6;
373 parsedStream >> val6;
374 data << val6;
375 }
376 else if (type == "appitsguid")
377 {
378 data << unit->GetPackGUID();
379 }
380 else if (type == "appmyguid")
381 {
382 data << player->GetPackGUID();
383 }
384 else if (type == "appgoguid")
385 {
386 GameObject* obj = handler->GetNearbyGameObject();
387 if (!obj)
388 {
390 ifs.close();
391 return false;
392 }
393 data << obj->GetPackGUID();
394 }
395 else if (type == "goguid")
396 {
397 GameObject* obj = handler->GetNearbyGameObject();
398 if (!obj)
399 {
401 ifs.close();
402 return false;
403 }
404 data << obj->GetGUID();
405 }
406 else if (type == "myguid")
407 {
408 data << player->GetGUID();
409 }
410 else if (type == "itsguid")
411 {
412 data << unit->GetGUID();
413 }
414 else if (type == "itspos")
415 {
416 data << unit->GetPositionX();
417 data << unit->GetPositionY();
418 data << unit->GetPositionZ();
419 }
420 else if (type == "mypos")
421 {
422 data << player->GetPositionX();
423 data << player->GetPositionY();
424 data << player->GetPositionZ();
425 }
426 else
427 {
428 LOG_ERROR("network.opcode", "Sending opcode that has unknown type '{}'", type);
429 break;
430 }
431 }
432
433 data.hexlike();
434 player->GetSession()->SendPacket(&data);
435 handler->PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName());
436 return true;
437 }
@ LANG_COMMAND_OBJNOTFOUND
Definition Language.h:319
@ LANG_COMMAND_OPCODESENT
Definition Language.h:514
@ LANG_DEBUG_OPCODE_FILE_MISSING
Definition Language.h:1321
#define LOG_ERROR(filterType__,...)
Definition Log.h:157
GameObject * GetNearbyGameObject() const
Definition Chat.cpp:565
bool IsPlayer() const
Definition Object.h:201
PackedGuid const & GetPackGUID() const
Definition Object.h:115
Player * ToPlayer()
Definition Object.h:202
WorldSession * GetSession() const
Definition Player.h:2007
float GetPositionZ() const
Definition Position.h:123

References Object::GetGUID(), WorldObject::GetName(), ChatHandler::GetNearbyGameObject(), WorldPacket::GetOpcode(), Object::GetPackGUID(), WorldSession::GetPlayer(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), ChatHandler::getSelectedUnit(), ChatHandler::GetSession(), Player::GetSession(), ByteBuffer::hexlike(), Object::IsPlayer(), LANG_COMMAND_OBJNOTFOUND, LANG_COMMAND_OPCODESENT, LANG_DEBUG_OPCODE_FILE_MISSING, LOG_ERROR, ChatHandler::PSendSysMessage(), ChatHandler::SendErrorMessage(), WorldSession::SendPacket(), and Object::ToPlayer().

Referenced by GetCommands().

◆ HandleDebugSendQuestInvalidMsgCommand()

static bool debug_commandscript::HandleDebugSendQuestInvalidMsgCommand ( ChatHandler handler,
QuestFailedReason  msg 
)
inlinestatic
500 {
501 handler->GetPlayer()->SendCanTakeQuestResponse(msg);
502 return true;
503 }
void SendCanTakeQuestResponse(uint32 msg) const
Definition PlayerQuest.cpp:2405

References ChatHandler::GetPlayer(), and Player::SendCanTakeQuestResponse().

Referenced by GetCommands().

◆ HandleDebugSendQuestPartyMsgCommand()

static bool debug_commandscript::HandleDebugSendQuestPartyMsgCommand ( ChatHandler handler,
QuestShareMessages  msg 
)
inlinestatic
482 {
483 handler->GetPlayer()->SendPushToPartyResponse(handler->GetPlayer(), msg);
484 return true;
485 }
void SendPushToPartyResponse(Player const *player, uint8 msg) const
Definition PlayerQuest.cpp:2435

References ChatHandler::GetPlayer(), and Player::SendPushToPartyResponse().

Referenced by GetCommands().

◆ HandleDebugSendSellErrorCommand()

static bool debug_commandscript::HandleDebugSendSellErrorCommand ( ChatHandler handler,
SellResult  error 
)
inlinestatic
245 {
246 handler->GetPlayer()->SendSellError(SellResult(error), nullptr, ObjectGuid::Empty, 0);
247 return true;
248 }
SellResult
Definition Item.h:154
static ObjectGuid const Empty
Definition ObjectGuid.h:120
void SendSellError(SellResult msg, Creature *creature, ObjectGuid guid, uint32 param)
Definition PlayerStorage.cpp:4076

References ObjectGuid::Empty, ChatHandler::GetPlayer(), and Player::SendSellError().

Referenced by GetCommands().

◆ HandleDebugSendSetPhaseShiftCommand()

static bool debug_commandscript::HandleDebugSendSetPhaseShiftCommand ( ChatHandler handler,
uint32  phaseShift 
)
inlinestatic
971 {
972 handler->GetSession()->SendSetPhaseShift(phaseShift);
973 return true;
974 }
void SendSetPhaseShift(uint32 phaseShift)
Definition MiscHandler.cpp:1614

References ChatHandler::GetSession(), and WorldSession::SendSetPhaseShift().

Referenced by GetCommands().

◆ HandleDebugSendSpellFailCommand()

static bool debug_commandscript::HandleDebugSendSpellFailCommand ( ChatHandler handler,
SpellCastResult  result,
Optional< uint32 failArg1,
Optional< uint32 failArg2 
)
inlinestatic
218 {
220 data << uint8(0);
221 data << uint32(133); // Spell "Fireball"
222 data << uint8(result);
223
224 if (failArg1 || failArg2)
225 {
226 data << uint32(failArg1.value_or(0));
227 }
228
229 if (failArg2)
230 {
231 data << uint32(*failArg2);
232 }
233
234 handler->GetSession()->SendPacket(&data);
235 return true;
236 }
@ SMSG_CAST_FAILED
Definition Opcodes.h:334

References ChatHandler::GetSession(), WorldSession::SendPacket(), and SMSG_CAST_FAILED.

Referenced by GetCommands().

◆ HandleDebugSet32BitCommand()

static bool debug_commandscript::HandleDebugSet32BitCommand ( ChatHandler handler,
uint32  index,
uint8  bit 
)
inlinestatic
1182 {
1183 WorldObject* target = handler->getSelectedObject();
1184 if (!target)
1185 {
1187 return false;
1188 }
1189
1190 if (bit > 32) // uint32 = 32 bits
1191 return false;
1192
1193 uint32 value = bit ? 1 << (bit - 1) : 0;
1194 target->SetUInt32Value(index, value);
1195
1196 handler->PSendSysMessage(LANG_SET_32BIT_FIELD, index, value);
1197 return true;
1198 }
@ LANG_SET_32BIT_FIELD
Definition Language.h:632
WorldObject * getSelectedObject() const
Definition Chat.cpp:397
void SetUInt32Value(uint16 index, uint32 value)
Definition Object.cpp:650
Definition Object.h:411

References ChatHandler::getSelectedObject(), LANG_SELECT_CHAR_OR_CREATURE, LANG_SET_32BIT_FIELD, ChatHandler::PSendSysMessage(), ChatHandler::SendErrorMessage(), and Object::SetUInt32Value().

Referenced by GetCommands().

◆ HandleDebugSetAuraStateCommand()

static bool debug_commandscript::HandleDebugSetAuraStateCommand ( ChatHandler handler,
Optional< AuraStateType state,
bool  apply 
)
inlinestatic
1048 {
1049 Unit* unit = handler->getSelectedUnit();
1050 if (!unit)
1051 {
1053 return false;
1054 }
1055
1056 if (!state)
1057 {
1058 // reset all states
1059 for (AuraStateType s : EnumUtils::Iterate<AuraStateType>())
1060 unit->ModifyAuraState(s, false);
1061 return true;
1062 }
1063
1064 unit->ModifyAuraState(*state, apply);
1065 return true;
1066 }
AuraStateType
Definition SharedDefines.h:1288
Definition SmartEnum.h:47
void ModifyAuraState(AuraStateType flag, bool apply)
Definition Unit.cpp:10541

References ChatHandler::getSelectedUnit(), LANG_SELECT_CHAR_OR_CREATURE, Unit::ModifyAuraState(), and ChatHandler::SendErrorMessage().

Referenced by GetCommands().

◆ HandleDebugSetItemValueCommand()

static bool debug_commandscript::HandleDebugSetItemValueCommand ( ChatHandler handler,
ObjectGuid::LowType  guid,
uint32  index,
uint32  value 
)
inlinestatic
994 {
995 Item* i = handler->GetPlayer()->GetItemByGuid(ObjectGuid(HighGuid::Item, 0, guid));
996
997 if (!i)
998 return false;
999
1000 if (index >= i->GetValuesCount())
1001 return false;
1002
1003 i->SetUInt32Value(index, value);
1004
1005 return true;
1006 }

References Player::GetItemByGuid(), ChatHandler::GetPlayer(), Object::GetValuesCount(), Item, and Object::SetUInt32Value().

Referenced by GetCommands().

◆ HandleDebugSetValueCommand()

static bool debug_commandscript::HandleDebugSetValueCommand ( ChatHandler handler,
uint32  index,
Variant< uint32, float >  value 
)
inlinestatic
1069 {
1070 WorldObject* target = handler->getSelectedObject();
1071 if (!target)
1072 {
1074 return false;
1075 }
1076
1077 if (index >= target->GetValuesCount())
1078 {
1079 handler->PSendSysMessage(LANG_TOO_BIG_INDEX, index, target->GetGUID().ToString(), target->GetValuesCount());
1080 return false;
1081 }
1082
1083 if (value.holds_alternative<uint32>())
1084 {
1085 target->SetUInt32Value(index, value.get<uint32>());
1086 handler->PSendSysMessage(LANG_SET_UINT_FIELD, target->GetGUID().ToString(), uint32(index), uint32(value));
1087 }
1088 else if (value.holds_alternative<float>())
1089 {
1090 target->SetFloatValue(index, value.get<float>());
1091 handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, target->GetGUID().ToString(), static_cast<float>(index), uint32(value));
1092 }
1093
1094 return true;
1095 }
@ LANG_SET_UINT_FIELD
Definition Language.h:624
@ LANG_SET_FLOAT_FIELD
Definition Language.h:626
void SetFloatValue(uint16 index, float value)
Definition Object.cpp:737
constexpr decltype(auto) get()
Definition ChatCommandTags.h:284
constexpr bool holds_alternative() const
Definition ChatCommandTags.h:298

References Acore::ChatCommands::Variant< T1, Ts >::get(), Object::GetGUID(), ChatHandler::getSelectedObject(), Object::GetValuesCount(), Acore::ChatCommands::Variant< T1, Ts >::holds_alternative(), LANG_SELECT_CHAR_OR_CREATURE, LANG_SET_FLOAT_FIELD, LANG_SET_UINT_FIELD, LANG_TOO_BIG_INDEX, ChatHandler::PSendSysMessage(), ChatHandler::SendErrorMessage(), Object::SetFloatValue(), Object::SetUInt32Value(), and ObjectGuid::ToString().

Referenced by GetCommands().

◆ HandleDebugSetVehicleIdCommand()

static bool debug_commandscript::HandleDebugSetVehicleIdCommand ( ChatHandler handler,
uint32  id 
)
inlinestatic
888 {
889 Unit* target = handler->getSelectedUnit();
890 if (!target || target->IsVehicle())
891 return false;
892
893 //target->SetVehicleId(id);
894 handler->PSendSysMessage("Vehicle id set to {}", id);
895 return true;
896 }

References ChatHandler::getSelectedUnit(), Unit::IsVehicle(), and ChatHandler::PSendSysMessage().

Referenced by GetCommands().

◆ HandleDebugSpawnVehicleCommand()

static bool debug_commandscript::HandleDebugSpawnVehicleCommand ( ChatHandler handler,
uint32  entry,
Optional< uint32 id 
)
inlinestatic
927 {
928 float x, y, z, o = handler->GetPlayer()->GetOrientation();
929 handler->GetPlayer()->GetClosePoint(x, y, z, handler->GetPlayer()->GetCombatReach());
930
931 if (!id)
932 return handler->GetPlayer()->SummonCreature(entry, x, y, z, o) != nullptr;
933
934 CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(entry);
935
936 if (!ci)
937 return false;
938
939 VehicleEntry const* ve = sVehicleStore.LookupEntry(*id);
940
941 if (!ve)
942 return false;
943
944 Creature* v = new Creature();
945
946 Map* map = handler->GetPlayer()->GetMap();
947
948 if (!v->Create(map->GenerateLowGuid<HighGuid::Vehicle>(), map, handler->GetSession()->GetPlayer()->GetPhaseMask(), entry, *id, x, y, z, o))
949 {
950 delete v;
951 return false;
952 }
953
954 map->AddToMap(v->ToCreature());
955
956 return true;
957 }
DBCStorage< VehicleEntry > sVehicleStore(VehicleEntryfmt)
#define sObjectMgr
Definition ObjectMgr.h:1650
bool Create(ObjectGuid::LowType guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 vehId, float x, float y, float z, float ang, const CreatureData *data=nullptr)
Definition Creature.cpp:1131
ObjectGuid::LowType GenerateLowGuid()
Definition Map.h:487
bool AddToMap(T *, bool checkTransport=false)
Definition Map.cpp:394
Creature * ToCreature()
Definition Object.h:206
float GetCombatReach() const override
Definition Unit.h:821
uint32 GetPhaseMask() const
Definition Object.h:452
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
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
Definition CreatureData.h:186
float GetOrientation() const
Definition Position.h:124
Definition DBCStructure.h:2028

References Map::AddToMap(), Creature::Create(), Map::GenerateLowGuid(), WorldObject::GetClosePoint(), Unit::GetCombatReach(), WorldObject::GetMap(), Position::GetOrientation(), WorldObject::GetPhaseMask(), ChatHandler::GetPlayer(), WorldSession::GetPlayer(), ChatHandler::GetSession(), sObjectMgr, WorldObject::SummonCreature(), sVehicleStore, Object::ToCreature(), and Vehicle.

Referenced by GetCommands().

◆ HandleDebugThreatListCommand()

static bool debug_commandscript::HandleDebugThreatListCommand ( ChatHandler handler)
inlinestatic
816 {
817 Creature* target = handler->getSelectedCreature();
818 if (!target || target->IsTotem() || target->IsPet())
819 return false;
820
821 auto const& threatList = target->GetThreatMgr().GetThreatList();
822 ThreatContainer::StorageType::const_iterator itr;
823 uint32 count = 0;
824
825 handler->PSendSysMessage("Threat list of {} ({})", target->GetName(), target->GetGUID().ToString());
826
827 for (itr = threatList.begin(); itr != threatList.end(); ++itr)
828 {
829 Unit* unit = (*itr)->getTarget();
830 if (!unit)
831 {
832 handler->PSendSysMessage(" {}. No Unit - threat {}", ++count, (*itr)->GetThreat());
833 continue;
834 }
835
836 handler->PSendSysMessage(" {}. {} ({}) - threat {}", ++count, unit->GetName(), unit->GetGUID().ToString(), (*itr)->GetThreat());
837 }
838
839 auto const& threatList2 = target->GetThreatMgr().GetOfflineThreatList();
840 for (itr = threatList2.begin(); itr != threatList2.end(); ++itr)
841 {
842 Unit* unit = (*itr)->getTarget();
843 if (!unit)
844 {
845 handler->PSendSysMessage(" {}. [offline] No Unit - threat {}", ++count, (*itr)->GetThreat());
846 continue;
847 }
848
849 handler->PSendSysMessage(" {}. [offline] {} ({}) - threat {}", ++count, unit->GetName(), unit->GetGUID().ToString(), (*itr)->GetThreat());
850 }
851
852 handler->SendSysMessage("End of threat list.");
853
854 return true;
855 }
ThreatContainer::StorageType const & GetOfflineThreatList() const
Definition ThreatMgr.h:274
ThreatContainer::StorageType const & GetThreatList() const
Definition ThreatMgr.h:273
bool IsPet() const
Definition Unit.h:747
ThreatMgr & GetThreatMgr()
Definition Unit.h:896
bool IsTotem() const
Definition Unit.h:749

References Object::GetGUID(), WorldObject::GetName(), ThreatMgr::GetOfflineThreatList(), ChatHandler::getSelectedCreature(), ThreatMgr::GetThreatList(), Unit::GetThreatMgr(), Unit::IsPet(), Unit::IsTotem(), ChatHandler::PSendSysMessage(), ChatHandler::SendSysMessage(), and ObjectGuid::ToString().

Referenced by GetCommands().

◆ HandleDebugUnitStateCommand()

static bool debug_commandscript::HandleDebugUnitStateCommand ( ChatHandler handler,
uint32  unitState 
)
inlinestatic
1257 {
1258 Unit* target = handler->getSelectedUnit();
1259 if (!target)
1260 target = handler->GetSession()->GetPlayer();
1261
1262 target->ClearUnitState(target->GetUnitState());
1263 target->AddUnitState(unitState);
1264
1265 return true;
1266 }
void ClearUnitState(uint32 f)
Definition Unit.h:692
uint32 GetUnitState() const
Definition Unit.h:693
void AddUnitState(uint32 f)
Definition Unit.h:690

References Unit::AddUnitState(), Unit::ClearUnitState(), WorldSession::GetPlayer(), ChatHandler::getSelectedUnit(), ChatHandler::GetSession(), and Unit::GetUnitState().

Referenced by GetCommands().

◆ HandleDebugUpdateCommand()

static bool debug_commandscript::HandleDebugUpdateCommand ( ChatHandler handler,
uint32  index,
Optional< uint32 value 
)
inlinestatic
1147 {
1148 Unit* unit = handler->getSelectedUnit();
1149 if (!unit)
1150 {
1152 return false;
1153 }
1154
1155 if (!index)
1156 return true;
1157
1158 // check index
1159 if (unit->IsPlayer())
1160 {
1161 if (index >= PLAYER_END)
1162 return true;
1163 }
1164 else if (index >= UNIT_END)
1165 return true;
1166
1167 if (!value)
1168 {
1169 value = unit->GetUInt32Value(index);
1170
1171 handler->PSendSysMessage(LANG_UPDATE, unit->GetGUID().ToString(), index, *value);
1172 return true;
1173 }
1174
1175 unit->SetUInt32Value(index, *value);
1176
1177 handler->PSendSysMessage(LANG_UPDATE_CHANGE, unit->GetGUID().ToString(), index, *value);
1178 return true;
1179 }
@ LANG_UPDATE_CHANGE
Definition Language.h:621
@ LANG_UPDATE
Definition Language.h:620
@ UNIT_END
Definition UpdateFields.h:175
@ PLAYER_END
Definition UpdateFields.h:392

References Object::GetGUID(), ChatHandler::getSelectedUnit(), Object::GetUInt32Value(), Object::IsPlayer(), LANG_SELECT_CHAR_OR_CREATURE, LANG_UPDATE, LANG_UPDATE_CHANGE, PLAYER_END, ChatHandler::PSendSysMessage(), ChatHandler::SendErrorMessage(), Unit::SetUInt32Value(), ObjectGuid::ToString(), and UNIT_END.

Referenced by GetCommands().

◆ HandleDebugUpdateWorldStateCommand()

static bool debug_commandscript::HandleDebugUpdateWorldStateCommand ( ChatHandler handler,
uint32  variable,
uint32  value 
)
inlinestatic
440 {
441 handler->GetPlayer()->SendUpdateWorldState(variable, value);
442 return true;
443 }
void SendUpdateWorldState(uint32 variable, uint32 value) const
Definition PlayerUpdates.cpp:2243

References ChatHandler::GetPlayer(), and Player::SendUpdateWorldState().

Referenced by GetCommands().

◆ HandleDebugVisualCommand()

static bool debug_commandscript::HandleDebugVisualCommand ( ChatHandler handler,
uint32  visualId 
)
inlinestatic
197 {
198 if (!visualId)
199 {
201 return false;
202 }
203
204 Player* player = handler->GetPlayer();
205 Unit* target = handler->getSelectedUnit();
206
207 if (!target)
208 {
209 player->SendPlaySpellVisual(visualId);
210 return true;
211 }
212
213 player->SendPlaySpellImpact(target->GetGUID(), visualId);
214 return true;
215 }
@ LANG_BAD_VALUE
Definition Language.h:148
void SendPlaySpellVisual(uint32 id)
Definition Unit.cpp:18958
void SendPlaySpellImpact(ObjectGuid guid, uint32 id)
Definition Unit.cpp:18966

References Object::GetGUID(), ChatHandler::GetPlayer(), ChatHandler::getSelectedUnit(), LANG_BAD_VALUE, ChatHandler::SendErrorMessage(), Unit::SendPlaySpellImpact(), and Unit::SendPlaySpellVisual().

Referenced by GetCommands().

◆ HandleWPGPSCommand()

static bool debug_commandscript::HandleWPGPSCommand ( ChatHandler handler,
Optional< std::string >  type 
)
inlinestatic
1269 {
1270 Player* player = handler->GetSession()->GetPlayer();
1271
1272 if (!type)
1273 {
1274 // waypoint_data - id, point, X, Y, Z, O, delay, move_type, action, action_chance, wpguid
1275 LOG_INFO("sql.dev", "(@PATH, XX, {:.3f}, {:.3f}, {:.5f}, {:.5f}, 0, 0, 0, 100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation());
1276 }
1277
1278 if (type == "sai")
1279 {
1280 // waypoint (SAI) - entry, pointid, X, Y, Z, O, delay
1281 LOG_INFO("sql.dev", "(@PATH, XX, {:.3f}, {:.3f}, {:.5f}, {:.5f}, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation());
1282 }
1283
1284 handler->PSendSysMessage("Waypoint SQL written to SQL Developer log");
1285 return true;
1286 }
#define LOG_INFO(filterType__,...)
Definition Log.h:165

References Position::GetOrientation(), WorldSession::GetPlayer(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), ChatHandler::GetSession(), LOG_INFO, and ChatHandler::PSendSysMessage().

Referenced by GetCommands().


The documentation for this class was generated from the following file: