本文整理汇总了C++中CharmInfo::GetCommandState方法的典型用法代码示例。如果您正苦于以下问题:C++ CharmInfo::GetCommandState方法的具体用法?C++ CharmInfo::GetCommandState怎么用?C++ CharmInfo::GetCommandState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CharmInfo
的用法示例。
在下文中一共展示了CharmInfo::GetCommandState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandlePetAction
//.........这里部分代码省略.........
if (petC->IsPet())
{
Pet* p = (Pet*)petC;
if (p->getPetType() == HUNTER_PET)
p->Unsummon(PET_SAVE_AS_DELETED, _player);
else
// dismissing a summoned pet is like killing them (this prevents returning a soulshard...)
p->SetDeathState(CORPSE);
}
else // charmed
_player->Uncharm();
if (petC->IsTemporarySummon()) // special case when pet was temporary summon through DoSummonPossesed
{
petC->ForcedDespawn();
return;
}
((Pet*)pet)->ClearStayPosition();
break;
}
default:
sLog.outError("WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid);
}
break;
case ACT_REACTION: // 0x6
switch (spellid)
{
case REACT_PASSIVE: // passive
{
pet->AttackStop();
((Pet*)pet)->SetSpellOpener();
if (!charmInfo->GetCommandState() == COMMAND_STAY)
pet->GetMotionMaster()->MoveFollow(_player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
}
case REACT_DEFENSIVE: // recovery
case REACT_AGGRESSIVE: // activete
{
charmInfo->SetReactState(ReactStates(spellid));
break;
}
}
break;
case ACT_DISABLED: // 0x81 spell (disabled), ignore
case ACT_PASSIVE: // 0x01
case ACT_ENABLED: // 0xC1 spell
{
Unit* unit_target = nullptr;
if (targetGuid)
unit_target = _player->GetMap()->GetUnit(targetGuid);
// do not cast unknown spells
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellid);
if (!spellInfo)
{
sLog.outError("WORLD: unknown PET spell id %i", spellid);
return;
}
if (pet->GetCharmInfo() && pet->GetCharmInfo()->GetGlobalCooldownMgr().HasGlobalCooldown(spellInfo))
return;
for (int i = 0; i < MAX_EFFECT_INDEX; ++i)
{
if (spellInfo->EffectImplicitTargetA[i] == TARGET_ALL_ENEMY_IN_AREA