void BuffPlayers(Player *player) { if (!buffed) { //Buff every Player in map.. Map *map = me->GetMap(); if(!map->IsDungeon()) return; Map::PlayerList const &PlayerList = map->GetPlayers(); for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { if (Unit* i_pl = i->getSource()->ToUnit()) if(i_pl->isAlive()) me->CastSpell(i_pl, SPELL_MARK_OF_BITE, true); } GameObject *go = FindGameObject(182094, 20, me); go->SetGoState(GO_STATE_ACTIVE); Creature *c1 = me->SummonCreature(MOB_COILFANG_CHAMPION, -120.0f, -752.0f, 37.5f, 0, TEMPSUMMON_CORPSE_DESPAWN, 12000); Creature *c2 = me->SummonCreature(MOB_COILFANG_ENCHANTRESS, -120.0f, -752.0f, 37.5f, 0, TEMPSUMMON_CORPSE_DESPAWN, 12000); Creature *c3 = me->SummonCreature(MOB_COILFANG_SOOTHSAYER, -120.0f, -752.0f, 37.5f, 0, TEMPSUMMON_CORPSE_DESPAWN, 12000); c1->GetMotionMaster()->MoveChase(player); c1->Attack(player, true); c2->Attack(player, false); c3->Attack(player, false); //me->GetMotionMaster()->MovePoint(0, -195.0f, -797.0f, 44.0f); } }
void Reset() { if (!HasEscortState(STATE_ESCORT_ESCORTING)) m_creature->setFaction(1602); GameObject* Cage = FindGameObject(GO_CAGE, 20, m_creature); if(Cage) Cage->SetGoState(GO_STATE_READY); }
void MovementInform(uint32 /*type*/, uint32 id) { if (id == 1) { work = true; if (GameObject* Lumberpile = FindGameObject(GO_LUMBERPILE, 20, me)) me->SetFacingToObject(Lumberpile); } }
bool RewardReached(GameObject *reward) { GameObject *target = FindGameObject(GO_LOOT_BOX, 10, me); if(target) { me->CastSpell(me, SPELL_SMASH, false); // CHECKME: should do some emote that he is opening chest target->Delete(); } return true; }
void SpellHit(Unit *caster, const SpellEntry *spell) { if (spell->Id == SPELL_AWAKEN_PEON && caster->GetTypeId() == TYPEID_PLAYER) { DoScriptText(SAY_SPELL_HIT, me, caster); me->RemoveAllAuras(); if (GameObject* Lumberpile = FindGameObject(GO_LUMBERPILE, 20, me)) me->GetMotionMaster()->MovePoint(1,Lumberpile->GetPositionX()-1,Lumberpile->GetPositionY(),Lumberpile->GetPositionZ()); } }
void WaypointReached(uint32 i) { Player *player = GetPlayerForEscort(); if (!player) return; switch (i) { case 1: me->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, player->GetGUID()); break; case 7: me->HandleEmoteCommand(EMOTE_STATE_POINT); me->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, player->GetGUID()); if (pInstance) { if (Creature* dughal = Unit::GetCreature(*me, pInstance->GetData64(DATA_DUGHAL))) { if (!dughal->isAlive()) dughal->Respawn(); dughal->SetVisibility(VISIBILITY_ON); dughal->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); } } SetEscortPaused(true); break; case 10: me->setFaction(534); break; case 12: me->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, player->GetGUID()); break; case 13: if (GameObject* door = FindGameObject(GO_STORE_DOOR, INTERACTION_DISTANCE, me)) door->UseDoorOrButton(60); me->HandleEmoteCommand(EMOTE_STATE_USESTANDING); break; case 14: me->setFaction(11); break; case 16: me->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, player->GetGUID()); break; case 17: me->HandleEmoteCommand(EMOTE_STATE_USESTANDING); break; case 19: if (Creature* reginald = me->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR, 403.61, -51.71, -63.92, 3.600434, TEMPSUMMON_DEAD_DESPAWN , 0)) pInstance->SetData64(DATA_REGINALD, reginald->GetGUID()); me->SetVisibility(VISIBILITY_OFF); me->ForcedDespawn(); break; } }
void WaypointReached(uint32 i) { Player* player = GetPlayerForEscort(); if (!player) return; switch(i) { case 0: { m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); GameObject* Cage = FindGameObject(GO_CAGE, 20, m_creature); if(Cage) Cage->SetGoState(GO_STATE_ACTIVE); DoScriptText(SAY_START, m_creature, player); break; } case 5: DoScriptText(SAY_PROGRESS1, m_creature, player); case 11: DoScriptText(SAY_PROGRESS2, m_creature, player); m_creature->SetOrientation(4.762841); break; case 18: { DoScriptText(SAY_PROGRESS3, m_creature, player); Creature* Summ1 = m_creature->SummonCreature(16342, 7627.083984, -7532.538086, 152.128616, 1.082733, TEMPSUMMON_DEAD_DESPAWN, 0); Creature* Summ2 = m_creature->SummonCreature(16343, 7620.432129, -7532.550293, 152.454865, 0.827478, TEMPSUMMON_DEAD_DESPAWN, 0); if(Summ1 && Summ2) { Summ1->Attack(m_creature, true); Summ2->Attack(player, true); } m_creature->AI()->AttackStart(Summ1); break; } case 19: m_creature->SetWalk(false); break; case 25: m_creature->SetWalk(true); break; case 30: player->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS,m_creature); break; case 32: m_creature->SetOrientation(2.978281); DoScriptText(SAY_END1, m_creature, player); break; case 33: m_creature->SetOrientation(5.858011); DoScriptText(SAY_END2, m_creature, player); Unit* CaptainHelios = FindCreature(NPC_CAPTAIN_HELIOS, 50, m_creature); if(CaptainHelios) DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player); break; } }
void SpellHitTarget(Unit *target, const SpellEntry *entry) { GameObject *go = FindGameObject(GO_ASHLI_VASE, 5, target); if(!YellAshliVaseDone[1] && MovePoint == 3) { DoScriptText(YELL_ASHLI_VASE2, me); YellAshliVaseDone[1] = true; } if(!YellAshliVaseDone[2] && MovePoint == 6) { DoScriptText(YELL_ASHLI_VASE3, me); YellAshliVaseDone[2] = true; } if(go) go->Delete(); }
void WaypointReached(uint32 i) { switch (Part) { case 1: switch (i) { case 0: if (GameObject* door = FindGameObject(GO_PRISON_DOOR, INTERACTION_DISTANCE, me)) door->UseDoorOrButton(6); break; case 7: if (Creature* Armorer = me->SummonCreature(NPC_ARMORER, 2180.95f, 119.19f, 89.456f, 5.692f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 35000)) DoScriptText(SAY_ARMORER_CALL_GUARDS, Armorer); break; case 8: SetRun(false); break; case 9: DoScriptText(SAY_TH_KILL_ARMORER, me); DoCast(me, SPELL_KNOCKOUT_ARMORER); if (Creature* Armorer = me->GetMap()->GetCreature(ArmorerGUID)) Armorer->setDeathState(JUST_DIED); break; case 10: DoScriptText(SAY_TH_ARMORY, me); me->SetStandState(UNIT_STAND_STATE_KNEEL); break; case 11: me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, THRALL_WEAPON_MODEL); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, THRALL_SHIELD_MODEL); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038); me->SetUInt32Value(UNIT_FIELD_DISPLAYID, THRALL_MODEL_EQUIPPED); me->SetStandState(UNIT_STAND_STATE_STAND); SetRun(); break; case 12: if (Player* player = GetPlayerForEscort()) me->SetFacingToObject(player); DoScriptText(SAY_TH_ARMORY_2, me); break; case 17: me->SummonCreature(NPC_MAGE, 2186.909f, 139.8108f, 88.21628f, 5.75f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); me->SummonCreature(NPC_WARDEN, 2187.943f, 141.6124f, 88.21628f, 5.73f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); me->SummonCreature(NPC_VETERAN, 2190.508f, 140.4597f, 88.21628f, 6.04f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); me->SummonCreature(NPC_VETERAN, 2189.543f, 139.0996f, 88.23965f, 0.21f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); break; case 20: me->SummonCreature(NPC_MAGE, 2149.463f, 104.9756f, 73.63239f, 1.71f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); me->SummonCreature(NPC_SENTRY, 2147.642f, 105.0251f, 73.99422f, 1.52f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); me->SummonCreature(NPC_VETERAN, 2149.212f, 107.2005f, 74.15676f, 1.71f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); me->SummonCreature(NPC_WARDEN, 2147.328f, 106.7235f, 74.34447f, 1.69f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); break; case 23: me->SummonCreature(NPC_MAGE, 2142.363f, 172.4260f, 66.30494f, 2.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); me->SummonCreature(NPC_SENTRY, 2138.177f, 168.6046f, 66.30494f, 2.47f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); me->SummonCreature(NPC_SENTRY, 2142.372f, 174.2907f, 66.30494f, 2.56f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); me->SummonCreature(NPC_VETERAN, 2140.146f, 169.2364f, 66.30494f, 2.49f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); break; case 25: me->SummonCreature(NPC_MAGE, 2107.938f, 192.0753f, 66.30494f, 2.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); me->SummonCreature(NPC_MAGE, 2109.852f, 195.1403f, 66.30493f, 2.42f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); me->SummonCreature(NPC_VETERAN, 2108.486f, 189.9346f, 66.30494f, 2.68f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); me->SummonCreature(NPC_VETERAN, 2112.387f, 195.4947f, 66.30494f, 2.39f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); break; case 31: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_POINT); EmoteTimer = 2000; me->SetFacingTo(2.18f); me->SummonCreature(NPC_SKARLOC, 2000.201f, 277.9190f, 66.4911f, 6.11f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); DoScriptText(SAY_TH_SKARLOC_MEET, me); break; case 33: me->SetFacingTo(2.18f); DoScriptText(SAY_THRALL_END_P1, me); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); break; } break; case 2: switch (i) { case 1: DoScriptText(SAY_TH_MOUNTS_UP, me); DoMount(); if (Creature* mount = me->GetCreature(me->GetMap()->GetCreatureGUID(NPC_SKARLOC_MOUNT))) mount->ForcedDespawn(); SetRun(); break; case 29: me->SummonCreature(NPC_SKARLOC_MOUNT, 2488.64f, 625.77f, 58.26, 4.71f,TEMPSUMMON_TIMED_DESPAWN,10000); DoUnmount(); HadMount = false; SetRun(false); break; case 30: if (Creature* mount = me->GetMap()->GetCreature(MountGUID)) me->SetFacingToObject(mount); DoScriptText(EMOTE_TH_STARTLE_HORSE, me); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_EXCLAMATION); EmoteTimer = 2000; break; case 31: if (Creature* mount = me->GetMap()->GetCreature(MountGUID)) { mount->SetWalk(false); mount->GetMotionMaster()->MovePoint(0, 2517.504f, 506.253f, 42.329f); } me->SetFacingTo(4.66f); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); pInstance->SetData(TYPE_THRALL_PART2, DONE); break; } break; case 3: switch (i) { case 3: SetRun(false); break; case 6: DoScriptText(EMOTE_TH_CALM_HORSE, me); break; case 9: me->SummonCreature(NPC_TARREN_MILL_PROTECTOR, 2510.16f, 693.98f, 55.50f, 2.84f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); me->SummonCreature(NPC_TARREN_MILL_LOOKOUT, 2510.02f, 697.72f, 55.51f, 3.38f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); me->SummonCreature(NPC_TARREN_MILL_GUARDSMAN, 2507.83f, 693.76f, 55.50f, 3.14f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); me->SummonCreature(NPC_TARREN_MILL_GUARDSMAN, 2508.22f, 698.00f, 55.50f, 3.14f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 13: DoScriptText(SAY_TH_HEAD_TOWN, me); SetRun(); break; case 24: if (Player* player = GetPlayerForEscort()) me->SetFacingToObject(player); DoScriptText(SAY_TH_CHURCH_ENTER, me); break; case 25: me->SummonCreature(NPC_CHURCH_PROTECTOR, 2627.88f, 657.63f, 55.98f, 4.28f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); me->SummonCreature(NPC_CHURCH_LOOKOUT, 2627.27f, 655.17f, 56.03f, 4.50f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); me->SummonCreature(NPC_CHURCH_LOOKOUT, 2629.21f, 654.81f, 56.04f, 4.38f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); me->SummonCreature(NPC_CHURCH_GUARDSMAN, 2629.98f, 656.96f, 55.96f, 4.34f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); break; case 27: DoScriptText(SAY_TH_CHURCH_END, me); break; case 35: me->SummonCreature(NPC_INN_PROTECTOR, 2652.71f, 660.31f, 61.93f, 1.67f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); me->SummonCreature(NPC_INN_LOOKOUT, 2648.96f, 662.59f, 61.93f, 0.79f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); me->SummonCreature(NPC_INN_LOOKOUT, 2657.36f, 662.34f, 61.93f, 2.68f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); me->SummonCreature(NPC_INN_GUARDSMAN, 2656.39f, 659.77f, 61.93f, 2.61f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); break; case 36: SetRun(false); break; case 37: if (Creature* Taretha = me->GetMap()->GetCreature(TarethaGUID)) DoScriptText(SAY_TA_ESCAPED, Taretha, me); break; case 38: pInstance->SetData(TYPE_THRALL_PART3,DONE); DoScriptText(SAY_TH_MEET_TARETHA, me); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); break; } break; case 4: switch (i) { case 0: if (Creature* Epoch = me->SummonCreature(NPC_EPOCH,2639.13,698.55,65.43,4.59,TEMPSUMMON_DEAD_DESPAWN,120000)) DoScriptText(SAY_EPOCH_ENTER1, Epoch); me->SetFacingTo(2.63f); DoScriptText(SAY_TH_EPOCH_WONDER, me); break; case 1: me->SetFacingTo(5.79f); DoScriptText(SAY_TH_EPOCH_KILL_TARETHA, me); if (Creature* Epoch = me->GetMap()->GetCreature(EpochGUID)) DoScriptText(SAY_EPOCH_ENTER2, Epoch); if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) { Creature* Taretha = (Unit::GetCreature(*me, TarethaGUID)); Taretha->CastSpell(Taretha, SPELL_SHADOW_SPIKE, true); Taretha->SetStandState(UNIT_STAND_STATE_DEAD); } break; case 9: if (Creature* Epoch = me->GetMap()->GetCreature(EpochGUID)) { DoScriptText(SAY_EPOCH_ENTER3, Epoch); me->SetFacingToObject(Epoch); } SetEscortPaused(true); break; case 11: if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) { Creature* Taretha = (Unit::GetCreature(*me, TarethaGUID)); if (Player* pPlayer = GetPlayerForEscort()) CAST_AI(npc_escortAI, (Taretha->AI()))->Start(false, true, pPlayer->GetGUID()); } Event = true; me->SetFacingTo(5.79f); SetEscortPaused(true); break; case 13: Event = false; pInstance->SetData(TYPE_THRALL_EVENT, DONE); break; } break; } }
void Reset() { if (GameObject* Cage = FindGameObject(GO_CAGE, 20, m_creature)) Cage->SetGoState(1); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; //If we are <30% cast enrage if (!enraged && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false)) { enraged = true; DoCast(m_creature,SPELL_ENRAGE,true); }else if(enraged && !m_creature->HasAura(SPELL_ENRAGE,0)) { DoCast(m_creature,SPELL_ENRAGE,true); } //MORTALWOUND_Timer if (MORTALWOUND_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_MORTALWOUND); MORTALWOUND_Timer = 6000 + rand()%2000; }else MORTALWOUND_Timer -= diff; if(THRASH_Timer < diff) { DoCast(m_creature,SPELL_THRASH); THRASH_Timer = 3000+ rand()%5000; }else THRASH_Timer -= diff; if(SLASH_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_SLASH); SLASH_Timer = 5000 + rand()%5000; }else SLASH_Timer -= diff; if( SUMMON_Timer < diff) { Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1,70,true); if(target) { DoCast(target,SPELL_SUMMON); } SUMMON_Timer = 8000 + rand()%2000; }else SUMMON_Timer -= diff; //SANDTRAP_Timer if (SANDTRAP_Timer < diff) { if(!sandtrap) { Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0,50,true); if(target) { target->CastSpell(target,SPELL_SANDTRAP,true,0,0,m_creature->GetGUID()); sandtrap = true; } SANDTRAP_Timer = 5000; }else { GameObject* trap = FindGameObject(180647,100,m_creature); if(trap) { float x,y,z; trap->GetPosition(x,y,z); //trap->CastSpell((Unit*)trap,25656); Creature* trigger = m_creature->SummonCreature(15426,x,y,z,0,TEMPSUMMON_TIMED_DESPAWN,2000); trigger->CastSpell(trigger,25656,false); trap->Delete(); } SANDTRAP_Timer = 5000; sandtrap = false; } }else SANDTRAP_Timer -= diff; DoMeleeAttackIfReady(); }