本文整理汇总了C++中AssistPlayerInCombat函数的典型用法代码示例。如果您正苦于以下问题:C++ AssistPlayerInCombat函数的具体用法?C++ AssistPlayerInCombat怎么用?C++ AssistPlayerInCombat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AssistPlayerInCombat函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetScript
void SmartAI::MoveInLineOfSight(Unit* who)
{
if (!who)
return;
GetScript()->OnMoveInLineOfSight(who);
if (me->HasReactState(REACT_PASSIVE) || AssistPlayerInCombat(who))
return;
if (!CanAIAttack(who))
return;
if (!me->canStartAttack(who, false))
return;
if (me->IsHostileTo(who))
{
float fAttackRadius = me->GetAttackDistance(who);
if (me->IsWithinDistInMap(who, fAttackRadius) && me->IsWithinLOSInMap(who))
{
if (!me->getVictim())
{
who->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
AttackStart(who);
}
else/* if (me->GetMap()->IsDungeon())*/
{
who->SetInCombatWith(me);
me->AddThreat(who, 0.0f);
}
}
}
}
示例2: MoveInLineOfSight
void npc_escortAI::MoveInLineOfSight(Unit* pWho)
{
if (pWho->isTargetableForAttack() && pWho->isInAccessablePlaceFor(m_creature))
{
// AssistPlayerInCombat can start attack, so return if true
if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(pWho))
return;
if (!m_creature->CanInitiateAttack())
return;
if (!m_creature->CanFly() && m_creature->GetDistanceZ(pWho) > CREATURE_Z_ATTACK_RANGE)
return;
if (m_creature->IsHostileTo(pWho))
{
float fAttackRadius = m_creature->GetAttackDistance(pWho);
if (m_creature->IsWithinDistInMap(pWho, fAttackRadius) && m_creature->IsWithinLOSInMap(pWho))
{
if (!m_creature->getVictim())
{
pWho->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
AttackStart(pWho);
}
else if (m_creature->GetMap()->IsDungeon())
{
pWho->SetInCombatWith(m_creature);
m_creature->AddThreat(pWho);
}
}
}
}
}
示例3: MoveInLineOfSight
void FollowerAI::MoveInLineOfSight(Unit* pWho)
{
if (m_creature->CanInitiateAttack() && pWho->isTargetableForAttack() && pWho->isInAccessablePlaceFor(m_creature))
{
if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(pWho))
return;
// if (!m_creature->canFly() && m_creature->GetDistanceZ(pWho) > CREATURE_Z_ATTACK_RANGE)
// return;
if (m_creature->IsHostileTo(pWho))
{
float fAttackRadius = m_creature->GetAttackDistance(pWho);
if (m_creature->IsWithinDistInMap(pWho, fAttackRadius) && m_creature->IsWithinLOSInMap(pWho))
{
if (!m_creature->getVictim())
{
pWho->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
AttackStart(pWho);
}
else if (m_creature->GetMap()->IsDungeon())
{
pWho->SetInCombatWith(m_creature);
m_creature->AddThreat(pWho);
}
}
}
}
}
示例4: MoveInLineOfSight
void npc_escortAI::MoveInLineOfSight(Unit* who)
{
if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
{
if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(who))
return;
if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;
if (me->IsHostileTo(who))
{
float fAttackRadius = me->GetAttackDistance(who);
if (me->IsWithinDistInMap(who, fAttackRadius) && me->IsWithinLOSInMap(who))
{
if (!me->getVictim())
{
who->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
AttackStart(who);
}
else if (me->GetMap()->IsDungeon())
{
who->SetInCombatWith(me);
me->AddThreat(who, 0.0f);
}
}
}
}
}
示例5: CheckForHelp
void UnitAI::MoveInLineOfSight(Unit* who)
{
if (!HasReactState(REACT_AGGRESSIVE))
return;
if (!m_unit->CanFly() && m_unit->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;
if (m_unit->getVictim() && !m_unit->GetMap()->IsDungeon())
return;
if (m_unit->IsNeutralToAll())
return;
if (who->GetObjectGuid().IsCreature() && who->isInCombat())
CheckForHelp(who, m_unit, 10.0);
if (m_unit->CanInitiateAttack() && who->isInAccessablePlaceFor(m_unit))
{
if (AssistPlayerInCombat(who))
return;
if (m_unit->CanAttackOnSight(who))
DetectOrAttack(who);
}
}
示例6: MoveInLineOfSight
void FollowerAI::MoveInLineOfSight(Unit* pWho)
{
if (!me->HasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(me))
{
if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(pWho))
return;
if (!me->canFly() && me->GetDistanceZ(pWho) > CREATURE_Z_ATTACK_RANGE)
return;
if (me->IsHostileTo(pWho))
{
float fAttackRadius = me->GetAttackDistance(pWho);
if (me->IsWithinDistInMap(pWho, fAttackRadius) && me->IsWithinLOSInMap(pWho))
{
if (!me->getVictim())
{
pWho->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
AttackStart(pWho);
}
else if (me->GetMap()->IsDungeon())
{
pWho->SetInCombatWith(me);
me->AddThreat(pWho, 0.0f);
}
}
}
}
}
示例7: MoveInLineOfSight
void FollowerAI::MoveInLineOfSight(Unit* who)
{
if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
{
if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(who))
return;
if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;
if (me->IsHostileTo(who))
{
float fAttackRadius = me->GetAttackDistance(who);
if (me->IsWithinDistInMap(who, fAttackRadius) && me->IsWithinLOSInMap(who))
{
if (!me->GetVictim())
{
// Clear distracted state on combat
if (me->HasUnitState(UNIT_STATE_DISTRACTED))
{
me->ClearUnitState(UNIT_STATE_DISTRACTED);
me->GetMotionMaster()->Clear();
}
AttackStart(who);
}
else if (me->GetMap()->IsDungeon())
{
who->SetInCombatWith(me);
me->AddThreat(who, 0.0f);
}
}
}
}
}
示例8: MoveInLineOfSight
void npc_escortAI::MoveInLineOfSight(Unit* pWho)
{
if (!me->hasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlacefor(me))
{
if (!HasEscortState(STATE_ESCORT_ESCORTING)) // Xpearlis: No escort state, so ignore enemy
return;
if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(pWho))
return;
if (!me->CanFly() && me->GetDistanceZ(pWho) > CREATURE_Z_ATTACK_RANGE)
return;
if (me->IsHostileTo(pWho) && IsActiveAttacker)
{
float fAttackRadius = me->GetAttackDistance(pWho);
if (me->IsWithinDistInMap(pWho, fAttackRadius) && me->IsWithinLOSInMap(pWho))
{
if (!me->getVictim())
{
pWho->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH);
AttackStart(pWho);
}
else if (me->GetMap()->IsDungeon())
{
pWho->SetInCombatWith(me);
me->AddThreat(pWho, 0.0f);
}
}
}
}
}
示例9: GetScript
void SmartAI::MoveInLineOfSight(Unit* who)
{
if (!who)
return;
GetScript()->OnMoveInLineOfSight(who);
if (AssistPlayerInCombat(who))
return;
CreatureAI::MoveInLineOfSight(who);
}
示例10: MoveInLineOfSight
void FollowerAI::MoveInLineOfSight(Unit* who)
{
if (me->GetVictim())
return;
if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack(true, me) && who->isInAccessiblePlaceFor(me))
if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(who))
return;
if (me->CanStartAttack(who))
AttackStart(who);
}
示例11: GetScript
void SmartAI::MoveInLineOfSight(Unit* who)
{
if (!who)
return;
GetScript()->OnMoveInLineOfSight(who);
if (me->GetVictim())
return;
if (me->HasReactState(REACT_PASSIVE) || AssistPlayerInCombat(who))
return;
if (me->CanStartAttack(who))
AttackStart(who);
}
示例12: GetScript
void SmartAI::MoveInLineOfSight(Unit* who)
{
if (!who)
return;
GetScript()->OnMoveInLineOfSight(who);
if (me->HasReactState(REACT_PASSIVE) || AssistPlayerInCombat(who))
return;
if (!CanAIAttack(who))
return;
if (!me->CanStartAttack(who, false))
return;
if (me->IsHostileTo(who))
{
float fAttackRadius = me->GetAttackDistance(who);
if (me->IsWithinDistInMap(who, fAttackRadius) && me->IsWithinLOSInMap(who))
{
if (!me->GetVictim())
{
// Clear distracted state on combat
if (me->HasUnitState(UNIT_STATE_DISTRACTED))
{
me->ClearUnitState(UNIT_STATE_DISTRACTED);
me->GetMotionMaster()->Clear();
}
AttackStart(who);
}
else/* if (me->GetMap()->IsDungeon())*/
{
who->SetInCombatWith(me);
me->AddThreat(who, 0.0f);
}
}
}
}