void Reset() override { // Remove immunity m_creature->ApplySpellImmune(nullptr, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ALL, false); m_uiPhase = PHASE_SPEECH; m_uiSpeech = 1; m_uiTraineeTimer = 24 * IN_MILLISECONDS; m_uiDeathKnightTimer = 74 * IN_MILLISECONDS; m_uiRiderTimer = 134 * IN_MILLISECONDS; m_uiTeleportTimer = urand(30000, 45000); // Teleport every 30-45 seconds. m_uiShadowboltTimer = 2 * IN_MILLISECONDS; m_uiHarvestSoulTimer = 2500; m_uiPhaseTimer = 3 * MINUTE * IN_MILLISECONDS + 44 * IN_MILLISECONDS; // last summon at 3:44 - Teleport down at 4:34 m_uiControlZoneTimer = urand(120 * IN_MILLISECONDS, 150 * IN_MILLISECONDS); m_uiSpeechTimer = 1 * IN_MILLISECONDS; // Despawn Adds for (GuidList::const_iterator itr = m_lSummonedAddGuids.begin(); itr != m_lSummonedAddGuids.end(); ++itr) { if (Creature* pCreature = m_creature->GetMap()->GetCreature(*itr)) pCreature->ForcedDespawn(); } m_lSummonedAddGuids.clear(); m_lTraineeSummonPosGuids.clear(); m_lDeathKnightSummonPosGuids.clear(); m_lRiderSummonPosGuids.clear(); }
void Reset() override { if (!HasEscortState(STATE_ESCORT_ESCORTING)) { uiTimer = 0; uiPhase = 0; RestoreAll(); SummonList.clear(); GoSummonList.clear(); } }
void SpellHit(Unit* /*pCaster*/, const SpellEntry* pSpell) override { // start runic smash event if (pSpell->Id == SPELL_RUNIC_SMASH_L && m_pInstance) { m_lCurrentSmashBunnies.clear(); m_pInstance->GetSmashTargetsGuids(m_lCurrentSmashBunnies, true); m_bSmashActive = true; } else if (pSpell->Id == SPELL_RUNIC_SMASH_R && m_pInstance) { m_lCurrentSmashBunnies.clear(); m_pInstance->GetSmashTargetsGuids(m_lCurrentSmashBunnies, false); m_bSmashActive = true; } }
void Reset() override { // Remove immunity m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ALL, false); m_uiPhase = PHASE_SPEECH; m_uiSpeech = 1; m_uiTraineeTimer = 24 * IN_MILLISECONDS; m_uiDeathKnightTimer = 74 * IN_MILLISECONDS; m_uiRiderTimer = 134 * IN_MILLISECONDS; m_uiTeleportTimer = 20 * IN_MILLISECONDS; m_uiShadowboltTimer = 2 * IN_MILLISECONDS; m_uiHarvestSoulTimer = 2500; m_uiPhaseTimer = 4 * MINUTE * IN_MILLISECONDS + 7 * IN_MILLISECONDS; // last summon at 4:04, next would be 4:09 m_uiControlZoneTimer = urand(120 * IN_MILLISECONDS, 150 * IN_MILLISECONDS); m_uiSpeechTimer = 1 * IN_MILLISECONDS; // Despawn Adds for (GuidList::const_iterator itr = m_lSummonedAddGuids.begin(); itr != m_lSummonedAddGuids.end(); itr++) { if (Creature* pCreature = m_creature->GetMap()->GetCreature(*itr)) pCreature->ForcedDespawn(); } m_lSummonedAddGuids.clear(); }
void JustDied(Unit* /*pKiller*/) override { if (m_pInstance) m_pInstance->SetData(TYPE_THERMAPLUGG, DONE); m_lSummonedBombGUIDs.clear(); }
void Reset() override { m_uiCrowdSpeechTimer = 0; m_bEventInit = false; m_bEventInProgress = false; m_lCrowdGuidList.clear(); }
void Reset() override { m_bIsEnrage = false; m_bSaidOver25 = false; m_bSaidOver75 = false; m_bIsHealed = false; m_uiEnrageTimer = 7 * MINUTE * IN_MILLISECONDS; m_uiHealthCheckTimer = 30000; // no need to check in the beginning of the fight m_uiOutroTimer = 4000; m_uiSummonPortalsTimer = 30000; m_uiSummonSuppresserTimer = 60000; m_uiSummonAbominationTimer = 30000; m_uiSummonZombieTimer = 35000; m_uiSummonSkeletonTimer = 45000; m_uiSummonArchmageTimer = 40000; m_uiSummonSuppresserCounter = 0; m_uiSummonSkeletonCounter = 0; m_lSummonedAddsGuids.clear(); m_creature->SetHealth(m_creature->GetMaxHealth() / 2.0f); m_fHP = 50.0f; }
void Reset() override { Initialize(); DespawnGolem(); m_lGolemGUIDList.clear(); instance->SetBossState(DATA_VOLKHAN, NOT_STARTED); }
void Reset() override { m_uiKnockAwayTimer = urand(17000, 20000); m_uiActivateBombTimer = urand(10000, 15000); m_bIsPhaseTwo = false; m_asBombFaces = nullptr; memset(&m_afSpawnPos, 0, sizeof(m_afSpawnPos)); m_lLandedBombGUIDs.clear(); }
// Wrapper to kill the eye tentacles before summoning new ones void DoDespawnEyeTentacles() { for (GuidList::const_iterator itr = m_lEyeTentaclesList.begin(); itr != m_lEyeTentaclesList.end(); ++itr) { if (Creature* pTemp = m_creature->GetMap()->GetCreature(*itr)) pTemp->DealDamage(pTemp, pTemp->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, nullptr, false); } m_lEyeTentaclesList.clear(); }
void Reset() override { Initialize(); intenseColdList.clear(); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); RemovePrison(CheckContainmentSpheres()); instance->SetData(DATA_KERISTRASZA_EVENT, NOT_STARTED); }
void Reset() override { Initialize(); instance->HandleGameObject(instance->GetGuidData(DATA_GO_KADDRAK), false); instance->HandleGameObject(instance->GetGuidData(DATA_GO_MARNAK), false); instance->HandleGameObject(instance->GetGuidData(DATA_GO_ABEDNEUM), false); instance->HandleGameObject(instance->GetGuidData(DATA_GO_SKY_FLOOR), false); KaddrakGUIDList.clear(); }
// Unsummon Majordomo adds void UnsummonMajordomoAdds() { for (GuidList::const_iterator itr = m_luiMajordomoAddsGUIDs.begin(); itr != m_luiMajordomoAddsGUIDs.end(); ++itr) { if (Creature* pAdd = m_creature->GetMap()->GetCreature(*itr)) if (pAdd->IsTemporarySummon()) ((TemporarySpawn*)pAdd)->UnSummon(); } m_luiMajordomoAddsGUIDs.clear(); }
void DespawnDwarf() { if (lDwarfGUIDList.empty()) return; for (GuidList::const_iterator itr = lDwarfGUIDList.begin(); itr != lDwarfGUIDList.end(); ++itr) { Creature* temp = ObjectAccessor::GetCreature(*me, instance ? (*itr) : ObjectGuid::Empty); if (temp && temp->IsAlive()) temp->DespawnOrUnsummon(); } lDwarfGUIDList.clear(); }
void Reset() override { m_bDidAggroText = false; // Used for 'defend' text, is triggered when the npc is attacked if (!HasEscortState(STATE_ESCORT_ESCORTING)) { m_uiPhase = 0; m_uiPhaseTimer = 0; m_bSouthernCaveInOpened = m_bNorthernCaveInOpened = false; m_luiSummonedMobGUIDs.clear(); } }
void DespawnAdds(GuidList& List) { if (!List.empty()) { for (GuidList::iterator itr = List.begin(); itr != List.end(); ++itr) { if (Creature* pSummon = m_creature->GetMap()->GetCreature(*itr)) pSummon->ForcedDespawn(); } List.clear(); } }
void Reset() override { if (!HasEscortState(STATE_ESCORT_ESCORTING)) { m_uiKilledCreatures = 0; m_bIsFirstSearScale = true; m_lSearscaleGuidList.clear(); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } }
void Reset() override { m_uiEventTimer = 0; m_uiSadEndTimer = 0; m_uiPhase = 0; m_uiCurrentWave = 0; m_uiKillCounter = 0; m_uiSaveCounter = 0; m_playerGuid.Clear(); m_lSummonedGuidList.clear(); m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); }
void DespawnSpark() { for (GuidList::const_iterator itr = m_lSparkGUIDList.begin(); itr != m_lSparkGUIDList.end(); ++itr) { if (Creature* pTemp = m_creature->GetMap()->GetCreature(*itr)) { if (pTemp->IsAlive()) pTemp->ForcedDespawn(); } } m_lSparkGUIDList.clear(); }
void JustReachedHome() override { if (m_pInstance) m_pInstance->SetData(TYPE_THERMAPLUGG, FAIL); // Remove remaining bombs for (GuidList::const_iterator itr = m_lSummonedBombGUIDs.begin(); itr != m_lSummonedBombGUIDs.end(); ++itr) { if (Creature* pBomb = m_creature->GetMap()->GetCreature(*itr)) pBomb->ForcedDespawn(); } m_lSummonedBombGUIDs.clear(); }
void Reset() override { m_uiThundershockTimer = 40000; m_uiCycloneStrikeTimer = 15000; m_uiLightningBoltTimer = 7000; m_uiVisualTimer = 5000; m_bSacrifice = false; m_bIsSacrificing = false; m_lVolunteerGuidList.clear(); SetCombatMovement(true); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); }
void DespawnGolem() { if (m_lGolemGUIDList.empty()) return; for (ObjectGuid guid : m_lGolemGUIDList) { if (Creature* temp = ObjectAccessor::GetCreature(*me, guid)) if (temp->IsAlive()) temp->DespawnOrUnsummon(); } m_lGolemGUIDList.clear(); }
void Reset() override { SetCombatMovement(false); m_uiPhase = 0; m_uiDestructivePoisonTimer = 15000; m_uiLightningBoltTimer = 10000; m_uiSummonPackTimer = 5000; m_uiSummonDefenderTimer = 10000; m_uiSummonSorcererTimer = 10000; m_uiChannelersDead = 0; m_bHasYelledOnce = false; m_lBrokenGUIDList.clear(); m_lSorcerersGUIDList.clear(); DoCastSpellIfCan(m_creature, SPELL_STEALTH); m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); }
void JustDied(Unit* /*pKiller*/) override { DoScriptText(aTexts[3][m_uiFace], m_creature); if (m_pInstance) m_pInstance->SetData(TYPE_DEVOURER_OF_SOULS, DONE); for (GuidList::const_iterator itr = m_lWellGuids.begin(); itr != m_lWellGuids.end(); ++itr) { if (Creature* pWell = m_creature->GetMap()->GetCreature(*itr)) pWell->ForcedDespawn(); } m_lWellGuids.clear(); }
void Reset() override { m_uiMortalWoundTimer = urand(4000, 8000); m_uiSummonWorm1Timer = urand(22500, 30000); m_uiSummonWorm2Timer = 0; m_uiSummonWorm3Timer = 0; m_uiEntangle1Timer = urand(10000, 15000); m_uiEntangle2Timer = 0; m_uiEntangle3Timer = 0; m_uiEntangleSummonTimer = 0; m_uiEntangleAttackTimer = 0; m_uiEvadeCheckTimer = 2500; m_lHatchlingsGUIDs.clear(); }
void Reset() override { m_playerGuid.Clear(); m_uiSummonPatientTimer = 10000; m_uiSummonPatientCount = 0; m_uiPatientDiedCount = 0; m_uiPatientSavedCount = 0; m_lPatientGuids.clear(); m_vPatientSummonCoordinates.clear(); m_bIsEventInProgress = false; m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); }
void JustReachedHome() override { if (m_pInstance) { m_pInstance->SetData(NPC_DEVOURER_OF_SOULS, FAIL); // If we previously failed, set such that possible to try again m_pInstance->SetData(TYPE_ACHIEV_PHANTOM_BLAST, IN_PROGRESS); } for (GuidList::const_iterator itr = m_lWellGuids.begin(); itr != m_lWellGuids.end(); ++itr) { if (Creature* pWell = m_creature->GetMap()->GetCreature(*itr)) pWell->ForcedDespawn(); } m_lWellGuids.clear(); }
void JustDied(Unit* /*pKiller*/) override { DoScriptText(SAY_DEATH, m_creature); if (m_pInstance) { m_pInstance->SetData(TYPE_TRIBUNAL, FAIL); // Continue at right state after respawn if (m_bHasContinued) m_pInstance->SetData(TYPE_TRIBUNAL, IN_PROGRESS); } for (GuidList::const_iterator itr = m_luiDwarfGUIDs.begin(); itr != m_luiDwarfGUIDs.end(); ++itr) { if (Creature* pDwarf = m_creature->GetMap()->GetCreature(*itr)) pDwarf->ForcedDespawn(); } m_luiDwarfGUIDs.clear(); }
void DamageTaken(Unit* pDealer, uint32& uiDamage, DamageEffectType /*damagetype*/) override { // apply missing aura: 50% damage reduction; uiDamage = uiDamage * 0.5f; if (m_uiPhase != PHASE_FROZEN) return; ++m_uiHitCount; // only count melee attacks if (pDealer->hasUnitState(UNIT_STAT_MELEE_ATTACKING) && m_uiHitCount >= HITCOUNT_EXPLODE) { if (m_creature->GetHealthPercent() <= 5.0f) { if (DoCastSpellIfCan(m_creature, SPELL_VISCIDUS_SUICIDE, CAST_TRIGGERED) == CAST_OK) m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); } else if (DoCastSpellIfCan(m_creature, SPELL_VISCIDUS_EXPLODE, CAST_TRIGGERED | CAST_INTERRUPT_PREVIOUS) == CAST_OK) { DoScriptText(EMOTE_EXPLODE, m_creature); m_uiPhase = PHASE_EXPLODED; m_uiHitCount = 0; m_lGlobesGuidList.clear(); uint32 uiGlobeCount = m_creature->GetHealthPercent() / 5.0f; for (uint8 i = 0; i < uiGlobeCount; ++i) DoCastSpellIfCan(m_creature, auiGlobSummonSpells[i], CAST_TRIGGERED); m_creature->RemoveAurasDueToSpell(SPELL_VISCIDUS_FREEZE); m_uiExplodeDelayTimer = 2000; SetCombatMovement(false); m_creature->GetMotionMaster()->MoveIdle(); m_creature->SetStandState(UNIT_STAND_STATE_DEAD); } } else if (m_uiHitCount == HITCOUNT_SHATTER) DoScriptText(EMOTE_SHATTER, m_creature); else if (m_uiHitCount == HITCOUNT_CRACK) DoScriptText(EMOTE_CRACK, m_creature); }
// Function to respawn GOs void DoRespawnObjects(uint32 uiEntry, float fRange) { GameObjectList lBarrelsInRange; m_lExplosivesGuidsList.clear(); GetGameObjectListWithEntryInGrid(lBarrelsInRange, m_creature, uiEntry, fRange); if (lBarrelsInRange.empty()) { script_error_log("Bloodmyst Isle: ERROR Failed to find any gameobjects of entry %u in range.", uiEntry); return; } // respawn explosives and store for future use for (GameObjectList::const_iterator itr = lBarrelsInRange.begin(); itr != lBarrelsInRange.end(); ++itr) { (*itr)->SetRespawnTime(5 * MINUTE); (*itr)->Refresh(); m_lExplosivesGuidsList.push_back((*itr)->GetObjectGuid()); } }