Implement new commands for add/remove/lookup titles.

Autor Vladimir.

--HG--
branch : trunk
This commit is contained in:
win32
2010-01-21 11:19:34 +02:00
parent ce620223eb
commit 19ac6f6a3c
11 changed files with 368 additions and 44 deletions
-36
View File
@@ -1074,42 +1074,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)
{