mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[Sync] Some minor project sync
This commit is contained in:
parent
7332173b6e
commit
461923f632
35 changed files with 3690 additions and 1585 deletions
|
|
@ -41,28 +41,28 @@
|
|||
bool ChatHandler::HandleDebugSendSpellFailCommand(char* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
uint32 failnum;
|
||||
if (!ExtractUInt32(&args, failnum) || failnum > 255)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
uint32 failarg1;
|
||||
if (!ExtractOptUInt32(&args, failarg1, 0))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
uint32 failarg2;
|
||||
if (!ExtractOptUInt32(&args, failarg2, 0))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
WorldPacket data(SMSG_CAST_FAILED, 5);
|
||||
data << uint8(0);
|
||||
data << uint32(133);
|
||||
data << uint8(failnum);
|
||||
if (failarg1 || failarg2)
|
||||
data << uint32(failarg1);
|
||||
{ data << uint32(failarg1); }
|
||||
if (failarg2)
|
||||
data << uint32(failarg2);
|
||||
{ data << uint32(failarg2); }
|
||||
|
||||
m_session->SendPacket(&data);
|
||||
|
||||
|
|
@ -81,11 +81,11 @@ bool ChatHandler::HandleDebugSendPoiCommand(char* args)
|
|||
|
||||
uint32 icon;
|
||||
if (!ExtractUInt32(&args, icon))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
uint32 flags;
|
||||
if (!ExtractUInt32(&args, flags))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
DETAIL_LOG("Command : POI, NPC = %u, icon = %u flags = %u", target->GetGUIDLow(), icon, flags);
|
||||
pPlayer->PlayerTalkClass->SendPointOfInterest(target->GetPositionX(), target->GetPositionY(), Poi_Icon(icon), flags, 30, "Test POI");
|
||||
|
|
@ -95,7 +95,7 @@ bool ChatHandler::HandleDebugSendPoiCommand(char* args)
|
|||
bool ChatHandler::HandleDebugSendEquipErrorCommand(char* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
uint8 msg = atoi(args);
|
||||
m_session->GetPlayer()->SendEquipError(InventoryResult(msg), NULL, NULL);
|
||||
|
|
@ -105,7 +105,7 @@ bool ChatHandler::HandleDebugSendEquipErrorCommand(char* args)
|
|||
bool ChatHandler::HandleDebugSendSellErrorCommand(char* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
uint8 msg = atoi(args);
|
||||
m_session->GetPlayer()->SendSellError(SellResult(msg), 0, ObjectGuid(), 0);
|
||||
|
|
@ -115,7 +115,7 @@ bool ChatHandler::HandleDebugSendSellErrorCommand(char* args)
|
|||
bool ChatHandler::HandleDebugSendBuyErrorCommand(char* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
uint8 msg = atoi(args);
|
||||
m_session->GetPlayer()->SendBuyError(BuyResult(msg), 0, 0, 0);
|
||||
|
|
@ -126,11 +126,11 @@ bool ChatHandler::HandleDebugSendOpcodeCommand(char* /*args*/)
|
|||
{
|
||||
Unit* unit = getSelectedUnit();
|
||||
if (!unit || (unit->GetTypeId() != TYPEID_PLAYER))
|
||||
unit = m_session->GetPlayer();
|
||||
{ unit = m_session->GetPlayer(); }
|
||||
|
||||
std::ifstream stream("opcode.txt");
|
||||
if (!stream.is_open())
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
uint32 opcode = 0;
|
||||
if (!(stream >> opcode))
|
||||
|
|
@ -145,7 +145,7 @@ bool ChatHandler::HandleDebugSendOpcodeCommand(char* /*args*/)
|
|||
while (stream >> type)
|
||||
{
|
||||
if (type.empty())
|
||||
break;
|
||||
{ break; }
|
||||
|
||||
if (type == "uint8")
|
||||
{
|
||||
|
|
@ -209,11 +209,11 @@ bool ChatHandler::HandleDebugUpdateWorldStateCommand(char* args)
|
|||
{
|
||||
uint32 world;
|
||||
if (!ExtractUInt32(&args, world))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
uint32 state;
|
||||
if (!ExtractUInt32(&args, state))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
m_session->GetPlayer()->SendUpdateWorldState(world, state);
|
||||
return true;
|
||||
|
|
@ -225,7 +225,7 @@ bool ChatHandler::HandleDebugPlayCinematicCommand(char* args)
|
|||
// #cinematicid - ID decimal number from CinemaicSequences.dbc (1st column)
|
||||
uint32 dwId;
|
||||
if (!ExtractUInt32(&args, dwId))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
if (!sCinematicSequencesStore.LookupEntry(dwId))
|
||||
{
|
||||
|
|
@ -264,7 +264,7 @@ bool ChatHandler::HandleDebugPlaySoundCommand(char* args)
|
|||
// #soundid - ID decimal number from SoundEntries.dbc (1st column)
|
||||
uint32 dwSoundId;
|
||||
if (!ExtractUInt32(&args, dwSoundId))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
if (!sSoundEntriesStore.LookupEntry(dwSoundId))
|
||||
{
|
||||
|
|
@ -282,9 +282,9 @@ bool ChatHandler::HandleDebugPlaySoundCommand(char* args)
|
|||
}
|
||||
|
||||
if (m_session->GetPlayer()->GetSelectionGuid())
|
||||
unit->PlayDistanceSound(dwSoundId, m_session->GetPlayer());
|
||||
{ unit->PlayDistanceSound(dwSoundId, m_session->GetPlayer()); }
|
||||
else
|
||||
unit->PlayDirectSound(dwSoundId, m_session->GetPlayer());
|
||||
{ unit->PlayDirectSound(dwSoundId, m_session->GetPlayer()); }
|
||||
|
||||
PSendSysMessage(LANG_YOU_HEAR_SOUND, dwSoundId);
|
||||
return true;
|
||||
|
|
@ -297,7 +297,7 @@ bool ChatHandler::HandleDebugSendChannelNotifyCommand(char* args)
|
|||
|
||||
uint32 code;
|
||||
if (!ExtractUInt32(&args, code) || code > 255)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
WorldPacket data(SMSG_CHANNEL_NOTIFY, (1 + 10));
|
||||
data << uint8(code); // notify type
|
||||
|
|
@ -315,7 +315,7 @@ bool ChatHandler::HandleDebugSendChatMsgCommand(char* args)
|
|||
|
||||
uint32 type;
|
||||
if (!ExtractUInt32(&args, type) || type > 255)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, ChatMsg(type), msg, LANG_UNIVERSAL, CHAT_TAG_NONE, m_session->GetPlayer()->GetObjectGuid(), m_session->GetPlayerName());
|
||||
|
|
@ -327,7 +327,7 @@ bool ChatHandler::HandleDebugSendQuestPartyMsgCommand(char* args)
|
|||
{
|
||||
uint32 msg;
|
||||
if (!ExtractUInt32(&args, msg))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
m_session->GetPlayer()->SendPushToPartyResponse(m_session->GetPlayer(), msg);
|
||||
return true;
|
||||
|
|
@ -337,17 +337,17 @@ bool ChatHandler::HandleDebugGetLootRecipientCommand(char* /*args*/)
|
|||
{
|
||||
Creature* target = getSelectedCreature();
|
||||
if (!target)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
if (!target->HasLootRecipient())
|
||||
SendSysMessage("loot recipient: no loot recipient");
|
||||
{ SendSysMessage("loot recipient: no loot recipient"); }
|
||||
else if (Player* recipient = target->GetLootRecipient())
|
||||
PSendSysMessage("loot recipient: %s with raw data %s from group %u",
|
||||
recipient->GetGuidStr().c_str(),
|
||||
target->GetLootRecipientGuid().GetString().c_str(),
|
||||
target->GetLootGroupRecipientId());
|
||||
else
|
||||
SendSysMessage("loot recipient: offline ");
|
||||
{ SendSysMessage("loot recipient: offline "); }
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -362,7 +362,7 @@ bool ChatHandler::HandleDebugSendQuestInvalidMsgCommand(char* args)
|
|||
bool ChatHandler::HandleDebugGetItemStateCommand(char* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
ItemUpdateState state = ITEM_UNCHANGED;
|
||||
bool list_queue = false, check_all = false;
|
||||
|
|
@ -390,14 +390,14 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args)
|
|||
state_str = "removed";
|
||||
}
|
||||
else if (strncmp(args, "queue", strlen(args)) == 0)
|
||||
list_queue = true;
|
||||
{ list_queue = true; }
|
||||
else if (strncmp(args, "all", strlen(args)) == 0)
|
||||
check_all = true;
|
||||
{ check_all = true; }
|
||||
else
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
Player* player = getSelectedPlayer();
|
||||
if (!player) player = m_session->GetPlayer();
|
||||
if (!player) { player = m_session->GetPlayer(); }
|
||||
|
||||
if (!list_queue && !check_all)
|
||||
{
|
||||
|
|
@ -406,10 +406,10 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args)
|
|||
for (uint8 i = PLAYER_SLOT_START; i < PLAYER_SLOT_END; ++i)
|
||||
{
|
||||
if (i >= BUYBACK_SLOT_START && i < BUYBACK_SLOT_END)
|
||||
continue;
|
||||
{ continue; }
|
||||
|
||||
Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
|
||||
if (!item) continue;
|
||||
if (!item) { continue; }
|
||||
if (!item->IsBag())
|
||||
{
|
||||
if (item->GetState() == state)
|
||||
|
|
@ -433,11 +433,11 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args)
|
|||
|
||||
if (list_queue)
|
||||
{
|
||||
std::vector<Item*> &updateQueue = player->GetItemUpdateQueue();
|
||||
std::vector<Item*>& updateQueue = player->GetItemUpdateQueue();
|
||||
for (size_t i = 0; i < updateQueue.size(); ++i)
|
||||
{
|
||||
Item* item = updateQueue[i];
|
||||
if (!item) continue;
|
||||
if (!item) { continue; }
|
||||
|
||||
Bag* container = item->GetContainer();
|
||||
uint8 bag_slot = container ? container->GetSlot() : uint8(INVENTORY_SLOT_BAG_0);
|
||||
|
|
@ -455,20 +455,20 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args)
|
|||
item->GetGuidStr().c_str(), bag_slot, item->GetSlot(), st.c_str());
|
||||
}
|
||||
if (updateQueue.empty())
|
||||
PSendSysMessage("updatequeue empty");
|
||||
{ PSendSysMessage("updatequeue empty"); }
|
||||
}
|
||||
|
||||
if (check_all)
|
||||
{
|
||||
bool error = false;
|
||||
std::vector<Item*> &updateQueue = player->GetItemUpdateQueue();
|
||||
std::vector<Item*>& updateQueue = player->GetItemUpdateQueue();
|
||||
for (uint8 i = PLAYER_SLOT_START; i < PLAYER_SLOT_END; ++i)
|
||||
{
|
||||
if (i >= BUYBACK_SLOT_START && i < BUYBACK_SLOT_END)
|
||||
continue;
|
||||
{ continue; }
|
||||
|
||||
Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
|
||||
if (!item) continue;
|
||||
if (!item) { continue; }
|
||||
|
||||
if (item->GetSlot() != i)
|
||||
{
|
||||
|
|
@ -531,7 +531,7 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args)
|
|||
for (uint8 j = 0; j < bag->GetBagSize(); ++j)
|
||||
{
|
||||
Item* item2 = bag->GetItemByPos(j);
|
||||
if (!item2) continue;
|
||||
if (!item2) { continue; }
|
||||
|
||||
if (item2->GetSlot() != j)
|
||||
{
|
||||
|
|
@ -602,7 +602,7 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args)
|
|||
for (size_t i = 0; i < updateQueue.size(); ++i)
|
||||
{
|
||||
Item* item = updateQueue[i];
|
||||
if (!item) continue;
|
||||
if (!item) { continue; }
|
||||
|
||||
if (item->GetOwnerGuid() != player->GetObjectGuid())
|
||||
{
|
||||
|
|
@ -619,7 +619,7 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args)
|
|||
error = true; continue;
|
||||
}
|
||||
|
||||
if (item->GetState() == ITEM_REMOVED) continue;
|
||||
if (item->GetState() == ITEM_REMOVED) { continue; }
|
||||
Item* test = player->GetItemByPos(item->GetBagSlot(), item->GetSlot());
|
||||
|
||||
if (test == NULL)
|
||||
|
|
@ -638,7 +638,7 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args)
|
|||
}
|
||||
}
|
||||
if (!error)
|
||||
SendSysMessage("All OK!");
|
||||
{ SendSysMessage("All OK!"); }
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -702,7 +702,7 @@ bool ChatHandler::HandleDebugAnimCommand(char* args)
|
|||
{
|
||||
uint32 emote_id;
|
||||
if (!ExtractUInt32(&args, emote_id))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
m_session->GetPlayer()->HandleEmoteCommand(emote_id);
|
||||
return true;
|
||||
|
|
@ -712,7 +712,7 @@ bool ChatHandler::HandleDebugSetAuraStateCommand(char* args)
|
|||
{
|
||||
int32 state;
|
||||
if (!ExtractInt32(&args, state))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
Unit* unit = getSelectedUnit();
|
||||
if (!unit)
|
||||
|
|
@ -726,7 +726,7 @@ bool ChatHandler::HandleDebugSetAuraStateCommand(char* args)
|
|||
{
|
||||
// reset all states
|
||||
for (int i = 1; i <= 32; ++i)
|
||||
unit->ModifyAuraState(AuraState(i), false);
|
||||
{ unit->ModifyAuraState(AuraState(i), false); }
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -747,23 +747,23 @@ bool ChatHandler::HandleSetValueHelper(Object* target, uint32 field, char* typeS
|
|||
|
||||
uint32 base; // 0 -> float
|
||||
if (!typeStr)
|
||||
base = 10;
|
||||
{ base = 10; }
|
||||
else if (strncmp(typeStr, "int", strlen(typeStr)) == 0)
|
||||
base = 10;
|
||||
{ base = 10; }
|
||||
else if (strncmp(typeStr, "hex", strlen(typeStr)) == 0)
|
||||
base = 16;
|
||||
{ base = 16; }
|
||||
else if (strncmp(typeStr, "bit", strlen(typeStr)) == 0)
|
||||
base = 2;
|
||||
{ base = 2; }
|
||||
else if (strncmp(typeStr, "float", strlen(typeStr)) == 0)
|
||||
base = 0;
|
||||
{ base = 0; }
|
||||
else
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
if (base)
|
||||
{
|
||||
uint32 iValue;
|
||||
if (!ExtractUInt32Base(&valStr, iValue, base))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
DEBUG_LOG(GetMangosString(LANG_SET_UINT), guid.GetString().c_str(), field, iValue);
|
||||
target->SetUInt32Value(field , iValue);
|
||||
|
|
@ -773,7 +773,7 @@ bool ChatHandler::HandleSetValueHelper(Object* target, uint32 field, char* typeS
|
|||
{
|
||||
float fValue;
|
||||
if (!ExtractFloat(&valStr, fValue))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
DEBUG_LOG(GetMangosString(LANG_SET_FLOAT), guid.GetString().c_str(), field, fValue);
|
||||
target->SetFloatValue(field , fValue);
|
||||
|
|
@ -787,23 +787,23 @@ bool ChatHandler::HandleDebugSetItemValueCommand(char* args)
|
|||
{
|
||||
uint32 guid;
|
||||
if (!ExtractUInt32(&args, guid))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
uint32 field;
|
||||
if (!ExtractUInt32(&args, field))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
char* typeStr = ExtractOptNotLastArg(&args);
|
||||
if (!typeStr)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
char* valStr = ExtractLiteralArg(&args);
|
||||
if (!valStr)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
Item* item = m_session->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, guid));
|
||||
if (!item)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
return HandleSetValueHelper(item, field, typeStr, valStr);
|
||||
}
|
||||
|
|
@ -820,15 +820,15 @@ bool ChatHandler::HandleDebugSetValueCommand(char* args)
|
|||
|
||||
uint32 field;
|
||||
if (!ExtractUInt32(&args, field))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
char* typeStr = ExtractOptNotLastArg(&args);
|
||||
if (!typeStr)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
char* valStr = ExtractLiteralArg(&args);
|
||||
if (!valStr)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
return HandleSetValueHelper(target, field, typeStr, valStr);
|
||||
}
|
||||
|
|
@ -845,17 +845,17 @@ bool ChatHandler::HandleGetValueHelper(Object* target, uint32 field, char* typeS
|
|||
|
||||
uint32 base; // 0 -> float
|
||||
if (!typeStr)
|
||||
base = 10;
|
||||
{ base = 10; }
|
||||
else if (strncmp(typeStr, "int", strlen(typeStr)) == 0)
|
||||
base = 10;
|
||||
{ base = 10; }
|
||||
else if (strncmp(typeStr, "hex", strlen(typeStr)) == 0)
|
||||
base = 16;
|
||||
{ base = 16; }
|
||||
else if (strncmp(typeStr, "bit", strlen(typeStr)) == 0)
|
||||
base = 2;
|
||||
{ base = 2; }
|
||||
else if (strncmp(typeStr, "float", strlen(typeStr)) == 0)
|
||||
base = 0;
|
||||
{ base = 0; }
|
||||
else
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
if (base)
|
||||
{
|
||||
|
|
@ -870,7 +870,7 @@ bool ChatHandler::HandleGetValueHelper(Object* target, uint32 field, char* typeS
|
|||
res.reserve(1 + 32 + 1);
|
||||
res = iValue & (1 << (32 - 1)) ? "0" : " ";
|
||||
for (int i = 32; i > 0; --i)
|
||||
res += iValue & (1 << (i - 1)) ? "1" : "0";
|
||||
{ res += iValue & (1 << (i - 1)) ? "1" : "0"; }
|
||||
DEBUG_LOG(GetMangosString(LANG_GET_BITSTR), guid.GetString().c_str(), field, res.c_str());
|
||||
PSendSysMessage(LANG_GET_BITSTR_FIELD, guid.GetString().c_str(), field, res.c_str());
|
||||
break;
|
||||
|
|
@ -899,19 +899,19 @@ bool ChatHandler::HandleDebugGetItemValueCommand(char* args)
|
|||
{
|
||||
uint32 guid;
|
||||
if (!ExtractUInt32(&args, guid))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
uint32 field;
|
||||
if (!ExtractUInt32(&args, field))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
char* typeStr = ExtractLiteralArg(&args);
|
||||
if (!typeStr && *args) // optional arg but check format fail case
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
Item* item = m_session->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, guid));
|
||||
if (!item)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
return HandleGetValueHelper(item, field, typeStr);
|
||||
}
|
||||
|
|
@ -928,11 +928,11 @@ bool ChatHandler::HandleDebugGetValueCommand(char* args)
|
|||
|
||||
uint32 field;
|
||||
if (!ExtractUInt32(&args, field))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
char* typeStr = ExtractLiteralArg(&args);
|
||||
if (!typeStr && *args) // optional arg but check format fail case
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
return HandleGetValueHelper(target, field, typeStr);
|
||||
}
|
||||
|
|
@ -950,23 +950,23 @@ bool ChatHandler::HandlerDebugModValueHelper(Object* target, uint32 field, char*
|
|||
|
||||
uint32 type; // 0 -> float 1 -> int add 2-> bit or 3 -> bit and 4 -> bit and not
|
||||
if (strncmp(typeStr, "int", strlen(typeStr)) == 0)
|
||||
type = 1;
|
||||
{ type = 1; }
|
||||
else if (strncmp(typeStr, "float", strlen(typeStr)) == 0)
|
||||
type = 0;
|
||||
{ type = 0; }
|
||||
else if (strncmp(typeStr, "|=", strlen("|=") + 1) == 0) // exactly copy
|
||||
type = 2;
|
||||
{ type = 2; }
|
||||
else if (strncmp(typeStr, "&=", strlen("&=") + 1) == 0) // exactly copy
|
||||
type = 3;
|
||||
{ type = 3; }
|
||||
else if (strncmp(typeStr, "&=~", strlen("&=~") + 1) == 0) // exactly copy
|
||||
type = 4;
|
||||
{ type = 4; }
|
||||
else
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
if (type)
|
||||
{
|
||||
uint32 iValue;
|
||||
if (!ExtractUInt32Base(&valStr, iValue, type == 1 ? 10 : 16))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
uint32 value = target->GetUInt32Value(field);
|
||||
const char* guidString = guid.GetString().c_str();
|
||||
|
|
@ -1002,7 +1002,7 @@ bool ChatHandler::HandlerDebugModValueHelper(Object* target, uint32 field, char*
|
|||
{
|
||||
float fValue;
|
||||
if (!ExtractFloat(&valStr, fValue))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
float value = target->GetFloatValue(field);
|
||||
|
||||
|
|
@ -1021,23 +1021,23 @@ bool ChatHandler::HandleDebugModItemValueCommand(char* args)
|
|||
{
|
||||
uint32 guid;
|
||||
if (!ExtractUInt32(&args, guid))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
uint32 field;
|
||||
if (!ExtractUInt32(&args, field))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
char* typeStr = ExtractLiteralArg(&args);
|
||||
if (!typeStr)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
char* valStr = ExtractLiteralArg(&args);
|
||||
if (!valStr)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
Item* item = m_session->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, guid));
|
||||
if (!item)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
return HandlerDebugModValueHelper(item, field, typeStr, valStr);
|
||||
}
|
||||
|
|
@ -1054,15 +1054,15 @@ bool ChatHandler::HandleDebugModValueCommand(char* args)
|
|||
|
||||
uint32 field;
|
||||
if (!ExtractUInt32(&args, field))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
char* typeStr = ExtractLiteralArg(&args);
|
||||
if (!typeStr && *args) // optional arg but check format fail case
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
char* valStr = ExtractLiteralArg(&args);
|
||||
if (!valStr)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
return HandlerDebugModValueHelper(target, field, typeStr, valStr);
|
||||
}
|
||||
|
|
@ -1071,11 +1071,11 @@ bool ChatHandler::HandleDebugSpellCoefsCommand(char* args)
|
|||
{
|
||||
uint32 spellid = ExtractSpellIdFromLink(&args);
|
||||
if (!spellid)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
SpellEntry const* spellEntry = sSpellStore.LookupEntry(spellid);
|
||||
if (!spellEntry)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
SpellBonusEntry const* bonus = sSpellMgr.GetSpellBonusData(spellid);
|
||||
|
||||
|
|
@ -1128,27 +1128,27 @@ bool ChatHandler::HandleDebugSpellModsCommand(char* args)
|
|||
{
|
||||
char* typeStr = ExtractLiteralArg(&args);
|
||||
if (!typeStr)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
Opcodes opcode;
|
||||
if (strncmp(typeStr, "flat", strlen(typeStr)) == 0)
|
||||
opcode = SMSG_SET_FLAT_SPELL_MODIFIER;
|
||||
{ opcode = SMSG_SET_FLAT_SPELL_MODIFIER; }
|
||||
else if (strncmp(typeStr, "pct", strlen(typeStr)) == 0)
|
||||
opcode = SMSG_SET_PCT_SPELL_MODIFIER;
|
||||
{ opcode = SMSG_SET_PCT_SPELL_MODIFIER; }
|
||||
else
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
uint32 effidx;
|
||||
if (!ExtractUInt32(&args, effidx) || effidx >= 64 + 32)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
uint32 spellmodop;
|
||||
if (!ExtractUInt32(&args, spellmodop) || spellmodop >= MAX_SPELLMOD)
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
int32 value;
|
||||
if (!ExtractInt32(&args, value))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
Player* chr = getSelectedPlayer();
|
||||
if (chr == NULL)
|
||||
|
|
@ -1160,7 +1160,7 @@ bool ChatHandler::HandleDebugSpellModsCommand(char* args)
|
|||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr))
|
||||
return false;
|
||||
{ return false; }
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_SPELLMODS, opcode == SMSG_SET_FLAT_SPELL_MODIFIER ? "flat" : "pct",
|
||||
spellmodop, value, effidx, GetNameLink(chr).c_str());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue