TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
modify_commandscript Class Reference

Public Member Functions

 modify_commandscript ()
 
std::vector< ChatCommandGetCommands () const override
 
- Public Member Functions inherited from ScriptObject
const std::string & GetName () const
 

Static Public Member Functions

static bool HandleModifyHPCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyManaCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyEnergyCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyRageCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyRunicPowerCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyFactionCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifySpellCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyTalentCommand (ChatHandler *, const char *)
 
static bool HandleModifyASpeedCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifySpeedCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifySwimCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyBWalkCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyFlyCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyScaleCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyMountCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyMoneyCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyBitCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyHonorCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyDrunkCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyRepCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyMorphCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyPhaseCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyStandStateCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyGenderCommand (ChatHandler *handler, const char *args)
 
static bool HandleDeMorphCommand (ChatHandler *handler, const char *)
 
static bool HandleModifyCurrencyCommand (ChatHandler *handler, const char *args)
 
static bool HandleModifyXPCommand (ChatHandler *handler, const char *args)
 

Additional Inherited Members

- Protected Member Functions inherited from CommandScript
 CommandScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()
 

Constructor & Destructor Documentation

modify_commandscript::modify_commandscript ( )
inline
37 : CommandScript("modify_commandscript") { }
CommandScript(const char *name)
Definition: ScriptMgr.cpp:1616

Member Function Documentation

std::vector<ChatCommand> modify_commandscript::GetCommands ( ) const
inlineoverridevirtual

Implements CommandScript.

40  {
41  static std::vector<ChatCommand> modifyspeedCommandTable =
42  {
49  };
50  static std::vector<ChatCommand> modifyCommandTable =
51  {
68  { "speed", rbac::RBAC_PERM_COMMAND_MODIFY_SPEED, false, NULL, "", modifyspeedCommandTable },
73  };
74  static std::vector<ChatCommand> commandTable =
75  {
77  { "demorph", rbac::RBAC_PERM_COMMAND_DEMORPH, false, &HandleDeMorphCommand, "" },
78  { "modify", rbac::RBAC_PERM_COMMAND_MODIFY, false, NULL, "", modifyCommandTable },
79  };
80  return commandTable;
81  }
static bool HandleModifyStandStateCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:1271
static bool HandleModifyPhaseCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:1251
static bool HandleModifyBWalkCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:583
static bool HandleModifyMountCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:702
static bool HandleModifyEnergyCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:159
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: RBAC.h:449
static bool HandleModifyASpeedCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:445
static bool HandleModifyBitCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:1034
static bool HandleModifyMorphCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:1230
static bool HandleModifyManaCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:121
static bool HandleModifySpeedCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:493
static bool HandleModifyHPCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:84
static bool HandleModifyXPCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:1386
Definition: RBAC.h:450
Definition: RBAC.h:459
static bool HandleModifyRageCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:199
static bool HandleModifyFactionCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:271
static bool HandleModifyCurrencyCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:1358
static bool HandleModifyFlyCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:628
static bool HandleModifyMoneyCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:963
static bool HandleModifyRepCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:1129
static bool HandleModifyDrunkCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:1114
static bool HandleModifyScaleCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:664
static bool HandleModifyRunicPowerCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:237
Definition: RBAC.h:451
static bool HandleModifySpellCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:339
static bool HandleModifyHonorCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:1088
static bool HandleModifyTalentCommand(ChatHandler *, const char *)
Definition: cs_modify.cpp:398
Definition: RBAC.h:692
static bool HandleModifySwimCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:538
static bool HandleDeMorphCommand(ChatHandler *handler, const char *)
Definition: cs_modify.cpp:1343
static bool HandleModifyGenderCommand(ChatHandler *handler, const char *args)
Definition: cs_modify.cpp:1282

+ Here is the call graph for this function:

static bool modify_commandscript::HandleDeMorphCommand ( ChatHandler handler,
const char *   
)
inlinestatic
1344  {
1345  Unit* target = handler->getSelectedUnit();
1346  if (!target)
1347  target = handler->GetSession()->GetPlayer();
1348 
1349  // check online security
1350  else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), ObjectGuid::Empty))
1351  return false;
1352 
1353  target->DeMorph();
1354 
1355  return true;
1356  }
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Unit * getSelectedUnit()
Definition: Chat.cpp:591
Player * GetPlayer() const
Definition: WorldSession.h:927
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
Player * ToPlayer()
Definition: Object.h:191
TypeID GetTypeId() const
Definition: Object.h:113
void DeMorph()
Definition: Unit.cpp:3019
Definition: ObjectGuid.h:33
WorldSession * GetSession()
Definition: Chat.h:59
Definition: Unit.h:1305

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyASpeedCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
446  {
447  if (!*args)
448  return false;
449 
450  float ASpeed = (float)atof((char*)args);
451 
452  if (ASpeed > 50.0f || ASpeed < 0.1f)
453  {
454  handler->SendSysMessage(LANG_BAD_VALUE);
455  handler->SetSentErrorMessage(true);
456  return false;
457  }
458 
459  Player* target = handler->getSelectedPlayerOrSelf();
460  if (!target)
461  {
463  handler->SetSentErrorMessage(true);
464  return false;
465  }
466 
467  // check online security
468  if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
469  return false;
470 
471  std::string targetNameLink = handler->GetNameLink(target);
472 
473  if (target->IsInFlight())
474  {
475  handler->PSendSysMessage(LANG_CHAR_IN_FLIGHT, targetNameLink.c_str());
476  handler->SetSentErrorMessage(true);
477  return false;
478  }
479 
480  handler->PSendSysMessage(LANG_YOU_CHANGE_ASPEED, ASpeed, targetNameLink.c_str());
481  if (handler->needReportToTarget(target))
482  ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_ASPEED_CHANGED, handler->GetNameLink().c_str(), ASpeed);
483 
484  target->SetSpeed(MOVE_WALK, ASpeed, true);
485  target->SetSpeed(MOVE_RUN, ASpeed, true);
486  target->SetSpeed(MOVE_SWIM, ASpeed, true);
487  //target->SetSpeed(MOVE_TURN, ASpeed, true);
488  target->SetSpeed(MOVE_FLIGHT, ASpeed, true);
489  return true;
490  }
Definition: Language.h:164
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
Definition: Unit.h:605
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:623
Definition: Unit.h:599
Definition: Language.h:140
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
Definition: Language.h:54
Definition: Unit.h:602
virtual std::string GetNameLink() const
Definition: Chat.h:101
Definition: Language.h:139
Definition: Chat.h:56
Definition: Unit.h:600
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
Definition: Language.h:165
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
virtual bool needReportToTarget(Player *chr) const
Definition: Chat.cpp:1056

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyBitCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
1035  {
1036  if (!*args)
1037  return false;
1038 
1039  Unit* target = handler->getSelectedUnit();
1040  if (!target)
1041  {
1043  handler->SetSentErrorMessage(true);
1044  return false;
1045  }
1046 
1047  // check online security
1048  if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), ObjectGuid::Empty))
1049  return false;
1050 
1051  char* pField = strtok((char*)args, " ");
1052  if (!pField)
1053  return false;
1054 
1055  char* pBit = strtok(NULL, " ");
1056  if (!pBit)
1057  return false;
1058 
1059  uint16 field = atoi(pField);
1060  uint32 bit = atoi(pBit);
1061 
1062  if (field < OBJECT_END || field >= target->GetValuesCount())
1063  {
1064  handler->SendSysMessage(LANG_BAD_VALUE);
1065  handler->SetSentErrorMessage(true);
1066  return false;
1067  }
1068  if (bit < 1 || bit > 32)
1069  {
1070  handler->SendSysMessage(LANG_BAD_VALUE);
1071  handler->SetSentErrorMessage(true);
1072  return false;
1073  }
1074 
1075  if (target->HasFlag(field, (1<<(bit-1))))
1076  {
1077  target->RemoveFlag(field, (1<<(bit-1)));
1078  handler->PSendSysMessage(LANG_REMOVE_BIT, bit, field);
1079  }
1080  else
1081  {
1082  target->SetFlag(field, (1<<(bit-1)));
1083  handler->PSendSysMessage(LANG_SET_BIT, bit, field);
1084  }
1085  return true;
1086  }
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Unit * getSelectedUnit()
Definition: Chat.cpp:591
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: Language.h:192
Definition: Language.h:140
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
Player * ToPlayer()
Definition: Object.h:191
TypeID GetTypeId() const
Definition: Object.h:113
uint32_t uint32
Definition: Define.h:150
uint16_t uint16
Definition: Define.h:151
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
Definition: Language.h:139
uint16 GetValuesCount() const
Definition: Object.h:178
Definition: Language.h:193
Definition: ObjectGuid.h:33
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
bool HasFlag(uint16 index, uint32 flag) const
Definition: Object.cpp:1239
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
Definition: Unit.h:1305

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyBWalkCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
584  {
585  if (!*args)
586  return false;
587 
588  float BSpeed = (float)atof((char*)args);
589 
590  if (BSpeed > 50.0f || BSpeed < 0.1f)
591  {
592  handler->SendSysMessage(LANG_BAD_VALUE);
593  handler->SetSentErrorMessage(true);
594  return false;
595  }
596 
597  Player* target = handler->getSelectedPlayerOrSelf();
598  if (!target)
599  {
601  handler->SetSentErrorMessage(true);
602  return false;
603  }
604 
605  // check online security
606  if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
607  return false;
608 
609  std::string targetNameLink = handler->GetNameLink(target);
610 
611  if (target->IsInFlight())
612  {
613  handler->PSendSysMessage(LANG_CHAR_IN_FLIGHT, targetNameLink.c_str());
614  handler->SetSentErrorMessage(true);
615  return false;
616  }
617 
618  handler->PSendSysMessage(LANG_YOU_CHANGE_BACK_SPEED, BSpeed, targetNameLink.c_str());
619  if (handler->needReportToTarget(target))
620  ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_BACK_SPEED_CHANGED, handler->GetNameLink().c_str(), BSpeed);
621 
622  target->SetSpeed(MOVE_RUN_BACK, BSpeed, true);
623 
624  return true;
625  }
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:623
Definition: Unit.h:601
Definition: Language.h:140
Definition: Language.h:170
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
Definition: Language.h:54
virtual std::string GetNameLink() const
Definition: Chat.h:101
Definition: Language.h:139
Definition: Chat.h:56
Definition: Language.h:171
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
virtual bool needReportToTarget(Player *chr) const
Definition: Chat.cpp:1056

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyCurrencyCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
1359  {
1360  if (!*args)
1361  return false;
1362 
1363  Player* target = handler->getSelectedPlayer();
1364  if (!target)
1365  {
1367  handler->SetSentErrorMessage(true);
1368  return false;
1369  }
1370 
1371  uint32 currencyId = atoi(strtok((char*)args, " "));
1372  const CurrencyTypesEntry* currencyType = sCurrencyTypesStore.LookupEntry(currencyId);
1373  if (!currencyType)
1374  return false;
1375 
1376  uint32 amount = atoi(strtok(NULL, " "));
1377  if (!amount)
1378  return false;
1379 
1380  target->ModifyCurrency(currencyId, amount, true, true);
1381 
1382  return true;
1383  }
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
DB2Storage< CurrencyTypesEntry > sCurrencyTypesStore("CurrencyTypes.db2", CurrencyTypesFormat, HOTFIX_SEL_CURRENCY_TYPES)
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: DB2Structure.h:330
uint32_t uint32
Definition: Define.h:150
Player * getSelectedPlayer()
Definition: Chat.cpp:579
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
Definition: Language.h:509

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyDrunkCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
1115  {
1116  if (!*args)
1117  return false;
1118 
1119  uint8 drunklevel = (uint8)atoi(args);
1120  if (drunklevel > 100)
1121  drunklevel = 100;
1122 
1123  if (Player* target = handler->getSelectedPlayerOrSelf())
1124  target->SetDrunkValue(drunklevel);
1125 
1126  return true;
1127  }
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:623
uint8_t uint8
Definition: g3dmath.h:164
uint8_t uint8
Definition: Define.h:152

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyEnergyCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
160  {
161  if (!*args)
162  return false;
163 
164  int32 energy = atoi((char*)args)*10;
165  int32 energym = atoi((char*)args)*10;
166 
167  if (energy <= 0 || energym <= 0 || energym < energy)
168  {
169  handler->SendSysMessage(LANG_BAD_VALUE);
170  handler->SetSentErrorMessage(true);
171  return false;
172  }
173 
174  Player* target = handler->getSelectedPlayerOrSelf();
175  if (!target)
176  {
178  handler->SetSentErrorMessage(true);
179  return false;
180  }
181 
182  // check online security
183  if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
184  return false;
185 
186  handler->PSendSysMessage(LANG_YOU_CHANGE_ENERGY, handler->GetNameLink(target).c_str(), energy/10, energym/10);
187  if (handler->needReportToTarget(target))
188  ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, handler->GetNameLink().c_str(), energy/10, energym/10);
189 
190  target->SetMaxPower(POWER_ENERGY, energym);
191  target->SetPower(POWER_ENERGY, energy);
192 
193  TC_LOG_DEBUG("misc", handler->GetTrinityString(LANG_CURRENT_ENERGY), target->GetMaxPower(POWER_ENERGY));
194 
195  return true;
196  }
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:623
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: Language.h:148
Definition: Language.h:140
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
virtual std::string GetNameLink() const
Definition: Chat.h:101
int32_t int32
Definition: Define.h:146
Definition: Language.h:139
Definition: Chat.h:56
Definition: Language.h:150
Definition: SharedDefines.h:251
Definition: Language.h:147
virtual char const * GetTrinityString(uint32 entry) const
Definition: Chat.cpp:67
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
virtual bool needReportToTarget(Player *chr) const
Definition: Chat.cpp:1056

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyFactionCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
272  {
273  if (!*args)
274  return false;
275 
276  char* pfactionid = handler->extractKeyFromLink((char*)args, "Hfaction");
277 
278  Creature* target = handler->getSelectedCreature();
279  if (!target)
280  {
282  handler->SetSentErrorMessage(true);
283  return false;
284  }
285 
286  if (!pfactionid)
287  {
288  uint32 factionid = target->getFaction();
289  uint32 flag = target->GetUInt32Value(UNIT_FIELD_FLAGS);
290  uint64 npcflag = target->GetUInt64Value(UNIT_NPC_FLAGS);
291  uint32 dyflag = target->GetUInt32Value(OBJECT_DYNAMIC_FLAGS);
292  handler->PSendSysMessage(LANG_CURRENT_FACTION, target->GetGUID().ToString().c_str(), factionid, flag, npcflag, dyflag);
293  return true;
294  }
295 
296  uint32 factionid = atoi(pfactionid);
297  uint32 flag;
298 
299  char *pflag = strtok(NULL, " ");
300  if (!pflag)
301  flag = target->GetUInt32Value(UNIT_FIELD_FLAGS);
302  else
303  flag = atoi(pflag);
304 
305  char* pnpcflag = strtok(NULL, " ");
306 
307  uint64 npcflag;
308  if (!pnpcflag)
309  npcflag = target->GetUInt64Value(UNIT_NPC_FLAGS);
310  else
311  npcflag = std::strtoull(pnpcflag, nullptr, 10);
312 
313  char* pdyflag = strtok(NULL, " ");
314 
315  uint32 dyflag;
316  if (!pdyflag)
317  dyflag = target->GetUInt32Value(OBJECT_DYNAMIC_FLAGS);
318  else
319  dyflag = atoi(pdyflag);
320 
321  if (!sFactionTemplateStore.LookupEntry(factionid))
322  {
323  handler->PSendSysMessage(LANG_WRONG_FACTION, factionid);
324  handler->SetSentErrorMessage(true);
325  return false;
326  }
327 
328  handler->PSendSysMessage(LANG_YOU_CHANGE_FACTION, target->GetGUID().ToString().c_str(), factionid, flag, npcflag, dyflag);
329 
330  target->setFaction(factionid);
331  target->SetUInt32Value(UNIT_FIELD_FLAGS, flag);
332  target->SetUInt64Value(UNIT_NPC_FLAGS, npcflag);
333  target->SetUInt32Value(OBJECT_DYNAMIC_FLAGS, dyflag);
334 
335  return true;
336  }
Definition: Language.h:156
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
uint32 GetUInt32Value(uint16 index) const
Definition: Object.cpp:300
Creature * getSelectedCreature()
Definition: Chat.cpp:615
uint32 getFaction() const
Definition: Unit.h:1466
arena_t NULL
Definition: jemalloc_internal.h:624
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:996
Definition: Creature.h:467
void setFaction(uint32 faction)
Definition: Unit.h:1467
Definition: Language.h:33
Definition: Language.h:155
uint32_t uint32
Definition: Define.h:150
uint64_t uint64
Definition: Define.h:149
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: UpdateFields.h:109
Definition: Language.h:154
Definition: UpdateFields.h:135
Definition: UpdateFields.h:30
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
void SetUInt64Value(uint16 index, uint64 value)
Definition: Object.cpp:1017
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
char * extractKeyFromLink(char *text, char const *linkType, char **something1=NULL)
Definition: Chat.cpp:641
DBCStorage< FactionTemplateEntry > sFactionTemplateStore(FactionTemplatefmt)
uint64 GetUInt64Value(uint16 index) const
Definition: Object.cpp:306
std::string ToString() const
Definition: ObjectGuid.cpp:99

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyFlyCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
629  {
630  if (!*args)
631  return false;
632 
633  float FSpeed = (float)atof((char*)args);
634 
635  if (FSpeed > 50.0f || FSpeed < 0.1f)
636  {
637  handler->SendSysMessage(LANG_BAD_VALUE);
638  handler->SetSentErrorMessage(true);
639  return false;
640  }
641 
642  Player* target = handler->getSelectedPlayerOrSelf();
643  if (!target)
644  {
646  handler->SetSentErrorMessage(true);
647  return false;
648  }
649 
650  // check online security
651  if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
652  return false;
653 
654  handler->PSendSysMessage(LANG_YOU_CHANGE_FLY_SPEED, FSpeed, handler->GetNameLink(target).c_str());
655  if (handler->needReportToTarget(target))
656  ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_FLY_SPEED_CHANGED, handler->GetNameLink().c_str(), FSpeed);
657 
658  target->SetSpeed(MOVE_FLIGHT, FSpeed, true);
659 
660  return true;
661  }
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
Definition: Unit.h:605
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Definition: Language.h:172
Definition: Language.h:173
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:623
Definition: Language.h:140
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
virtual std::string GetNameLink() const
Definition: Chat.h:101
Definition: Language.h:139
Definition: Chat.h:56
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
virtual bool needReportToTarget(Player *chr) const
Definition: Chat.cpp:1056

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyGenderCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
1283  {
1284  if (!*args)
1285  return false;
1286 
1287  Player* target = handler->getSelectedPlayerOrSelf();
1288 
1289  if (!target)
1290  {
1292  handler->SetSentErrorMessage(true);
1293  return false;
1294  }
1295 
1296  PlayerInfo const* info = sObjectMgr->GetPlayerInfo(target->getRace(), target->getClass());
1297  if (!info)
1298  return false;
1299 
1300  char const* gender_str = (char*)args;
1301  int gender_len = strlen(gender_str);
1302 
1303  Gender gender;
1304 
1305  if (!strncmp(gender_str, "male", gender_len)) // MALE
1306  {
1307  if (target->getGender() == GENDER_MALE)
1308  return true;
1309 
1310  gender = GENDER_MALE;
1311  }
1312  else if (!strncmp(gender_str, "female", gender_len)) // FEMALE
1313  {
1314  if (target->getGender() == GENDER_FEMALE)
1315  return true;
1316 
1317  gender = GENDER_FEMALE;
1318  }
1319  else
1320  {
1322  handler->SetSentErrorMessage(true);
1323  return false;
1324  }
1325 
1326  // Set gender
1327  target->SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, gender);
1328  target->SetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER, gender);
1329 
1330  // Change display ID
1331  target->InitDisplayIds();
1332 
1333  char const* gender_full = gender ? "female" : "male";
1334 
1335  handler->PSendSysMessage(LANG_YOU_CHANGE_GENDER, handler->GetNameLink(target).c_str(), gender_full);
1336 
1337  if (handler->needReportToTarget(target))
1338  ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_GENDER_CHANGED, gender_full, handler->GetNameLink().c_str());
1339 
1340  return true;
1341  }
Definition: Player.h:587
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
Definition: Unit.h:234
Definition: UpdateFields.h:96
Definition: Player.h:396
Definition: Language.h:922
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:623
#define sObjectMgr
Definition: ObjectMgr.h:1567
Definition: UpdateFields.h:198
Definition: SharedDefines.h:93
Definition: SharedDefines.h:94
Gender
Definition: SharedDefines.h:90
virtual std::string GetNameLink() const
Definition: Chat.h:101
Definition: Language.h:923
Definition: Chat.h:56
Definition: Language.h:924
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
Definition: Language.h:509
virtual bool needReportToTarget(Player *chr) const
Definition: Chat.cpp:1056

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyHonorCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
1089  {
1090  if (!*args)
1091  return false;
1092 
1093  Player* target = handler->getSelectedPlayerOrSelf();
1094  if (!target)
1095  {
1097  handler->SetSentErrorMessage(true);
1098  return false;
1099  }
1100 
1101  // check online security
1102  if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
1103  return false;
1104 
1105  int32 amount = (uint32)atoi(args);
1106 
1107  target->ModifyCurrency(CURRENCY_TYPE_HONOR_POINTS, amount, true, true);
1108 
1109  handler->PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_HONOR_POINTS));
1110 
1111  return true;
1112  }
Definition: Language.h:325
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:623
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
virtual std::string GetNameLink() const
Definition: Chat.h:101
int32_t int32
Definition: Define.h:146
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
uint32_t uint32
Definition: g3dmath.h:168
Definition: DBCEnums.h:759
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
Definition: Language.h:509

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyHPCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
85  {
86  if (!*args)
87  return false;
88 
89  int32 hp = atoi((char*)args);
90  int32 hpm = atoi((char*)args);
91 
92  if (hp < 1 || hpm < 1 || hpm < hp)
93  {
95  handler->SetSentErrorMessage(true);
96  return false;
97  }
98 
99  Player* target = handler->getSelectedPlayerOrSelf();
100  if (!target)
101  {
103  handler->SetSentErrorMessage(true);
104  return false;
105  }
106 
107  if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
108  return false;
109 
110  handler->PSendSysMessage(LANG_YOU_CHANGE_HP, handler->GetNameLink(target).c_str(), hp, hpm);
111  if (handler->needReportToTarget(target))
112  ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_HP_CHANGED, handler->GetNameLink().c_str(), hp, hpm);
113 
114  target->SetMaxHealth(hpm);
115  target->SetHealth(hp);
116 
117  return true;
118  }
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:623
Definition: Language.h:140
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
Definition: Language.h:143
Definition: Language.h:144
virtual std::string GetNameLink() const
Definition: Chat.h:101
int32_t int32
Definition: Define.h:146
Definition: Language.h:139
Definition: Chat.h:56
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
virtual bool needReportToTarget(Player *chr) const
Definition: Chat.cpp:1056

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyManaCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
122  {
123  if (!*args)
124  return false;
125 
126  int32 mana = atoi((char*)args);
127  int32 manam = atoi((char*)args);
128 
129  if (mana <= 0 || manam <= 0 || manam < mana)
130  {
131  handler->SendSysMessage(LANG_BAD_VALUE);
132  handler->SetSentErrorMessage(true);
133  return false;
134  }
135 
136  Player* target = handler->getSelectedPlayerOrSelf();
137  if (!target)
138  {
140  handler->SetSentErrorMessage(true);
141  return false;
142  }
143 
144  // check online security
145  if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
146  return false;
147 
148  handler->PSendSysMessage(LANG_YOU_CHANGE_MANA, handler->GetNameLink(target).c_str(), mana, manam);
149  if (handler->needReportToTarget(target))
150  ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_MANA_CHANGED, handler->GetNameLink().c_str(), mana, manam);
151 
152  target->SetMaxPower(POWER_MANA, manam);
153  target->SetPower(POWER_MANA, mana);
154 
155  return true;
156  }
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:623
Definition: Language.h:140
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
Definition: Language.h:145
virtual std::string GetNameLink() const
Definition: Chat.h:101
int32_t int32
Definition: Define.h:146
Definition: Language.h:139
Definition: Chat.h:56
Definition: Language.h:146
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
virtual bool needReportToTarget(Player *chr) const
Definition: Chat.cpp:1056
Definition: SharedDefines.h:248

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyMoneyCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
964  {
965  if (!*args)
966  return false;
967 
968  Player* target = handler->getSelectedPlayerOrSelf();
969  if (!target)
970  {
972  handler->SetSentErrorMessage(true);
973  return false;
974  }
975 
976  // check online security
977  if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
978  return false;
979 
980  int64 moneyToAdd = 0;
981  if (strchr(args, 'g') || strchr(args, 's') || strchr(args, 'c'))
982  moneyToAdd = MoneyStringToMoney(std::string(args));
983  else
984  moneyToAdd = atoll(args);
985 
986  uint64 targetMoney = target->GetMoney();
987 
988  if (moneyToAdd < 0)
989  {
990  int64 newmoney = int64(targetMoney) + moneyToAdd;
991 
992  TC_LOG_DEBUG("misc", handler->GetTrinityString(LANG_CURRENT_MONEY), uint32(targetMoney), int32(moneyToAdd), uint32(newmoney));
993  if (newmoney <= 0)
994  {
995  handler->PSendSysMessage(LANG_YOU_TAKE_ALL_MONEY, handler->GetNameLink(target).c_str());
996  if (handler->needReportToTarget(target))
997  ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_ALL_MONEY_GONE, handler->GetNameLink().c_str());
998 
999  target->SetMoney(0);
1000  }
1001  else
1002  {
1003  uint64 moneyToAddMsg = moneyToAdd * -1;
1004  if (newmoney > static_cast<int64>(MAX_MONEY_AMOUNT))
1005  newmoney = MAX_MONEY_AMOUNT;
1006 
1007  handler->PSendSysMessage(LANG_YOU_TAKE_MONEY, moneyToAddMsg, handler->GetNameLink(target).c_str());
1008  if (handler->needReportToTarget(target))
1009  ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_MONEY_TAKEN, handler->GetNameLink().c_str(), moneyToAddMsg);
1010  target->SetMoney(newmoney);
1011  }
1012  }
1013  else
1014  {
1015  handler->PSendSysMessage(LANG_YOU_GIVE_MONEY, uint32(moneyToAdd), handler->GetNameLink(target).c_str());
1016  if (handler->needReportToTarget(target))
1017  ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, handler->GetNameLink().c_str(), uint32(moneyToAdd));
1018 
1019  if (moneyToAdd >= int64(MAX_MONEY_AMOUNT))
1020  moneyToAdd = MAX_MONEY_AMOUNT;
1021 
1022  if (targetMoney >= uint64(MAX_MONEY_AMOUNT) - moneyToAdd)
1023  moneyToAdd -= targetMoney;
1024 
1025  target->ModifyMoney(moneyToAdd);
1026  }
1027 
1028  TC_LOG_DEBUG("misc", handler->GetTrinityString(LANG_NEW_MONEY), uint32(targetMoney), int32(moneyToAdd), uint32(target->GetMoney()));
1029 
1030  return true;
1031  }
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
uint64 const MAX_MONEY_AMOUNT
Definition: Player.cpp:130
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Definition: Language.h:185
int64_t int64
Definition: Define.h:145
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:623
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
uint64_t uint64
Definition: g3dmath.h:170
#define atoll
Definition: Common.h:77
Definition: Language.h:140
Definition: Language.h:186
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
Definition: Language.h:183
virtual std::string GetNameLink() const
Definition: Chat.h:101
Definition: Language.h:190
uint64_t uint64
Definition: Define.h:149
Definition: Language.h:184
Definition: Language.h:181
Definition: Language.h:187
int64_t int64
Definition: g3dmath.h:169
Definition: Chat.h:56
virtual char const * GetTrinityString(uint32 entry) const
Definition: Chat.cpp:67
int32_t int32
Definition: g3dmath.h:167
int64 MoneyStringToMoney(const std::string &moneyString)
Definition: Util.cpp:132
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
Definition: Language.h:182
uint32_t uint32
Definition: g3dmath.h:168
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
virtual bool needReportToTarget(Player *chr) const
Definition: Chat.cpp:1056

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyMorphCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
1231  {
1232  if (!*args)
1233  return false;
1234 
1235  uint16 display_id = (uint16)atoi((char*)args);
1236 
1237  Unit* target = handler->getSelectedUnit();
1238  if (!target)
1239  target = handler->GetSession()->GetPlayer();
1240 
1241  // check online security
1242  else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), ObjectGuid::Empty))
1243  return false;
1244 
1245  target->SetDisplayId(display_id);
1246 
1247  return true;
1248  }
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Unit * getSelectedUnit()
Definition: Chat.cpp:591
Player * GetPlayer() const
Definition: WorldSession.h:927
uint16_t uint16
Definition: g3dmath.h:166
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
Player * ToPlayer()
Definition: Object.h:191
TypeID GetTypeId() const
Definition: Object.h:113
virtual void SetDisplayId(uint32 modelId)
Definition: Unit.cpp:12799
uint16_t uint16
Definition: Define.h:151
Definition: ObjectGuid.h:33
WorldSession * GetSession()
Definition: Chat.h:59
Definition: Unit.h:1305

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyMountCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
703  {
704  if (!*args)
705  return false;
706 
707  uint16 mId = 1147;
708  float speed = (float)15;
709  uint32 num = 0;
710 
711  num = atoi((char*)args);
712  switch (num)
713  {
714  case 1:
715  mId=14340;
716  break;
717  case 2:
718  mId=4806;
719  break;
720  case 3:
721  mId=6471;
722  break;
723  case 4:
724  mId=12345;
725  break;
726  case 5:
727  mId=6472;
728  break;
729  case 6:
730  mId=6473;
731  break;
732  case 7:
733  mId=10670;
734  break;
735  case 8:
736  mId=10719;
737  break;
738  case 9:
739  mId=10671;
740  break;
741  case 10:
742  mId=10672;
743  break;
744  case 11:
745  mId=10720;
746  break;
747  case 12:
748  mId=14349;
749  break;
750  case 13:
751  mId=11641;
752  break;
753  case 14:
754  mId=12244;
755  break;
756  case 15:
757  mId=12242;
758  break;
759  case 16:
760  mId=14578;
761  break;
762  case 17:
763  mId=14579;
764  break;
765  case 18:
766  mId=14349;
767  break;
768  case 19:
769  mId=12245;
770  break;
771  case 20:
772  mId=14335;
773  break;
774  case 21:
775  mId=207;
776  break;
777  case 22:
778  mId=2328;
779  break;
780  case 23:
781  mId=2327;
782  break;
783  case 24:
784  mId=2326;
785  break;
786  case 25:
787  mId=14573;
788  break;
789  case 26:
790  mId=14574;
791  break;
792  case 27:
793  mId=14575;
794  break;
795  case 28:
796  mId=604;
797  break;
798  case 29:
799  mId=1166;
800  break;
801  case 30:
802  mId=2402;
803  break;
804  case 31:
805  mId=2410;
806  break;
807  case 32:
808  mId=2409;
809  break;
810  case 33:
811  mId=2408;
812  break;
813  case 34:
814  mId=2405;
815  break;
816  case 35:
817  mId=14337;
818  break;
819  case 36:
820  mId=6569;
821  break;
822  case 37:
823  mId=10661;
824  break;
825  case 38:
826  mId=10666;
827  break;
828  case 39:
829  mId=9473;
830  break;
831  case 40:
832  mId=9476;
833  break;
834  case 41:
835  mId=9474;
836  break;
837  case 42:
838  mId=14374;
839  break;
840  case 43:
841  mId=14376;
842  break;
843  case 44:
844  mId=14377;
845  break;
846  case 45:
847  mId=2404;
848  break;
849  case 46:
850  mId=2784;
851  break;
852  case 47:
853  mId=2787;
854  break;
855  case 48:
856  mId=2785;
857  break;
858  case 49:
859  mId=2736;
860  break;
861  case 50:
862  mId=2786;
863  break;
864  case 51:
865  mId=14347;
866  break;
867  case 52:
868  mId=14346;
869  break;
870  case 53:
871  mId=14576;
872  break;
873  case 54:
874  mId=9695;
875  break;
876  case 55:
877  mId=9991;
878  break;
879  case 56:
880  mId=6448;
881  break;
882  case 57:
883  mId=6444;
884  break;
885  case 58:
886  mId=6080;
887  break;
888  case 59:
889  mId=6447;
890  break;
891  case 60:
892  mId=4805;
893  break;
894  case 61:
895  mId=9714;
896  break;
897  case 62:
898  mId=6448;
899  break;
900  case 63:
901  mId=6442;
902  break;
903  case 64:
904  mId=14632;
905  break;
906  case 65:
907  mId=14332;
908  break;
909  case 66:
910  mId=14331;
911  break;
912  case 67:
913  mId=8469;
914  break;
915  case 68:
916  mId=2830;
917  break;
918  case 69:
919  mId=2346;
920  break;
921  default:
922  handler->SendSysMessage(LANG_NO_MOUNT);
923  handler->SetSentErrorMessage(true);
924  return false;
925  }
926 
927  Player* target = handler->getSelectedPlayerOrSelf();
928  if (!target)
929  {
931  handler->SetSentErrorMessage(true);
932  return false;
933  }
934 
935  // check online security
936  if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
937  return false;
938 
939  handler->PSendSysMessage(LANG_YOU_GIVE_MOUNT, handler->GetNameLink(target).c_str());
940  if (handler->needReportToTarget(target))
941  ChatHandler(target->GetSession()).PSendSysMessage(LANG_MOUNT_GIVED, handler->GetNameLink().c_str());
942 
943  target->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP);
944  target->Mount(mId);
945 
946  WorldPacket data(SMSG_MOVE_SET_RUN_SPEED, (8+4+1+4));
947  data << target->GetPackGUID();
948  data << (uint32)0;
949  data << (uint8)0; //new 2.1.0
950  data << float(speed);
951  target->SendMessageToSet(&data, true);
952 
953  data.Initialize(SMSG_MOVE_SET_SWIM_SPEED, (8+4+4));
954  data << target->GetPackGUID();
955  data << (uint32)0;
956  data << float(speed);
957  target->SendMessageToSet(&data, true);
958 
959  return true;
960  }
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
Definition: Unit.h:685
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:623
Definition: Language.h:140
Definition: Language.h:179
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
virtual std::string GetNameLink() const
Definition: Chat.h:101
uint32_t uint32
Definition: Define.h:150
uint16_t uint16
Definition: Define.h:151
Definition: Language.h:178
Definition: Opcodes.h:1251
uint8_t uint8
Definition: g3dmath.h:164
Definition: Chat.h:56
Definition: UpdateFields.h:109
Definition: Language.h:177
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
uint32_t uint32
Definition: g3dmath.h:168
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
virtual bool needReportToTarget(Player *chr) const
Definition: Chat.cpp:1056
Definition: WorldPacket.h:26
Definition: Opcodes.h:1249

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyPhaseCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
1252  {
1253  if (!*args)
1254  return false;
1255 
1256  uint32 phase = (uint32)atoi((char*)args);
1257 
1258  Unit* target = handler->getSelectedUnit();
1259  if (!target)
1260  target = handler->GetSession()->GetPlayer();
1261 
1262  target->SetInPhase(phase, true, !target->IsInPhase(phase));
1263 
1264  if (target->GetTypeId() == TYPEID_PLAYER)
1265  target->ToPlayer()->SendUpdatePhasing();
1266 
1267  return true;
1268  }
Unit * getSelectedUnit()
Definition: Chat.cpp:591
Player * GetPlayer() const
Definition: WorldSession.h:927
bool SetInPhase(uint32 id, bool update, bool apply) override
Definition: Unit.cpp:14578
Player * ToPlayer()
Definition: Object.h:191
TypeID GetTypeId() const
Definition: Object.h:113
uint32_t uint32
Definition: Define.h:150
bool IsInPhase(uint32 phase) const
Definition: Object.h:462
Definition: ObjectGuid.h:33
WorldSession * GetSession()
Definition: Chat.h:59
uint32_t uint32
Definition: g3dmath.h:168
Definition: Unit.h:1305

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyRageCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
200  {
201  if (!*args)
202  return false;
203 
204  int32 rage = atoi((char*)args)*10;
205  int32 ragem = atoi((char*)args)*10;
206 
207  if (rage <= 0 || ragem <= 0 || ragem < rage)
208  {
209  handler->SendSysMessage(LANG_BAD_VALUE);
210  handler->SetSentErrorMessage(true);
211  return false;
212  }
213 
214  Player* target = handler->getSelectedPlayerOrSelf();
215  if (!target)
216  {
218  handler->SetSentErrorMessage(true);
219  return false;
220  }
221 
222  // check online security
223  if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
224  return false;
225 
226  handler->PSendSysMessage(LANG_YOU_CHANGE_RAGE, handler->GetNameLink(target).c_str(), rage/10, ragem/10);
227  if (handler->needReportToTarget(target))
228  ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, handler->GetNameLink().c_str(), rage/10, ragem/10);
229 
230  target->SetMaxPower(POWER_RAGE, ragem);
231  target->SetPower(POWER_RAGE, rage);
232 
233  return true;
234  }
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Definition: Language.h:151
Definition: Language.h:152
Definition: SharedDefines.h:249
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:623
Definition: Language.h:140
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
virtual std::string GetNameLink() const
Definition: Chat.h:101
int32_t int32
Definition: Define.h:146
Definition: Language.h:139
Definition: Chat.h:56
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
virtual bool needReportToTarget(Player *chr) const
Definition: Chat.cpp:1056

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyRepCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
1130  {
1131  if (!*args)
1132  return false;
1133 
1134  Player* target = handler->getSelectedPlayerOrSelf();
1135  if (!target)
1136  {
1138  handler->SetSentErrorMessage(true);
1139  return false;
1140  }
1141 
1142  // check online security
1143  if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
1144  return false;
1145 
1146  char* factionTxt = handler->extractKeyFromLink((char*)args, "Hfaction");
1147  if (!factionTxt)
1148  return false;
1149 
1150  uint32 factionId = atoi(factionTxt);
1151 
1152  int32 amount = 0;
1153  char *rankTxt = strtok(NULL, " ");
1154  if (!factionId || !rankTxt)
1155  return false;
1156 
1157  amount = atoi(rankTxt);
1158  if ((amount == 0) && (rankTxt[0] != '-') && !isdigit(rankTxt[0]))
1159  {
1160  std::string rankStr = rankTxt;
1161  std::wstring wrankStr;
1162  if (!Utf8toWStr(rankStr, wrankStr))
1163  return false;
1164  wstrToLower(wrankStr);
1165 
1166  int r = 0;
1167  amount = -42000;
1168  for (; r < MAX_REPUTATION_RANK; ++r)
1169  {
1170  std::string rank = handler->GetTrinityString(ReputationRankStrIndex[r]);
1171  if (rank.empty())
1172  continue;
1173 
1174  std::wstring wrank;
1175  if (!Utf8toWStr(rank, wrank))
1176  continue;
1177 
1178  wstrToLower(wrank);
1179 
1180  if (wrank.substr(0, wrankStr.size()) == wrankStr)
1181  {
1182  char *deltaTxt = strtok(NULL, " ");
1183  if (deltaTxt)
1184  {
1185  int32 delta = atoi(deltaTxt);
1186  if ((delta < 0) || (delta > ReputationMgr::PointsInRank[r] -1))
1187  {
1189  handler->SetSentErrorMessage(true);
1190  return false;
1191  }
1192  amount += delta;
1193  }
1194  break;
1195  }
1196  amount += ReputationMgr::PointsInRank[r];
1197  }
1198  if (r >= MAX_REPUTATION_RANK)
1199  {
1201  handler->SetSentErrorMessage(true);
1202  return false;
1203  }
1204  }
1205 
1206  FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId);
1207 
1208  if (!factionEntry)
1209  {
1210  handler->PSendSysMessage(LANG_COMMAND_FACTION_UNKNOWN, factionId);
1211  handler->SetSentErrorMessage(true);
1212  return false;
1213  }
1214 
1215  if (factionEntry->ReputationIndex < 0)
1216  {
1217  handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->Name_lang, factionId);
1218  handler->SetSentErrorMessage(true);
1219  return false;
1220  }
1221 
1222  target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false);
1223  target->GetReputationMgr().SendState(target->GetReputationMgr().GetState(factionEntry));
1224  handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->Name_lang, factionId,
1225  handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry));
1226  return true;
1227  }
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
static const int32 PointsInRank[MAX_REPUTATION_RANK]
Definition: ReputationMgr.h:74
arena_t NULL
Definition: jemalloc_internal.h:624
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:623
Definition: Language.h:337
bool Utf8toWStr(char const *utf8str, size_t csize, wchar_t *wstr, size_t &wsize)
Definition: Util.cpp:281
void wstrToLower(std::wstring &str)
Definition: Util.h:306
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
#define MAX_REPUTATION_RANK
Definition: SharedDefines.h:224
Definition: Language.h:354
virtual std::string GetNameLink() const
Definition: Chat.h:101
char * Name_lang
Definition: DBCStructure.h:418
int32_t int32
Definition: Define.h:146
uint32_t uint32
Definition: Define.h:150
static uint32 ReputationRankStrIndex[MAX_REPUTATION_RANK]
Definition: ReputationMgr.h:29
Definition: DBCStructure.h:405
Definition: Language.h:333
Definition: Language.h:336
virtual char const * GetTrinityString(uint32 entry) const
Definition: Chat.cpp:67
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
DBCStorage< FactionEntry > sFactionStore(Factionfmt)
Definition: Language.h:338
int32 ReputationIndex
Definition: DBCStructure.h:408
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
Definition: Language.h:509
char * extractKeyFromLink(char *text, char const *linkType, char **something1=NULL)
Definition: Chat.cpp:641

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyRunicPowerCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
238  {
239  if (!*args)
240  return false;
241 
242  int32 rune = atoi((char*)args)*10;
243  int32 runem = atoi((char*)args)*10;
244 
245  if (rune <= 0 || runem <= 0 || runem < rune)
246  {
247  handler->SendSysMessage(LANG_BAD_VALUE);
248  handler->SetSentErrorMessage(true);
249  return false;
250  }
251 
252  Player* target = handler->getSelectedPlayerOrSelf();
253  if (!target)
254  {
256  handler->SetSentErrorMessage(true);
257  return false;
258  }
259 
260  handler->PSendSysMessage(LANG_YOU_CHANGE_RUNIC_POWER, handler->GetNameLink(target).c_str(), rune/10, runem/10);
261  if (handler->needReportToTarget(target))
262  ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_RUNIC_POWER_CHANGED, handler->GetNameLink().c_str(), rune/10, runem/10);
263 
264  target->SetMaxPower(POWER_RUNIC_POWER, runem);
265  target->SetPower(POWER_RUNIC_POWER, rune);
266 
267  return true;
268  }
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
Definition: Language.h:205
Definition: SharedDefines.h:254
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:623
Definition: Language.h:206
Definition: Language.h:140
virtual std::string GetNameLink() const
Definition: Chat.h:101
int32_t int32
Definition: Define.h:146
Definition: Language.h:139
Definition: Chat.h:56
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
virtual bool needReportToTarget(Player *chr) const
Definition: Chat.cpp:1056

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyScaleCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
665  {
666  if (!*args)
667  return false;
668 
669  float Scale = (float)atof((char*)args);
670  if (Scale > 10.0f || Scale < 0.1f)
671  {
672  handler->SendSysMessage(LANG_BAD_VALUE);
673  handler->SetSentErrorMessage(true);
674  return false;
675  }
676 
677  Unit* target = handler->getSelectedUnit();
678  if (!target)
679  {
681  handler->SetSentErrorMessage(true);
682  return false;
683  }
684 
685  if (Player* player = target->ToPlayer())
686  {
687  // check online security
688  if (handler->HasLowerSecurity(player, ObjectGuid::Empty))
689  return false;
690 
691  handler->PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, handler->GetNameLink(player).c_str());
692  if (handler->needReportToTarget(player))
693  ChatHandler(player->GetSession()).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, handler->GetNameLink().c_str(), Scale);
694  }
695 
696  target->SetObjectScale(Scale);
697 
698  return true;
699  }
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Unit * getSelectedUnit()
Definition: Chat.cpp:591
Definition: Language.h:32
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
Player * ToPlayer()
Definition: Object.h:191
virtual std::string GetNameLink() const
Definition: Chat.h:101
Definition: Language.h:175
Definition: Language.h:139
Definition: Chat.h:56
virtual void SetObjectScale(float scale)
Definition: Object.h:111
Definition: Language.h:176
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
Definition: Unit.h:1305
virtual bool needReportToTarget(Player *chr) const
Definition: Chat.cpp:1056

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifySpeedCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
494  {
495  if (!*args)
496  return false;
497 
498  float Speed = (float)atof((char*)args);
499 
500  if (Speed > 50.0f || Speed < 0.1f)
501  {
502  handler->SendSysMessage(LANG_BAD_VALUE);
503  handler->SetSentErrorMessage(true);
504  return false;
505  }
506 
507  Player* target = handler->getSelectedPlayerOrSelf();
508  if (!target)
509  {
511  handler->SetSentErrorMessage(true);
512  return false;
513  }
514 
515  // check online security
516  if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
517  return false;
518 
519  std::string targetNameLink = handler->GetNameLink(target);
520 
521  if (target->IsInFlight())
522  {
523  handler->PSendSysMessage(LANG_CHAR_IN_FLIGHT, targetNameLink.c_str());
524  handler->SetSentErrorMessage(true);
525  return false;
526  }
527 
528  handler->PSendSysMessage(LANG_YOU_CHANGE_SPEED, Speed, targetNameLink.c_str());
529  if (handler->needReportToTarget(target))
530  ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_SPEED_CHANGED, handler->GetNameLink().c_str(), Speed);
531 
532  target->SetSpeed(MOVE_RUN, Speed, true);
533 
534  return true;
535  }
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:623
Definition: Language.h:140
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
Definition: Language.h:54
virtual std::string GetNameLink() const
Definition: Chat.h:101
Definition: Language.h:139
Definition: Chat.h:56
Definition: Unit.h:600
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
Definition: Language.h:167
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
virtual bool needReportToTarget(Player *chr) const
Definition: Chat.cpp:1056
Definition: Language.h:166

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifySpellCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
340  {
341  if (!*args)
342  return false;
343 
344  char* pspellflatid = strtok((char*)args, " ");
345  if (!pspellflatid)
346  return false;
347 
348  char* pop = strtok(NULL, " ");
349  if (!pop)
350  return false;
351 
352  char* pval = strtok(NULL, " ");
353  if (!pval)
354  return false;
355 
356  uint16 mark;
357 
358  char* pmark = strtok(NULL, " ");
359 
360  uint8 spellflatid = atoi(pspellflatid);
361  uint8 op = atoi(pop);
362  uint16 val = atoi(pval);
363  if (!pmark)
364  mark = 65535;
365  else
366  mark = atoi(pmark);
367 
368  Player* target = handler->getSelectedPlayerOrSelf();
369  if (target == NULL)
370  {
372  handler->SetSentErrorMessage(true);
373  return false;
374  }
375 
376  // check online security
377  if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
378  return false;
379 
380  handler->PSendSysMessage(LANG_YOU_CHANGE_SPELLFLATID, spellflatid, val, mark, handler->GetNameLink(target).c_str());
381  if (handler->needReportToTarget(target))
382  ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_SPELLFLATID_CHANGED, handler->GetNameLink().c_str(), spellflatid, val, mark);
383 
386  spellMod.ModIndex = op;
388  modData.ClassIndex = spellflatid;
389  modData.ModifierValue = float(val);
390  spellMod.ModifierData.push_back(modData);
391  packet.Modifiers.push_back(spellMod);
392  target->GetSession()->SendPacket(packet.Write());
393 
394  return true;
395  }
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
arena_t NULL
Definition: jemalloc_internal.h:624
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:623
Definition: SpellPackets.h:448
Definition: Language.h:140
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
Definition: Language.h:158
std::vector< SpellModifierData > ModifierData
Definition: SpellPackets.h:445
uint8 ClassIndex
Definition: SpellPackets.h:439
virtual std::string GetNameLink() const
Definition: Chat.h:101
Definition: SpellPackets.h:436
Definition: Opcodes.h:1503
uint16_t uint16
Definition: Define.h:151
float ModifierValue
Definition: SpellPackets.h:438
Definition: Chat.h:56
Definition: SpellPackets.h:442
uint8 ModIndex
Definition: SpellPackets.h:444
uint8_t uint8
Definition: Define.h:152
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
Definition: Language.h:157
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
virtual bool needReportToTarget(Player *chr) const
Definition: Chat.cpp:1056

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyStandStateCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
1272  {
1273  if (!*args)
1274  return false;
1275 
1276  uint32 anim_id = atoi((char*)args);
1277  handler->GetSession()->GetPlayer()->SetUInt32Value(UNIT_NPC_EMOTESTATE, anim_id);
1278 
1279  return true;
1280  }
Definition: UpdateFields.h:136
Player * GetPlayer() const
Definition: WorldSession.h:927
uint32_t uint32
Definition: Define.h:150
WorldSession * GetSession()
Definition: Chat.h:59

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifySwimCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
539  {
540  if (!*args)
541  return false;
542 
543  float Swim = (float)atof((char*)args);
544 
545  if (Swim > 50.0f || Swim < 0.1f)
546  {
547  handler->SendSysMessage(LANG_BAD_VALUE);
548  handler->SetSentErrorMessage(true);
549  return false;
550  }
551 
552  Player* target = handler->getSelectedPlayerOrSelf();
553  if (!target)
554  {
556  handler->SetSentErrorMessage(true);
557  return false;
558  }
559 
560  // check online security
561  if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
562  return false;
563 
564  std::string targetNameLink = handler->GetNameLink(target);
565 
566  if (target->IsInFlight())
567  {
568  handler->PSendSysMessage(LANG_CHAR_IN_FLIGHT, targetNameLink.c_str());
569  handler->SetSentErrorMessage(true);
570  return false;
571  }
572 
573  handler->PSendSysMessage(LANG_YOU_CHANGE_SWIM_SPEED, Swim, targetNameLink.c_str());
574  if (handler->needReportToTarget(target))
575  ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_SWIM_SPEED_CHANGED, handler->GetNameLink().c_str(), Swim);
576 
577  target->SetSpeed(MOVE_SWIM, Swim, true);
578 
579  return true;
580  }
Definition: Language.h:169
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:623
Definition: Language.h:140
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
Definition: Language.h:54
Definition: Unit.h:602
virtual std::string GetNameLink() const
Definition: Chat.h:101
Definition: Language.h:139
Definition: Chat.h:56
Definition: Language.h:168
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
virtual bool needReportToTarget(Player *chr) const
Definition: Chat.cpp:1056

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyTalentCommand ( ChatHandler ,
const char *   
)
inlinestatic
399  {
400  /* TODO: 6.x remove this
401  if (!*args)
402  return false;
403 
404  int tp = atoi((char*)args);
405  if (tp < 0)
406  return false;
407 
408  Unit* target = handler->getSelectedUnit();
409  if (!target)
410  {
411  handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
412  handler->SetSentErrorMessage(true);
413  return false;
414  }
415 
416  if (target->GetTypeId() == TYPEID_PLAYER)
417  {
418  // check online security
419  if (handler->HasLowerSecurity(target->ToPlayer(), ObjectGuid::Empty))
420  return false;
421  target->ToPlayer()->SetFreeTalentPoints(tp);
422  target->ToPlayer()->SendTalentsInfoData(false);
423  return true;
424  }
425  else if (target->IsPet())
426  {
427  Unit* owner = target->GetOwner();
428  if (owner && owner->GetTypeId() == TYPEID_PLAYER && ((Pet*)target)->IsPermanentPetFor(owner->ToPlayer()))
429  {
430  // check online security
431  if (handler->HasLowerSecurity(owner->ToPlayer(), ObjectGuid::Empty))
432  return false;
433  ((Pet*)target)->SetFreeTalentPoints(tp);
434  owner->ToPlayer()->SendTalentsInfoData(true);
435  return true;
436  }
437  }
438 
439  handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
440  handler->SetSentErrorMessage(true);*/
441  return false;
442  }

+ Here is the caller graph for this function:

static bool modify_commandscript::HandleModifyXPCommand ( ChatHandler handler,
const char *  args 
)
inlinestatic
1387  {
1388  if (!*args)
1389  return false;
1390 
1391  int32 xp = atoi((char*)args);
1392 
1393  if (xp < 1)
1394  {
1395  handler->SendSysMessage(LANG_BAD_VALUE);
1396  handler->SetSentErrorMessage(true);
1397  return false;
1398  }
1399 
1400  Player* target = handler->getSelectedPlayerOrSelf();
1401  if (!target)
1402  {
1404  handler->SetSentErrorMessage(true);
1405  return false;
1406  }
1407 
1408  if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
1409  return false;
1410 
1411  // we can run the command
1412  target->GiveXP(xp, nullptr);
1413  return true;
1414  }
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:623
Definition: Language.h:140
bool HasLowerSecurity(Player *target, ObjectGuid guid, bool strong=false)
Definition: Chat.cpp:77
int32_t int32
Definition: Define.h:146
Definition: Language.h:139
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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