TrinityCore
Loading...
Searching...
No Matches
cs_modify.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/* ScriptData
19Name: modify_commandscript
20%Complete: 100
21Comment: All modify related commands
22Category: commandscripts
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "CharacterCache.h"
27#include "Chat.h"
28#include "ChatCommand.h"
29#include "Creature.h"
30#include "DB2Stores.h"
31#include "Log.h"
32#include "ObjectMgr.h"
33#include "PhasingHandler.h"
34#include "Player.h"
35#include "RBAC.h"
36#include "ReputationMgr.h"
37#include "SpellPackets.h"
38#include "UpdateFields.h"
39#include "Util.h"
40#include "WorldSession.h"
41
42using namespace Trinity::ChatCommands;
43
44#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
45#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
46#endif
47
49{
50public:
51 modify_commandscript() : CommandScript("modify_commandscript") { }
52
53 std::span<ChatCommandBuilder const> GetCommands() const override
54 {
55 static ChatCommandTable modifyspeedCommandTable =
56 {
63 };
64 static ChatCommandTable modifyCommandTable =
65 {
81 { "speed", rbac::RBAC_PERM_COMMAND_MODIFY_SPEED, false, nullptr, "", modifyspeedCommandTable },
87 };
88 static ChatCommandTable commandTable =
89 {
91 { "demorph", rbac::RBAC_PERM_COMMAND_DEMORPH, false, &HandleDeMorphCommand, "" },
92 { "modify", rbac::RBAC_PERM_COMMAND_MODIFY, false, nullptr, "", modifyCommandTable },
93 };
94 return commandTable;
95 }
96
97 template<typename... Args>
98 static void NotifyModification(ChatHandler* handler, Unit* target, TrinityStrings resourceMessage, TrinityStrings resourceReportMessage, Args&&... args)
99 {
100 if (Player* player = target->ToPlayer())
101 {
102 handler->PSendSysMessage(resourceMessage, handler->GetNameLink(player).c_str(), args...);
103 if (handler->needReportToTarget(player))
104 ChatHandler(player->GetSession()).PSendSysMessage(resourceReportMessage, handler->GetNameLink().c_str(), std::forward<Args>(args)...);
105 }
106 }
107
108 static bool CheckModifyResources(ChatHandler* handler, char const* args, Player* target, int32& res, int32& resmax, int8 const multiplier = 1)
109 {
110 if (!*args)
111 return false;
112
113 res = atoi((char*)args) * multiplier;
114 resmax = atoi((char*)args) * multiplier;
115
116 if (res < 1 || resmax < 1 || resmax < res)
117 {
119 handler->SetSentErrorMessage(true);
120 return false;
121 }
122
123 if (!target)
124 {
126 handler->SetSentErrorMessage(true);
127 return false;
128 }
129
130 if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
131 return false;
132
133 return true;
134 }
135
136 //Edit Player HP
137 static bool HandleModifyHPCommand(ChatHandler* handler, char const* args)
138 {
139 int32 hp, hpmax;
140 Player* target = handler->getSelectedPlayerOrSelf();
141 if (CheckModifyResources(handler, args, target, hp, hpmax))
142 {
143 NotifyModification(handler, target, LANG_YOU_CHANGE_HP, LANG_YOURS_HP_CHANGED, hp, hpmax);
144 target->SetMaxHealth(hpmax);
145 target->SetHealth(hp);
146 return true;
147 }
148 return false;
149 }
150
151 //Edit Player Mana
152 static bool HandleModifyManaCommand(ChatHandler* handler, char const* args)
153 {
154 int32 mana, manamax;
155 Player* target = handler->getSelectedPlayerOrSelf();
156
157 if (CheckModifyResources(handler, args, target, mana, manamax))
158 {
159 NotifyModification(handler, target, LANG_YOU_CHANGE_MANA, LANG_YOURS_MANA_CHANGED, mana, manamax);
160 target->SetMaxPower(POWER_MANA, manamax);
161 target->SetPower(POWER_MANA, mana);
162 return true;
163 }
164 return false;
165 }
166
167 //Edit Player Energy
168 static bool HandleModifyEnergyCommand(ChatHandler* handler, char const* args)
169 {
170 int32 energy, energymax;
171 Player* target = handler->getSelectedPlayerOrSelf();
172 int8 const energyMultiplier = 10;
173 if (CheckModifyResources(handler, args, target, energy, energymax, energyMultiplier))
174 {
175 NotifyModification(handler, target, LANG_YOU_CHANGE_ENERGY, LANG_YOURS_ENERGY_CHANGED, energy / energyMultiplier, energymax / energyMultiplier);
176 target->SetMaxPower(POWER_ENERGY, energymax);
177 target->SetPower(POWER_ENERGY, energy);
178 return true;
179 }
180 return false;
181 }
182
183 //Edit Player Rage
184 static bool HandleModifyRageCommand(ChatHandler* handler, char const* args)
185 {
186 int32 rage, ragemax;
187 Player* target = handler->getSelectedPlayerOrSelf();
188 int8 const rageMultiplier = 10;
189 if (CheckModifyResources(handler, args, target, rage, ragemax, rageMultiplier))
190 {
191 NotifyModification(handler, target, LANG_YOU_CHANGE_RAGE, LANG_YOURS_RAGE_CHANGED, rage / rageMultiplier, ragemax / rageMultiplier);
192 target->SetMaxPower(POWER_RAGE, ragemax);
193 target->SetPower(POWER_RAGE, rage);
194 return true;
195 }
196 return false;
197 }
198
199 // Edit Player Runic Power
200 static bool HandleModifyRunicPowerCommand(ChatHandler* handler, char const* args)
201 {
202 int32 rune, runemax;
203 Player* target = handler->getSelectedPlayerOrSelf();
204 int8 const runeMultiplier = 10;
205 if (CheckModifyResources(handler, args, target, rune, runemax, runeMultiplier))
206 {
207 NotifyModification(handler, target, LANG_YOU_CHANGE_RUNIC_POWER, LANG_YOURS_RUNIC_POWER_CHANGED, rune / runeMultiplier, runemax / runeMultiplier);
208 target->SetMaxPower(POWER_RUNIC_POWER, runemax);
209 target->SetPower(POWER_RUNIC_POWER, rune);
210 return true;
211 }
212 return false;
213 }
214
215 //Edit Player Faction
217 {
218 Creature* target = handler->getSelectedCreature();
219 if (!target)
220 {
222 handler->SetSentErrorMessage(true);
223 return false;
224 }
225
226 if (!flag)
227 flag = target->m_unitData->Flags;
228
229 if (!npcflag)
230 npcflag = (uint64(target->GetNpcFlags2()) << 32) | target->GetNpcFlags();
231
232 if (!dyflag)
233 dyflag = target->m_objectData->DynamicFlags;
234
235 if (!factionid)
236 {
237 handler->PSendSysMessage(LANG_CURRENT_FACTION, target->GetGUID().ToString().c_str(), target->GetFaction(), *flag, std::to_string(*npcflag).c_str(), *dyflag);
238 return true;
239 }
240
241 if (!sFactionTemplateStore.LookupEntry(*factionid))
242 {
243 handler->PSendSysMessage(LANG_WRONG_FACTION, *factionid);
244 handler->SetSentErrorMessage(true);
245 return false;
246 }
247
248 handler->PSendSysMessage(LANG_YOU_CHANGE_FACTION, target->GetGUID().ToString().c_str(), *factionid, *flag, std::to_string(*npcflag).c_str(), *dyflag);
249
250 target->SetFaction(*factionid);
251 target->ReplaceAllUnitFlags(UnitFlags(*flag));
252 target->ReplaceAllNpcFlags(NPCFlags(*npcflag & 0xFFFFFFFF));
253 target->ReplaceAllNpcFlags2(NPCFlags2(*npcflag >> 32));
254 target->ReplaceAllDynamicFlags(*dyflag);
255
256 return true;
257 }
258
259 //Edit Player Spell
260 static bool HandleModifySpellCommand(ChatHandler* handler, char const* args)
261 {
262 if (!*args)
263 return false;
264
265 char* pspellflatid = strtok((char*)args, " ");
266 if (!pspellflatid)
267 return false;
268
269 char* pop = strtok(nullptr, " ");
270 if (!pop)
271 return false;
272
273 char* pval = strtok(nullptr, " ");
274 if (!pval)
275 return false;
276
277 uint16 mark;
278
279 char* pmark = strtok(nullptr, " ");
280
281 uint8 spellflatid = atoi(pspellflatid);
282 uint8 op = atoi(pop);
283 uint16 val = atoi(pval);
284 if (!pmark)
285 mark = 65535;
286 else
287 mark = atoi(pmark);
288
289 Player* target = handler->getSelectedPlayerOrSelf();
290 if (target == nullptr)
291 {
293 handler->SetSentErrorMessage(true);
294 return false;
295 }
296
297 // check online security
298 if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
299 return false;
300
301 handler->PSendSysMessage(LANG_YOU_CHANGE_SPELLFLATID, spellflatid, val, mark, handler->GetNameLink(target).c_str());
302 if (handler->needReportToTarget(target))
303 ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_SPELLFLATID_CHANGED, handler->GetNameLink().c_str(), spellflatid, val, mark);
304
307 spellMod.ModIndex = op;
309 modData.ClassIndex = spellflatid;
310 modData.ModifierValue = float(val);
311 spellMod.ModifierData.push_back(modData);
312 packet.Modifiers.push_back(spellMod);
313 target->SendDirectMessage(packet.Write());
314
315 return true;
316 }
317
318 //Edit Player TP
319 static bool HandleModifyTalentCommand(ChatHandler* /*handler*/, char const* /*args*/)
320 {
321 /* TODO: 6.x remove this
322 if (!*args)
323 return false;
324
325 int tp = atoi((char*)args);
326 if (tp < 0)
327 return false;
328
329 Unit* target = handler->getSelectedUnit();
330 if (!target)
331 {
332 handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
333 handler->SetSentErrorMessage(true);
334 return false;
335 }
336
337 if (target->GetTypeId() == TYPEID_PLAYER)
338 {
339 // check online security
340 if (handler->HasLowerSecurity(target->ToPlayer(), ObjectGuid::Empty))
341 return false;
342 target->ToPlayer()->SetFreeTalentPoints(tp);
343 target->ToPlayer()->SendTalentsInfoData(false);
344 return true;
345 }
346 else if (target->IsPet())
347 {
348 Unit* owner = target->GetOwner();
349 if (owner && owner->GetTypeId() == TYPEID_PLAYER && ((Pet*)target)->IsPermanentPetFor(owner->ToPlayer()))
350 {
351 // check online security
352 if (handler->HasLowerSecurity(owner->ToPlayer(), ObjectGuid::Empty))
353 return false;
354 ((Pet*)target)->SetFreeTalentPoints(tp);
355 owner->ToPlayer()->SendTalentsInfoData(true);
356 return true;
357 }
358 }
359
360 handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
361 handler->SetSentErrorMessage(true);*/
362 return false;
363 }
364
365 static bool CheckModifySpeed(ChatHandler* handler, Unit* target, float speed, float minimumBound, float maximumBound, bool checkInFlight = true)
366 {
367 if (speed > maximumBound || speed < minimumBound)
368 {
370 handler->SetSentErrorMessage(true);
371 return false;
372 }
373
374 if (!target)
375 {
377 handler->SetSentErrorMessage(true);
378 return false;
379 }
380
381 if (Player* player = target->ToPlayer())
382 {
383 // check online security
384 if (handler->HasLowerSecurity(player, ObjectGuid::Empty))
385 return false;
386
387 if (player->IsInFlight() && checkInFlight)
388 {
389 handler->PSendSysMessage(LANG_CHAR_IN_FLIGHT, handler->GetNameLink(player).c_str());
390 handler->SetSentErrorMessage(true);
391 return false;
392 }
393 }
394 return true;
395 }
396
397 static bool CheckModifySpeed(ChatHandler* handler, char const* args, Unit* target, float& speed, float minimumBound, float maximumBound, bool checkInFlight = true)
398 {
399 if (!*args)
400 return false;
401
402 speed = (float)atof((char*)args);
403 return CheckModifySpeed(handler, target, speed, minimumBound, maximumBound, checkInFlight);
404 }
405
406 //Edit Player Aspeed
407 static bool HandleModifyASpeedCommand(ChatHandler* handler, char const* args)
408 {
409 float allSpeed;
410 Player* target = handler->getSelectedPlayerOrSelf();
411 if (CheckModifySpeed(handler, args, target, allSpeed, 0.1f, 50.0f))
412 {
414 target->SetSpeedRate(MOVE_WALK, allSpeed);
415 target->SetSpeedRate(MOVE_RUN, allSpeed);
416 target->SetSpeedRate(MOVE_SWIM, allSpeed);
417 target->SetSpeedRate(MOVE_FLIGHT, allSpeed);
418 return true;
419 }
420 return false;
421 }
422
423 //Edit Player Speed
424 static bool HandleModifySpeedCommand(ChatHandler* handler, char const* args)
425 {
426 float Speed;
427 Player* target = handler->getSelectedPlayerOrSelf();
428 if (CheckModifySpeed(handler, args, target, Speed, 0.1f, 50.0f))
429 {
431 target->SetSpeedRate(MOVE_RUN, Speed);
432 return true;
433 }
434 return false;
435 }
436
437 //Edit Player Swim Speed
438 static bool HandleModifySwimCommand(ChatHandler* handler, char const* args)
439 {
440 float swimSpeed;
441 Player* target = handler->getSelectedPlayerOrSelf();
442 if (CheckModifySpeed(handler, args, target, swimSpeed, 0.1f, 50.0f))
443 {
445 target->SetSpeedRate(MOVE_SWIM, swimSpeed);
446 return true;
447 }
448 return false;
449 }
450
451 //Edit Player Backwards Walk Speed
452 static bool HandleModifyBWalkCommand(ChatHandler* handler, char const* args)
453 {
454 float backSpeed;
455 Player* target = handler->getSelectedPlayerOrSelf();
456 if (CheckModifySpeed(handler, args, target, backSpeed, 0.1f, 50.0f))
457 {
459 target->SetSpeedRate(MOVE_RUN_BACK, backSpeed);
460 return true;
461 }
462 return false;
463 }
464
465 //Edit Player Fly
466 static bool HandleModifyFlyCommand(ChatHandler* handler, char const* args)
467 {
468 float flySpeed;
469 Player* target = handler->getSelectedPlayerOrSelf();
470 if (CheckModifySpeed(handler, args, target, flySpeed, 0.1f, 50.0f, false))
471 {
473 target->SetSpeedRate(MOVE_FLIGHT, flySpeed);
474 return true;
475 }
476 return false;
477 }
478
479 //Edit Player or Creature Scale
480 static bool HandleModifyScaleCommand(ChatHandler* handler, char const* args)
481 {
482 float scale;
483 Unit* target = handler->getSelectedUnit();
484 if (CheckModifySpeed(handler, args, target, scale, 0.1f, 10.0f, false))
485 {
487 target->SetObjectScale(scale);
488 return true;
489 }
490 return false;
491 }
492
493 //Enable Player mount
494 static bool HandleModifyMountCommand(ChatHandler* handler, uint32 mount, float speed)
495 {
496 if (!sCreatureDisplayInfoStore.HasRecord(mount))
497 {
499 handler->SetSentErrorMessage(true);
500 return false;
501 }
502
503 Player* target = handler->getSelectedPlayerOrSelf();
504 if (!target)
505 {
507 handler->SetSentErrorMessage(true);
508 return false;
509 }
510
511 // check online security
512 if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
513 return false;
514
515 if (!CheckModifySpeed(handler, target, speed, 0.1f, 50.0f))
516 return false;
517
519 target->Mount(mount);
520 target->SetSpeedRate(MOVE_RUN, speed);
521 target->SetSpeedRate(MOVE_FLIGHT, speed);
522 return true;
523 }
524
525 //Edit Player money
526 static bool HandleModifyMoneyCommand(ChatHandler* handler, char const* args)
527 {
528 if (!*args)
529 return false;
530
531 Player* target = handler->getSelectedPlayerOrSelf();
532 if (!target)
533 {
535 handler->SetSentErrorMessage(true);
536 return false;
537 }
538
539 // check online security
540 if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
541 return false;
542
543 Optional<int64> moneyToAddO = 0;
544 if (strchr(args, 'g') || strchr(args, 's') || strchr(args, 'c'))
545 moneyToAddO = MoneyStringToMoney(std::string(args));
546 else
547 moneyToAddO = Trinity::StringTo<int64>(args);
548
549 if (!moneyToAddO)
550 return false;
551
552 int64 moneyToAdd = *moneyToAddO;
553
554 uint64 targetMoney = target->GetMoney();
555
556 if (moneyToAdd < 0)
557 {
558 int64 newmoney = int64(targetMoney) + moneyToAdd;
559
560 TC_LOG_DEBUG("misc", "{}", handler->PGetParseString(LANG_CURRENT_MONEY, std::to_string(targetMoney), std::to_string(moneyToAdd), std::to_string(newmoney)));
561 if (newmoney <= 0)
562 {
564 target->SetMoney(0);
565 }
566 else
567 {
568 uint64 moneyToAddMsg = moneyToAdd * -1;
569 if (newmoney > static_cast<int64>(MAX_MONEY_AMOUNT))
570 newmoney = MAX_MONEY_AMOUNT;
571
572 handler->PSendSysMessage(LANG_YOU_TAKE_MONEY, std::to_string(moneyToAddMsg).c_str(), handler->GetNameLink(target).c_str());
573 if (handler->needReportToTarget(target))
574 ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_MONEY_TAKEN, handler->GetNameLink().c_str(), std::to_string(moneyToAddMsg).c_str());
575 target->SetMoney(newmoney);
576 }
577 }
578 else
579 {
580 handler->PSendSysMessage(LANG_YOU_GIVE_MONEY, std::to_string(moneyToAdd).c_str(), handler->GetNameLink(target).c_str());
581 if (handler->needReportToTarget(target))
582 ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, handler->GetNameLink().c_str(), std::to_string(moneyToAdd).c_str());
583
584 if (moneyToAdd >= int64(MAX_MONEY_AMOUNT))
585 moneyToAdd = MAX_MONEY_AMOUNT;
586
587 moneyToAdd = std::min(moneyToAdd, int64(MAX_MONEY_AMOUNT - targetMoney));
588
589 target->ModifyMoney(moneyToAdd);
590 }
591
592 TC_LOG_DEBUG("misc", "{}", handler->PGetParseString(LANG_NEW_MONEY, std::to_string(targetMoney), std::to_string(moneyToAdd), std::to_string(target->GetMoney())));
593
594 return true;
595 }
596
597 static bool HandleModifyHonorCommand(ChatHandler* handler, char const* args)
598 {
599 if (!*args)
600 return false;
601
602 Player* target = handler->getSelectedPlayerOrSelf();
603 if (!target)
604 {
606 handler->SetSentErrorMessage(true);
607 return false;
608 }
609
610 // check online security
611 if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
612 return false;
613
614 int32 amount = atoi(args);
615
616 handler->PSendSysMessage("NOT IMPLEMENTED: %d honor NOT added.", amount);
617
618 //handler->PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_HONOR_POINTS));
619
620 return true;
621 }
622
623 static bool HandleModifyDrunkCommand(ChatHandler* handler, char const* args)
624 {
625 if (!*args)
626 return false;
627
628 uint8 drunklevel = (uint8)atoi(args);
629 if (drunklevel > 100)
630 drunklevel = 100;
631
632 if (Player* target = handler->getSelectedPlayerOrSelf())
633 target->SetDrunkValue(drunklevel);
634
635 return true;
636 }
637
638 static bool HandleModifyRepCommand(ChatHandler* handler, char const* args)
639 {
640 if (!*args)
641 return false;
642
643 Player* target = handler->getSelectedPlayerOrSelf();
644 if (!target)
645 {
647 handler->SetSentErrorMessage(true);
648 return false;
649 }
650
651 // check online security
652 if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
653 return false;
654
655 char* factionTxt = handler->extractKeyFromLink((char*)args, "Hfaction");
656 if (!factionTxt)
657 return false;
658
659 uint32 factionId = atoi(factionTxt);
660
661 int32 amount = 0;
662 char *rankTxt = strtok(nullptr, " ");
663 if (!factionId || !rankTxt)
664 return false;
665
666 FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId);
667
668 if (!factionEntry)
669 {
671 handler->SetSentErrorMessage(true);
672 return false;
673 }
674
675 if (factionEntry->ReputationIndex < 0)
676 {
677 handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->Name[handler->GetSessionDbcLocale()], factionId);
678 handler->SetSentErrorMessage(true);
679 return false;
680 }
681
682 amount = atoi(rankTxt);
683 // try to find rank by name
684 if ((amount == 0) && (rankTxt[0] != '-') && !isdigit((unsigned char)rankTxt[0]))
685 {
686 std::string rankStr = rankTxt;
687 std::wstring wrankStr;
688 if (!Utf8toWStr(rankStr, wrankStr))
689 return false;
690
691 wstrToLower(wrankStr);
692
693 auto rankThresholdItr = ReputationMgr::ReputationRankThresholds.begin();
695
696 int32 r = 0;
697
698 for (; rankThresholdItr != end; ++rankThresholdItr, ++r)
699 {
700 std::string rank = handler->GetTrinityString(ReputationRankStrIndex[r]);
701 if (rank.empty())
702 continue;
703
704 std::wstring wrank;
705 if (!Utf8toWStr(rank, wrank))
706 continue;
707
708 wstrToLower(wrank);
709
710 if (wrank.substr(0, wrankStr.size()) == wrankStr)
711 break;
712 }
713
714 if (rankThresholdItr == end)
715 {
717 handler->SetSentErrorMessage(true);
718 return false;
719 }
720
721 amount = *rankThresholdItr;
722
723 char *deltaTxt = strtok(nullptr, " ");
724 if (deltaTxt)
725 {
726 int32 toNextRank = 0;
727 auto nextThresholdItr = rankThresholdItr;
728 ++nextThresholdItr;
729 if (nextThresholdItr != end)
730 toNextRank = *nextThresholdItr - *rankThresholdItr;
731
732 int32 delta = atoi(deltaTxt);
733 if (delta < 0 || delta >= toNextRank)
734 {
735 handler->PSendSysMessage(LANG_COMMAND_FACTION_DELTA, std::max(0, toNextRank - 1));
736 handler->SetSentErrorMessage(true);
737 return false;
738 }
739 amount += delta;
740 }
741 }
742
743 target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false);
744 target->GetReputationMgr().SendState(target->GetReputationMgr().GetState(factionEntry));
745 handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->Name[handler->GetSessionDbcLocale()], factionId,
746 handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry));
747 return true;
748 }
749
750 //morph creature or player
751 static bool HandleModifyMorphCommand(ChatHandler* handler, uint32 display_id)
752 {
753 Unit* target = handler->getSelectedUnit();
754 if (!target)
755 target = handler->GetSession()->GetPlayer();
756
757 // check online security
758 else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), ObjectGuid::Empty))
759 return false;
760
761 target->SetDisplayId(display_id);
762
763 return true;
764 }
765
766 // Toggles a phaseid on a player
767 static bool HandleModifyPhaseCommand(ChatHandler* handler, uint32 phaseId, Optional<uint32> visibleMapId)
768 {
769 if (phaseId && !sPhaseStore.LookupEntry(phaseId))
770 {
772 handler->SetSentErrorMessage(true);
773 return false;
774 }
775
776 Unit* target = handler->getSelectedUnit();
777
778 if (visibleMapId)
779 {
780 MapEntry const* visibleMap = sMapStore.LookupEntry(*visibleMapId);
781 if (!visibleMap || visibleMap->ParentMapID != int32(target->GetMapId()))
782 {
784 handler->SetSentErrorMessage(true);
785 return false;
786 }
787
788 if (!target->GetPhaseShift().HasVisibleMapId(*visibleMapId))
789 PhasingHandler::AddVisibleMapId(target, *visibleMapId);
790 else
791 PhasingHandler::RemoveVisibleMapId(target, *visibleMapId);
792 }
793
794 if (phaseId)
795 {
796 if (!target->GetPhaseShift().HasPhase(phaseId))
797 PhasingHandler::AddPhase(target, phaseId, true);
798 else
799 PhasingHandler::RemovePhase(target, phaseId, true);
800 }
801
802 return true;
803 }
804
805 //change standstate
806 static bool HandleModifyStandStateCommand(ChatHandler* handler, char const* args)
807 {
808 if (!*args)
809 return false;
810
811 uint32 anim_id = atoi((char*)args);
812 handler->GetSession()->GetPlayer()->SetEmoteState(Emote(anim_id));
813
814 return true;
815 }
816
817 static bool HandleModifyGenderCommand(ChatHandler* handler, char const* args)
818 {
819 if (!*args)
820 return false;
821
822 Player* target = handler->getSelectedPlayerOrSelf();
823
824 if (!target)
825 {
827 handler->SetSentErrorMessage(true);
828 return false;
829 }
830
831 PlayerInfo const* info = sObjectMgr->GetPlayerInfo(target->GetRace(), target->GetClass());
832 if (!info)
833 return false;
834
835 char const* gender_str = (char*)args;
836 int gender_len = strlen(gender_str);
837
838 Gender gender;
839
840 if (!strncmp(gender_str, "male", gender_len)) // MALE
841 {
842 if (target->GetGender() == GENDER_MALE)
843 return true;
844
845 gender = GENDER_MALE;
846 }
847 else if (!strncmp(gender_str, "female", gender_len)) // FEMALE
848 {
849 if (target->GetGender() == GENDER_FEMALE)
850 return true;
851
852 gender = GENDER_FEMALE;
853 }
854 else
855 {
857 handler->SetSentErrorMessage(true);
858 return false;
859 }
860
861 // Set gender
862 target->SetGender(gender);
863 target->SetNativeGender(gender);
864
865 // Change display ID
866 target->InitDisplayIds();
867
868 target->RestoreDisplayId(false);
869 sCharacterCache->UpdateCharacterGender(target->GetGUID(), gender);
870
871 // Generate random customizations
872 std::vector<UF::ChrCustomizationChoice> customizations;
873
874 Races race = Races(target->GetRace());
875 Classes playerClass = Classes(target->GetClass());
876 std::vector<ChrCustomizationOptionEntry const*> const* options = sDB2Manager.GetCustomiztionOptions(target->GetRace(), gender);
877 WorldSession const* worldSession = target->GetSession();
878 for (ChrCustomizationOptionEntry const* option : *options)
879 {
880 ChrCustomizationReqEntry const* optionReq = sChrCustomizationReqStore.LookupEntry(option->ChrCustomizationReqID);
881 if (optionReq && !worldSession->MeetsChrCustomizationReq(optionReq, race, playerClass, false, MakeChrCustomizationChoiceRange(customizations)))
882 continue;
883
884 // Loop over the options until the first one fits
885 std::vector<ChrCustomizationChoiceEntry const*> const* choicesForOption = sDB2Manager.GetCustomiztionChoices(option->ID);
886 for (ChrCustomizationChoiceEntry const* choiceForOption : *choicesForOption)
887 {
888 ChrCustomizationReqEntry const* choiceReq = sChrCustomizationReqStore.LookupEntry(choiceForOption->ChrCustomizationReqID);
889 if (choiceReq && !worldSession->MeetsChrCustomizationReq(choiceReq, race, playerClass, false, MakeChrCustomizationChoiceRange(customizations)))
890 continue;
891
892 ChrCustomizationChoiceEntry const* choiceEntry = choicesForOption->at(0);
894 choice.ChrCustomizationOptionID = option->ID;
895 choice.ChrCustomizationChoiceID = choiceEntry->ID;
896 customizations.push_back(choice);
897 break;
898 }
899 }
900
901 target->SetCustomizations(Trinity::Containers::MakeIteratorPair(customizations.begin(), customizations.end()));
902
903 char const* gender_full = gender ? "female" : "male";
904
905 handler->PSendSysMessage(LANG_YOU_CHANGE_GENDER, handler->GetNameLink(target).c_str(), gender_full);
906
907 if (handler->needReportToTarget(target))
908 ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_GENDER_CHANGED, gender_full, handler->GetNameLink().c_str());
909
910 return true;
911 }
912//demorph player or unit
913 static bool HandleDeMorphCommand(ChatHandler* handler, char const* /*args*/)
914 {
915 Unit* target = handler->getSelectedUnit();
916 if (!target)
917 target = handler->GetSession()->GetPlayer();
918
919 // check online security
920 else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), ObjectGuid::Empty))
921 return false;
922
923 target->DeMorph();
924
925 return true;
926 }
927
928 static bool HandleModifyCurrencyCommand(ChatHandler* handler, CurrencyTypesEntry const* currency, int32 amount)
929 {
930 Player* target = handler->getSelectedPlayerOrSelf();
931 if (!target)
932 {
934 handler->SetSentErrorMessage(true);
935 return false;
936 }
937
939
940 return true;
941 }
942
943 // mod xp command
944 static bool HandleModifyXPCommand(ChatHandler *handler, char const* args)
945 {
946 if (!*args)
947 return false;
948
949 int32 xp = atoi((char*)args);
950
951 if (xp < 1)
952 {
954 handler->SetSentErrorMessage(true);
955 return false;
956 }
957
958 Player* target = handler->getSelectedPlayerOrSelf();
959 if (!target)
960 {
962 handler->SetSentErrorMessage(true);
963 return false;
964 }
965
966 if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
967 return false;
968
969 // we can run the command
970 target->GiveXP(xp, nullptr);
971 return true;
972 }
973
974 // Edit Player Power
975 static bool HandleModifyPowerCommand(ChatHandler* handler, const char* args)
976 {
977 if (!*args)
978 return false;
979
980 Player* target = handler->getSelectedPlayerOrSelf();
981 if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
982 return false;
983
984 char* powerTypeToken = strtok((char*)args, " ");
985 if (!powerTypeToken)
986 return false;
987
988 PowerTypeEntry const* powerType = sDB2Manager.GetPowerTypeByName(powerTypeToken);
989 if (!powerType)
990 {
992 handler->SetSentErrorMessage(true);
993 return false;
994 }
995
996 if (target->GetPowerIndex(Powers(powerType->PowerTypeEnum)) == MAX_POWERS)
997 {
999 handler->SetSentErrorMessage(true);
1000 return false;
1001 }
1002
1003 char* amount = strtok(nullptr, " ");
1004 if (!amount)
1005 return false;
1006
1007 int32 powerAmount = atoi(amount);
1008
1009 if (powerAmount < 1)
1010 {
1012 handler->SetSentErrorMessage(true);
1013 return false;
1014 }
1015
1016 std::string formattedPowerName = powerType->NameGlobalStringTag;
1017 bool upperCase = true;
1018 for (char& c : formattedPowerName)
1019 {
1020 if (upperCase)
1021 {
1022 c = charToUpper(c);
1023 upperCase = false;
1024 }
1025 else
1026 c = charToLower(c);
1027
1028 if (c == '_')
1029 {
1030 c = ' ';
1031 upperCase = true;
1032 }
1033 }
1034
1035 NotifyModification(handler, target, LANG_YOU_CHANGE_POWER, LANG_YOUR_POWER_CHANGED, formattedPowerName.c_str(), powerAmount, powerAmount);
1036 powerAmount *= powerType->DisplayModifier;
1037 target->SetMaxPower(Powers(powerType->PowerTypeEnum), powerAmount);
1038 target->SetPower(Powers(powerType->PowerTypeEnum), powerAmount);
1039 return true;
1040 }
1041};
1042
#define sCharacterCache
DB2Storage< PhaseEntry > sPhaseStore("Phase.db2", &PhaseLoadInfo::Instance)
DB2Storage< MapEntry > sMapStore("Map.db2", &MapLoadInfo::Instance)
DB2Storage< ChrCustomizationReqEntry > sChrCustomizationReqStore("ChrCustomizationReq.db2", &ChrCustomizationReqLoadInfo::Instance)
DB2Storage< CreatureDisplayInfoEntry > sCreatureDisplayInfoStore("CreatureDisplayInfo.db2", &CreatureDisplayInfoLoadInfo::Instance)
DB2Storage< FactionTemplateEntry > sFactionTemplateStore("FactionTemplate.db2", &FactionTemplateLoadInfo::Instance)
DB2Storage< FactionEntry > sFactionStore("Faction.db2", &FactionLoadInfo::Instance)
#define sDB2Manager
Definition DB2Stores.h:569
uint8_t uint8
Definition Define.h:156
int64_t int64
Definition Define.h:149
int8_t int8
Definition Define.h:152
int32_t int32
Definition Define.h:150
uint64_t uint64
Definition Define.h:153
uint16_t uint16
Definition Define.h:155
uint32_t uint32
Definition Define.h:154
TrinityStrings
Definition Language.h:29
@ LANG_CURRENT_MONEY
Definition Language.h:191
@ LANG_MUST_MALE_OR_FEMALE
Definition Language.h:895
@ LANG_NO_MOUNT
Definition Language.h:187
@ LANG_YOURS_ASPEED_CHANGED
Definition Language.h:175
@ LANG_YOU_CHANGE_SIZE
Definition Language.h:185
@ LANG_SELECT_CREATURE
Definition Language.h:32
@ LANG_YOURS_MANA_CHANGED
Definition Language.h:156
@ LANG_COMMAND_FACTION_UNKNOWN
Definition Language.h:363
@ LANG_YOURS_FLY_SPEED_CHANGED
Definition Language.h:183
@ LANG_COMMAND_FACTION_DELTA
Definition Language.h:365
@ LANG_YOURS_SWIM_SPEED_CHANGED
Definition Language.h:179
@ LANG_YOU_TAKE_ALL_MONEY
Definition Language.h:192
@ LANG_YOU_GIVE_MOUNT
Definition Language.h:188
@ LANG_YOURS_MONEY_TAKEN
Definition Language.h:195
@ LANG_YOUR_POWER_CHANGED
Definition Language.h:1255
@ LANG_YOU_CHANGE_RAGE
Definition Language.h:161
@ LANG_YOURS_ALL_MONEY_GONE
Definition Language.h:193
@ LANG_YOU_CHANGE_SPEED
Definition Language.h:176
@ LANG_YOU_TAKE_MONEY
Definition Language.h:194
@ LANG_YOU_CHANGE_POWER
Definition Language.h:1254
@ LANG_YOURS_SPEED_CHANGED
Definition Language.h:177
@ LANG_WRONG_FACTION
Definition Language.h:165
@ LANG_YOURS_MONEY_GIVEN
Definition Language.h:197
@ LANG_YOURS_HP_CHANGED
Definition Language.h:154
@ LANG_YOURS_SIZE_CHANGED
Definition Language.h:186
@ LANG_YOU_CHANGE_ENERGY
Definition Language.h:157
@ LANG_CURRENT_FACTION
Definition Language.h:164
@ LANG_YOU_CHANGE_HP
Definition Language.h:153
@ LANG_YOU_CHANGE_RUNIC_POWER
Definition Language.h:215
@ LANG_NEW_MONEY
Definition Language.h:200
@ LANG_YOURS_SPELLFLATID_CHANGED
Definition Language.h:168
@ LANG_YOU_CHANGE_FLY_SPEED
Definition Language.h:182
@ LANG_YOU_CHANGE_FACTION
Definition Language.h:166
@ LANG_YOU_CHANGE_ASPEED
Definition Language.h:174
@ LANG_YOURS_RAGE_CHANGED
Definition Language.h:162
@ LANG_NO_CHAR_SELECTED
Definition Language.h:150
@ LANG_COMMAND_FACTION_NOREP_ERROR
Definition Language.h:381
@ LANG_YOU_CHANGE_BACK_SPEED
Definition Language.h:180
@ LANG_PLAYER_NOT_FOUND
Definition Language.h:570
@ LANG_COMMAND_INVALID_PARAM
Definition Language.h:364
@ LANG_YOU_CHANGE_GENDER
Definition Language.h:896
@ LANG_BAD_VALUE
Definition Language.h:149
@ LANG_YOU_CHANGE_SPELLFLATID
Definition Language.h:167
@ LANG_YOURS_ENERGY_CHANGED
Definition Language.h:158
@ LANG_COMMAND_MODIFY_REP
Definition Language.h:360
@ LANG_YOURS_BACK_SPEED_CHANGED
Definition Language.h:181
@ LANG_YOURS_RUNIC_POWER_CHANGED
Definition Language.h:216
@ LANG_CHAR_IN_FLIGHT
Definition Language.h:53
@ LANG_MOUNT_GIVED
Definition Language.h:189
@ LANG_INVALID_POWER_NAME
Definition Language.h:1256
@ LANG_YOU_CHANGE_SWIM_SPEED
Definition Language.h:178
@ LANG_YOUR_GENDER_CHANGED
Definition Language.h:897
@ LANG_YOU_GIVE_MONEY
Definition Language.h:196
@ LANG_YOU_CHANGE_MANA
Definition Language.h:155
@ LANG_PHASE_NOTFOUND
Definition Language.h:1071
#define TC_LOG_DEBUG(filterType__, message__,...)
Definition Log.h:181
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
#define sObjectMgr
Definition ObjectMgr.h:1885
@ SMSG_SET_FLAT_SPELL_MODIFIER
Definition Opcodes.h:2283
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
Trinity::IteratorPair< UF::ChrCustomizationChoice const * > MakeChrCustomizationChoiceRange(Container const &container)
Definition Player.h:3449
constexpr uint64 MAX_MONEY_AMOUNT
Definition Player.h:1044
Role Based Access Control related classes definition.
Races
Definition RaceMask.h:27
uint32 const ReputationRankStrIndex[MAX_REPUTATION_RANK]
Classes
Gender
@ GENDER_MALE
@ GENDER_FEMALE
Powers
@ MAX_POWERS
@ POWER_RAGE
@ POWER_RUNIC_POWER
@ POWER_ENERGY
@ POWER_MANA
@ MOVE_FLIGHT
@ MOVE_SWIM
@ MOVE_RUN
@ MOVE_RUN_BACK
@ MOVE_WALK
NPCFlags
Non Player Character flags.
NPCFlags2
UnitFlags
void wstrToLower(std::wstring &str)
Definition Util.cpp:433
bool Utf8toWStr(char const *utf8str, size_t csize, wchar_t *wstr, size_t &wsize)
Definition Util.cpp:336
Optional< int64 > MoneyStringToMoney(std::string const &moneyString)
Definition Util.cpp:180
struct CharToUpper charToUpper
struct CharToLower charToLower
ObjectGuid const & GetGUID() const
Definition BaseEntity.h:163
TypeID GetTypeId() const
Definition BaseEntity.h:166
char * extractKeyFromLink(char *text, char const *linkType, char **something1=nullptr)
Definition Chat.cpp:266
Player * getSelectedPlayerOrSelf()
Definition Chat.cpp:248
Unit * getSelectedUnit()
Definition Chat.cpp:216
WorldSession * GetSession()
Definition Chat.h:42
virtual LocaleConstant GetSessionDbcLocale() const
Definition Chat.cpp:593
virtual std::string GetNameLink() const
Definition Chat.cpp:56
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition Chat.cpp:61
Creature * getSelectedCreature()
Definition Chat.cpp:240
static std::string PGetParseString(std::string_view fmt, Args &&... args) noexcept
Definition Chat.h:74
void SetSentErrorMessage(bool val)
Definition Chat.h:127
void PSendSysMessage(char const *fmt, Args &&... args)
Definition Chat.h:62
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition Chat.cpp:111
virtual bool needReportToTarget(Player *chr) const
Definition Chat.cpp:587
virtual char const * GetTrinityString(uint32 entry) const
Definition Chat.cpp:46
static ObjectGuid const Empty
Definition ObjectGuid.h:314
std::string ToString() const
Player * ToPlayer()
Definition Object.h:126
void ReplaceAllDynamicFlags(uint32 flag)
Definition Object.h:99
virtual void SetObjectScale(float scale)
Definition Object.h:93
UF::UpdateField< UF::ObjectData, int32(WowCS::EntityFragment::CGObject), TYPEID_OBJECT > m_objectData
Definition Object.h:161
bool HasPhase(uint32 phaseId) const
Definition PhaseShift.h:100
bool HasVisibleMapId(uint32 visibleMapId) const
Definition PhaseShift.h:105
static void AddVisibleMapId(WorldObject *object, uint32 visibleMapId)
static void AddPhase(WorldObject *object, uint32 phaseId, bool updateVisibility)
static void RemoveVisibleMapId(WorldObject *object, uint32 visibleMapId)
static void RemovePhase(WorldObject *object, uint32 phaseId, bool updateVisibility)
bool ModifyMoney(int64 amount, bool sendError=true)
Definition Player.cpp:24850
void SetNativeGender(Gender gender) override
Definition Player.h:1351
void SendDirectMessage(WorldPacket const *data) const
Definition Player.cpp:6283
uint32 GetPowerIndex(Powers power) const override
void GiveXP(uint32 xp, Unit *victim, float group_rate=1.0f)
Definition Player.cpp:2199
void InitDisplayIds()
Definition Player.cpp:23458
WorldSession * GetSession() const
Definition Player.h:2272
uint64 GetMoney() const
Definition Player.h:1905
void SetMoney(uint64 value)
Definition Player.cpp:24876
void ModifyCurrency(uint32 id, int32 amount, CurrencyGainSource gainSource=CurrencyGainSource::Cheat, CurrencyDestroyReason destroyReason=CurrencyDestroyReason::Cheat)
Modify currency amount.
Definition Player.cpp:7146
ReputationMgr & GetReputationMgr()
Definition Player.h:2439
void SetCustomizations(Trinity::IteratorPair< Iter > customizations, bool markChanged=true)
Definition Player.h:2936
void SendState(FactionState const *faction)
int32 GetReputation(uint32 faction_id) const
FactionState const * GetState(FactionEntry const *factionEntry) const
bool SetOneFactionReputation(FactionEntry const *factionEntry, int32 standing, bool incremental)
Public for chat command needs.
static std::set< int32 > const ReputationRankThresholds
Definition Unit.h:635
void SetHealth(uint64 val)
Definition Unit.cpp:9973
void SetGender(Gender gender)
Definition Unit.h:768
void RestoreDisplayId(bool ignorePositiveAurasPreventingMounting=false)
Definition Unit.cpp:10803
void ReplaceAllNpcFlags2(NPCFlags2 flags)
Definition Unit.h:1005
uint8 GetClass() const
Definition Unit.h:764
NPCFlags GetNpcFlags() const
Definition Unit.h:995
void SetFaction(uint32 faction) override
Definition Unit.h:872
void SetPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition Unit.cpp:10046
void ReplaceAllUnitFlags(UnitFlags flags)
Definition Unit.h:848
NPCFlags2 GetNpcFlags2() const
Definition Unit.h:1001
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition Unit.cpp:8284
Gender GetGender() const
Definition Unit.h:767
void SetEmoteState(Emote emote)
Definition Unit.h:865
uint32 GetFaction() const override
Definition Unit.h:871
void SetMaxHealth(uint64 val)
Definition Unit.cpp:10004
UF::UpdateField< UF::UnitData, int32(WowCS::EntityFragment::CGObject), TYPEID_UNIT > m_unitData
Definition Unit.h:1881
void SetSpeedRate(UnitMoveType mtype, float rate)
Definition Unit.cpp:8942
void SetMaxPower(Powers power, int32 val)
Definition Unit.cpp:10083
void ReplaceAllNpcFlags(NPCFlags flags)
Definition Unit.h:999
void DeMorph()
Definition Unit.cpp:3382
uint8 GetRace() const
Definition Unit.h:761
virtual void SetDisplayId(uint32 displayId, bool setNative=false)
Definition Unit.cpp:10779
constexpr uint32 GetMapId() const
Definition Position.h:216
PhaseShift & GetPhaseShift()
Definition Object.h:310
std::vector< SpellModifier > Modifiers
WorldPacket const * Write() override
Player session in the World.
Player * GetPlayer() const
bool MeetsChrCustomizationReq(ChrCustomizationReqEntry const *req, Races race, Classes playerClass, bool checkRequiredDependentChoices, Trinity::IteratorPair< UF::ChrCustomizationChoice const * > selectedChoices) const
static bool CheckModifySpeed(ChatHandler *handler, Unit *target, float speed, float minimumBound, float maximumBound, bool checkInFlight=true)
static bool HandleModifyPowerCommand(ChatHandler *handler, const char *args)
static bool HandleModifyFactionCommand(ChatHandler *handler, Optional< uint32 > factionid, Optional< uint32 > flag, Optional< uint64 > npcflag, Optional< uint32 > dyflag)
static bool HandleModifyMorphCommand(ChatHandler *handler, uint32 display_id)
static bool HandleModifyMountCommand(ChatHandler *handler, uint32 mount, float speed)
static bool HandleModifyRepCommand(ChatHandler *handler, char const *args)
static bool HandleModifyXPCommand(ChatHandler *handler, char const *args)
static bool HandleDeMorphCommand(ChatHandler *handler, char const *)
static void NotifyModification(ChatHandler *handler, Unit *target, TrinityStrings resourceMessage, TrinityStrings resourceReportMessage, Args &&... args)
Definition cs_modify.cpp:98
static bool HandleModifyStandStateCommand(ChatHandler *handler, char const *args)
std::span< ChatCommandBuilder const > GetCommands() const override
Definition cs_modify.cpp:53
static bool HandleModifyRageCommand(ChatHandler *handler, char const *args)
static bool HandleModifyTalentCommand(ChatHandler *, char const *)
static bool HandleModifySpellCommand(ChatHandler *handler, char const *args)
static bool HandleModifyHPCommand(ChatHandler *handler, char const *args)
static bool HandleModifyGenderCommand(ChatHandler *handler, char const *args)
static bool HandleModifyEnergyCommand(ChatHandler *handler, char const *args)
static bool HandleModifyDrunkCommand(ChatHandler *handler, char const *args)
static bool HandleModifyFlyCommand(ChatHandler *handler, char const *args)
static bool CheckModifyResources(ChatHandler *handler, char const *args, Player *target, int32 &res, int32 &resmax, int8 const multiplier=1)
static bool HandleModifyBWalkCommand(ChatHandler *handler, char const *args)
static bool CheckModifySpeed(ChatHandler *handler, char const *args, Unit *target, float &speed, float minimumBound, float maximumBound, bool checkInFlight=true)
static bool HandleModifySwimCommand(ChatHandler *handler, char const *args)
static bool HandleModifyMoneyCommand(ChatHandler *handler, char const *args)
static bool HandleModifyScaleCommand(ChatHandler *handler, char const *args)
static bool HandleModifyRunicPowerCommand(ChatHandler *handler, char const *args)
static bool HandleModifySpeedCommand(ChatHandler *handler, char const *args)
static bool HandleModifyCurrencyCommand(ChatHandler *handler, CurrencyTypesEntry const *currency, int32 amount)
static bool HandleModifyPhaseCommand(ChatHandler *handler, uint32 phaseId, Optional< uint32 > visibleMapId)
static bool HandleModifyManaCommand(ChatHandler *handler, char const *args)
static bool HandleModifyASpeedCommand(ChatHandler *handler, char const *args)
static bool HandleModifyHonorCommand(ChatHandler *handler, char const *args)
void AddSC_modify_commandscript()
ChatCommandBuilder const [] ChatCommandTable
Definition ChatCommand.h:49
constexpr IteratorPair< iterator, end_iterator > MakeIteratorPair(iterator first, end_iterator second)
@ RBAC_PERM_COMMAND_MODIFY_MONEY
Definition RBAC.h:426
@ RBAC_PERM_COMMAND_MODIFY_RUNICPOWER
Definition RBAC.h:431
@ RBAC_PERM_COMMAND_MODIFY_MOUNT
Definition RBAC.h:427
@ RBAC_PERM_COMMAND_MODIFY_SPEED_SWIM
Definition RBAC.h:438
@ RBAC_PERM_COMMAND_MODIFY_PHASE
Definition RBAC.h:428
@ RBAC_PERM_COMMAND_MODIFY_SPEED_BACKWALK
Definition RBAC.h:435
@ RBAC_PERM_COMMAND_MODIFY_SPEED_FLY
Definition RBAC.h:436
@ RBAC_PERM_COMMAND_MODIFY_POWER
Definition RBAC.h:738
@ RBAC_PERM_COMMAND_MODIFY_SPEED
Definition RBAC.h:433
@ RBAC_PERM_COMMAND_MODIFY_TALENTPOINTS
Definition RBAC.h:441
@ RBAC_PERM_COMMAND_MODIFY
Definition RBAC.h:416
@ RBAC_PERM_COMMAND_MODIFY_CURRENCY
Definition RBAC.h:647
@ RBAC_PERM_COMMAND_MODIFY_SCALE
Definition RBAC.h:432
@ RBAC_PERM_COMMAND_MODIFY_SPEED_WALK
Definition RBAC.h:437
@ RBAC_PERM_COMMAND_MODIFY_HONOR
Definition RBAC.h:423
@ RBAC_PERM_COMMAND_MODIFY_FACTION
Definition RBAC.h:421
@ RBAC_PERM_COMMAND_DEMORPH
Definition RBAC.h:415
@ RBAC_PERM_COMMAND_MODIFY_SPELL
Definition RBAC.h:439
@ RBAC_PERM_COMMAND_MORPH
Definition RBAC.h:414
@ RBAC_PERM_COMMAND_MODIFY_RAGE
Definition RBAC.h:429
@ RBAC_PERM_COMMAND_MODIFY_GENDER
Definition RBAC.h:422
@ RBAC_PERM_COMMAND_MODIFY_MANA
Definition RBAC.h:425
@ RBAC_PERM_COMMAND_MODIFY_XP
Definition RBAC.h:670
@ RBAC_PERM_COMMAND_MODIFY_STANDSTATE
Definition RBAC.h:440
@ RBAC_PERM_COMMAND_MODIFY_REPUTATION
Definition RBAC.h:430
@ RBAC_PERM_COMMAND_MODIFY_ENERGY
Definition RBAC.h:420
@ RBAC_PERM_COMMAND_MODIFY_SPEED_ALL
Definition RBAC.h:434
@ RBAC_PERM_COMMAND_MODIFY_HP
Definition RBAC.h:424
@ RBAC_PERM_COMMAND_MODIFY_DRUNK
Definition RBAC.h:419
LocalizedString Name
int16 ReputationIndex
int16 ParentMapID
char const * NameGlobalStringTag
std::vector< SpellModifierData > ModifierData