本文整理汇总了C++中Player::ActivateSpec方法的典型用法代码示例。如果您正苦于以下问题:C++ Player::ActivateSpec方法的具体用法?C++ Player::ActivateSpec怎么用?C++ Player::ActivateSpec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player::ActivateSpec方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleRemoveDualSpecCommand
static bool HandleRemoveDualSpecCommand(ChatHandler* handler, const char* args)
{
std::string name;
Player *player;
char *TargetName = strtok((char*)args, " ");
if (!TargetName)
{
player = handler->getSelectedPlayer();
if (player)
{
name = player->GetName();
normalizePlayerName(name);
}
}
else
{
name = TargetName;
normalizePlayerName(name);
player = sObjectAccessor->FindPlayerByName(name.c_str());
}
if (!player)
{
// Try reset talents as Hunter Pet
Creature* creature = handler->getSelectedCreature();
if (creature && creature->isPet())
{
Unit *owner = creature->GetOwner();
if (owner && owner->GetTypeId() == TYPEID_PLAYER && ((Pet *)creature)->IsPermanentPetFor(owner->ToPlayer()))
{
((Pet *)creature)->resetTalents(true);
owner->ToPlayer()->SendTalentsInfoData(true);
ChatHandler(owner->ToPlayer()).SendSysMessage(LANG_RESET_PET_TALENTS);
return true;
}
}
}
else
{
player->ActivateSpec(1);
player->resetTalents(true);
player->SendTalentsInfoData(false);
player->ActivateSpec(0);
player->CastSpell(player, SPELL_DUAL_SPEC, true);
ChatHandler(player).SendSysMessage(LANG_RESET_TALENTS);
Pet* pet = player->GetPet();
Pet::resetTalentsForAllPetsOf(player, pet);
if (pet)
player->SendTalentsInfoData(true);
return true;
}
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
return false;
}