mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
Many cmangos commits applied
Many cmangos commits applied
This commit is contained in:
parent
cba86c231e
commit
8431568536
38 changed files with 173 additions and 83 deletions
|
|
@ -4623,6 +4623,33 @@ bool ChatHandler::HandleLevelUpCommand(char* args)
|
|||
}
|
||||
}
|
||||
|
||||
//add pet to levelup command
|
||||
if (m_session)
|
||||
{
|
||||
Creature* creatureTarget = getSelectedCreature();
|
||||
Player* player = m_session->GetPlayer();
|
||||
if (creatureTarget && creatureTarget->IsPet() && creatureTarget->GetOwner() && creatureTarget->GetOwner()->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Pet* petTarget = (Pet*)creatureTarget;
|
||||
|
||||
if (petTarget->getPetType() == HUNTER_PET)
|
||||
{
|
||||
uint32 newPetLevel = petTarget->getLevel() + addlevel;
|
||||
|
||||
if (newPetLevel <= player->getLevel())
|
||||
{
|
||||
petTarget->GivePetLevel(newPetLevel);
|
||||
|
||||
std::string nameLink = petLink(petTarget->GetName());
|
||||
PSendSysMessage(LANG_YOU_CHANGE_LVL, nameLink.c_str(), newPetLevel);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Player* target;
|
||||
ObjectGuid target_guid;
|
||||
std::string target_name;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue