mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[9710] Add gm possibilities reset talents for all specs.
* At login reset '.reset all talents' will reset all spec talents. * New command '.reset specs' will reset its online/offline. * Command '.reset talents' now not support offline player case.
This commit is contained in:
parent
15e4d337c3
commit
6ef88699d1
11 changed files with 83 additions and 18 deletions
|
|
@ -4534,12 +4534,47 @@ bool ChatHandler::HandleResetSpellsCommand(const char * args)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleResetTalentsCommand(const char * args)
|
||||
bool ChatHandler::HandleResetSpecsCommand(const char * args)
|
||||
{
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
std::string target_name;
|
||||
if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
|
||||
return false;
|
||||
|
||||
if (target)
|
||||
{
|
||||
target->resetTalents(true,true);
|
||||
target->SendTalentsInfoData(false);
|
||||
ChatHandler(target).SendSysMessage(LANG_RESET_TALENTS);
|
||||
if (!m_session || m_session->GetPlayer() != target)
|
||||
PSendSysMessage(LANG_RESET_TALENTS_ONLINE,GetNameLink(target).c_str());
|
||||
|
||||
Pet* pet = target->GetPet();
|
||||
Pet::resetTalentsForAllPetsOf(target, pet);
|
||||
if(pet)
|
||||
target->SendTalentsInfoData(true);
|
||||
return true;
|
||||
}
|
||||
else if (target_guid)
|
||||
{
|
||||
uint32 at_flags = AT_LOGIN_RESET_TALENTS | AT_LOGIN_RESET_PET_TALENTS;
|
||||
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid = '%u'", at_flags, GUID_LOPART(target_guid) );
|
||||
std::string nameLink = playerLink(target_name);
|
||||
PSendSysMessage(LANG_RESET_TALENTS_OFFLINE, nameLink.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleResetTalentsCommand(const char * args)
|
||||
{
|
||||
Player* target;
|
||||
std::string target_name;
|
||||
if (!extractPlayerTarget((char*)args, &target, NULL, &target_name))
|
||||
{
|
||||
// Try reset talents as Hunter Pet
|
||||
Creature* creature = getSelectedCreature();
|
||||
|
|
@ -4577,14 +4612,6 @@ bool ChatHandler::HandleResetTalentsCommand(const char * args)
|
|||
target->SendTalentsInfoData(true);
|
||||
return true;
|
||||
}
|
||||
else if (target_guid)
|
||||
{
|
||||
uint32 at_flags = AT_LOGIN_RESET_PET_TALENTS;
|
||||
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid = '%u'", at_flags, GUID_LOPART(target_guid) );
|
||||
std::string nameLink = playerLink(target_name);
|
||||
PSendSysMessage(LANG_RESET_TALENTS_OFFLINE, nameLink.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
SetSentErrorMessage(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue