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)
 
static bool HandleDebugVisibilityDataCommand (ChatHandler *handler)
 

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 { "visibilitydata", HandleDebugVisibilityDataCommand, SEC_ADMINISTRATOR, Console::No }
104 };
105 static ChatCommandTable commandTable =
106 {
107 { "debug", debugCommandTable },
108 { "wpgps", HandleWPGPSCommand, SEC_ADMINISTRATOR, Console::No }
109 };
110 return commandTable;
111 }
@ SEC_ADMINISTRATOR
Definition Common.h:60
static bool HandleDebugSet32BitCommand(ChatHandler *handler, uint32 index, uint8 bit)
Definition cs_debug.cpp:1182
static bool HandleDebugSendSetPhaseShiftCommand(ChatHandler *handler, uint32 phaseShift)
Definition cs_debug.cpp:971
static bool HandleDebugThreatListCommand(ChatHandler *handler)
Definition cs_debug.cpp:816
static bool HandleDebugGetItemStateCommand(ChatHandler *handler, std::string itemState)
Definition cs_debug.cpp:506
static bool HandleDebugGetItemValueCommand(ChatHandler *handler, ObjectGuid::LowType guid, uint32 index)
Definition cs_debug.cpp:977
static bool HandleDebugSendLargePacketCommand(ChatHandler *handler)
Definition cs_debug.cpp:960
static bool HandleDebugSetValueCommand(ChatHandler *handler, uint32 index, Variant< uint32, float > value)
Definition cs_debug.cpp:1069
static bool HandleDebugMoveflagsCommand(ChatHandler *handler, Optional< uint32 > moveFlags, Optional< uint32 > moveFlagsExtra)
Definition cs_debug.cpp:1201
static bool HandleWPGPSCommand(ChatHandler *handler, Optional< std::string > type)
Definition cs_debug.cpp:1269
static bool HandleDebugSendChatMsgCommand(ChatHandler *handler, ChatMsg type)
Definition cs_debug.cpp:474
static bool HandleDebugAreaTriggersCommand(ChatHandler *handler)
Definition cs_debug.cpp:446
static bool HandleDebugSendSellErrorCommand(ChatHandler *handler, SellResult error)
Definition cs_debug.cpp:245
static bool HandleDebugGetValueCommand(ChatHandler *handler, uint32 index, bool isInt)
Definition cs_debug.cpp:1098
static bool HandleDebugUpdateCommand(ChatHandler *handler, uint32 index, Optional< uint32 > value)
Definition cs_debug.cpp:1147
static bool HandleDebugSetVehicleIdCommand(ChatHandler *handler, uint32 id)
Definition cs_debug.cpp:888
static bool HandleDebugGetLootRecipientCommand(ChatHandler *handler)
Definition cs_debug.cpp:488
static bool HandleDebugLoSCommand(ChatHandler *handler)
Definition cs_debug.cpp:1033
static bool HandleDebugPlayMovieCommand(ChatHandler *handler, uint32 movieId)
Definition cs_debug.cpp:141
static bool HandleDebugUnitStateCommand(ChatHandler *handler, uint32 unitState)
Definition cs_debug.cpp:1257
static bool HandleDebugVisibilityDataCommand(ChatHandler *handler)
Definition cs_debug.cpp:1408
static bool HandleDebugMapDataCommand(ChatHandler *handler)
Definition cs_debug.cpp:1373
static bool HandleDebugPlaySoundCommand(ChatHandler *handler, uint32 soundId)
Definition cs_debug.cpp:154
static bool HandleDebugDungeonFinderCommand(ChatHandler *)
Definition cs_debug.cpp:771
static bool HandleDebugSendOpcodeCommand(ChatHandler *handler)
Definition cs_debug.cpp:257
static bool HandleDebugDummyCommand(ChatHandler *handler)
Definition cs_debug.cpp:1367
static bool HandleDebugSendEquipErrorCommand(ChatHandler *handler, InventoryResult error)
Definition cs_debug.cpp:239
static bool HandleDebugHostileRefListCommand(ChatHandler *handler)
Definition cs_debug.cpp:858
static bool HandleDebugSpawnVehicleCommand(ChatHandler *handler, uint32 entry, Optional< uint32 > id)
Definition cs_debug.cpp:927
static bool HandleDebugCooldownCommand(ChatHandler *handler, uint32 spell_id, uint32 end_time, Optional< uint32 > item_id)
Definition cs_debug.cpp:783
static bool HandleDebugPlayMusicCommand(ChatHandler *handler, uint32 musicId)
Definition cs_debug.cpp:181
static bool HandleDebugBattlegroundCommand(ChatHandler *)
Definition cs_debug.cpp:777
static bool HandleDebugSendBuyErrorCommand(ChatHandler *handler, BuyResult error)
Definition cs_debug.cpp:251
static bool HandleDebugBoundaryCommand(ChatHandler *handler, Optional< uint32 > durationArg, Optional< EXACT_SEQUENCE("fill")> fill, Optional< EXACT_SEQUENCE("z")> checkZ)
Definition cs_debug.cpp:1387
static bool HandleDebugObjectCountCommand(ChatHandler *handler, Optional< uint32 > mapId)
Definition cs_debug.cpp:1289
static bool HandleDebugSendChannelNotifyCommand(ChatHandler *handler, ChatNotify type)
Definition cs_debug.cpp:463
static bool HandleDebugEnterVehicleCommand(ChatHandler *handler, uint32 entry, Optional< int8 > seatId)
Definition cs_debug.cpp:899
static bool HandleDebugSetItemValueCommand(ChatHandler *handler, ObjectGuid::LowType guid, uint32 index, uint32 value)
Definition cs_debug.cpp:994
static bool HandleDebugMod32ValueCommand(ChatHandler *handler, uint32 index, uint32 value)
Definition cs_debug.cpp:1129
static bool HandleDebugItemExpireCommand(ChatHandler *handler, ObjectGuid::LowType guid)
Definition cs_debug.cpp:1009
static bool HandleDebugSendQuestInvalidMsgCommand(ChatHandler *handler, QuestFailedReason msg)
Definition cs_debug.cpp:500
static bool HandleDebugPlayCinematicCommand(ChatHandler *handler, uint32 cinematicId)
Definition cs_debug.cpp:114
static bool HandleDebugVisualCommand(ChatHandler *handler, uint32 visualId)
Definition cs_debug.cpp:197
static bool HandleDebugUpdateWorldStateCommand(ChatHandler *handler, uint32 variable, uint32 value)
Definition cs_debug.cpp:440
static bool HandleDebugArenaCommand(ChatHandler *)
Definition cs_debug.cpp:810
static bool HandleDebugAnimCommand(ChatHandler *handler, Emote emote)
Definition cs_debug.cpp:1023
static bool HandleDebugSendSpellFailCommand(ChatHandler *handler, SpellCastResult result, Optional< uint32 > failArg1, Optional< uint32 > failArg2)
Definition cs_debug.cpp:218
static bool HandleDebugSendQuestPartyMsgCommand(ChatHandler *handler, QuestShareMessages msg)
Definition cs_debug.cpp:482
static bool HandleDebugSetAuraStateCommand(ChatHandler *handler, Optional< AuraStateType > state, bool apply)
Definition cs_debug.cpp:1048
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(), HandleDebugVisibilityDataCommand(), HandleDebugVisualCommand(), HandleWPGPSCommand(), and SEC_ADMINISTRATOR.

◆ HandleDebugAnimCommand()

static bool debug_commandscript::HandleDebugAnimCommand ( ChatHandler handler,
Emote  emote 
)
inlinestatic
1024 {
1025 if (Unit* unit = handler->getSelectedUnit())
1026 unit->HandleEmoteCommand(emote);
1027
1028 handler->PSendSysMessage("Playing emote {}", EnumUtils::ToConstant(emote));
1029
1030 return true;
1031 }
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
447 {
448 Player* player = handler->GetSession()->GetPlayer();
449 if (!player->isDebugAreaTriggers)
450 {
452 player->isDebugAreaTriggers = true;
453 }
454 else
455 {
457 player->isDebugAreaTriggers = false;
458 }
459
460 return true;
461 }
@ LANG_DEBUG_AREATRIGGER_ON
Definition Language.h:987
@ LANG_DEBUG_AREATRIGGER_OFF
Definition Language.h:988
WorldSession * GetSession()
Definition Chat.h:242
Definition Player.h:1072
bool isDebugAreaTriggers
Definition Player.h:2566
Player * GetPlayer() const
Definition WorldSession.h:411

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
811 {
812 sBattlegroundMgr->ToggleArenaTesting();
813 return true;
814 }
#define sBattlegroundMgr
Definition BattlegroundMgr.h:187

References sBattlegroundMgr.

Referenced by GetCommands().

◆ HandleDebugBattlegroundCommand()

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

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
1388 {
1389 Player* player = handler->GetPlayer();
1390 if (!player)
1391 return false;
1392
1393 Creature* target = handler->getSelectedCreature();
1394 if (!target || !target->IsAIEnabled)
1395 return false;
1396
1397 uint32 duration = durationArg.value_or(5 * IN_MILLISECONDS);
1398 if (duration > 180 * IN_MILLISECONDS) // arbitrary upper limit
1399 duration = 180 * IN_MILLISECONDS;
1400
1401 int32 errMsg = target->AI()->VisualizeBoundary(duration, player, fill.has_value(), checkZ.has_value());
1402 if (errMsg > 0)
1403 handler->PSendSysMessage(errMsg);
1404
1405 return true;
1406 }
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:403
Definition Creature.h:43
CreatureAI * AI() const
Definition Creature.h:141
bool IsAIEnabled
Definition Unit.h:2015

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
784 {
785 Player* player = handler->GetPlayer();
786
787 if (!player || !spell_id || !end_time)
788 return false;
789
790 if (!sSpellMgr->GetSpellInfo(spell_id))
791 return false;
792
793 if (!item_id)
794 item_id = 0;
795 else if (!sItemStore.LookupEntry(*item_id))
796 return false;
797
798 if (end_time < player->GetSpellCooldownDelay(spell_id))
799 player->RemoveSpellCooldown(spell_id, true);
800
801 player->AddSpellCooldown(spell_id, *item_id, end_time, true, false);
802
803 WorldPacket data;
804 player->BuildCooldownPacket(data, SPELL_COOLDOWN_FLAG_NONE, spell_id, end_time);
805 player->SendDirectMessage(&data);
806
807 return true;
808 }
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:5728
void AddSpellCooldown(uint32 spell_id, uint32 itemid, uint32 end_time, bool needSendToClient=false, bool forceSendToSpectator=false) override
Definition Player.cpp:11124
void RemoveSpellCooldown(uint32 spell_id, bool update=false)
Definition Player.cpp:3548
void BuildCooldownPacket(WorldPacket &data, uint8 flags, uint32 spellId, uint32 cooldown)
Definition Unit.cpp:20845
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
1368 {
1369 handler->SendSysMessage("This command does nothing right now. Edit your local core (cs_debug.cpp) to make it do whatever you need for testing.");
1370 return true;
1371 }
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
772 {
773 sLFGMgr->ToggleTesting();
774 return true;
775 }
#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
900 {
901 Unit* target = handler->getSelectedUnit();
902 if (!target || !target->IsVehicle())
903 return false;
904
905 if (!seatId)
906 seatId = -1;
907
908 if (!entry)
909 handler->GetPlayer()->EnterVehicle(target, *seatId);
910 else
911 {
912 Creature* passenger = nullptr;
913 Acore::AllCreaturesOfEntryInRange check(handler->GetPlayer(), entry, 20.0f);
914 Acore::CreatureSearcher<Acore::AllCreaturesOfEntryInRange> searcher(handler->GetPlayer(), passenger, check);
915 Cell::VisitObjects(handler->GetPlayer(), searcher, 30.0f);
916
917 if (!passenger || passenger == target)
918 return false;
919
920 passenger->EnterVehicle(target, *seatId);
921 }
922
923 handler->PSendSysMessage("Unit {} entered vehicle {:d}", entry, *seatId);
924 return true;
925 }
Definition GridNotifiers.h:1474
void EnterVehicle(Unit *base, int8 seatId=-1)
Definition Unit.cpp:19469
bool IsVehicle() const
Definition Unit.h:752
Definition GridNotifiers.h:433
static void VisitObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:165

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

Referenced by GetCommands().

◆ HandleDebugGetItemStateCommand()

static bool debug_commandscript::HandleDebugGetItemStateCommand ( ChatHandler handler,
std::string  itemState 
)
inlinestatic
507 {
509 bool listQueue = false;
510 bool checkAll = false;
511
512 if (itemState == "unchanged")
513 state = ITEM_UNCHANGED;
514 else if (itemState == "changed")
515 state = ITEM_CHANGED;
516 else if (itemState == "new")
517 state = ITEM_NEW;
518 else if (itemState == "removed")
519 state = ITEM_REMOVED;
520 else if (itemState == "queue")
521 listQueue = true;
522 else if (itemState == "check_all")
523 checkAll = true;
524 else
525 return false;
526
527 Player* player = handler->getSelectedPlayer();
528 if (!player)
529 player = handler->GetPlayer();
530
531 if (!listQueue && !checkAll)
532 {
533 itemState = "The player has the following " + itemState + " items: ";
534 handler->SendSysMessage(itemState.c_str());
535 for (uint8 i = PLAYER_SLOT_START; i < PLAYER_SLOT_END; ++i)
536 {
537 if (i >= BUYBACK_SLOT_START && i < BUYBACK_SLOT_END)
538 continue;
539
540 if (Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, i))
541 {
542 if (Bag* bag = item->ToBag())
543 {
544 for (uint8 j = 0; j < bag->GetBagSize(); ++j)
545 if (Item* item2 = bag->GetItemByPos(j))
546 if (item2->GetState() == state)
547 handler->PSendSysMessage("bag: 255 slot: {} {} owner: {}", item2->GetSlot(), item2->GetGUID().ToString(), item2->GetOwnerGUID().ToString());
548 }
549 else if (item->GetState() == state)
550 handler->PSendSysMessage("bag: 255 slot: {} {} owner: {}", item->GetSlot(), item->GetGUID().ToString(), item->GetOwnerGUID().ToString());
551 }
552 }
553 }
554
555 if (listQueue)
556 {
557 auto const& updateQueue = player->GetItemUpdateQueue();
558
559 for (auto const& item : updateQueue)
560 {
561 Bag* container = item->GetContainer();
562 uint8 bagSlot = container ? container->GetSlot() : uint8(INVENTORY_SLOT_BAG_0);
563
564 std::string st;
565 switch (item->GetState())
566 {
567 case ITEM_UNCHANGED:
568 st = "unchanged";
569 break;
570 case ITEM_CHANGED:
571 st = "changed";
572 break;
573 case ITEM_NEW:
574 st = "new";
575 break;
576 case ITEM_REMOVED:
577 st = "removed";
578 break;
579 }
580
581 handler->PSendSysMessage("bag: {} slot: {} guid: {} - state: {}", bagSlot, item->GetSlot(), item->GetGUID().ToString(), st);
582 }
583
584 if (updateQueue.empty())
585 handler->PSendSysMessage("The player's updatequeue is empty");
586 }
587
588 if (checkAll)
589 {
590 bool error = false;
591 auto const& updateQueue = player->GetItemUpdateQueue();
592 for (uint8 i = PLAYER_SLOT_START; i < PLAYER_SLOT_END; ++i)
593 {
594 if (i >= BUYBACK_SLOT_START && i < BUYBACK_SLOT_END)
595 continue;
596
597 Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
598 if (!item)
599 continue;
600
601 if (item->GetSlot() != i)
602 {
603 handler->PSendSysMessage("Item with slot {} and guid {} has an incorrect slot value: {}", i, item->GetGUID().ToString(), item->GetSlot());
604 error = true;
605 continue;
606 }
607
608 if (item->GetOwnerGUID() != player->GetGUID())
609 {
610 handler->PSendSysMessage("The item with slot {} {} does have non-matching owner guid {} and {}!", item->GetSlot(), item->GetGUID().ToString(), item->GetOwnerGUID().ToString(), player->GetGUID().ToString());
611 error = true;
612 continue;
613 }
614
615 if (Bag* container = item->GetContainer())
616 {
617 handler->PSendSysMessage("The item with slot {} {} has a container (slot: {}, {}) but shouldn't!", item->GetSlot(), item->GetGUID().ToString(), container->GetSlot(), container->GetGUID().ToString());
618 error = true;
619 continue;
620 }
621
622 if (item->IsInUpdateQueue())
623 {
624 uint16 qp = item->GetQueuePos();
625 if (qp > updateQueue.size())
626 {
627 handler->PSendSysMessage("The item with slot {} and guid {} has its queuepos ({}) larger than the update queue size! ", item->GetSlot(), item->GetGUID().ToString(), qp);
628 error = true;
629 continue;
630 }
631
632 if (!updateQueue[qp])
633 {
634 handler->PSendSysMessage("The item with slot {} and guid {} has its queuepos ({}) pointing to NULL in the queue!", item->GetSlot(), item->GetGUID().ToString(), qp);
635 error = true;
636 continue;
637 }
638
639 if (updateQueue[qp] != item)
640 {
641 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());
642 error = true;
643 continue;
644 }
645 }
646 else if (item->GetState() != ITEM_UNCHANGED)
647 {
648 handler->PSendSysMessage("The item with slot {} and guid {} is not in queue but should be (state: {})!", item->GetSlot(), item->GetGUID().ToString(), item->GetState());
649 error = true;
650 continue;
651 }
652
653 if (Bag* bag = item->ToBag())
654 {
655 for (uint8 j = 0; j < bag->GetBagSize(); ++j)
656 {
657 Item* item2 = bag->GetItemByPos(j);
658 if (!item2)
659 continue;
660
661 if (item2->GetSlot() != j)
662 {
663 handler->PSendSysMessage("The item in bag {} and slot {} (guid: {}) has an incorrect slot value: {}", bag->GetSlot(), j, item2->GetGUID().ToString(), item2->GetSlot());
664 error = true;
665 continue;
666 }
667
668 if (item2->GetOwnerGUID() != player->GetGUID())
669 {
670 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());
671 error = true;
672 continue;
673 }
674
675 Bag* container = item2->GetContainer();
676 if (!container)
677 {
678 handler->PSendSysMessage("The item in bag {} at slot {} {} has no container!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString());
679 error = true;
680 continue;
681 }
682
683 if (container != bag)
684 {
685 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());
686 error = true;
687 continue;
688 }
689
690 if (item2->IsInUpdateQueue())
691 {
692 uint16 qp = item2->GetQueuePos();
693 if (qp > updateQueue.size())
694 {
695 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);
696 error = true;
697 continue;
698 }
699
700 if (!updateQueue[qp])
701 {
702 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);
703 error = true;
704 continue;
705 }
706
707 if (updateQueue[qp] != item2)
708 {
709 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());
710 error = true;
711 continue;
712 }
713 }
714 else if (item2->GetState() != ITEM_UNCHANGED)
715 {
716 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());
717 error = true;
718 continue;
719 }
720 }
721 }
722 }
723
724 uint32 index = 0;
725
726 for (auto const& item : updateQueue)
727 {
728 index++;
729
730 if (item->GetOwnerGUID() != player->GetGUID())
731 {
732 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()));
733 error = true;
734 continue;
735 }
736
737 if (item->GetQueuePos() != index)
738 {
739 handler->SendSysMessage(Acore::StringFormat("queue({}): For the item {}, the queuepos doesn't match it's position in the queue!", index, item->GetGUID().ToString()));
740 error = true;
741 continue;
742 }
743
744 if (item->GetState() == ITEM_REMOVED)
745 continue;
746
747 Item* test = player->GetItemByPos(item->GetBagSlot(), item->GetSlot());
748
749 if (!test)
750 {
751 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()));
752 error = true;
753 continue;
754 }
755
756 if (test != item)
757 {
758 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()));
759 error = true;
760 continue;
761 }
762 }
763
764 if (!error)
765 handler->SendSysMessage("All OK!");
766 }
767
768 return true;
769 }
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:721
@ BUYBACK_SLOT_START
Definition Player.h:720
#define INVENTORY_SLOT_BAG_0
Definition Player.h:666
@ PLAYER_SLOT_START
Definition Player.h:660
@ PLAYER_SLOT_END
Definition Player.h:662
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:1266
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
978 {
979 Item* i = handler->GetPlayer()->GetItemByGuid(ObjectGuid(HighGuid::Item, 0, guid));
980
981 if (!i)
982 return false;
983
984 if (index >= i->GetValuesCount())
985 return false;
986
987 uint32 value = i->GetUInt32Value(index);
988
989 handler->PSendSysMessage("Item {}: value at {} is {}", guid, index, value);
990
991 return true;
992 }
Definition ObjectGuid.h:118
uint32 GetUInt32Value(uint16 index) const
Definition Object.cpp:294
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
489 {
490 Creature* target = handler->getSelectedCreature();
491 if (!target)
492 return false;
493
494 handler->PSendSysMessage("Loot recipient for creature {} (GUID {}, SpawnID {}) is {}",
495 target->GetName(), target->GetGUID().ToString(), target->GetSpawnId(),
496 target->hasLootRecipient() ? (target->GetLootRecipient() ? target->GetLootRecipient()->GetName() : "offline") : "no loot recipient");
497 return true;
498 }
bool hasLootRecipient() const
Definition Creature.h:235
Player * GetLootRecipient() const
Definition Creature.cpp:1317
ObjectGuid::LowType GetSpawnId() const
Definition Creature.h:65
std::string const & GetName() const
Definition Object.h:525

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
1099 {
1100 Unit* target = handler->getSelectedUnit();
1101 if (!target)
1102 {
1104 return false;
1105 }
1106
1107 ObjectGuid guid = target->GetGUID();
1108
1109 if (index >= target->GetValuesCount())
1110 {
1111 handler->PSendSysMessage(LANG_TOO_BIG_INDEX, index, guid.ToString(), target->GetValuesCount());
1112 return false;
1113 }
1114
1115 if (isInt)
1116 {
1117 uint32 value = target->GetUInt32Value(index);
1118 handler->PSendSysMessage(LANG_GET_UINT_FIELD, guid.ToString(), index, value);
1119 }
1120 else
1121 {
1122 float value = target->GetFloatValue(index);
1123 handler->PSendSysMessage(LANG_GET_FLOAT_FIELD, guid.ToString(), index, value);
1124 }
1125
1126 return true;
1127 }
@ LANG_TOO_BIG_INDEX
Definition Language.h:627
@ LANG_SELECT_CHAR_OR_CREATURE
Definition Language.h:31
@ LANG_GET_UINT_FIELD
Definition Language.h:633
@ LANG_GET_FLOAT_FIELD
Definition Language.h:635
void SendErrorMessage(uint32 entry)
Definition Chat.cpp:216
float GetFloatValue(uint16 index) const
Definition Object.cpp:306

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
859 {
860 Unit* target = handler->getSelectedUnit();
861 if (!target)
862 target = handler->GetSession()->GetPlayer();
863
864 HostileReference* ref = target->getHostileRefMgr().getFirst();
865 uint32 count = 0;
866
867 handler->PSendSysMessage("Hostile reference list of {} ({})", target->GetName(), target->GetGUID().ToString());
868
869 while (ref)
870 {
871 if (Unit* unit = ref->GetSource()->GetOwner())
872 {
873 handler->PSendSysMessage(" {}. {} {} ({}) - threat {}", ++count, (ref->IsOnline() ? "" : "[offline]"),
874 unit->GetName(), unit->GetGUID().ToString(), ref->GetThreat());
875 }
876 else
877 {
878 handler->PSendSysMessage(" {}. No Owner - threat {}", ++count, ref->GetThreat());
879 }
880
881 ref = ref->next();
882 }
883
884 handler->SendSysMessage("End of hostile reference list.");
885 return true;
886 }
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:904
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
1010 {
1011 Item* i = handler->GetPlayer()->GetItemByGuid(ObjectGuid(HighGuid::Item, guid));
1012
1013 if (!i)
1014 return false;
1015
1016 handler->GetPlayer()->DestroyItem(i->GetBagSlot(), i->GetSlot(), true);
1017 sScriptMgr->OnItemExpire(handler->GetPlayer(), i->GetTemplate());
1018
1019 return true;
1020 }
#define sScriptMgr
Definition ScriptMgr.h:728
ItemTemplate const * GetTemplate() const
Definition Item.cpp:544
void DestroyItem(uint8 bag, uint8 slot, bool update)
Definition PlayerStorage.cpp:3018

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

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
1374 {
1375 Cell cell(handler->GetPlayer()->GetPositionX(), handler->GetPlayer()->GetPositionY());
1376 Map* map = handler->GetPlayer()->GetMap();
1377
1378 handler->PSendSysMessage("GridX {} GridY {}", cell.GridX(), cell.GridY());
1379 handler->PSendSysMessage("CellX {} CellY {}", cell.CellX(), cell.CellY());
1380 handler->PSendSysMessage("Created Grids: {} / {}", map->GetCreatedGridsCount(), MAX_NUMBER_OF_GRIDS * MAX_NUMBER_OF_GRIDS);
1381 handler->PSendSysMessage("Loaded Grids: {} / {}", map->GetLoadedGridsCount(), MAX_NUMBER_OF_GRIDS * MAX_NUMBER_OF_GRIDS);
1382 handler->PSendSysMessage("Created Cells In Grid: {} / {}", map->GetCreatedCellsInGridCount(cell.GridX(), cell.GridY()), MAX_NUMBER_OF_CELLS * MAX_NUMBER_OF_CELLS);
1384 return true;
1385 }
#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:160
uint32 GetLoadedGridsCount()
Definition Map.cpp:3126
uint32 GetCreatedGridsCount()
Definition Map.cpp:3121
uint32 GetCreatedCellsInGridCount(uint16 const x, uint16 const y)
Definition Map.cpp:3131
uint32 GetCreatedCellsInMapCount()
Definition Map.cpp:3136
Map * GetMap() const
Definition Object.h:621
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
1130 {
1131 if (index >= handler->GetPlayer()->GetValuesCount())
1132 {
1133 handler->PSendSysMessage(LANG_TOO_BIG_INDEX, index, handler->GetPlayer()->GetGUID().ToString(), handler->GetPlayer()->GetValuesCount());
1134 return false;
1135 }
1136
1137 uint32 currentValue = handler->GetPlayer()->GetUInt32Value(index);
1138
1139 currentValue += value;
1140 handler->GetPlayer()->SetUInt32Value(index, currentValue);
1141
1142 handler->PSendSysMessage(LANG_CHANGE_32BIT_FIELD, index, currentValue);
1143
1144 return true;
1145 }
@ LANG_CHANGE_32BIT_FIELD
Definition Language.h:639
void SetUInt32Value(uint16 index, uint32 value)
Definition Unit.cpp:21182

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

1202 {
1203 Unit* target = handler->getSelectedUnit();
1204 if (!target)
1205 target = handler->GetPlayer();
1206
1207 if (!moveFlags)
1208 {
1211 }
1212 else
1213 {
1214 static uint32 const FlagsWithHandlers = MOVEMENTFLAG_MASK_HAS_PLAYER_STATUS_OPCODE |
1217
1218 bool unhandledFlag = ((*moveFlags ^ target->GetUnitMovementFlags()) & ~FlagsWithHandlers) != 0;
1219
1220 target->SetWalk((*moveFlags & MOVEMENTFLAG_WALKING) != 0);
1221 target->SetDisableGravity((*moveFlags & MOVEMENTFLAG_DISABLE_GRAVITY) != 0);
1222 target->SetSwim((*moveFlags & MOVEMENTFLAG_SWIMMING) != 0);
1223 target->SetCanFly((*moveFlags & MOVEMENTFLAG_CAN_FLY) != 0);
1224 target->SetWaterWalking((*moveFlags & MOVEMENTFLAG_WATERWALKING) != 0);
1225 target->SetFeatherFall((*moveFlags & MOVEMENTFLAG_FALLING_SLOW) != 0);
1226 target->SetHover((*moveFlags & MOVEMENTFLAG_HOVER) != 0);
1227
1229 *moveFlags &= ~MOVEMENTFLAG_FALLING;
1230
1231 if (*moveFlags & MOVEMENTFLAG_ROOT)
1232 {
1233 target->SetControlled(true, UNIT_STATE_ROOT);
1234 *moveFlags &= ~MOVEMENTFLAG_MASK_MOVING;
1235 }
1236
1238 target->StopMoving();
1239
1240 if (unhandledFlag)
1241 target->SetUnitMovementFlags(*moveFlags);
1242
1243 if (moveFlagsExtra)
1244 {
1245 target->SetExtraUnitMovementFlags(*moveFlagsExtra);
1246 }
1247
1248 if (moveFlagsExtra || unhandledFlag)
1249 target->SendMovementFlagUpdate();
1250
1252 }
1253
1254 return true;
1255 }
@ LANG_MOVEFLAGS_GET
Definition Language.h:938
@ LANG_MOVEFLAGS_SET
Definition Language.h:939
@ MOVEMENTFLAG_SPLINE_ENABLED
Definition UnitDefines.h:394
@ MOVEMENTFLAG_WATERWALKING
Definition UnitDefines.h:395
@ MOVEMENTFLAG_DISABLE_GRAVITY
Definition UnitDefines.h:377
@ MOVEMENTFLAG_FALLING_SLOW
Definition UnitDefines.h:396
@ MOVEMENTFLAG_CAN_FLY
Definition UnitDefines.h:391
@ MOVEMENTFLAG_ROOT
Definition UnitDefines.h:378
@ MOVEMENTFLAG_FALLING
Definition UnitDefines.h:379
@ MOVEMENTFLAG_MASK_HAS_PLAYER_STATUS_OPCODE
Movement flags that have change status opcodes associated for players.
Definition UnitDefines.h:416
@ MOVEMENTFLAG_SWIMMING
Definition UnitDefines.h:388
@ MOVEMENTFLAG_HOVER
Definition UnitDefines.h:397
@ MOVEMENTFLAG_WALKING
Definition UnitDefines.h:375
@ 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:16733
virtual bool SetSwim(bool enable)
Definition Unit.cpp:20442
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition Unit.cpp:18131
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:20467
bool HasUnitMovementFlag(uint32 f) const
Definition Unit.h:729
virtual bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true)
Definition Unit.cpp:20424
void SendMovementFlagUpdate(bool self=false)
Definition Unit.cpp:16787
virtual bool SetFeatherFall(bool enable, bool packetOnly=false)
Definition Unit.cpp:20511
virtual bool SetWalk(bool enable)
Definition Unit.cpp:20410
virtual bool SetHover(bool enable, bool packetOnly=false, bool updateAnimationTier=true)
Definition Unit.cpp:20533
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:20489

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
1290 {
1291 if (mapId)
1292 {
1293 sMapMgr->DoForAllMapsWithMapId(mapId.value(),
1294 [handler](Map* map) -> void
1295 {
1296 HandleDebugObjectCountMap(handler, map);
1297 }
1298 );
1299 }
1300 else
1301 {
1302 sMapMgr->DoForAllMaps(
1303 [handler](Map* map) -> void
1304 {
1305 HandleDebugObjectCountMap(handler, map);
1306 }
1307 );
1308 }
1309
1310 return true;
1311 }
#define sMapMgr
Definition MapMgr.h:220
static void HandleDebugObjectCountMap(ChatHandler *handler, Map *map)
Definition cs_debug.cpp:1349

References HandleDebugObjectCountMap(), and sMapMgr.

Referenced by GetCommands().

◆ HandleDebugObjectCountMap()

static void debug_commandscript::HandleDebugObjectCountMap ( ChatHandler handler,
Map map 
)
inlinestatic
1350 {
1351 handler->PSendSysMessage("Map Id: {} Name: '{}' Instance Id: {} Creatures: {} GameObjects: {} Update Objects: {}",
1352 map->GetId(), map->GetMapName(), map->GetInstanceId(),
1356
1357 CreatureCountWorker worker;
1359 visitor.Visit(map->GetObjectsStore());
1360
1361 handler->PSendSysMessage("Top Creatures count:");
1362
1363 for (auto&& p : worker.GetTopCreatureCount(5))
1364 handler->PSendSysMessage("Entry: {} Count: {}", p.first, p.second);
1365 }
std::uint64_t uint64
Definition Define.h:106
Definition GameObject.h:120
MapStoredObjectTypesContainer & GetObjectsStore()
Definition Map.h:345
size_t GetUpdatableObjectsCount() const
Definition Map.h:486
uint32 GetId() const
Definition Map.h:226
const char * GetMapName() const
Definition Map.cpp:1627
uint32 GetInstanceId() const
Definition Map.h:263
Definition TypeContainerVisitor.h:105
std::size_t Size() const
Definition TypeContainer.h:195

References Map::GetId(), Map::GetInstanceId(), Map::GetMapName(), Map::GetObjectsStore(), debug_commandscript::CreatureCountWorker::GetTopCreatureCount(), Map::GetUpdatableObjectsCount(), 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
115 {
116 CinematicSequencesEntry const* cineSeq = sCinematicSequencesStore.LookupEntry(cinematicId);
117 if (!cineSeq)
118 {
119 handler->SendErrorMessage(LANG_CINEMATIC_NOT_EXIST, cinematicId);
120 return false;
121 }
122
123 // Dump camera locations
124 if (std::vector<FlyByCamera> const* flyByCameras = GetFlyByCameras(cineSeq->cinematicCamera))
125 {
126 handler->PSendSysMessage("Waypoints for sequence {}, camera {}", cinematicId, cineSeq->cinematicCamera);
127 uint32 count = 1;
128 for (FlyByCamera const& cam : *flyByCameras)
129 {
130 handler->PSendSysMessage("{} - {}ms [{} ({} degrees)]", count, cam.timeStamp, cam.locations.ToString(), cam.locations.GetOrientation() * (180 / M_PI));
131 ++count;
132 }
133 handler->PSendSysMessage("{} waypoints dumped", flyByCameras->size());
134 }
135
136 handler->GetPlayer()->SendCinematicStart(cinematicId);
137 return true;
138 }
DBCStorage< CinematicSequencesEntry > sCinematicSequencesStore(CinematicSequencesEntryfmt)
@ LANG_CINEMATIC_NOT_EXIST
Definition Language.h:985
std::vector< FlyByCamera > const * GetFlyByCameras(uint32 cinematicCameraId)
Definition M2Stores.cpp:254
void SendCinematicStart(uint32 CinematicSequenceId) const
Definition Player.cpp:5733
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
142 {
143 if (!sMovieStore.LookupEntry(movieId))
144 {
145 handler->SendErrorMessage(LANG_MOVIE_NOT_EXIST, movieId);
146 return false;
147 }
148
149 handler->GetPlayer()->SendMovieStart(movieId);
150 return true;
151 }
DBCStorage< MovieEntry > sMovieStore(MovieEntryfmt)
@ LANG_MOVIE_NOT_EXIST
Definition Language.h:986
void SendMovieStart(uint32 MovieId)
Definition Player.cpp:5744

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
182 {
183 if (!sSoundEntriesStore.LookupEntry(musicId))
184 {
185 handler->SendErrorMessage(LANG_SOUND_NOT_EXIST, musicId);
186 return false;
187 }
188
189 Player* player = handler->GetPlayer();
190
191 player->PlayDirectMusic(musicId, player);
192
193 handler->PSendSysMessage(LANG_YOU_HEAR_SOUND, musicId);
194 return true;
195 }
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:2902

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
155 {
156 if (!sSoundEntriesStore.LookupEntry(soundId))
157 {
158 handler->SendErrorMessage(LANG_SOUND_NOT_EXIST, soundId);
159 return false;
160 }
161
162 Player* player = handler->GetPlayer();
163
164 Unit* unit = handler->getSelectedUnit();
165 if (!unit)
166 {
168 return false;
169 }
170
171 if (player->GetTarget())
172 unit->PlayDistanceSound(soundId, player);
173 else
174 unit->PlayDirectSound(soundId, player);
175
176 handler->PSendSysMessage(LANG_YOU_HEAR_SOUND, soundId);
177 return true;
178 }
ObjectGuid GetTarget() const
Definition Unit.h:813
void PlayDirectSound(uint32 sound_id, Player *target=nullptr)
Definition Object.cpp:2883
void PlayDistanceSound(uint32 sound_id, Player *target=nullptr)
Definition Object.cpp:2875

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
252 {
253 handler->GetPlayer()->SendBuyError(BuyResult(error), nullptr, 0, 0);
254 return true;
255 }
BuyResult
Definition Item.h:140
void SendBuyError(BuyResult msg, Creature *creature, uint32 item, uint32 param)
Definition PlayerStorage.cpp:4057

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

Referenced by GetCommands().

◆ HandleDebugSendChannelNotifyCommand()

static bool debug_commandscript::HandleDebugSendChannelNotifyCommand ( ChatHandler handler,
ChatNotify  type 
)
inlinestatic
464 {
465 WorldPacket data(SMSG_CHANNEL_NOTIFY, (1 + 10));
466 data << type;
467 data << "test";
468 data << uint32(0);
469 data << uint32(0);
470 handler->GetSession()->SendPacket(&data);
471 return true;
472 }
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
Definition WorldSession.cpp:251
@ 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
475 {
476 WorldPacket data;
477 ChatHandler::BuildChatPacket(data, type, LANG_UNIVERSAL, handler->GetPlayer(), handler->GetPlayer(), "testtest", 0, "chan");
478 handler->GetSession()->SendPacket(&data);
479 return true;
480 }
@ LANG_UNIVERSAL
Definition SharedDefines.h:746
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
240 {
241 handler->GetPlayer()->SendEquipError(InventoryResult(error), nullptr, nullptr);
242 return true;
243 }
InventoryResult
Definition Item.h:46
void SendEquipError(InventoryResult msg, Item *pItem, Item *pItem2=nullptr, uint32 itemid=0)
Definition PlayerStorage.cpp:4014

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

Referenced by GetCommands().

◆ HandleDebugSendLargePacketCommand()

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

References ChatHandler::SendSysMessage().

Referenced by GetCommands().

◆ HandleDebugSendOpcodeCommand()

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

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

Referenced by GetCommands().

◆ HandleDebugSendSetPhaseShiftCommand()

static bool debug_commandscript::HandleDebugSendSetPhaseShiftCommand ( ChatHandler handler,
uint32  phaseShift 
)
inlinestatic
972 {
973 handler->GetSession()->SendSetPhaseShift(phaseShift);
974 return true;
975 }
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
219 {
221 data << uint8(0);
222 data << uint32(133); // Spell "Fireball"
223 data << uint8(result);
224
225 if (failArg1 || failArg2)
226 {
227 data << uint32(failArg1.value_or(0));
228 }
229
230 if (failArg2)
231 {
232 data << uint32(*failArg2);
233 }
234
235 handler->GetSession()->SendPacket(&data);
236 return true;
237 }
@ 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
1183 {
1184 WorldObject* target = handler->getSelectedObject();
1185 if (!target)
1186 {
1188 return false;
1189 }
1190
1191 if (bit > 32) // uint32 = 32 bits
1192 return false;
1193
1194 uint32 value = bit ? 1 << (bit - 1) : 0;
1195 target->SetUInt32Value(index, value);
1196
1197 handler->PSendSysMessage(LANG_SET_32BIT_FIELD, index, value);
1198 return true;
1199 }
@ LANG_SET_32BIT_FIELD
Definition Language.h:637
WorldObject * getSelectedObject() const
Definition Chat.cpp:397
void SetUInt32Value(uint16 index, uint32 value)
Definition Object.cpp:639
Definition Object.h:472

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
1049 {
1050 Unit* unit = handler->getSelectedUnit();
1051 if (!unit)
1052 {
1054 return false;
1055 }
1056
1057 if (!state)
1058 {
1059 // reset all states
1060 for (AuraStateType s : EnumUtils::Iterate<AuraStateType>())
1061 unit->ModifyAuraState(s, false);
1062 return true;
1063 }
1064
1065 unit->ModifyAuraState(*state, apply);
1066 return true;
1067 }
AuraStateType
Definition SharedDefines.h:1299
Definition SmartEnum.h:47
void ModifyAuraState(AuraStateType flag, bool apply)
Definition Unit.cpp:10592

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
995 {
996 Item* i = handler->GetPlayer()->GetItemByGuid(ObjectGuid(HighGuid::Item, 0, guid));
997
998 if (!i)
999 return false;
1000
1001 if (index >= i->GetValuesCount())
1002 return false;
1003
1004 i->SetUInt32Value(index, value);
1005
1006 return true;
1007 }

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
1070 {
1071 WorldObject* target = handler->getSelectedObject();
1072 if (!target)
1073 {
1075 return false;
1076 }
1077
1078 if (index >= target->GetValuesCount())
1079 {
1080 handler->PSendSysMessage(LANG_TOO_BIG_INDEX, index, target->GetGUID().ToString(), target->GetValuesCount());
1081 return false;
1082 }
1083
1084 if (value.holds_alternative<uint32>())
1085 {
1086 target->SetUInt32Value(index, value.get<uint32>());
1087 handler->PSendSysMessage(LANG_SET_UINT_FIELD, target->GetGUID().ToString(), uint32(index), uint32(value));
1088 }
1089 else if (value.holds_alternative<float>())
1090 {
1091 target->SetFloatValue(index, value.get<float>());
1092 handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, target->GetGUID().ToString(), static_cast<float>(index), uint32(value));
1093 }
1094
1095 return true;
1096 }
@ LANG_SET_UINT_FIELD
Definition Language.h:629
@ LANG_SET_FLOAT_FIELD
Definition Language.h:631
void SetFloatValue(uint16 index, float value)
Definition Object.cpp:726
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
889 {
890 Unit* target = handler->getSelectedUnit();
891 if (!target || target->IsVehicle())
892 return false;
893
894 //target->SetVehicleId(id);
895 handler->PSendSysMessage("Vehicle id set to {}", id);
896 return true;
897 }

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
928 {
929 float x, y, z, o = handler->GetPlayer()->GetOrientation();
930 handler->GetPlayer()->GetClosePoint(x, y, z, handler->GetPlayer()->GetCombatReach());
931
932 if (!id)
933 return handler->GetPlayer()->SummonCreature(entry, x, y, z, o) != nullptr;
934
935 CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(entry);
936
937 if (!ci)
938 return false;
939
940 VehicleEntry const* ve = sVehicleStore.LookupEntry(*id);
941
942 if (!ve)
943 return false;
944
945 Creature* v = new Creature();
946
947 Map* map = handler->GetPlayer()->GetMap();
948
949 if (!v->Create(map->GenerateLowGuid<HighGuid::Vehicle>(), map, handler->GetSession()->GetPlayer()->GetPhaseMask(), entry, *id, x, y, z, o))
950 {
951 delete v;
952 return false;
953 }
954
955 map->AddToMap(v->ToCreature());
956
957 return true;
958 }
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:1136
ObjectGuid::LowType GenerateLowGuid()
Definition Map.h:470
bool AddToMap(T *, bool checkTransport=false)
Definition Map.cpp:300
Creature * ToCreature()
Definition Object.h:206
float GetCombatReach() const override
Definition Unit.h:824
uint32 GetPhaseMask() const
Definition Object.h:513
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:2334
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:2692
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
817 {
818 Creature* target = handler->getSelectedCreature();
819 if (!target || target->IsTotem() || target->IsPet())
820 return false;
821
822 auto const& threatList = target->GetThreatMgr().GetThreatList();
823 ThreatContainer::StorageType::const_iterator itr;
824 uint32 count = 0;
825
826 handler->PSendSysMessage("Threat list of {} ({})", target->GetName(), target->GetGUID().ToString());
827
828 for (itr = threatList.begin(); itr != threatList.end(); ++itr)
829 {
830 Unit* unit = (*itr)->getTarget();
831 if (!unit)
832 {
833 handler->PSendSysMessage(" {}. No Unit - threat {}", ++count, (*itr)->GetThreat());
834 continue;
835 }
836
837 handler->PSendSysMessage(" {}. {} ({}) - threat {}", ++count, unit->GetName(), unit->GetGUID().ToString(), (*itr)->GetThreat());
838 }
839
840 auto const& threatList2 = target->GetThreatMgr().GetOfflineThreatList();
841 for (itr = threatList2.begin(); itr != threatList2.end(); ++itr)
842 {
843 Unit* unit = (*itr)->getTarget();
844 if (!unit)
845 {
846 handler->PSendSysMessage(" {}. [offline] No Unit - threat {}", ++count, (*itr)->GetThreat());
847 continue;
848 }
849
850 handler->PSendSysMessage(" {}. [offline] {} ({}) - threat {}", ++count, unit->GetName(), unit->GetGUID().ToString(), (*itr)->GetThreat());
851 }
852
853 handler->SendSysMessage("End of threat list.");
854
855 return true;
856 }
ThreatContainer::StorageType const & GetOfflineThreatList() const
Definition ThreatMgr.h:274
ThreatContainer::StorageType const & GetThreatList() const
Definition ThreatMgr.h:273
bool IsPet() const
Definition Unit.h:749
ThreatMgr & GetThreatMgr()
Definition Unit.h:900
bool IsTotem() const
Definition Unit.h:751

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
1258 {
1259 Unit* target = handler->getSelectedUnit();
1260 if (!target)
1261 target = handler->GetSession()->GetPlayer();
1262
1263 target->ClearUnitState(target->GetUnitState());
1264 target->AddUnitState(unitState);
1265
1266 return true;
1267 }
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
1148 {
1149 Unit* unit = handler->getSelectedUnit();
1150 if (!unit)
1151 {
1153 return false;
1154 }
1155
1156 if (!index)
1157 return true;
1158
1159 // check index
1160 if (unit->IsPlayer())
1161 {
1162 if (index >= PLAYER_END)
1163 return true;
1164 }
1165 else if (index >= UNIT_END)
1166 return true;
1167
1168 if (!value)
1169 {
1170 value = unit->GetUInt32Value(index);
1171
1172 handler->PSendSysMessage(LANG_UPDATE, unit->GetGUID().ToString(), index, *value);
1173 return true;
1174 }
1175
1176 unit->SetUInt32Value(index, *value);
1177
1178 handler->PSendSysMessage(LANG_UPDATE_CHANGE, unit->GetGUID().ToString(), index, *value);
1179 return true;
1180 }
@ LANG_UPDATE_CHANGE
Definition Language.h:626
@ LANG_UPDATE
Definition Language.h:625
@ 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
441 {
442 handler->GetPlayer()->SendUpdateWorldState(variable, value);
443 return true;
444 }
void SendUpdateWorldState(uint32 variable, uint32 value) const
Definition PlayerUpdates.cpp:2233

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

Referenced by GetCommands().

◆ HandleDebugVisibilityDataCommand()

static bool debug_commandscript::HandleDebugVisibilityDataCommand ( ChatHandler handler)
inlinestatic
1409 {
1410 Player* player = handler->GetPlayer();
1411 if (!player)
1412 return false;
1413
1414 std::array<uint32, NUM_CLIENT_OBJECT_TYPES> objectByTypeCount = {};
1415
1416 ObjectVisibilityContainer const& objectVisibilityContainer = player->GetObjectVisibilityContainer();
1417 for (auto const& kvPair : *objectVisibilityContainer.GetVisibleWorldObjectsMap())
1418 {
1419 WorldObject const* obj = kvPair.second;
1420 ++objectByTypeCount[obj->GetTypeId()];
1421 }
1422
1423 uint32 zoneWideVisibleObjectsInZone = 0;
1424 if (ZoneWideVisibleWorldObjectsSet const* farVisibleSet = player->GetMap()->GetZoneWideVisibleWorldObjectsForZone(player->GetZoneId()))
1425 zoneWideVisibleObjectsInZone = farVisibleSet->size();
1426
1427 handler->PSendSysMessage("Visibility Range: {}", player->GetVisibilityRange());
1428 handler->PSendSysMessage("Visible Creatures: {}", objectByTypeCount[TYPEID_UNIT]);
1429 handler->PSendSysMessage("Visible Players: {}", objectByTypeCount[TYPEID_PLAYER]);
1430 handler->PSendSysMessage("Visible GameObjects: {}", objectByTypeCount[TYPEID_GAMEOBJECT]);
1431 handler->PSendSysMessage("Visible DynamicObjects: {}", objectByTypeCount[TYPEID_DYNAMICOBJECT]);
1432 handler->PSendSysMessage("Visible Corpses: {}", objectByTypeCount[TYPEID_CORPSE]);
1433 handler->PSendSysMessage("Players we are visible to: {}", objectVisibilityContainer.GetVisiblePlayersMap().size());
1434 handler->PSendSysMessage("Zone wide visible objects in zone: {}", zoneWideVisibleObjectsInZone);
1435 return true;
1436 }
std::unordered_set< WorldObject * > ZoneWideVisibleWorldObjectsSet
Definition Map.h:150
@ TYPEID_DYNAMICOBJECT
Definition ObjectGuid.h:38
@ TYPEID_GAMEOBJECT
Definition ObjectGuid.h:37
@ TYPEID_UNIT
Definition ObjectGuid.h:35
@ TYPEID_CORPSE
Definition ObjectGuid.h:39
@ TYPEID_PLAYER
Definition ObjectGuid.h:36
ZoneWideVisibleWorldObjectsSet const * GetZoneWideVisibleWorldObjectsForZone(uint32 zoneId) const
Definition Map.cpp:665
Definition ObjectVisibilityContainer.h:34
VisiblePlayersMap & GetVisiblePlayersMap()
Definition ObjectVisibilityContainer.h:54
TypeID GetTypeId() const
Definition Object.h:128
float GetVisibilityRange() const
Definition Object.cpp:1650
ObjectVisibilityContainer & GetObjectVisibilityContainer()
Definition Object.h:726
uint32 GetZoneId() const
Definition Object.cpp:3038

References WorldObject::GetMap(), WorldObject::GetObjectVisibilityContainer(), ChatHandler::GetPlayer(), Object::GetTypeId(), WorldObject::GetVisibilityRange(), ObjectVisibilityContainer::GetVisiblePlayersMap(), ObjectVisibilityContainer::GetVisibleWorldObjectsMap(), WorldObject::GetZoneId(), Map::GetZoneWideVisibleWorldObjectsForZone(), ChatHandler::PSendSysMessage(), TYPEID_CORPSE, TYPEID_DYNAMICOBJECT, TYPEID_GAMEOBJECT, TYPEID_PLAYER, and TYPEID_UNIT.

Referenced by GetCommands().

◆ HandleDebugVisualCommand()

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

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

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: