void MovementInform(uint32 uiMoveType, uint32 uiPointId) override { if (uiMoveType != POINT_MOTION_TYPE) return; switch (uiPointId) { // Prepare for combat case POINT_ID_PREPARE: m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->RemoveAurasDueToSpell(SPELL_LIGHTNING_VISUAL); m_creature->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL); m_creature->SetLevitate(false); break; // Prepare for sacrifice lift off case POINT_ID_SACRIFICE: DoCastSpellIfCan(m_creature, SPELL_HOVER_FALL); m_creature->SetLevitate(true); m_creature->GetMotionMaster()->MovePoint(POINT_ID_LEVITATE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ() + 10.0f); break; // Call a volunteer to sacrifice case POINT_ID_LEVITATE: if (Creature* pVolunteer = m_creature->GetMap()->GetCreature(SelectRandomVolunteer())) { DoScriptText(urand(0, 1) ? SAY_CALL_SACRIFICE1 : SAY_CALL_SACRIFICE2, m_creature); DoScriptText(SAY_VOLUNTEER_CHOOSEN, pVolunteer); pVolunteer->RemoveAurasDueToSpell(SPELL_VOLUNTEER_SPHERE); pVolunteer->SetStandState(UNIT_STAND_STATE_STAND); pVolunteer->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pVolunteer->CastSpell(pVolunteer, SPELL_PILLAR_LIGHTNING, false); pVolunteer->SetWalk(true); pVolunteer->GetMotionMaster()->MovePoint(POINT_ID_SACRIFICE, aJedogaLandingLoc[0], aJedogaLandingLoc[1], aJedogaLandingLoc[2]); } // Set visual aura if (m_pInstance) { if (Creature* pTemp = m_creature->GetMap()->GetCreature(m_pInstance->SelectJedogaSacrificeControllerGuid())) pTemp->CastSpell(pTemp, SPELL_SACRIFICE_VISUAL, false); } break; // Resume combat case POINT_ID_COMBAT: m_creature->RemoveAurasDueToSpell(SPELL_HOVER_FALL); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_bIsSacrificing = false; SetCombatMovement(true); m_creature->SetLevitate(false); if (m_creature->getVictim()) m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); break; } }
void SummonedCreatureJustDied(Creature* pSummoned) override { if (pSummoned->GetEntry() == NPC_TWILIGHT_VOLUNTEER) { m_lVolunteerGuidList.remove(pSummoned->GetObjectGuid()); if (m_pInstance) { if (Creature* pTemp = m_creature->GetMap()->GetCreature(m_pInstance->SelectJedogaSacrificeControllerGuid())) pTemp->RemoveAurasDueToSpell(SPELL_SACRIFICE_VISUAL); } m_creature->GetMotionMaster()->MovePoint(POINT_ID_COMBAT, aJedogaLandingLoc[0], aJedogaLandingLoc[1], aJedogaLandingLoc[2]); } }