void AttackStart(Unit* pWho) override { if (m_creature->Attack(pWho, true)) { m_creature->AddThreat(pWho); m_creature->SetInCombatWith(pWho); pWho->SetInCombatWith(m_creature); HandleMovementOnAttackStart(pWho); } }
/** * This function sets the TargetGuid for the creature if required * Also it will handle the combat movement (chase movement), depending on SetCombatMovement(bool) */ void ScriptedAI::AttackStart(Unit* pWho) { if (pWho && m_creature->Attack(pWho, true)) // The Attack function also uses basic checks if pWho can be attacked { m_creature->AddThreat(pWho); m_creature->SetInCombatWith(pWho); pWho->SetInCombatWith(m_creature); HandleMovementOnAttackStart(pWho); } }
void UnitAI::AttackStart(Unit* who) { if (!who || HasReactState(REACT_PASSIVE)) return; if (m_unit->Attack(who, m_meleeEnabled)) { m_unit->AddThreat(who); m_unit->SetInCombatWith(who); who->SetInCombatWith(m_unit); HandleMovementOnAttackStart(who); } }
void PetAI::AttackStart(Unit* u) { if (!u || (m_creature->IsPet() && ((Pet*)m_creature)->getPetType() == MINI_PET)) return; if (m_creature->Attack(u, true)) { // TMGs call CreatureRelocation which via MoveInLineOfSight can call this function // thus with the following clear the original TMG gets invalidated and crash, doh // hope it doesn't start to leak memory without this :-/ // i_pet->Clear(); HandleMovementOnAttackStart(u); inCombat = true; } }
void GuardAI::AttackStart(Unit* u) { if (!u) return; if (m_creature->Attack(u, true)) { i_victimGuid = u->GetObjectGuid(); m_creature->AddThreat(u); m_creature->SetInCombatWith(u); u->SetInCombatWith(m_creature); HandleMovementOnAttackStart(u); } }
/** * This function sets the TargetGuid for the creature if required * Also it will handle the combat movement (chase movement), depending on SetCombatMovement(bool) */ void ScriptedAI::AttackStart(Unit* pWho) { #if defined (WOTLK) if (!m_creature->CanAttackByItself()) return; #endif if (pWho && m_creature->Attack(pWho, true)) // The Attack function also uses basic checks if pWho can be attacked { m_creature->AddThreat(pWho); m_creature->SetInCombatWith(pWho); pWho->SetInCombatWith(m_creature); HandleMovementOnAttackStart(pWho); } }
void AggressorAI::AttackStart(Unit* u) { if (!u || !m_creature->CanAttackByItself()) return; if (m_creature->Attack(u, true)) { i_victimGuid = u->GetObjectGuid(); m_creature->AddThreat(u); m_creature->SetInCombatWith(u); u->SetInCombatWith(m_creature); HandleMovementOnAttackStart(u); } }
void ReactorAI::AttackStart(Unit *p) { if(!p) return; if(m_creature->Attack(p,true)) { DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Tag unit GUID: %u (TypeId: %u) as a victim", p->GetGUIDLow(), p->GetTypeId()); i_victimGuid = p->GetObjectGuid(); m_creature->AddThreat(p); m_creature->SetInCombatWith(p); p->SetInCombatWith(m_creature); HandleMovementOnAttackStart(p); } }
void PetAI::AttackStart(Unit* u) { Pet* pet = (m_unit->GetTypeId() == TYPEID_UNIT && static_cast<Creature*>(m_unit)->IsPet()) ? static_cast<Pet*>(m_unit) : nullptr; if (!u || (pet && pet->GetModeFlags() & PET_MODE_DISABLE_ACTIONS)) return; if (m_unit->Attack(u, true)) { // TMGs call CreatureRelocation which via MoveInLineOfSight can call this function // thus with the following clear the original TMG gets invalidated and crash, doh // hope it doesn't start to leak memory without this :-/ // i_pet->Clear(); HandleMovementOnAttackStart(u); inCombat = true; } }
void CreatureAI::AttackStart(Unit* who) { if (!who || HasReactState(REACT_PASSIVE)) return; if (m_creature->Attack(who, m_meleeEnabled)) { m_creature->AddThreat(who); m_creature->SetInCombatWith(who); who->SetInCombatWith(m_unit); // Cast "Spawn Guard" to help Civilian if (m_creature->IsCivilian()) m_creature->CastSpell(m_creature, 43783, TRIGGERED_OLD_TRIGGERED); HandleMovementOnAttackStart(who); } }