void MoveDown()
        {
            if (!pInstance)
                return;

            bOpFerokFail = false;

            pInstance->SetData(DATA_JEDOGA_TRIGGER_SWITCH, 0);
            me->GetMotionMaster()->MovePoint(1, JedogaPosition[1]);
            me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false);
            me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false);
            me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);

            me->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);

            bOnGround = true;

            if (UpdateVictim())
            {
                AttackStart(me->getVictim());
                me->GetMotionMaster()->MoveChase(me->getVictim());
            }
            else
            {
                if (Unit* pTarget = Unit::GetUnit(*me, pInstance->GetData64(DATA_PL_JEDOGA_TARGET)))
                {
                    AttackStart(pTarget);
                    pInstance->SetData(DATA_JEDOGA_RESET_INITIANDS, 0);
                    if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS)
                        EnterCombat(pTarget);
                }
                else if (!me->isInCombat())
                    EnterEvadeMode();
            }
        }
    void MoveInLineOfSight(Unit* who) override
    {
        if (!me->HasReactState(REACT_PASSIVE))
        {
            ScriptedAI::MoveInLineOfSight(who);
            return;
        }

        if (me->CanStartAttack(who, false) && me->IsWithinDistInMap(who, me->GetAttackDistance(who) + me->m_CombatDistance))
            EnterCombat(who);
    }
        void MoveInLineOfSight(Unit* who) override
        {
            if (!me->HasReactState(REACT_PASSIVE))
            {
                ScriptedAI::MoveInLineOfSight(who);
                return;
            }

            if (me->CanStartAttack(who, false) && me->GetDistance2d(who) <= MINION_AGGRO_DISTANCE)
                EnterCombat(who);
        }
Exemple #4
0
		void SpellHit(Unit* caster, SpellInfo const* spell) { 
			if (spell->Id == ITEM_SPELL) {
				me->RemoveAllAuras();
				DoCast(9096);
				me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
				me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
				me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
				me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
				me->setFaction(7);
				me->AI()->AttackStart(caster);
				EnterCombat(caster);
				Talk(0);
			}
		}
Exemple #5
0
    void MoveInLineOfSight(Unit* who)
    {
        if (IsRunning)
            return;

        if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor (me))
        {
            if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
                return;
            if (who->GetTypeId() != TYPEID_PLAYER)
                return;

            float attackRadius = me->GetAttackDistance(who) / 10;
            if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
                EnterCombat(who);
        }
    }
Exemple #6
0
            void MoveInLineOfSight(Unit* who)
            {
                if (IsRunning)
                    return;

                if (!me->getVictim() && me->canCreatureAttack(who))
                {
                    if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
                        return;
                    if (who->GetTypeId() != TYPEID_PLAYER)
                        return;

                    float attackRadius = me->GetAttackDistance(who)/10;
                    if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
                        EnterCombat(who);
                }
            }
Exemple #7
0
 void OnCharmed(bool apply) override
 {
     ScriptedAI::OnCharmed(apply);
     if (apply)
     {
         if (!me->IsInCombat())
             EnterCombat(nullptr);
         me->StopMoving();
         me->SetReactState(REACT_PASSIVE);
         _charmer = me->GetCharmerGUID();
     }
     else
     {
         me->SetReactState(REACT_AGGRESSIVE);
         if (Unit* charmer = ObjectAccessor::GetUnit(*me, _charmer))
             me->AddThreat(charmer, 100000.0f);
         DoZoneInCombat(nullptr, 250.0f);
     }
 }
Exemple #8
0
        void MoveInLineOfSight(Unit *who)
        {
            if (!who || me->getVictim())
                return;

            if (me->canCreatureAttack(who))
            {
                float attackRadius = me->GetAttackDistance(who);
                if (me->IsWithinDistInMap(who, attackRadius) && me->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && me->IsWithinLOSInMap(who))
                {
                    if (!InCombat)
                    {
                        DoStartNoMovement(who);
                        EnterCombat(who);
                        InCombat = true;
                    }
                }
            }
            else if (IntroStepCounter == 10 && me->IsWithinLOSInMap(who)&& me->IsWithinDistInMap(who, 25) )
            {
                IntroStepCounter = 0;
            }
        }
        void MoveInLineOfSight(Unit *who)
        {
            if (!who || me->getVictim())
                return;

            if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who))
            {

                float attackRadius = me->GetAttackDistance(who);
                if (me->IsWithinDistInMap(who, attackRadius) && me->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && me->IsWithinLOSInMap(who))
                {
                    if (!InCombat)
                    {
                        DoStartNoMovement(who);
                        EnterCombat(who);
                        InCombat = true;
                    }
                }
            }
            else if (IntroStepCounter == 10 && me->IsWithinLOSInMap(who)&& me->IsWithinDistInMap(who, 25) )
            {
                IntroStepCounter = 0;
            }
        }
Exemple #10
0
 void AttackStart(Unit* who)
 {
     EnterCombat(who);
     ScriptedAI::AttackStart(who);
 }