mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[8833] Implement new commands for add/remove/lookup titles.
Inspired by patch suggested by LordJZ.
This commit is contained in:
parent
f66f0a0914
commit
b5980f061a
14 changed files with 377 additions and 47 deletions
|
|
@ -637,42 +637,6 @@ bool ChatHandler::HandleRecallCommand(const char* args)
|
|||
return true;
|
||||
}
|
||||
|
||||
//Edit Player KnownTitles
|
||||
bool ChatHandler::HandleModifyKnownTitlesCommand(const char* args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
|
||||
uint64 titles = 0;
|
||||
|
||||
sscanf((char*)args, UI64FMTD, &titles);
|
||||
|
||||
Player *chr = getSelectedPlayer();
|
||||
if (!chr)
|
||||
{
|
||||
SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
uint64 titles2 = titles;
|
||||
|
||||
for(uint32 i = 1; i < sCharTitlesStore.GetNumRows(); ++i)
|
||||
if(CharTitlesEntry const* tEntry = sCharTitlesStore.LookupEntry(i))
|
||||
titles2 &= ~(uint64(1) << tEntry->bit_index);
|
||||
|
||||
titles &= ~titles2; // remove not existed titles
|
||||
|
||||
chr->SetUInt64Value(PLAYER__FIELD_KNOWN_TITLES, titles);
|
||||
SendSysMessage(LANG_DONE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//Edit Player HP
|
||||
bool ChatHandler::HandleModifyHPCommand(const char* args)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue