void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell) { switch (pSpell->Id) { case SPELL_SUMMON_MENAGERIE: me->SetHomePosition(968.66f, 1042.53f, 527.32f, 0.077f); LeaveCombat(); me->CastSpell(me, SPELL_EVOCATE); break; case SPELL_SUMMON_MENAGERIE_2: me->SetHomePosition(1164.02f, 1170.85f, 527.321f, 3.66f); LeaveCombat(); me->CastSpell(me, SPELL_EVOCATE); break; case SPELL_SUMMON_MENAGERIE_3: me->SetHomePosition(1118.31f, 1080.377f, 508.361f, 4.25f); LeaveCombat(); me->CastSpell(me, SPELL_EVOCATE); break; case SPELL_TELEPORT: //! Unconfirmed, previous below me->SetDisableGravity(true); //me->AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); // with out it the npc will fall down while is casting canCast = true; break; default: break; } }
void UpdateAI(const uint32 uiDiff) { if(!UpdateVictim()) return; if(YellTime && uiYell_Timer <= uiDiff) { DoScriptText(SAY_AGGRO2, me); YellTime = false; } else uiYell_Timer -= uiDiff; if(HealthBelowPct(20)) { Player* pPlayer = Unit::GetPlayer(*me, (me->getVictim())->GetGUID()); if(pPlayer) { pPlayer->GroupEventHappens(QUEST_RECLUSIVE_RUNEMASTER, me); DoScriptText(SAY_DEFEAT, me); LeaveCombat(); me->DisappearAndDie(); } } DoMeleeAttackIfReady(); }
void SpellHit(Unit* /*pCaster*/, const SpellEntry* pSpell) { switch(pSpell->Id) { case SPELL_SUMMON_MENAGERIE: me->SetHomePosition(968.66f, 1042.53f, 527.32f, 0.077f); LeaveCombat(); break; case SPELL_SUMMON_MENAGERIE_2: me->SetHomePosition(1164.02f, 1170.85f, 527.321f, 3.66f); LeaveCombat(); break; case SPELL_SUMMON_MENAGERIE_3: me->SetHomePosition(1118.31f, 1080.377f, 508.361f, 4.25f); LeaveCombat(); break; case SPELL_TELEPORT: me->AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); // with out it the npc will fall down while is casting bCanCast = true; break; default: break; } }
void SpellHit(Unit* caster, const SpellInfo* spell) { switch( spell->Id ) { case SPELL_SUMMON_MENAGERIE_1: case SPELL_SUMMON_MENAGERIE_2: case SPELL_SUMMON_MENAGERIE_3: { me->DestroyForNearbyPlayers(); uint8 phase = GetPhaseByCurrentPosition(); for( uint8 i=0; i<4; ++i ) me->SummonCreature(summons[phase][i], cords[phase][0] + ((i%2) ? 4.0f : -4.0f), cords[phase][1] + (i<2 ? 4.0f : -4.0f), cords[phase][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000); me->SetHomePosition(cords[phase+1][0], cords[phase+1][1], cords[phase+1][2], cords[phase+1][3]); LeaveCombat(); me->CastSpell(me, SPELL_EVOCATION, true); releaseLockTimer = 1; } break; case SPELL_TELEPORT: me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveIdle(); me->StopMoving(); me->SetControlled(true, UNIT_STATE_ROOT); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetCanFly(true); me->SetDisableGravity(true); me->NearTeleportTo(1103.69f, 1048.76f, 512.279f, 1.16f); Talk(SAY_ARCANE_EXPLOSION); Talk(EMOTE_ARCANE_EXPLOSION); me->CastSpell(me, SPELL_EMPOWERED_ARCANE_EXPLOSION, false); events.RescheduleEvent(EVENT_TELE_BACK, DUNGEON_MODE(9000, 7000)); default: break; } }
void UpdateAI(uint32 diff) { if( releaseLockTimer ) { if( releaseLockTimer >= 5000 ) { lock = false; if (me->IsInCombat()) { LeaveCombat(); me->CastSpell(me, SPELL_EVOCATION, true); } releaseLockTimer = 0; } else releaseLockTimer += diff; } if( !UpdateVictim() ) return; events.Update(diff); if( me->HasUnitState(UNIT_STATE_CASTING) ) return; DoMeleeAttackIfReady(); switch( events.GetEvent() ) { case 0: break; case EVENT_FROSTBOMB: if( Unit* v = me->GetVictim() ) me->CastSpell(v, SPELL_FROSTBOMB, false); events.RepeatEvent(urand(7000,11000)); break; case EVENT_TIME_BOMB: if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true) ) me->CastSpell(target, SPELL_TIME_BOMB, false); events.RepeatEvent(urand(20000, 25000)); break; case EVENT_TELEPORT_TO_CENTER: x = me->GetPositionX(); y = me->GetPositionY(); z = me->GetPositionZ(); me->CastSpell(me, SPELL_TELEPORT, false); events.RepeatEvent(urand(25000,30000)); events.DelayEvents(10000); break; case EVENT_TELE_BACK: me->GetMotionMaster()->MoveIdle(); me->DisableSpline(); me->SetCanFly(false); me->SetDisableGravity(false); me->NearTeleportTo(x, y, z, 0.0f); me->SetControlled(false, UNIT_STATE_ROOT); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->GetMotionMaster()->MoveChase(me->GetVictim()); events.PopEvent(); break; } }