本文整理汇总了C++中Pet::GetMapMgr方法的典型用法代码示例。如果您正苦于以下问题:C++ Pet::GetMapMgr方法的具体用法?C++ Pet::GetMapMgr怎么用?C++ Pet::GetMapMgr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pet
的用法示例。
在下文中一共展示了Pet::GetMapMgr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnLoad
void OnLoad()
{
if (_unit->IsPet())
{
Pet* s = TO< Pet* >(_unit);
Player* owner = s->GetPetOwner();
float owner_bonus = static_cast<float>(owner->GetDamageDoneMod(SCHOOL_SHADOW) * 0.375f); // 37.5%
s->BaseAttackType = SCHOOL_SHADOW; // Melee hits are supposed to do damage with the shadow school
s->SetBaseAttackTime(MELEE, 1500); // Shadowfiend is supposed to do 10 attacks, sometimes it can be 11
s->SetMinDamage(s->GetMinDamage() + owner_bonus);
s->SetMaxDamage(s->GetMaxDamage() + owner_bonus);
s->BaseDamage[0] += owner_bonus;
s->BaseDamage[1] += owner_bonus;
Unit* uTarget = s->GetMapMgr()->GetUnit(owner->GetTargetGUID());
if ((uTarget != NULL) && isAttackable(owner, uTarget))
{
s->GetAIInterface()->AttackReaction(uTarget, 1);
s->GetAIInterface()->setNextTarget(uTarget);
}
}
}