本文整理匯總了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);
}
}
}
}