bool GossipHello_go_ulduar_teleporter(Player *pPlayer, GameObject* pGo) { ScriptedInstance *pInstance = (ScriptedInstance *) pGo->GetInstanceData(); if (!pInstance || !pPlayer) return false; if (pPlayer->isInCombat()) return true; for(uint8 i = 0; i < PORTALS_COUNT; i++) { if ((PortalLoc[i].active == true && (PortalLoc[i].state == true || pInstance->GetData(PortalLoc[i].encounter) == DONE || pInstance->GetData(PortalLoc[i].encounter) == IN_PROGRESS)) || pPlayer->isGameMaster()) pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_TAXI, PortalLoc[i].textNum, GOSSIP_SENDER_MAIN, i); }; pPlayer->SEND_GOSSIP_MENU(TELEPORT_GOSSIP_MESSAGE, pGo->GetObjectGuid()); return true; }
bool GOUse_go_sapphiron_birth(Player* pPlayer, GameObject* pGo) { ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData(); if (!pInstance) return true; if (pInstance->GetData(TYPE_SAPPHIRON) != NOT_STARTED) return true; // If already summoned return (safety check) if (pInstance->GetSingleCreatureFromStorage(NPC_SAPPHIRON, true)) return true; // Set data to special and allow the Go animation to proceed pInstance->SetData(TYPE_SAPPHIRON, SPECIAL); return false; }
void MoveInLineOfSight(Unit* pWho) override { if (!m_pInstance) return; if (m_pInstance->GetData(TYPE_ASHBRINGER_EVENT) == IN_PROGRESS) { if (pWho->GetTypeId() == TYPEID_PLAYER) { Player* player = static_cast<Player*>(pWho); if (player->HasItemOrGemWithIdEquipped(ITEM_CORRUPTED_ASHBRINGER, 1) && m_creature->IsWithinDist(player, 20.0f)) { player->GetMap()->ScriptsStart(sRelayScripts, ASHBRINGER_RELAY_SCRIPT_ID, m_creature, player); m_pInstance->SetData(TYPE_ASHBRINGER_EVENT, DONE); } } } }
void UpdateAI(const uint32 diff) { if(!pInstance || !(pInstance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS)) { m_creature->SetVisibility(VISIBILITY_OFF); m_creature->setDeathState(JUST_DIED); return; } if(!isHatching) { if(WaitTimer) { m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->MovePoint(0,hatcherway[side][waypoint][0],hatcherway[side][waypoint][1],hatcherway[side][waypoint][2]); waypoint++; WaitTimer = 0; } } else { if(WaitTimer < diff) { if(HatchEggs(HatchNum)) { HatchNum++; WaitTimer = 10000; } else if(!hasChangedSide) { side = side ? 0 : 1; isHatching = false; waypoint = 3; WaitTimer = 1; hasChangedSide = true; } else { m_creature->SetVisibility(VISIBILITY_OFF); m_creature->setDeathState(JUST_DIED); } }else WaitTimer -= diff; } }
void UpdateAI(const uint32 uiDiff) { if (!UpdateVictim()) return; if (m_bHasDied && !m_bHeal && m_pInstance && m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) { //On ressurection, stop fake death and heal whitemane and resume fight if (Unit* Whitemane = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_WHITEMANE))) { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetStandState(UNIT_STAND_STATE_STAND); DoCast(Whitemane, SPELL_LAYONHANDS); m_uiCrusaderStrike_Timer = 10000; m_uiHammerOfJustice_Timer = 10000; if (me->getVictim()) me->GetMotionMaster()->MoveChase(me->getVictim()); m_bHeal = true; } } //This if-check to make sure mograine does not attack while fake death if (m_bFakeDeath) return; //m_uiCrusaderStrike_Timer if (m_uiCrusaderStrike_Timer <= uiDiff) { DoCast(me->getVictim(), SPELL_CRUSADERSTRIKE); m_uiCrusaderStrike_Timer = 10000; } else m_uiCrusaderStrike_Timer -= uiDiff; //m_uiHammerOfJustice_Timer if (m_uiHammerOfJustice_Timer <= uiDiff) { DoCast(me->getVictim(), SPELL_HAMMEROFJUSTICE); m_uiHammerOfJustice_Timer = 60000; } else m_uiHammerOfJustice_Timer -= uiDiff; DoMeleeAttackIfReady(); }
void Reset() { ShadowVolley_Timer = 10000; Immolate_Timer = 18000; CurseOfWeakness_Timer = 5000; DemonArmor_Timer = 16000; Voidwalkers = false; me->setFaction(FACTION_FRIEND); // was set before event start, so set again me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); if (pInstance) if (pInstance->GetData(DATA_GHOSTKILL) >= 7) me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); else me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); }
void EnterCombat(Unit* /*who*/) { if (pInstance) { if (pInstance->GetData64(DATA_NETHEKURSE)) { Creature *pKurse = Unit::GetCreature(*me,pInstance->GetData64(DATA_NETHEKURSE)); if (pKurse && me->IsWithinDist(pKurse, 45.0f)) { CAST_AI(boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonAggro(); if (pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS) return; else pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS); } } } }
void Reset() { SpellCorrupt_Timer = 0; Check_Timer = 0; Life75 = true; Life50 = true; Life25 = true; if (!m_pInstance) return; if (m_pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) m_creature->CastSpell(m_creature,SPELL_CHANNEL,true); else if (m_creature->HasAura(SPELL_CHANNEL, EFFECT_INDEX_0)) m_creature->RemoveAurasDueToSpell(SPELL_CHANNEL); m_creature->CastSpell(m_creature,SPELL_PORTAL_RUNE,true); }
void Reset() { EventCheck_Timer = 5000; Banish_Timer = 0; CorrosiveAcid_Timer = 25000; Fear_Timer = 40000; Enrage_Timer = 180000; IsBanished = false; Intro = false; if (pInstance) { if (pInstance->GetData(TYPE_HELLMAW) == NOT_STARTED) { DoCast(me, SPELL_BANISH); IsBanished = true; } } }
void Reset() override { uiCrystalChainTimer = 30000; uiTailSweepTimer = urand(5000, 7500); uiCrystalfireBreathTimer = urand(10000, 20000); uiCrystallizeTimer = urand(20000, 30000); uiCheckIntenseColdTimer = 2000; m_bIsEnraged = false; if (!m_pInstance) return; if (m_creature->IsAlive()) { if (m_pInstance->GetData(TYPE_KERISTRASZA) != SPECIAL) DoCastSpellIfCan(m_creature, SPELL_FROZEN_PRISON, CAST_TRIGGERED); } }
void DoAction(const int32 actionId) { switch(actionId) { case ACTION_OUTRO: { Position pos; if (Creature* pIck = GetIck()) { // TODO: tele on Ick then run some distance. pIck->GetNearPosition(pos, 5.0f, 3.14); me->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), 0.0f); } me->SetVisibility(VISIBILITY_ON); Creature* pJainaOrSylvanas = me->GetCreature(*me, pInstance->GetData64(DATA_JAINA_SYLVANAS_1)); if (pJainaOrSylvanas) { Position pos; me->GetNearPosition(pos, 5.0f, 0); pJainaOrSylvanas->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetAngle(me->GetPositionX(), me->GetPositionY())); } else { if (pInstance->GetData(DATA_TEAM_IN_INSTANCE) == TEAM_ALLIANCE) pJainaOrSylvanas = me->SummonCreature(NPC_SYLVANAS_PART1, *me, TEMPSUMMON_MANUAL_DESPAWN); else pJainaOrSylvanas = me->SummonCreature(NPC_JAINA_PART1, *me, TEMPSUMMON_MANUAL_DESPAWN); } if (pJainaOrSylvanas) { pJainaOrSylvanas->SetOrientation(pJainaOrSylvanas->GetAngle(me->GetPositionX(), me->GetPositionY())); me->SetOrientation(me->GetAngle(pJainaOrSylvanas->GetPositionX(), pJainaOrSylvanas->GetPositionY())); uiNpcOutroDialog = pJainaOrSylvanas->GetGUID(); } phase = PHASE_OUTRO; events.Reset(); events.ScheduleEvent(EVENT_OUTRO_1, 1000); break; } } }
void UpdateAI(const uint32 uiDiff) { if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; if (m_uiLevelUp_Timer < uiDiff) { if (m_pInstance && m_pInstance->GetData(TYPE_MARLI) != DONE) { DoCastSpellIfCan(m_creature,SPELL_LEVELUP); m_creature->SetLevel(m_creature->getLevel() + 1); } m_uiLevelUp_Timer = 3000; } else m_uiLevelUp_Timer -= uiDiff; DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!instance || !(instance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS)) { me->DisappearAndDie(); return; } if (!UpdateVictim()) return; if (BuffetTimer <= diff) { DoCast(me->getVictim(), SPELL_FLAMEBUFFET, false); BuffetTimer = 10000; } else BuffetTimer -= diff; DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { ScriptedInstance* pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); if (pInstance->GetData(TYPE_ALTAR_EVENT)==IN_PROGRESS) { if ( feuerwache_glutseher_timer < diff) { m_creature->MonsterYell("Gut so, lasst mich frei!",LANG_UNIVERSAL,0); m_creature->setFaction(754); Player* pe; if (pe=pInstance->instance->GetPlayer(pInstance->GetData64(DATA_PLAYER))) m_creature->AI()->AttackStart(pe); }feuerwache_glutseher_timer -= diff; } else { m_creature->setFaction(734); return; } if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) { return; } if (FeuerNova_Timer < diff) { DoCastSpellIfCan(m_creature->getVictim(),SPELL_FEUERNOVA); FeuerNova_Timer = 6000; } else FeuerNova_Timer -= diff; if (FlameBuffet_Timer < diff) { DoCastSpellIfCan(m_creature->getVictim(),SPELL_FLAMEBUFFET); FlameBuffet_Timer = 12500; } else FlameBuffet_Timer -= diff; DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { //Return since we have no target if (!UpdateVictim()) return; //Cleave_Timer if (Cleave_Timer <= diff) { DoCast(me->getVictim(), SPELL_CLEAVE); Cleave_Timer = 5000 + rand()%7000; } else Cleave_Timer -= diff; //ToxicVolley_Timer if (ToxicVolley_Timer <= diff) { DoCast(me->getVictim(), SPELL_TOXIC_VOLLEY); ToxicVolley_Timer = 10000 + rand()%5000; } else ToxicVolley_Timer -= diff; if (me->GetHealth() <= me->GetMaxHealth() * 0.05 && !Death) { DoCast(me->getVictim(), SPELL_POISON_CLOUD); Death = true; } if (!VemDead) { //Checking if Vem is dead. If yes we will enrage. if (Check_Timer <= diff) { if (pInstance && pInstance->GetData(DATA_VEMISDEAD)) { DoCast(me, SPELL_ENRAGE); VemDead = true; } Check_Timer = 2000; } else Check_Timer -=diff; } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { //Check_Timer if (Check_Timer <= diff) { if (pInstance) { if (pInstance->GetData(DATA_NETHERMANCER_EVENT) != IN_PROGRESS) { //remove me->setDeathState(JUST_DIED); me->RemoveCorpse(); } } Check_Timer = 1000; } else Check_Timer -= diff; if (!UpdateVictim()) return; if (!onlyonce) { if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) me->GetMotionMaster()->MoveChase(pTarget); onlyonce = true; } if (inferno_Timer <= diff) { DoCast(me->getVictim(),HeroicMode ? H_SPELL_INFERNO : SPELL_INFERNO); me->TauntApply(me->getVictim()); inferno_Timer = 10000; } else inferno_Timer -= diff; if (flame_timer <= diff) { DoCast(me,SPELL_FIRE_TAIL); flame_timer = 500; } else flame_timer -=diff; DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 diff) { if (!m_pInstance) return; //Bomb_Timer if (Bomb_Timer < diff) Bomb_Timer = 0; else Bomb_Timer -= diff; switch (m_pInstance->GetData(TYPE_JEKLIK)) { case IN_PROGRESS: DoAttack(); break; default: m_creature->AddObjectToRemoveList(); break; } }
void UpdateAI(const uint32 diff) { if(!pInstance || !(pInstance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS)) { m_creature->SetVisibility(VISIBILITY_OFF); m_creature->setDeathState(JUST_DIED); return; } if(!UpdateVictim()) return; if(BuffetTimer < diff) { m_creature->CastSpell(m_creature->getVictim(), SPELL_FLAMEBUFFET, false); BuffetTimer = urand(7000, 9000); }else BuffetTimer -= diff; DoMeleeAttackIfReady(); }
bool QuestAccept_npc_marshal_windsor(Player *player, Creature *creature, Quest const *quest) { if (quest->GetQuestId() == QUEST_JAIL_BREAK) { ScriptedInstance *pInstance = (creature->GetInstanceData()); if (!pInstance) return false; if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == NOT_STARTED) { ((npc_escortAI*)(creature->AI()))->SetMaxPlayerDistance(88.0f); CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); pInstance->SetData64(Q_STARTER, player->GetGUID()); pInstance->SetData(DATA_QUEST_JAIL_BREAK, IN_PROGRESS); creature->setFaction(11); } } return false; }
void Aggro(Unit* pWho) { if (!m_pInstance) return; m_creature->InterruptNonMeleeSpells(false); if (Creature* pMagtheridon = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_MAGTHERIDON))) { if (!pMagtheridon->isAlive()) return; if (m_pInstance->GetData(TYPE_CHANNELER_EVENT) == NOT_STARTED) DoScriptText(EMOTE_BEGIN, pMagtheridon); } m_pInstance->SetData(TYPE_CHANNELER_EVENT, IN_PROGRESS); m_creature->SetInCombatWithZone(); }
void DoSummonAtRift(uint32 creature_entry) { if (!creature_entry) return; if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS) { m_creature->InterruptNonMeleeSpells(true); m_creature->RemoveAllAuras(); return; } float x,y,z; m_creature->GetRandomPoint(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),10.0f,x,y,z); //normalize Z-level if we can, if rift is not at ground level. m_creature->UpdateAllowedPositionZ(x, y, z); Unit *Summon = m_creature->SummonCreature(creature_entry,x,y,z,m_creature->GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN,30000); }
void JustDied(Unit* /*Killer*/) override { // Spawn 10 yauj brood on death float fX, fY, fZ; for (int i = 0; i < 10; ++i) { m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 10.0f, fX, fY, fZ); m_creature->SummonCreature(NPC_YAUJ_BROOD, fX, fY, fZ, 0.0f, TEMPSUMMON_TIMED_OOC_DESPAWN, 30000); } if (!m_pInstance) return; // If the other 2 bugs are still alive, make unlootable if (m_pInstance->GetData(TYPE_BUG_TRIO) != DONE) { m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); m_pInstance->SetData(TYPE_BUG_TRIO, SPECIAL); } }
void UpdateAI(const uint32 diff) { if (!m_pInstance) return; if (TimeRiftWave_Timer < diff) { DoSelectSummon(); TimeRiftWave_Timer = 15000; } else TimeRiftWave_Timer -= diff; if (m_creature->IsNonMeleeSpellCasted(false)) return; debug_log("SD2: npc_time_rift: not casting anylonger, i need to die."); m_creature->setDeathState(JUST_DIED); if (m_pInstance->GetData(TYPE_RIFT) == IN_PROGRESS) m_pInstance->SetData(TYPE_RIFT,SPECIAL); }
bool ItemUse_item_defias_gunpowder(Player* pPlayer, Item* pItem, SpellCastTargets const& targets) { ScriptedInstance *pInstance = pPlayer->GetInstanceData(); if (!pInstance) { pPlayer->GetSession()->SendNotification("Instance script not initialized"); return true; } if (pInstance->GetData(EVENT_STATE)!= CANNON_NOT_USED) return false; if (targets.getGOTarget() && targets.getGOTarget()->GetTypeId() == TYPEID_GAMEOBJECT && targets.getGOTarget()->GetEntry() == GO_DEFIAS_CANNON) { pInstance->SetData(EVENT_STATE, CANNON_GUNPOWDER_USED); } pPlayer->DestroyItemCount(pItem->GetEntry(), 1, true); return true; }
void MoveInLineOfSight(Unit* pWho) { if (!m_bIsIntroDone) { if (m_pInstance && m_pInstance->GetData(TYPE_SVALA) == IN_PROGRESS) { m_pInstance->SetData(TYPE_SVALA, SPECIAL); float fX, fY, fZ; m_creature->GetClosePoint(fX, fY, fZ, m_creature->GetObjectBoundingRadius(), 16.0f, 0.0f); // we assume m_creature is spawned in proper location m_creature->SummonCreature(NPC_ARTHAS_IMAGE, fX, fY, fZ, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000); } return; } ScriptedAI::MoveInLineOfSight(pWho); }
void Reset() { if(!m_pInstance) return; Difficulty = m_pInstance->GetData(TYPE_DIFFICULTY); m_pInstance->SetData(TYPE_JARAXXUS, NOT_STARTED); //SetEquipmentSlots(false, EQUIP_MAIN, EQUIP_OFFHAND, EQUIP_RANGED); m_portalsCount = 1; if (Difficulty == RAID_DIFFICULTY_10MAN_HEROIC || Difficulty == RAID_DIFFICULTY_25MAN_HEROIC) { m_portalsCount = 2; m_volcanoCount = 4; } else { m_portalsCount = 1; m_volcanoCount = 4; } DoScriptText(-1713517,m_creature); m_creature->SetRespawnDelay(DAY); }
bool GOUse_go_gauntlet_gate(Player* pPlayer, GameObject* pGo) { ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData(); if (!pInstance) { return false; } if (pInstance->GetData(TYPE_BARON_RUN) != NOT_STARTED) { return false; } if (Group* pGroup = pPlayer->GetGroup()) { for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) { Player* pGroupie = itr->getSource(); if (!pGroupie) { continue; } if (!pGroupie->HasAura(SPELL_BARON_ULTIMATUM)) { pGroupie->CastSpell(pGroupie, SPELL_BARON_ULTIMATUM, true); } } } else { if (!pPlayer->HasAura(SPELL_BARON_ULTIMATUM)) { pPlayer->CastSpell(pPlayer, SPELL_BARON_ULTIMATUM, true); } } pInstance->SetData(TYPE_BARON_RUN, IN_PROGRESS); return false; }
void MoveDown() { if (!pInstance) return; bOpFerokFail = false; pInstance->SetData(DATA_JEDOGA_TRIGGER_SWITCH, 0); m_creature->GetMotionMaster()->MovePoint(1, JEDOGA_POS[1][0], JEDOGA_POS[1][1], JEDOGA_POS[1][2]); m_creature->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING); m_creature->SendMonsterMove(JEDOGA_POS[1][0], JEDOGA_POS[1][1], JEDOGA_POS[1][2], 0, MOVEFLAG_JUMP, 0); m_creature->Relocate(JEDOGA_POS[1][0], JEDOGA_POS[1][1], JEDOGA_POS[1][2], JEDOGA_POS[1][3]); m_creature->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE); m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false); m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); m_creature->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL); bOnGround = true; if (UpdateVictim()) { AttackStart(m_creature->getVictim()); m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); } else { if (Unit* pTarget = Unit::GetUnit(*m_creature, 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 (!m_creature->isInCombat()) EnterEvadeMode(); } }
void UpdateAI(const uint32 uiDiff) { if (!pInstance || pInstance->GetData(TYPE_SAURFANG) != IN_PROGRESS) m_creature->ForcedDespawn(); if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; if (!m_creature->HasAura(SPELL_RESISTANT_SKIN)) doCast(SPELL_RESISTANT_SKIN); if (!scentcasted && (m_creature->GetHealthPercent() <= 20.0f)) { if (urand(0,1)) //50% doCast(SPELL_SCENT_OF_BLOOD); scentcasted = true; } DoMeleeAttackIfReady(); }
void Reset() { SlashTimer = 11000; StompTimer = 30000; BurnTimer = 60000; BerserkTimer = 360000; IntroPhase = 0; IntroPhaseTimer = 0; IntroFrostBoltTimer = 0; IntroAttackTimer = 0; Intro = false; Intro_Done = false; Enraged = false; DoCast(me, SPELL_DUAL_WIELD, true); if (pInstance && pInstance->GetData(DATA_BRUTALLUS_EVENT) != DONE) pInstance->SetData(DATA_BRUTALLUS_EVENT, NOT_STARTED); }