From e80a19a0f1ce2387ab14e06a35ee6ab1acb0317e Mon Sep 17 00:00:00 2001 From: MitchesD Date: Sun, 10 Aug 2014 22:04:02 +0200 Subject: [PATCH 01/19] Scripts/ScarletMonastery: rewritten InstanceScript and some bosses converted to BossAI and eventmap --- .../ScarletMonastery/boss_arcanist_doan.cpp | 7 +- .../boss_azshir_the_sleepless.cpp | 134 ++++---- .../boss_bloodmage_thalnos.cpp | 176 +++++------ .../boss_headless_horseman.cpp | 39 ++- .../ScarletMonastery/boss_herod.cpp | 149 +++++---- .../boss_high_inquisitor_fairbanks.cpp | 16 +- .../boss_houndmaster_loksey.cpp | 86 ++--- .../boss_interrogator_vishas.cpp | 3 + .../boss_mograine_and_whitemane.cpp | 16 +- .../ScarletMonastery/boss_scorn.cpp | 127 ++++---- .../instance_scarlet_monastery.cpp | 294 +++++++++++------- .../ScarletMonastery/scarlet_monastery.h | 39 ++- 12 files changed, 616 insertions(+), 470 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp index f18c0aac8bb..26937a83e63 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp @@ -70,6 +70,11 @@ class boss_arcanist_doan : public CreatureScript events.ScheduleEvent(EVENT_POLYMORPH, 30 * IN_MILLISECONDS); } + void JustDied(Unit* /*killer*/) override + { + _JustDied(); + } + void UpdateAI(uint32 diff) override { if (!UpdateVictim()) @@ -119,7 +124,7 @@ class boss_arcanist_doan : public CreatureScript CreatureAI* GetAI(Creature* creature) const override { - return new boss_arcanist_doanAI(creature); + return GetInstanceAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp index dd173c75232..72874bba510 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2014 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -25,79 +24,104 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "scarlet_monastery.h" enum Spells { - SPELL_CALLOFTHEGRAVE = 17831, + SPELL_CALL_OF_THE_GRAVE = 17831, SPELL_TERRIFY = 7399, - SPELL_SOULSIPHON = 7290 + SPELL_SOUL_SIPHON = 7290 +}; + +enum Events +{ + EVENT_CALL_OF_GRAVE = 1, + EVENT_TERRIFY, + EVENT_SOUL_SIPHON }; class boss_azshir_the_sleepless : public CreatureScript { -public: - boss_azshir_the_sleepless() : CreatureScript("boss_azshir_the_sleepless") { } + public: + boss_azshir_the_sleepless() : CreatureScript("boss_azshir_the_sleepless") { } - CreatureAI* GetAI(Creature* creature) const override - { - return new boss_azshir_the_sleeplessAI(creature); - } - - struct boss_azshir_the_sleeplessAI : public ScriptedAI - { - boss_azshir_the_sleeplessAI(Creature* creature) : ScriptedAI(creature) { } - - uint32 SoulSiphon_Timer; - uint32 CallOftheGrave_Timer; - uint32 Terrify_Timer; - - void Reset() override + struct boss_azshir_the_sleeplessAI : public BossAI { - SoulSiphon_Timer = 1; - CallOftheGrave_Timer = 30000; - Terrify_Timer = 20000; - } - - void EnterCombat(Unit* /*who*/) override { } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - //If we are <50% hp cast Soul Siphon rank 1 - if (!HealthAbovePct(50) && !me->IsNonMeleeSpellCast(false)) + boss_azshir_the_sleeplessAI(Creature* creature) : BossAI(creature, DATA_AZSHIR) { - //SoulSiphon_Timer - if (SoulSiphon_Timer <= diff) + _siphon = false; + } + + void Reset() override + { + _Reset(); + _siphon = false; + } + + void EnterCombat(Unit* /*who*/) override + { + _EnterCombat(); + events.ScheduleEvent(EVENT_CALL_OF_GRAVE, 30000); + events.ScheduleEvent(EVENT_TERRIFY, 20000); + } + + void JustDied(Unit* /*killer*/) override + { + _JustDied(); + } + + void DamageTaken(Unit* /*done_by*/, uint32& /*damage*/) override + { + if (HealthBelowPct(50) && !_siphon) { - DoCastVictim(SPELL_SOULSIPHON); + DoCastVictim(SPELL_SOUL_SIPHON); + events.ScheduleEvent(EVENT_SOUL_SIPHON, 20000); + _siphon = true; + } + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) return; - //SoulSiphon_Timer = 20000; + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_CALL_OF_GRAVE: + DoCastVictim(SPELL_CALL_OF_THE_GRAVE); + events.ScheduleEvent(EVENT_CALL_OF_GRAVE, 30000); + break; + case EVENT_TERRIFY: + DoCastVictim(SPELL_TERRIFY); + events.ScheduleEvent(EVENT_TERRIFY, 20000); + break; + case EVENT_SOUL_SIPHON: + DoCastVictim(SPELL_SOUL_SIPHON); + events.ScheduleEvent(EVENT_SOUL_SIPHON, 20000); + break; + default: + break; + } } - else SoulSiphon_Timer -= diff; + + DoMeleeAttackIfReady(); } - //CallOfTheGrave_Timer - if (CallOftheGrave_Timer <= diff) - { - DoCastVictim(SPELL_CALLOFTHEGRAVE); - CallOftheGrave_Timer = 30000; - } - else CallOftheGrave_Timer -= diff; + private: + bool _siphon; + }; - //Terrify_Timer - if (Terrify_Timer <= diff) - { - DoCastVictim(SPELL_TERRIFY); - Terrify_Timer = 20000; - } - else Terrify_Timer -= diff; - - DoMeleeAttackIfReady(); + CreatureAI* GetAI(Creature* creature) const override + { + return GetInstanceAI(creature); } - }; }; void AddSC_boss_azshir_the_sleepless() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp index 207c12f608a..43a9ef32be6 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2014 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,15 +15,9 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Bloodmage_Thalnos -SD%Complete: 100 -SDComment: -SDCategory: Scarlet Monastery -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "scarlet_monastery.h" enum Yells { @@ -38,95 +31,102 @@ enum Spells SPELL_FLAMESHOCK = 8053, SPELL_SHADOWBOLT = 1106, SPELL_FLAMESPIKE = 8814, - SPELL_FIRENOVA = 16079, + SPELL_FIRENOVA = 16079 +}; + +enum Events +{ + EVENT_FLAME_SHOCK = 1, + EVENT_SHADOW_BOLT, + EVENT_FLAME_SPIKE, + EVENT_FIRE_NOVA }; class boss_bloodmage_thalnos : public CreatureScript { -public: - boss_bloodmage_thalnos() : CreatureScript("boss_bloodmage_thalnos") { } + public: + boss_bloodmage_thalnos() : CreatureScript("boss_bloodmage_thalnos") { } - CreatureAI* GetAI(Creature* creature) const override - { - return new boss_bloodmage_thalnosAI(creature); - } - - struct boss_bloodmage_thalnosAI : public ScriptedAI - { - boss_bloodmage_thalnosAI(Creature* creature) : ScriptedAI(creature) { } - - bool HpYell; - uint32 FlameShock_Timer; - uint32 ShadowBolt_Timer; - uint32 FlameSpike_Timer; - uint32 FireNova_Timer; - - void Reset() override + struct boss_bloodmage_thalnosAI : public BossAI { - HpYell = false; - FlameShock_Timer = 10000; - ShadowBolt_Timer = 2000; - FlameSpike_Timer = 8000; - FireNova_Timer = 40000; - } + boss_bloodmage_thalnosAI(Creature* creature) : BossAI(creature, DATA_BLOODMAGE_THALNOS) + { + _hpYell = false; + } - void EnterCombat(Unit* /*who*/) override + void Reset() override + { + _hpYell = false; + _Reset(); + } + + void EnterCombat(Unit* /*who*/) override + { + Talk(SAY_AGGRO); + _EnterCombat(); + events.ScheduleEvent(EVENT_FLAME_SHOCK, 10000); + events.ScheduleEvent(EVENT_SHADOW_BOLT, 2000); + events.ScheduleEvent(EVENT_FLAME_SPIKE, 8000); + events.ScheduleEvent(EVENT_FIRE_NOVA, 40000); + } + + void JustDied(Unit* /*killer*/) override + { + _JustDied(); + } + + void KilledUnit(Unit* /*victim*/) override + { + Talk(SAY_KILL); + } + + void DamageTaken(Unit* /*done_by*/, uint32& /*damage*/) override + { + if (HealthBelowPct(35) && !_hpYell) + { + Talk(SAY_HEALTH); + _hpYell = true; + } + } + + void ExecuteEvent(uint32 eventId) override + { + switch (eventId) + { + case EVENT_FLAME_SHOCK: + DoCastVictim(SPELL_FLAMESHOCK); + events.ScheduleEvent(EVENT_FLAME_SHOCK, urand(10000, 15000)); + break; + case EVENT_SHADOW_BOLT: + DoCastVictim(SPELL_SHADOWBOLT); + events.ScheduleEvent(EVENT_SHADOW_BOLT, 2000); + break; + case EVENT_FLAME_SPIKE: + DoCastVictim(SPELL_FLAMESPIKE); + events.ScheduleEvent(EVENT_FLAME_SPIKE, 30000); + break; + case EVENT_FIRE_NOVA: + DoCastVictim(SPELL_FIRENOVA); + events.ScheduleEvent(EVENT_FIRE_NOVA, 40000); + break; + default: + break; + } + } + + void UpdateAI(uint32 diff) override + { + BossAI::UpdateAI(diff); + } + + private: + bool _hpYell; + }; + + CreatureAI* GetAI(Creature* creature) const override { - Talk(SAY_AGGRO); + return GetInstanceAI(creature); } - - void KilledUnit(Unit* /*Victim*/) override - { - Talk(SAY_KILL); - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - //If we are <35% hp - if (!HpYell && !HealthAbovePct(35)) - { - Talk(SAY_HEALTH); - HpYell = true; - } - - //FlameShock_Timer - if (FlameShock_Timer <= diff) - { - DoCastVictim(SPELL_FLAMESHOCK); - FlameShock_Timer = urand(10000, 15000); - } - else FlameShock_Timer -= diff; - - //FlameSpike_Timer - if (FlameSpike_Timer <= diff) - { - DoCastVictim(SPELL_FLAMESPIKE); - FlameSpike_Timer = 30000; - } - else FlameSpike_Timer -= diff; - - //FireNova_Timer - if (FireNova_Timer <= diff) - { - DoCastVictim(SPELL_FIRENOVA); - FireNova_Timer = 40000; - } - else FireNova_Timer -= diff; - - //ShadowBolt_Timer - if (ShadowBolt_Timer <= diff) - { - DoCastVictim(SPELL_SHADOWBOLT); - ShadowBolt_Timer = 2000; - } - else ShadowBolt_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; }; void AddSC_boss_bloodmage_thalnos() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 5939d4a41db..cad46b84748 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -155,13 +155,13 @@ public: { npc_wisp_invisAI(Creature* creature) : ScriptedAI(creature) { - Creaturetype = delay = spell = spell2 = 0; + Creaturetype = delay = _spell = _spell2 = 0; } uint32 Creaturetype; uint32 delay; - uint32 spell; - uint32 spell2; + uint32 _spell; + uint32 _spell2; void Reset() override { } void EnterCombat(Unit* /*who*/) override { } void SetType(uint32 _type) @@ -169,24 +169,24 @@ public: switch (Creaturetype = _type) { case 1: - spell = SPELL_PUMPKIN_AURA_GREEN; + _spell = SPELL_PUMPKIN_AURA_GREEN; break; case 2: delay = 15000; - spell = SPELL_BODY_FLAME; - spell2 = SPELL_DEATH; + _spell = SPELL_BODY_FLAME; + _spell2 = SPELL_DEATH; break; case 3: delay = 15000; - spell = SPELL_SMOKE; + _spell = SPELL_SMOKE; break; case 4: delay = 7000; - spell2 = SPELL_WISP_BLUE; + _spell2 = SPELL_WISP_BLUE; break; } - if (spell) - DoCast(me, spell); + if (_spell) + DoCast(me, _spell); } void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override @@ -196,7 +196,6 @@ public: } void MoveInLineOfSight(Unit* who) override - { if (!who || Creaturetype != 1 || !who->isTargetableForAttack()) return; @@ -212,8 +211,8 @@ public: if (delay <= diff) { me->RemoveAurasDueToSpell(SPELL_SMOKE); - if (spell2) - DoCast(me, spell2); + if (_spell2) + DoCast(me, _spell2); delay = 0; } else delay -= diff; } @@ -435,7 +434,7 @@ public: } me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - //instance->SetData(DATA_HORSEMAN_EVENT, NOT_STARTED); + //instance->SetBossState(DATA_HORSEMAN_EVENT, NOT_STARTED); } void FlyMode() @@ -471,7 +470,7 @@ public: break; } case 6: - instance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject + instance->SetData(DATA_PUMPKIN_SHRINE, 0); //hide gameobject break; case 19: me->SetDisableGravity(false); @@ -493,7 +492,7 @@ public: void EnterCombat(Unit* /*who*/) override { - instance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS); + instance->SetBossState(DATA_HORSEMAN_EVENT, IN_PROGRESS); DoZoneInCombat(); } @@ -503,7 +502,6 @@ public: } void MoveInLineOfSight(Unit* who) override - { if (withhead && Phase != 0) ScriptedAI::MoveInLineOfSight(who); @@ -567,7 +565,7 @@ public: flame->CastSpell(flame, SPELL_BODY_FLAME, false); if (Creature* wisp = DoSpawnCreature(WISP_INVIS, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 60000)) ENSURE_AI(npc_wisp_invis::npc_wisp_invisAI, wisp->AI())->SetType(4); - instance->SetData(DATA_HORSEMAN_EVENT, DONE); + instance->SetBossState(DATA_HORSEMAN_EVENT, DONE); Map::PlayerList const& players = me->GetMap()->GetPlayers(); if (!players.isEmpty()) @@ -852,7 +850,6 @@ public: } void MoveInLineOfSight(Unit* who) override - { if (!who || !me->IsValidAttackTarget(who) || me->GetVictim()) return; @@ -880,9 +877,9 @@ public: InstanceScript* instance = player->GetInstanceScript(); if (instance) { - if (instance->GetData(DATA_HORSEMAN_EVENT) != NOT_STARTED) + if (instance->GetBossState(DATA_HORSEMAN_EVENT) != NOT_STARTED) return true; - instance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS); + instance->SetBossState(DATA_HORSEMAN_EVENT, IN_PROGRESS); } /* if (soil->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER && player->getLevel() > 64) { diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp index 480b354fe29..0b7ad73fefd 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp @@ -26,6 +26,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedEscortAI.h" +#include "scarlet_monastery.h" enum Says { @@ -44,89 +45,103 @@ enum Spells SPELL_FRENZY = 8269 }; -enum Entry +enum Npcs { - ENTRY_SCARLET_TRAINEE = 6575, - ENTRY_SCARLET_MYRMIDON = 4295 + NPC_SCARLET_TRAINEE = 6575, + NPC_SCARLET_MYRMIDON = 4295 }; +enum Events +{ + EVENT_CLEAVE = 1, + EVENT_WHIRLWIND +}; + +Position const ScarletTraineePos = { 1939.18f, -431.58f, 17.09f, 6.22f }; + class boss_herod : public CreatureScript { -public: - boss_herod() : CreatureScript("boss_herod") { } + public: + boss_herod() : CreatureScript("boss_herod") { } - CreatureAI* GetAI(Creature* creature) const override - { - return new boss_herodAI(creature); - } - - struct boss_herodAI : public ScriptedAI - { - boss_herodAI(Creature* creature) : ScriptedAI(creature) { } - - bool Enrage; - - uint32 Cleave_Timer; - uint32 Whirlwind_Timer; - - void Reset() override + struct boss_herodAI : public BossAI { - Enrage = false; - Cleave_Timer = 12000; - Whirlwind_Timer = 60000; - } - - void EnterCombat(Unit* /*who*/) override - { - Talk(SAY_AGGRO); - DoCast(me, SPELL_RUSHINGCHARGE); - } - - void KilledUnit(Unit* /*victim*/) override - { - Talk(SAY_KILL); - } - - void JustDied(Unit* /*killer*/) override - { - for (uint8 i = 0; i < 20; ++i) - me->SummonCreature(ENTRY_SCARLET_TRAINEE, 1939.18f, -431.58f, 17.09f, 6.22f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - //If we are <30% hp goes Enraged - if (!Enrage && !HealthAbovePct(30) && !me->IsNonMeleeSpellCast(false)) + boss_herodAI(Creature* creature) : BossAI(creature, DATA_HEROD) { - Talk(EMOTE_ENRAGE); - Talk(SAY_ENRAGE); - DoCast(me, SPELL_FRENZY); - Enrage = true; + _enrage = false; } - //Cleave_Timer - if (Cleave_Timer <= diff) + void Reset() override { - DoCastVictim(SPELL_CLEAVE); - Cleave_Timer = 12000; + _enrage = false; + _Reset(); } - else Cleave_Timer -= diff; - // Whirlwind_Timer - if (Whirlwind_Timer <= diff) + void EnterCombat(Unit* /*who*/) override { - Talk(SAY_WHIRLWIND); - DoCastVictim(SPELL_WHIRLWIND); - Whirlwind_Timer = 30000; - } - else Whirlwind_Timer -= diff; + Talk(SAY_AGGRO); + DoCast(me, SPELL_RUSHINGCHARGE); + _EnterCombat(); - DoMeleeAttackIfReady(); + events.ScheduleEvent(EVENT_CLEAVE, 12000); + events.ScheduleEvent(EVENT_WHIRLWIND, 60000); + } + + void KilledUnit(Unit* /*victim*/) override + { + Talk(SAY_KILL); + } + + void JustDied(Unit* /*killer*/) override + { + _JustDied(); + + for (uint8 i = 0; i < 20; ++i) + me->SummonCreature(NPC_SCARLET_TRAINEE, ScarletTraineePos, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + } + + void DamageTaken(Unit* /*done_by*/, uint32& /*damage*/) override + { + if (HealthBelowPct(30) && !_enrage) + { + Talk(EMOTE_ENRAGE); + Talk(SAY_ENRAGE); + DoCast(me, SPELL_FRENZY); + _enrage = true; + } + } + + void ExecuteEvent(uint32 eventId) override + { + switch (eventId) + { + case EVENT_CLEAVE: + DoCastVictim(SPELL_CLEAVE); + events.ScheduleEvent(EVENT_CLEAVE, 12000); + break; + case EVENT_WHIRLWIND: + Talk(SAY_WHIRLWIND); + DoCastVictim(SPELL_WHIRLWIND); + events.ScheduleEvent(EVENT_WHIRLWIND, 30000); + break; + default: + break; + } + } + + void UpdateAI(uint32 diff) override + { + BossAI::UpdateAI(diff); + } + + private: + bool _enrage; + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return GetInstanceAI(creature); } - }; }; class npc_scarlet_trainee : public CreatureScript diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp index f58ab1519e4..a4a3660b360 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp @@ -25,6 +25,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "scarlet_monastery.h" enum Spells { @@ -43,12 +44,15 @@ public: CreatureAI* GetAI(Creature* creature) const override { - return new boss_high_inquisitor_fairbanksAI(creature); + return GetInstanceAI(creature); } struct boss_high_inquisitor_fairbanksAI : public ScriptedAI { - boss_high_inquisitor_fairbanksAI(Creature* creature) : ScriptedAI(creature) { } + boss_high_inquisitor_fairbanksAI(Creature* creature) : ScriptedAI(creature) + { + instance = creature->GetInstanceScript(); + } uint32 CurseOfBlood_Timer; uint32 DispelMagic_Timer; @@ -57,6 +61,7 @@ public: uint32 Sleep_Timer; uint32 Dispel_Timer; bool PowerWordShield; + InstanceScript* instance; void Reset() override { @@ -69,12 +74,19 @@ public: PowerWordShield = false; me->SetStandState(UNIT_STAND_STATE_DEAD); me->SetUInt32Value(UNIT_FIELD_BYTES_1, 7); + instance->SetBossState(DATA_HIGH_INQUISITOR_FAIRBANKS, NOT_STARTED); } void EnterCombat(Unit* /*who*/) override { me->SetStandState(UNIT_STAND_STATE_STAND); me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + instance->SetBossState(DATA_HIGH_INQUISITOR_FAIRBANKS, IN_PROGRESS); + } + + void JustDied(Unit* /*killer*/) override + { + instance->SetBossState(DATA_HIGH_INQUISITOR_FAIRBANKS, DONE); } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp index 5aa9729a7e8..40c7667843b 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2014 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,15 +15,9 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Houndmaster_Loksey -SD%Complete: 100 -SDComment: -SDCategory: Scarlet Monastery -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "scarlet_monastery.h" enum Yells { @@ -37,47 +30,60 @@ enum Spells SPELL_BLOODLUST = 6742 }; +enum Events +{ + EVENT_BLOODLUST = 1 +}; + class boss_houndmaster_loksey : public CreatureScript { -public: - boss_houndmaster_loksey() : CreatureScript("boss_houndmaster_loksey") { } + public: + boss_houndmaster_loksey() : CreatureScript("boss_houndmaster_loksey") { } - CreatureAI* GetAI(Creature* creature) const override - { - return new boss_houndmaster_lokseyAI(creature); - } - - struct boss_houndmaster_lokseyAI : public ScriptedAI - { - boss_houndmaster_lokseyAI(Creature* creature) : ScriptedAI(creature) { } - - uint32 BloodLust_Timer; - - void Reset() override + struct boss_houndmaster_lokseyAI : public BossAI { - BloodLust_Timer = 20000; - } + boss_houndmaster_lokseyAI(Creature* creature) : BossAI(creature, DATA_HOUNDMASTER_LOKSEY) { } - void EnterCombat(Unit* /*who*/) override - { - Talk(SAY_AGGRO); - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - if (BloodLust_Timer <= diff) + void Reset() override { - DoCast(me, SPELL_BLOODLUST); - BloodLust_Timer = 20000; + _Reset(); } - else BloodLust_Timer -= diff; - DoMeleeAttackIfReady(); + void EnterCombat(Unit* /*who*/) override + { + Talk(SAY_AGGRO); + _EnterCombat(); + events.ScheduleEvent(EVENT_BLOODLUST, 20000); + } + + void JustDied(Unit* /*killer*/) override + { + _JustDied(); + } + + void ExecuteEvent(uint32 eventId) override + { + switch (eventId) + { + case EVENT_BLOODLUST: + DoCast(me, SPELL_BLOODLUST); + events.ScheduleEvent(EVENT_BLOODLUST, 20000); + break; + default: + break; + } + } + + void UpdateAI(uint32 diff) override + { + BossAI::UpdateAI(diff); + } + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return GetInstanceAI(creature); } - }; }; void AddSC_boss_houndmaster_loksey() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp index a7c795a81f6..a73cf946a7c 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp @@ -69,11 +69,13 @@ public: ShadowWordPain_Timer = 5000; Yell60 = false; Yell30 = false; + instance->SetBossState(DATA_INTERROGATOR_VISHAS, NOT_STARTED); } void EnterCombat(Unit* /*who*/) override { Talk(SAY_AGGRO); + instance->SetBossState(DATA_INTERROGATOR_VISHAS, IN_PROGRESS); } void KilledUnit(Unit* /*Victim*/) override @@ -86,6 +88,7 @@ public: //Any other Actions to do with vorrel? setStandState? if (Creature* vorrel = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_VORREL))) vorrel->AI()->Talk(SAY_TRIGGER_VORREL); + instance->SetBossState(DATA_INTERROGATOR_VISHAS, DONE); } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp index 25bb08620a1..a9988584edd 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp @@ -95,7 +95,7 @@ public: me->SetStandState(UNIT_STAND_STATE_STAND); if (me->IsAlive()) - instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED); + instance->SetBossState(DATA_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED); _bHasDied = false; _bHeal = false; @@ -104,8 +104,8 @@ public: void JustReachedHome() override { - if (instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) != NOT_STARTED) - instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); + if (instance->GetBossState(DATA_MOGRAINE_AND_WHITE_EVENT) != NOT_STARTED) + instance->SetBossState(DATA_MOGRAINE_AND_WHITE_EVENT, FAIL); } void EnterCombat(Unit* /*who*/) override @@ -129,7 +129,7 @@ public: //On first death, fake death and open door, as well as initiate whitemane if exist if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetData64(DATA_WHITEMANE))) { - instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); + instance->SetBossState(DATA_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); Whitemane->GetMotionMaster()->MovePoint(1, 1163.113370f, 1398.856812f, 32.527786f); @@ -163,7 +163,7 @@ public: Talk(SAY_MO_RESURRECTED); _bFakeDeath = false; - instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); + instance->SetBossState(DATA_MOGRAINE_AND_WHITE_EVENT, SPECIAL); } } @@ -172,7 +172,7 @@ public: if (!UpdateVictim()) return; - if (_bHasDied && !_bHeal && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) + if (_bHasDied && !_bHeal && instance->GetBossState(DATA_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) { //On resurrection, stop fake death and heal whitemane and resume fight if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetData64(DATA_WHITEMANE))) @@ -254,12 +254,12 @@ public: _bCanResurrect = false; if (me->IsAlive()) - instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED); + instance->SetBossState(DATA_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED); } void AttackStart(Unit* who) override { - if (instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED) + if (instance->GetBossState(DATA_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED) return; ScriptedAI::AttackStart(who); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp index 3ed32b71cbb..24efd7017ec 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp @@ -25,84 +25,87 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "scarlet_monastery.h" enum Spells { SPELL_LICHSLAP = 28873, - SPELL_FROSTBOLTVOLLEY = 8398, + SPELL_FROSTBOLT_VOLLEY = 8398, SPELL_MINDFLAY = 17313, SPELL_FROSTNOVA = 15531 }; +enum Events +{ + EVENT_LICH_SLAP = 1, + EVENT_FROSTBOLT_VOLLEY, + EVENT_MIND_FLAY, + EVENT_FROST_NOVA +}; + class boss_scorn : public CreatureScript { -public: - boss_scorn() : CreatureScript("boss_scorn") { } + public: + boss_scorn() : CreatureScript("boss_scorn") { } - CreatureAI* GetAI(Creature* creature) const override - { - return new boss_scornAI(creature); - } - - struct boss_scornAI : public ScriptedAI - { - boss_scornAI(Creature* creature) : ScriptedAI(creature) { } - - uint32 LichSlap_Timer; - uint32 FrostboltVolley_Timer; - uint32 MindFlay_Timer; - uint32 FrostNova_Timer; - - void Reset() override + struct boss_scornAI : public BossAI { - LichSlap_Timer = 45000; - FrostboltVolley_Timer = 30000; - MindFlay_Timer = 30000; - FrostNova_Timer = 30000; - } + boss_scornAI(Creature* creature) : BossAI(creature, DATA_SCORN) { } - void EnterCombat(Unit* /*who*/) override { } + void Reset() override + { + _Reset(); + } - void UpdateAI(uint32 diff) override + void EnterCombat(Unit* /*who*/) override + { + _EnterCombat(); + events.ScheduleEvent(EVENT_LICH_SLAP, 45000); + events.ScheduleEvent(EVENT_FROSTBOLT_VOLLEY, 30000); + events.ScheduleEvent(EVENT_MIND_FLAY, 30000); + events.ScheduleEvent(EVENT_FROST_NOVA, 30000); + } + + void JustDied(Unit* /*killer*/) override + { + _JustDied(); + } + + void ExecuteEvent(uint32 eventId) override + { + switch (eventId) + { + case EVENT_LICH_SLAP: + DoCastVictim(SPELL_LICHSLAP); + events.ScheduleEvent(EVENT_LICH_SLAP, 45000); + break; + case EVENT_FROSTBOLT_VOLLEY: + DoCastVictim(SPELL_FROSTBOLT_VOLLEY); + events.ScheduleEvent(EVENT_FROSTBOLT_VOLLEY, 20000); + break; + case EVENT_MIND_FLAY: + DoCastVictim(SPELL_MINDFLAY); + events.ScheduleEvent(EVENT_MIND_FLAY, 20000); + break; + case EVENT_FROST_NOVA: + DoCastVictim(SPELL_FROSTNOVA); + events.ScheduleEvent(EVENT_FROST_NOVA, 15000); + break; + default: + break; + } + } + + void UpdateAI(uint32 diff) override + { + BossAI::UpdateAI(diff); + } + }; + + CreatureAI* GetAI(Creature* creature) const override { - if (!UpdateVictim()) - return; - - //LichSlap_Timer - if (LichSlap_Timer <= diff) - { - DoCastVictim(SPELL_LICHSLAP); - LichSlap_Timer = 45000; - } - else LichSlap_Timer -= diff; - - //FrostboltVolley_Timer - if (FrostboltVolley_Timer <= diff) - { - DoCastVictim(SPELL_FROSTBOLTVOLLEY); - FrostboltVolley_Timer = 20000; - } - else FrostboltVolley_Timer -= diff; - - //MindFlay_Timer - if (MindFlay_Timer <= diff) - { - DoCastVictim(SPELL_MINDFLAY); - MindFlay_Timer = 20000; - } - else MindFlay_Timer -= diff; - - //FrostNova_Timer - if (FrostNova_Timer <= diff) - { - DoCastVictim(SPELL_FROSTNOVA); - FrostNova_Timer = 15000; - } - else FrostNova_Timer -= diff; - - DoMeleeAttackIfReady(); + return GetInstanceAI(creature); } - }; }; void AddSC_boss_scorn() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index dc564e43af5..78837912688 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2014 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,146 +15,205 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Instance_Scarlet_Monastery -SD%Complete: 50 -SDComment: -SDCategory: Scarlet Monastery -EndScriptData */ - #include "ScriptMgr.h" -#include "ScriptedCreature.h" +#include "InstanceScript.h" #include "scarlet_monastery.h" -enum Entry +DoorData const doorData[] = { - ENTRY_PUMPKIN_SHRINE = 186267, - ENTRY_HORSEMAN = 23682, - ENTRY_HEAD = 23775, - ENTRY_PUMPKIN = 23694 + { GO_HIGH_INQUISITORS_DOOR, DATA_MOGRAINE_AND_WHITE_EVENT, DOOR_TYPE_ROOM, BOUNDARY_NONE }, + { 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE } // END }; -#define MAX_ENCOUNTER 2 - class instance_scarlet_monastery : public InstanceMapScript { -public: - instance_scarlet_monastery() : InstanceMapScript("instance_scarlet_monastery", 189) { } + public: + instance_scarlet_monastery() : InstanceMapScript("instance_scarlet_monastery", 189) { } - InstanceScript* GetInstanceScript(InstanceMap* map) const override - { - return new instance_scarlet_monastery_InstanceMapScript(map); - } - - struct instance_scarlet_monastery_InstanceMapScript : public InstanceScript - { - instance_scarlet_monastery_InstanceMapScript(Map* map) : InstanceScript(map) { } - - uint64 PumpkinShrineGUID; - uint64 HorsemanGUID; - uint64 HeadGUID; - std::set HorsemanAdds; - - uint64 MograineGUID; - uint64 WhitemaneGUID; - uint64 VorrelGUID; - uint64 DoorHighInquisitorGUID; - - uint32 encounter[MAX_ENCOUNTER]; - - void Initialize() override + struct instance_scarlet_monastery_InstanceMapScript : public InstanceScript { - memset(&encounter, 0, sizeof(encounter)); - - PumpkinShrineGUID = 0; - HorsemanGUID = 0; - HeadGUID = 0; - HorsemanAdds.clear(); - - MograineGUID = 0; - WhitemaneGUID = 0; - VorrelGUID = 0; - DoorHighInquisitorGUID = 0; - } - - void OnGameObjectCreate(GameObject* go) override - { - switch (go->GetEntry()) + instance_scarlet_monastery_InstanceMapScript(Map* map) : InstanceScript(map) { - case ENTRY_PUMPKIN_SHRINE: PumpkinShrineGUID = go->GetGUID();break; - case 104600: DoorHighInquisitorGUID = go->GetGUID(); break; + SetBossNumber(EncounterCount); + LoadDoorData(doorData); + + PumpkinShrineGUID = 0; + HorsemanGUID = 0; + HeadGUID = 0; + MograineGUID = 0; + WhitemaneGUID = 0; + VorrelGUID = 0; + + HorsemanAdds.clear(); } - } - void OnCreatureCreate(Creature* creature) override - { - switch (creature->GetEntry()) + void OnGameObjectCreate(GameObject* go) override { - case ENTRY_HORSEMAN: HorsemanGUID = creature->GetGUID(); break; - case ENTRY_HEAD: HeadGUID = creature->GetGUID(); break; - case ENTRY_PUMPKIN: HorsemanAdds.insert(creature->GetGUID());break; - case 3976: MograineGUID = creature->GetGUID(); break; - case 3977: WhitemaneGUID = creature->GetGUID(); break; - case 3981: VorrelGUID = creature->GetGUID(); break; - } - } - - void SetData(uint32 type, uint32 data) override - { - switch (type) - { - case TYPE_MOGRAINE_AND_WHITE_EVENT: - if (data == IN_PROGRESS) - DoUseDoorOrButton(DoorHighInquisitorGUID); - if (data == FAIL) - DoUseDoorOrButton(DoorHighInquisitorGUID); - - encounter[0] = data; - break; - case GAMEOBJECT_PUMPKIN_SHRINE: - HandleGameObject(PumpkinShrineGUID, false); - break; - case DATA_HORSEMAN_EVENT: - encounter[1] = data; - if (data == DONE) + switch (go->GetEntry()) { - for (std::set::const_iterator itr = HorsemanAdds.begin(); itr != HorsemanAdds.end(); ++itr) - { - Creature* add = instance->GetCreature(*itr); - if (add && add->IsAlive()) - add->Kill(add); - } - HorsemanAdds.clear(); - HandleGameObject(PumpkinShrineGUID, false); + case GO_PUMPKIN_SHRINE: + PumpkinShrineGUID = go->GetGUID(); + break; + case GO_HIGH_INQUISITORS_DOOR: + AddDoor(go, true); + break; + default: + break; } - break; } - } - uint64 GetData64(uint32 type) const override - { - switch (type) + void OnGameObjectRemove(GameObject* go) override { - //case GAMEOBJECT_PUMPKIN_SHRINE: return PumpkinShrineGUID; - //case DATA_HORSEMAN: return HorsemanGUID; - //case DATA_HEAD: return HeadGUID; - case DATA_MOGRAINE: return MograineGUID; - case DATA_WHITEMANE: return WhitemaneGUID; - case DATA_VORREL: return VorrelGUID; - case DATA_DOOR_WHITEMANE: return DoorHighInquisitorGUID; + switch (go->GetEntry()) + { + case GO_HIGH_INQUISITORS_DOOR: + AddDoor(go, false); + break; + default: + break; + } } - return 0; - } - uint32 GetData(uint32 type) const override + void OnCreatureCreate(Creature* creature) override + { + switch (creature->GetEntry()) + { + case NPC_HORSEMAN: + HorsemanGUID = creature->GetGUID(); + break; + case NPC_HEAD: + HeadGUID = creature->GetGUID(); + break; + case NPC_PUMPKIN: + HorsemanAdds.insert(creature->GetGUID()); + break; + case NPC_MOGRAINE: + MograineGUID = creature->GetGUID(); + break; + case NPC_WHITEMANE: + WhitemaneGUID = creature->GetGUID(); + break; + case NPC_VORREL: + VorrelGUID = creature->GetGUID(); + break; + default: + break; + } + } + + void SetData(uint32 type, uint32 /*data*/) override + { + switch (type) + { + case DATA_PUMPKIN_SHRINE: + HandleGameObject(PumpkinShrineGUID, false); + break; + default: + break; + } + } + + bool SetBossState(uint32 type, EncounterState state) override + { + if (!InstanceScript::SetBossState(type, state)) + return false; + + switch (type) + { + case DATA_HORSEMAN_EVENT: + if (state == DONE) + { + for (uint64 guid : HorsemanAdds) + { + Creature* add = instance->GetCreature(guid); + if (add && add->IsAlive()) + add->Kill(add); + } + HorsemanAdds.clear(); + HandleGameObject(PumpkinShrineGUID, false); + } + break; + default: + break; + } + return true; + } + + uint64 GetData64(uint32 type) const override + { + switch (type) + { + case DATA_MOGRAINE: + return MograineGUID; + case DATA_WHITEMANE: + return WhitemaneGUID; + case DATA_VORREL: + return VorrelGUID; + default: + break; + } + return 0; + } + + std::string GetSaveData() override + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << "S M " << GetBossSaveData(); + + OUT_SAVE_INST_DATA_COMPLETE; + return saveStream.str(); + } + + void Load(const char* str) override + { + if (!str) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(str); + + char dataHead1, dataHead2; + + std::istringstream loadStream(str); + loadStream >> dataHead1 >> dataHead2; + + if (dataHead1 == 'S' && dataHead2 == 'M') + { + for (uint8 i = 0; i < EncounterCount; ++i) + { + uint32 tmpState; + loadStream >> tmpState; + if (tmpState == IN_PROGRESS || tmpState > SPECIAL) + tmpState = NOT_STARTED; + + SetBossState(i, EncounterState(tmpState)); + } + } + else + OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; + } + + protected: + uint64 PumpkinShrineGUID; + uint64 HorsemanGUID; + uint64 HeadGUID; + uint64 MograineGUID; + uint64 WhitemaneGUID; + uint64 VorrelGUID; + + std::set HorsemanAdds; + }; + + InstanceScript* GetInstanceScript(InstanceMap* map) const override { - if (type == TYPE_MOGRAINE_AND_WHITE_EVENT) - return encounter[0]; - if (type == DATA_HORSEMAN_EVENT) - return encounter[1]; - return 0; + return new instance_scarlet_monastery_InstanceMapScript(map); } - }; }; void AddSC_instance_scarlet_monastery() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h index bdac6b089fd..40089cd9817 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2014 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -19,19 +18,43 @@ #ifndef SCARLET_M_ #define SCARLET_M_ +uint32 const EncounterCount = 10; + enum DataTypes { - TYPE_MOGRAINE_AND_WHITE_EVENT = 1, - + DATA_MOGRAINE_AND_WHITE_EVENT = 1, DATA_MOGRAINE = 2, DATA_WHITEMANE = 3, - DATA_DOOR_WHITEMANE = 4, - DATA_HORSEMAN_EVENT = 5, - GAMEOBJECT_PUMPKIN_SHRINE = 6, + DATA_HORSEMAN_EVENT = 4, + DATA_PUMPKIN_SHRINE = 5, - DATA_VORREL = 7, - DATA_ARCANIST_DOAN = 8 + DATA_VORREL = 6, + DATA_ARCANIST_DOAN = 7, + DATA_AZSHIR = 8, + DATA_BLOODMAGE_THALNOS = 9, + DATA_HEROD = 10, + DATA_HIGH_INQUISITOR_FAIRBANKS = 11, + DATA_HOUNDMASTER_LOKSEY = 12, + DATA_INTERROGATOR_VISHAS = 13, + DATA_SCORN = 14 +}; + +enum CreatureIds +{ + NPC_MOGRAINE = 3976, + NPC_WHITEMANE = 3977, + NPC_VORREL = 3981, + + NPC_HORSEMAN = 23682, + NPC_HEAD = 23775, + NPC_PUMPKIN = 23694 +}; + +enum GameObjectIds +{ + GO_HIGH_INQUISITORS_DOOR = 104600, + GO_PUMPKIN_SHRINE = 186267 }; #endif // SCARLET_M_ From 377f385c8138d37cfca2f55f80ac34c4839ab3a7 Mon Sep 17 00:00:00 2001 From: Unholychick Date: Mon, 18 Aug 2014 22:01:47 +0100 Subject: [PATCH 02/19] Scripts/Ulduar: Spellscripts for Mimiron Closes #12579 Signed-off-by: DDuarte --- .../world/2014_08_18_00_world_ulduar.sql | 100 ++ .../Northrend/Ulduar/Ulduar/boss_mimiron.cpp | 1417 ++++++++++++++++- .../Ulduar/Ulduar/instance_ulduar.cpp | 88 +- .../scripts/Northrend/Ulduar/Ulduar/ulduar.h | 35 + 4 files changed, 1590 insertions(+), 50 deletions(-) create mode 100644 sql/updates/world/2014_08_18_00_world_ulduar.sql diff --git a/sql/updates/world/2014_08_18_00_world_ulduar.sql b/sql/updates/world/2014_08_18_00_world_ulduar.sql new file mode 100644 index 00000000000..bdf0cedb986 --- /dev/null +++ b/sql/updates/world/2014_08_18_00_world_ulduar.sql @@ -0,0 +1,100 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id` IN (63274, 63414, 63667, 63382, 64402, 65034, 63681, 64542, 65192, 64570, 63027, 65346, 66351, 65224, 63009, 64620, 63820, 64425, 64426, 64621, 64398, 64619, 64623, 65354, 64618, 64436, 63340, 64383, 63339, 64562, 63041, 63801, 64463); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(63801, 'spell_mimiron_bomb_bot'), +(65192, 'spell_mimiron_clear_fires'), +(65224, 'spell_mimiron_clear_fires'), +(64619, 'spell_mimiron_clear_fires'), +(65354, 'spell_mimiron_clear_fires'), +(64463, 'spell_mimiron_despawn_assault_bots'), +(64618, 'spell_mimiron_fire_search'), +(64570, 'spell_mimiron_flame_suppressant'), +(64436, 'spell_mimiron_magnetic_core'), +(63667, 'spell_mimiron_napalm_shell'), +(63274, 'spell_mimiron_p3wx2_laser_barrage'), +(64542, 'spell_mimiron_plasma_blast'), +(63027, 'spell_mimiron_proximity_mines'), +(66351, 'spell_mimiron_proximity_explosion'), +(63009, 'spell_mimiron_proximity_explosion'), +(65346, 'spell_mimiron_proximity_trigger'), +(63382, 'spell_mimiron_rapid_burst'), +(64402, 'spell_mimiron_rocket_strike'), +(65034, 'spell_mimiron_rocket_strike'), +(63041, 'spell_mimiron_rocket_strike_damage'), +(63681, 'spell_mimiron_rocket_strike_target_select'), +(64383, 'spell_mimiron_self_repair'), +(63414, 'spell_mimiron_spinning_up'), +(64426, 'spell_mimiron_summon_assault_bot'), +(64425, 'spell_mimiron_summon_assault_bot_target'), +(64621, 'spell_mimiron_summon_fire_bot'), +(64620, 'spell_mimiron_summon_fire_bot_target'), +(64562, 'spell_mimiron_summon_flames_spread'), +(64623, 'spell_mimiron_summon_frost_bomb_target'), +(64398, 'spell_mimiron_summon_junk_bot'), +(63820, 'spell_mimiron_summon_junk_bot_target'), +(63339, 'spell_mimiron_weld'); + +DELETE FROM `spelldifficulty_dbc` WHERE `id` IN (66351, 64019, 63387, 62997, 64348, 64352, 63689, 65647, 63677, 63679, 64626); +INSERT INTO `spelldifficulty_dbc` (`id`, `spellid0`, `spellid1`) VALUES +(64348, 64348, 64536), +(64352, 64352, 64537), +(66351, 66351, 63009), +(63387, 63387, 64531), +(64019, 64019, 64532), +(62997, 62997, 64529), +(63689, 63689, 64535), +(65647, 65647, 65648), +(63677, 63677, 64533), +(63679, 63679, 64534), +(64626, 64626, 65333); + +DELETE FROM `conditions` WHERE `SourceEntry` IN (65192, 64570, 63274, 66490, 63300, 63414, 64539, 64402, 65034, 63041, 65224, 64620, 63820, 64425, 64619, 64626, 65333, 65354, 64618, 64623, 64436, 64444, 65101, 64463); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 65192, 0, 0, 31, 0, 3, 34363, 0, 0, 0, 0, '', 'Flame Suppressant VX EFFECT_0 can only hit NPC_FLAME'), +(13, 1, 65192, 0, 1, 31, 0, 3, 34121, 0, 0, 0, 0, '', 'Flame Suppressant VX EFFECT_0 can only hit NPC_FLAME_SPREAD'), +(13, 2, 64570, 0, 0, 31, 0, 3, 34363, 0, 0, 0, 0, '', 'Flame Suppressant MK EFFECT_1 can only hit NPC_FLAME'), +(13, 2, 64570, 0, 1, 31, 0, 3, 34121, 0, 0, 0, 0, '', 'Flame Suppressant MK EFFECT_1 can only hit NPC_FLAME_SPREAD'), +(13, 1, 64623, 0, 0, 31, 0, 3, 34363, 0, 0, 0, 0, '', 'Frost Bomb EFFECT_0 can only hit NPC_FLAME'), +(13, 1, 64623, 0, 1, 31, 0, 3, 34121, 0, 0, 0, 0, '', 'Frost Bomb EFFECT_0 can only hit NPC_FLAME_SPREAD'), +(13, 4, 64626, 0, 0, 31, 0, 3, 34363, 0, 0, 0, 0, '', 'Explosion EFFECT_2 can only hit NPC_FLAME'), +(13, 4, 64626, 0, 1, 31, 0, 3, 34121, 0, 0, 0, 0, '', 'Explosion EFFECT_2 can only hit NPC_FLAME_SPREAD'), +(13, 4, 65333, 0, 0, 31, 0, 3, 34363, 0, 0, 0, 0, '', 'Explosion EFFECT_2 can only hit NPC_FLAME'), +(13, 4, 65333, 0, 1, 31, 0, 3, 34121, 0, 0, 0, 0, '', 'Explosion EFFECT_2 can only hit NPC_FLAME_SPREAD'), +(13, 1, 65224, 0, 0, 31, 0, 3, 34363, 0, 0, 0, 0, '', 'Clear Fires EFFECT_0 can only hit NPC_FLAME'), +(13, 1, 65224, 0, 1, 31, 0, 3, 34121, 0, 0, 0, 0, '', 'Clear Fires EFFECT_0 can only hit NPC_FLAME_SPREAD'), +(13, 1, 65354, 0, 0, 31, 0, 3, 34363, 0, 0, 0, 0, '', 'Clear Fires EFFECT_0 can only hit NPC_FLAME'), +(13, 1, 65354, 0, 1, 31, 0, 3, 34121, 0, 0, 0, 0, '', 'Clear Fires EFFECT_0 can only hit NPC_FLAME_SPREAD'), +(13, 1, 64619, 0, 0, 31, 0, 3, 34363, 0, 0, 0, 0, '', 'Water Spray EFFECT_0 can only hit NPC_FLAME'), +(13, 1, 64619, 0, 1, 31, 0, 3, 34121, 0, 0, 0, 0, '', 'Water Spray EFFECT_0 can only hit NPC_FLAME_SPREAD'), +(13, 1, 64618, 0, 0, 31, 0, 3, 34363, 0, 0, 0, 0, '', 'Fire Search EFFECT_0 can only hit NPC_FLAME'), +(13, 1, 64618, 0, 1, 31, 0, 3, 34121, 0, 0, 0, 0, '', 'Fire Search EFFECT_0 can only hit NPC_FLAME_SPREAD'), +(13, 1, 64539, 0, 0, 31, 0, 3, 34071, 0, 0, 0, 0, '', 'Napalm Shell EFFECT_0 can only hit NPC_LEVIATHAN_MKII_TURRET'), +(13, 1, 63274, 0, 0, 31, 0, 3, 33576, 0, 0, 0, 0, '', 'P3Wx2 Laser Barrage EFFECT_0 can only hit NPC_DB_TARGET'), +(17, 0, 66490, 0, 0, 31, 0, 3, 33432, 0, 0, 0, 0, '', 'P3Wx2 Laser Barrage can only hit NPC_LEVIATHAN_MKII'), +(17, 0, 63300, 0, 0, 31, 0, 3, 33651, 0, 0, 0, 0, '', 'P3Wx2 Laser Barrage can only hit NPC_VX_001'), +(13, 1, 63414, 0, 0, 31, 0, 3, 33576, 0, 0, 0, 0, '', 'Spinning Up EFFECT_0 can only hit NPC_DB_TARGET'), +(13, 2, 63414, 0, 1, 31, 0, 3, 33432, 0, 0, 0, 0, '', 'Spinning Up EFFECT_1 can only hit NPC_LEVIATHAN_MKII'), +(13, 1, 64620, 0, 0, 31, 0, 3, 33856, 0, 0, 0, 0, '', 'Summon Fire Bot Trigger EFFECT_0 can only hit NPC_BOT_SUMMON_TRIGGER'), +(13, 1, 63820, 0, 0, 31, 0, 3, 33856, 0, 0, 0, 0, '', 'Summon Junk Bot Trigger EFFECT_0 can only hit NPC_BOT_SUMMON_TRIGGER'), +(13, 1, 64425, 0, 0, 31, 0, 3, 33856, 0, 0, 0, 0, '', 'Summon Assault Bot Trigger EFFECT_0 can only hit NPC_BOT_SUMMON_TRIGGER'), +(13, 1, 64402, 0, 0, 31, 0, 3, 34050, 0, 0, 0, 0, '', 'Rocket Strike EFFECT_0 can only hit NPC_ROCKET_MIMIRON_VISUAL'), +(13, 1, 65034, 0, 0, 31, 0, 3, 34050, 0, 0, 0, 0, '', 'Rocket Strike EFFECT_0 can only hit NPC_ROCKET_MIMIRON_VISUAL'), +(13, 2, 64436, 0, 0, 31, 0, 3, 33670, 0, 0, 0, 0, '', 'Magnetic Core EFFECT_1 can only hit NPC_AERIAL_COMMAND_UNIT'), +(13, 1, 64444, 0, 0, 31, 0, 3, 33670, 0, 0, 0, 0, '', 'Magnetic Core EFFECT_0 can only hit NPC_AERIAL_COMMAND_UNIT'), +(13, 1, 65101, 0, 0, 31, 0, 3, 34071, 0, 0, 0, 0, '', 'Emergency Mode EFFECT_0 can only hit NPC_LEVIATHAN_MKII_TURRET'), +(13, 1, 64463, 0, 0, 31, 0, 3, 34057, 0, 0, 0, 0, '', 'Despawn Assault Bots EFFECT_1 can only hit NPC_ASSAULT_BOT'), +(13, 2, 63041, 0, 0, 31, 0, 3, 34057, 0, 0, 0, 0, '', 'Rocket Strike EFFECT_1 can only hit NPC_ASSAULT_BOT'), +(13, 4, 63041, 0, 1, 31, 0, 3, 34137, 0, 0, 0, 0, '', 'Rocket Strike EFFECT_2 can only hit NPC_EMERGENCY_FIRE_BOT'), +(13, 4, 63041, 0, 2, 31, 0, 3, 33855, 0, 0, 0, 0, '', 'Rocket Strike EFFECT_2 can only hit NPC_JUNK_BOT'), +(13, 4, 63041, 0, 3, 31, 0, 3, 33836, 0, 0, 0, 0, '', 'Rocket Strike EFFECT_2 can only hit NPC_BOMB_BOT'); + +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (64626, 64570, 64627, 65333, 64567); +INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES +(64626, -64624, 0, 'Explosion - Remove SPELL_FROST_BOMB_LINKED from caster'), +(64626, -64561, 1, 'Explosion - Remove SPELL_FLAMES_PERIODIC_TRIGGER from targets'), +(65333, -64624, 0, 'Explosion - Remove SPELL_FROST_BOMB_LINKED from caster'), +(65333, -64561, 1, 'Explosion - Remove SPELL_FLAMES_PERIODIC_TRIGGER from targets'), +(64627, -64561, 1, 'Frost Bomb - Remove SPELL_FLAMES_PERIODIC_TRIGGER from target'), +(64567, 64563, 1, 'Summon Flames Initial - Cast SPELL_SUMMON_FLAMES_INITIAL on hit targets'), +(64570, -64561, 1, 'Flame Suppressant - Remove SPELL_FLAMES_PERIODIC_TRIGGER from targets'); +-- diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp index f284aacf996..b769c7e141e 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp @@ -15,10 +15,16 @@ * with this program. If not, see . */ +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" +#include "GridNotifiersImpl.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "SpellScript.h" +#include "SpellAuraEffects.h" #include "ulduar.h" +#include "Vehicle.h" enum Yells { @@ -39,78 +45,1413 @@ enum Yells SAY_BERSERK = 14 }; +enum ComputerYells +{ + SAY_SELF_DESTRUCT_INITIATED = 0, + SAY_SELF_DESTRUCT_TERMINATED = 1, + SAY_SELF_DESTRUCT_10 = 2, + SAY_SELF_DESTRUCT_9 = 3, + SAY_SELF_DESTRUCT_8 = 4, + SAY_SELF_DESTRUCT_7 = 5, + SAY_SELF_DESTRUCT_6 = 6, + SAY_SELF_DESTRUCT_5 = 7, + SAY_SELF_DESTRUCT_4 = 8, + SAY_SELF_DESTRUCT_3 = 9, + SAY_SELF_DESTRUCT_2 = 10, + SAY_SELF_DESTRUCT_1 = 11, + SAY_SELF_DESTRUCT_FINALIZED = 12 +}; + enum Spells { + // Mimiron + SPELL_WELD = 63339, // Idle aura. + SPELL_SEAT_1 = 52391, // Cast on all vehicles, Cycled on MKII + SPELL_SEAT_2 = 63313, // Cast on MKII and VX-001, Cycled on MKII + SPELL_SEAT_3 = 63314, // Cast on MKII, Cycled on MKII + SPELL_SEAT_5 = 63316, // Cast on MKII and VX-001, Cycled on MKII + SPELL_SEAT_6 = 63344, // Cast on MKII + SPELL_SEAT_7 = 63345, // Cast on MKII SPELL_JETPACK = 63341, - SPELL_EMERGENCY_MODE = 64582, - SPELL_SELF_REPAIR = 64383, - SPELL_MAGNETIC_CORE = 64444, + SPELL_DESPAWN_ASSAULT_BOTS = 64463, // only despawns assault bots... no equivalent spell for the other adds... + SPELL_TELEPORT_VISUAL = 41232, + SPELL_SLEEP_VISUAL_1 = 64393, + SPELL_SLEEP_VISUAL_2 = 64394, + // Leviathan MK II SPELL_FLAME_SUPPRESSANT_MK = 64570, SPELL_NAPALM_SHELL = 63666, - SPELL_PLASMA_BLAST = 62977, - SPELL_PROXIMITY_MINES = 63027, + SPELL_FORCE_CAST_NAPALM_SHELL = 64539, + SPELL_PLASMA_BLAST = 62997, + SPELL_SCRIPT_EFFECT_PLASMA_BLAST = 64542, SPELL_SHOCK_BLAST = 63631, - // VX 001 + SPELL_SHOCK_BLAST_AURA = 63632, // Deprecated? It is never cast. + + // VX-001 SPELL_FLAME_SUPPRESSANT_VX = 65192, - SPELL_FROSTBOMB = 64623, - SPELL_HAND_PULSE = 64348, SPELL_SPINNING_UP = 63414, - SPELL_RAPID_BURST = 63387, - SPELL_P3WX2_LASER_BARRAGE = 63293, - SPELL_ROCKET_STRIKE = 63041, - SPELL_HEAT_WAVE = 63677, + SPELL_HEAT_WAVE_AURA = 63679, + SPELL_HAND_PULSE_LEFT = 64348, + SPELL_HAND_PULSE_RIGHT = 64352, + SPELL_MOUNT_MKII = 64387, + SPELL_TORSO_DISABLED = 64120, + // Aerial Command Unit - SPELL_PLASMA_BALL = 63689, - // Additonal spells - SPELL_MAGNETIC_FIELD = 64668, - SPELL_DEAFENING_SIREN = 64616, + SPELL_PLASMA_BALL_P1 = 63689, + SPELL_PLASMA_BALL_P2 = 65647, + SPELL_MOUNT_VX_001 = 64388, + + // Proximity Mines + SPELL_PROXIMITY_MINES = 63027, // Cast by Leviathan MK II + SPELL_PROXIMITY_MINE_EXPLOSION = 66351, + SPELL_PROXIMITY_MINE_TRIGGER = 65346, + SPELL_PROXIMITY_MINE_PERIODIC_TRIGGER = 65345, + SPELL_PERIODIC_PROXIMITY_AURA = 65345, + SPELL_SUMMON_PROXIMITY_MINE = 65347, + + // Rapid Burst + SPELL_RAPID_BURST_LEFT = 63387, + SPELL_RAPID_BURST_RIGHT = 64019, + SPELL_RAPID_BURST = 63382, // Cast by VX-001 + SPELL_RAPID_BURST_TARGET_ME = 64841, // Cast by Burst Target + SPELL_SUMMON_BURST_TARGET = 64840, // Cast by VX-001 + + // Rocket Strike + SPELL_SUMMON_ROCKET_STRIKE = 63036, + SPELL_SCRIPT_EFFECT_ROCKET_STRIKE = 63681, // Cast by Rocket (Mimiron Visual) + SPELL_ROCKET_STRIKE = 64064, // Added in creature_template_addon + SPELL_ROCKET_STRIKE_LEFT = 64402, // Cast by VX-001 + SPELL_ROCKET_STRIKE_BOTH = 65034, // Cast by VX-001 + + // Flames + SPELL_FLAMES_PERIODIC_TRIGGER = 64561, // Added in creature_template_addon + SPELL_SUMMON_FLAMES_SPREAD_TRIGGER = 64562, + SPELL_SUMMON_FLAMES_INITIAL = 64563, + SPELL_SUMMON_FLAMES_SPREAD = 64564, + SPELL_FLAMES = 64566, + SPELL_SCRIPT_EFFECT_SUMMON_FLAMES_INITIAL = 64567, + + // Frost Bomb + SPELL_SCRIPT_EFFECT_FROST_BOMB = 64623, // Cast by VX-001 + SPELL_FROST_BOMB_LINKED = 64624, // Added in creature_template_addon + SPELL_FROST_BOMB_DUMMY = 64625, + SPELL_SUMMON_FROST_BOMB = 64627, // Cast by VX-001 + SPELL_FROST_BOMB_EXPLOSION = 64626, + SPELL_CLEAR_FIRES = 65354, + + // Bots + SPELL_SUMMON_FIRE_BOT = 64622, + SPELL_SUMMON_FIRE_BOT_DUMMY = 64621, + SPELL_SUMMON_FIRE_BOT_TRIGGER = 64620, // Cast by Areal Command Unit + SPELL_DEAFENING_SIREN = 64616, // Added in creature_template_addon + SPELL_FIRE_SEARCH_AURA = 64617, // Added in creature_template_addon + SPELL_FIRE_SEARCH = 64618, SPELL_WATER_SPRAY = 64619, - SPELL_FROST_BOMB_HARD_MODE = 64627, - SPELL_EXPLOSION = 66351, - SPELL_DISARM = 1842, - SPELL_RIDE_VEHICLE = 46598, - SPELL_TRIGGER_MISSILE = 65347, + + SPELL_SUMMON_JUNK_BOT = 63819, + SPELL_SUMMON_JUNK_BOT_TRIGGER = 63820, // Cast by Areal Command Unit + SPELL_SUMMON_JUNK_BOT_DUMMY = 64398, + + SPELL_SUMMON_ASSAULT_BOT_TRIGGER = 64425, // Cast by Areal Command Unit + SPELL_SUMMON_ASSAULT_BOT_DUMMY = 64426, + SPELL_SUMMON_ASSAULT_BOT = 64427, + SPELL_MAGNETIC_FIELD = 64668, + + SPELL_SUMMON_BOMB_BOT = 63811, // Cast by Areal Command Unit + SPELL_BOMB_BOT_AURA = 63767, // Added in creature_template_addon + + // Miscellaneous + SPELL_SELF_DESTRUCTION_AURA = 64610, + SPELL_SELF_DESTRUCTION_VISUAL = 64613, + SPELL_NOT_SO_FRIENDLY_FIRE = 65040, + SPELL_ELEVATOR_KNOCKBACK = 65096, // Cast by worldtrigger. + SPELL_VEHICLE_DAMAGED = 63415, + SPELL_EMERGENCY_MODE = 64582, // mkii, vx001, aerial, assault, junk + SPELL_EMERGENCY_MODE_TURRET = 65101, // Cast by Leviathan MK II, only hits Leviathan MK II turret + SPELL_SELF_REPAIR = 64383, + SPELL_MAGNETIC_CORE = 64436, + SPELL_MAGNETIC_CORE_VISUAL = 64438, + SPELL_HALF_HEAL = 64188, + SPELL_CLEAR_ALL_DEBUFFS = 34098, // TODO: make use of this spell... + SPELL_FREEZE_ANIM_STUN = 63354, // used to prevent mkii from doing stuff?.. + SPELL_FREEZE_ANIM = 16245 // Idle aura. Freezes animation. }; -enum Npc +enum Data { - NPC_ASSAULT_BOT = 34057, - NPC_BOMB_BOT = 33836, - NPC_JUNK_BOT = 33855, - NPC_EMERGENCE_FIRE_BOT = 34147, - NPC_FROST_BOMB = 34149, + DATA_SETUP_MINE, + DATA_SETUP_BOMB, + DATA_SETUP_ROCKET, + DATA_NOT_SO_FRIENDLY_FIRE, + DATA_FIREFIGHTER, + DATA_WATERSPRAY, + DATA_MOVE_NEW }; -class spell_ulduar_proximity_mines : public SpellScriptLoader +enum Events +{ + // Leviathan MK II + EVENT_PROXIMITY_MINE = 1, + EVENT_NAPALM_SHELL, + EVENT_PLASMA_BLAST, + EVENT_SHOCK_BLAST, + EVENT_FLAME_SUPPRESSANT_MK, + EVENT_MOVE_POINT_2, + EVENT_MOVE_POINT_3, + EVENT_MOVE_POINT_5, + + // VX-001 + EVENT_RAPID_BURST, + EVENT_SPINNING_UP, + EVENT_ROCKET_STRIKE, + EVENT_HAND_PULSE, + EVENT_FROST_BOMB, + EVENT_FLAME_SUPPRESSANT_VX, + EVENT_RELOAD, + + // Aerial Command Unit + EVENT_SUMMON_FIRE_BOTS, + EVENT_SUMMON_JUNK_BOT, + EVENT_SUMMON_ASSAULT_BOT, + EVENT_SUMMON_BOMB_BOT, + + // Mimiron + EVENT_SUMMON_FLAMES, + EVENT_INTRO_1, + EVENT_INTRO_2, + EVENT_INTRO_3, + + EVENT_VX001_ACTIVATION_1, + EVENT_VX001_ACTIVATION_2, + EVENT_VX001_ACTIVATION_3, + EVENT_VX001_ACTIVATION_4, + EVENT_VX001_ACTIVATION_5, + EVENT_VX001_ACTIVATION_6, + EVENT_VX001_ACTIVATION_7, + EVENT_VX001_ACTIVATION_8, + EVENT_VX001_ACTIVATION_9, + + EVENT_AERIAL_ACTIVATION_1, + EVENT_AERIAL_ACTIVATION_2, + EVENT_AERIAL_ACTIVATION_3, + EVENT_AERIAL_ACTIVATION_4, + EVENT_AERIAL_ACTIVATION_5, + EVENT_AERIAL_ACTIVATION_6, + + EVENT_VOL7RON_ACTIVATION_1, + EVENT_VOL7RON_ACTIVATION_2, + EVENT_VOL7RON_ACTIVATION_3, + EVENT_VOL7RON_ACTIVATION_4, + EVENT_VOL7RON_ACTIVATION_5, + EVENT_VOL7RON_ACTIVATION_6, + EVENT_VOL7RON_ACTIVATION_7, + + EVENT_OUTTRO_1, + EVENT_OUTTRO_2, + EVENT_OUTTRO_3, + + // Computer + EVENT_SELF_DESTRUCT_10, + EVENT_SELF_DESTRUCT_9, + EVENT_SELF_DESTRUCT_8, + EVENT_SELF_DESTRUCT_7, + EVENT_SELF_DESTRUCT_6, + EVENT_SELF_DESTRUCT_5, + EVENT_SELF_DESTRUCT_4, + EVENT_SELF_DESTRUCT_3, + EVENT_SELF_DESTRUCT_2, + EVENT_SELF_DESTRUCT_1, + EVENT_SELF_DESTRUCT_FINALIZED, + + // Misc + EVENT_MAGNETIC_FIELD, + EVENT_SPREAD_FLAMES, + EVENT_FROST_BOMB_EXPLOSION, + EVENT_FROST_BOMB_CLEAR_FIRES, + EVENT_PROXIMITY_MINE_ARM, + EVENT_PROXIMITY_MINE_DETONATION, + EVENT_SEARCH_FLAMES, + EVENT_WATER_SPRAY +}; + +enum Actions +{ + DO_START_MKII, + DO_HARDMODE_MKII, + + DO_ACTIVATE_VX001, + DO_START_VX001, + DO_HARDMODE_VX001, + + DO_ACTIVATE_AERIAL, + DO_START_AERIAL, + DO_HARDMODE_AERIAL, + DO_DISABLE_AERIAL, + DO_ENABLE_AERIAL, + + DO_ACTIVATE_V0L7R0N_1, + DO_ACTIVATE_V0L7R0N_2, + DO_ASSEMBLED_COMBAT, // All 3 parts use this action, its done on purpose. + + DO_ACTIVATE_HARD_MODE, + DO_ACTIVATE_COMPUTER, + DO_DEACTIVATE_COMPUTER, + DO_ACTIVATE_SELF_DESTRUCT, + + DO_ENCOUNTER_DONE +}; + +enum Phases +{ + // Leviathan MK II + PHASE_LEVIATHAN_SOLO = 1, + PHASE_LEVIATHAN_ASSEMBLED, + + // VX-001 + PHASE_VX001_SOLO, + PHASE_VX001_ASSEMBLED, + + // Aerial Command Unit + PHASE_AERIAL_SOLO, + PHASE_AERIAL_ASSEMBLED +}; + +uint32 const RepairSpells[4] = +{ + SPELL_SEAT_1, + SPELL_SEAT_2, + SPELL_SEAT_3, + SPELL_SEAT_5 +}; + +// 63801 Bomb Bot +class spell_mimiron_bomb_bot : public SpellScriptLoader { public: - spell_ulduar_proximity_mines() : SpellScriptLoader("spell_ulduar_proximity_mines") { } + spell_mimiron_bomb_bot() : SpellScriptLoader("spell_mimiron_bomb_bot") { } - class spell_ulduar_proximity_minesSpellScript : public SpellScript + class spell_mimiron_bomb_bot_SpellScript : public SpellScript { - PrepareSpellScript(spell_ulduar_proximity_minesSpellScript); + PrepareSpellScript(spell_mimiron_bomb_bot_SpellScript); - void HandleScript(SpellEffIndex effIndex) + void HandleScript(SpellEffIndex /*effIndex*/) { - PreventHitDefaultEffect(effIndex); - for (uint8 i = 0; i < 10; ++i) - GetCaster()->CastSpell(GetCaster(), SPELL_TRIGGER_MISSILE, true); + if (GetHitPlayer()) + if (InstanceScript* instance = GetCaster()->GetInstanceScript()) + if (Creature* mkii = ObjectAccessor::GetCreature(*GetCaster(), instance->GetData64(DATA_LEVIATHAN_MK_II))) + mkii->AI()->SetData(DATA_SETUP_BOMB, 0); + } + + void HandleDespawn(SpellEffIndex /*effIndex*/) + { + if (Creature* target = GetHitCreature()) + { + target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED); + target->DespawnOrUnsummon(1000); + } } void Register() override { - OnEffectHitTarget += SpellEffectFn(spell_ulduar_proximity_minesSpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectHitTarget += SpellEffectFn(spell_mimiron_bomb_bot_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + OnEffectHitTarget += SpellEffectFn(spell_mimiron_bomb_bot_SpellScript::HandleDespawn, EFFECT_1, SPELL_EFFECT_APPLY_AURA); } }; SpellScript* GetSpellScript() const override { - return new spell_ulduar_proximity_minesSpellScript(); + return new spell_mimiron_bomb_bot_SpellScript(); + } +}; + +// 65192 - Flame Suppressant, 65224 - Clear Fires, 65354 - Clear Fires, 64619 - Water Spray +class spell_mimiron_clear_fires : public SpellScriptLoader +{ + public: + spell_mimiron_clear_fires() : SpellScriptLoader("spell_mimiron_clear_fires") { } + + class spell_mimiron_clear_fires_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_clear_fires_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (GetHitCreature()) + GetHitCreature()->DespawnOrUnsummon(); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_mimiron_clear_fires_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_clear_fires_SpellScript(); + } +}; + +// 64463 - Despawn Assault Bots +class spell_mimiron_despawn_assault_bots : public SpellScriptLoader +{ + public: + spell_mimiron_despawn_assault_bots() : SpellScriptLoader("spell_mimiron_despawn_assault_bots") { } + + class spell_mimiron_despawn_assault_bots_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_despawn_assault_bots_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (GetHitCreature()) + GetHitCreature()->DespawnOrUnsummon(); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_mimiron_despawn_assault_bots_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_despawn_assault_bots_SpellScript(); + } +}; + +// 64618 - Fire Search +class spell_mimiron_fire_search : public SpellScriptLoader +{ + public: + spell_mimiron_fire_search() : SpellScriptLoader("spell_mimiron_fire_search") { } + + class spell_mimiron_fire_search_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_fire_search_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_WATER_SPRAY)) + return false; + return true; + } + + bool Load() override + { + _noTarget = false; + return true; + } + + void FilterTargets(std::list& targets) + { + _noTarget = targets.empty(); + if (_noTarget) + return; + + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + targets.clear(); + targets.push_back(target); + } + + void HandleAftercast() + { + if (_noTarget) + GetCaster()->GetMotionMaster()->MoveRandom(15.0f); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + + if (UnitAI* ai = caster->GetAI()) + { + if (caster->GetDistance2d(GetHitUnit()) <= 15.0f && ai->GetData(DATA_WATERSPRAY)) + { + caster->CastSpell(GetHitUnit(), SPELL_WATER_SPRAY, true); + ai->SetData(DATA_WATERSPRAY, 0); + ai->SetData(DATA_MOVE_NEW, 1); + } + else if (caster->GetAI()->GetData(DATA_MOVE_NEW)) + { + caster->GetMotionMaster()->MoveChase(GetHitUnit()); + ai->SetData(DATA_MOVE_NEW, 0); + } + } + } + + void Register() override + { + AfterCast += SpellCastFn(spell_mimiron_fire_search_SpellScript::HandleAftercast); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mimiron_fire_search_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnEffectHitTarget += SpellEffectFn(spell_mimiron_fire_search_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + + private: + bool _noTarget; + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_fire_search_SpellScript(); + } +}; + +// 64436 - Magnetic Core +class spell_mimiron_magnetic_core : public SpellScriptLoader +{ + public: + spell_mimiron_magnetic_core() : SpellScriptLoader("spell_mimiron_magnetic_core") { } + + class spell_mimiron_magnetic_core_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_magnetic_core_SpellScript); + + void FilterTargets(std::list& targets) + { + targets.remove_if([](WorldObject* obj) { return obj->ToUnit() && (obj->ToUnit()->GetVehicleBase() || obj->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)); }); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mimiron_magnetic_core_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENTRY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_magnetic_core_SpellScript(); + } + + class spell_mimiron_magnetic_core_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mimiron_magnetic_core_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAGNETIC_CORE_VISUAL)) + return false; + return true; + } + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Creature* target = GetTarget()->ToCreature()) + { + target->GetAI()->DoAction(DO_DISABLE_AERIAL); + target->CastSpell(target, SPELL_MAGNETIC_CORE_VISUAL, true); + } + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Creature* target = GetTarget()->ToCreature()) + { + target->GetAI()->DoAction(DO_ENABLE_AERIAL); + target->RemoveAurasDueToSpell(SPELL_MAGNETIC_CORE_VISUAL); + } + } + + void OnRemoveSelf(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (TempSummon* summ = GetTarget()->ToTempSummon()) + summ->DespawnOrUnsummon(); + } + + void Register() override + { + AfterEffectApply += AuraEffectApplyFn(spell_mimiron_magnetic_core_AuraScript::OnApply, EFFECT_1, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_mimiron_magnetic_core_AuraScript::OnRemove, EFFECT_1, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_mimiron_magnetic_core_AuraScript::OnRemoveSelf, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_mimiron_magnetic_core_AuraScript(); + } +}; + +// 63667 - Napalm Shell +class spell_mimiron_napalm_shell : public SpellScriptLoader +{ + public: + spell_mimiron_napalm_shell() : SpellScriptLoader("spell_mimiron_napalm_shell") { } + + class spell_mimiron_napalm_shell_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_napalm_shell_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_NAPALM_SHELL)) + return false; + return true; + } + + void FilterTargets(std::list& targets) + { + if (targets.empty()) + return; + + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + + targets.remove_if(Trinity::AllWorldObjectsInRange(GetCaster(), 15.0f)); + + if (!targets.empty()) + target = Trinity::Containers::SelectRandomContainerElement(targets); + + targets.clear(); + targets.push_back(target); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetHitUnit(), SPELL_NAPALM_SHELL); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mimiron_napalm_shell_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnEffectHitTarget += SpellEffectFn(spell_mimiron_napalm_shell_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_napalm_shell_SpellScript(); + } +}; + +// 63274 - P3Wx2 Laser Barrage -- HACK! Core will currently not set UNIT_FIELD_CHANNEL_OBJECT automatially if the spell targets more than a single target. +class spell_mimiron_p3wx2_laser_barrage : public SpellScriptLoader +{ + public: + spell_mimiron_p3wx2_laser_barrage() : SpellScriptLoader("spell_mimiron_p3wx2_laser_barrage") { } + + class spell_mimiron_p3wx2_laser_barrage_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_p3wx2_laser_barrage_SpellScript); + + void OnHit(SpellEffIndex /*effIndex*/) + { + GetCaster()->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, GetHitUnit()->GetGUID()); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_mimiron_p3wx2_laser_barrage_SpellScript::OnHit, EFFECT_0, SPELL_EFFECT_APPLY_AURA); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_p3wx2_laser_barrage_SpellScript(); + } +}; + +// 64542 - Plasma Blast +class spell_mimiron_plasma_blast : public SpellScriptLoader +{ + public: + spell_mimiron_plasma_blast() : SpellScriptLoader("spell_mimiron_plasma_blast") { } + + class spell_mimiron_plasma_blast_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_plasma_blast_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_PLASMA_BLAST)) + return false; + return true; + } + + bool Load() override + { + return GetCaster()->GetVehicleKit() != nullptr; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()->GetVehicleKit()->GetPassenger(3)) + caster->CastSpell(GetHitUnit(), SPELL_PLASMA_BLAST); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_mimiron_plasma_blast_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_plasma_blast_SpellScript(); + } +}; + +// 66351 - Explosion +class spell_mimiron_proximity_explosion : public SpellScriptLoader +{ + public: + spell_mimiron_proximity_explosion() : SpellScriptLoader("spell_mimiron_proximity_explosion") { } + + class spell_mimiron_proximity_explosion_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_proximity_explosion_SpellScript); + + void OnHit(SpellEffIndex /*effIndex*/) + { + if (GetHitPlayer()) + if (InstanceScript* instance = GetCaster()->GetInstanceScript()) + if (Creature* mkII = ObjectAccessor::GetCreature(*GetCaster(), instance->GetData64(DATA_LEVIATHAN_MK_II))) + mkII->AI()->SetData(DATA_SETUP_MINE, 0); + } + + void HandleAura(SpellEffIndex /*effIndex*/) + { + GetCaster()->RemoveAurasDueToSpell(SPELL_PROXIMITY_MINE_PERIODIC_TRIGGER); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_mimiron_proximity_explosion_SpellScript::OnHit, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + OnEffectHitTarget += SpellEffectFn(spell_mimiron_proximity_explosion_SpellScript::HandleAura, EFFECT_1, SPELL_EFFECT_APPLY_AURA); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_proximity_explosion_SpellScript(); + } +}; + +// 63027 - Proximity Mines +class spell_mimiron_proximity_mines : public SpellScriptLoader +{ + public: + spell_mimiron_proximity_mines() : SpellScriptLoader("spell_mimiron_proximity_mines") { } + + class spell_mimiron_proximity_mines_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_proximity_mines_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_PROXIMITY_MINE)) + return false; + return true; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + for (uint8 i = 0; i < 10; ++i) + GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_PROXIMITY_MINE, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_mimiron_proximity_mines_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_proximity_mines_SpellScript(); + } +}; + +// 65346 - Proximity Mine +class spell_mimiron_proximity_trigger : public SpellScriptLoader +{ + public: + spell_mimiron_proximity_trigger() : SpellScriptLoader("spell_mimiron_proximity_trigger") { } + + class spell_mimiron_proximity_trigger_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_proximity_trigger_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_PROXIMITY_MINE_EXPLOSION)) + return false; + return true; + } + + void FilterTargets(std::list& targets) + { + targets.remove(GetExplTargetWorldObject()); + + if (targets.empty()) + FinishCast(SPELL_FAILED_NO_VALID_TARGETS); + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell((Unit*)NULL, SPELL_PROXIMITY_MINE_EXPLOSION, true); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mimiron_proximity_trigger_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnEffectHit += SpellEffectFn(spell_mimiron_proximity_trigger_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_proximity_trigger_SpellScript(); + } +}; + +// 63382 - Rapid Burst +class spell_mimiron_rapid_burst : public SpellScriptLoader +{ + public: + spell_mimiron_rapid_burst() : SpellScriptLoader("spell_mimiron_rapid_burst") { } + + class spell_mimiron_rapid_burst_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mimiron_rapid_burst_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_RAPID_BURST_LEFT) || !sSpellMgr->GetSpellInfo(SPELL_RAPID_BURST_RIGHT)) + return false; + return true; + } + + void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (TempSummon* summ = GetTarget()->ToTempSummon()) + summ->DespawnOrUnsummon(); + } + + void HandleDummyTick(AuraEffect const* aurEff) + { + if (GetCaster()) + GetCaster()->CastSpell(GetTarget(), aurEff->GetTickNumber() % 2 == 0 ? SPELL_RAPID_BURST_RIGHT : SPELL_RAPID_BURST_LEFT, true, NULL, aurEff); + } + + void Register() override + { + AfterEffectRemove += AuraEffectApplyFn(spell_mimiron_rapid_burst_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_mimiron_rapid_burst_AuraScript::HandleDummyTick, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_mimiron_rapid_burst_AuraScript(); + } +}; + +// 64402 - Rocket Strike, 65034 - Rocket Strike +class spell_mimiron_rocket_strike : public SpellScriptLoader +{ + public: + spell_mimiron_rocket_strike() : SpellScriptLoader("spell_mimiron_rocket_strike") { } + + class spell_mimiron_rocket_strike_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_rocket_strike_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SCRIPT_EFFECT_ROCKET_STRIKE)) + return false; + return true; + } + + void FilterTargets(std::list& targets) + { + if (targets.empty()) + return; + + if (m_scriptSpellId == SPELL_ROCKET_STRIKE_LEFT && GetCaster()->IsVehicle()) + if (WorldObject* target = GetCaster()->GetVehicleKit()->GetPassenger(6)) + { + targets.clear(); + targets.push_back(target); + } + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell((Unit*)NULL, SPELL_SCRIPT_EFFECT_ROCKET_STRIKE, true, NULL, NULL, GetCaster()->GetGUID()); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mimiron_rocket_strike_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnEffectHitTarget += SpellEffectFn(spell_mimiron_rocket_strike_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_rocket_strike_SpellScript(); + } +}; + +// 63041 - Rocket Strike +class spell_mimiron_rocket_strike_damage : public SpellScriptLoader +{ + public: + spell_mimiron_rocket_strike_damage() : SpellScriptLoader("spell_mimiron_rocket_strike_damage") { } + + class spell_mimiron_rocket_strike_damage_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_rocket_strike_damage_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_NOT_SO_FRIENDLY_FIRE)) + return false; + return true; + } + + void HandleAfterCast() + { + if (TempSummon* summ = GetCaster()->ToTempSummon()) + summ->DespawnOrUnsummon(); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (GetHitPlayer()) + if (InstanceScript* instance = GetCaster()->GetInstanceScript()) + if (Creature* mkii = ObjectAccessor::GetCreature(*GetCaster(), instance->GetData64(DATA_LEVIATHAN_MK_II))) + mkii->AI()->SetData(DATA_SETUP_ROCKET, 0); + } + + void HandleFriendlyFire(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell((Unit*)NULL, SPELL_NOT_SO_FRIENDLY_FIRE, true); + } + + void Register() override + { + AfterCast += SpellCastFn(spell_mimiron_rocket_strike_damage_SpellScript::HandleAfterCast); + OnEffectHitTarget += SpellEffectFn(spell_mimiron_rocket_strike_damage_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + OnEffectHitTarget += SpellEffectFn(spell_mimiron_rocket_strike_damage_SpellScript::HandleFriendlyFire, EFFECT_1, SPELL_EFFECT_SCHOOL_DAMAGE); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_rocket_strike_damage_SpellScript(); + } +}; + +// 63681 - Rocket Strike +class spell_mimiron_rocket_strike_target_select : public SpellScriptLoader +{ + public: + spell_mimiron_rocket_strike_target_select() : SpellScriptLoader("spell_mimiron_rocket_strike_target_select") { } + + class spell_mimiron_rocket_strike_target_select_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_rocket_strike_target_select_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_ROCKET_STRIKE)) + return false; + return true; + } + + void FilterTargets(std::list& targets) + { + if (targets.empty()) + return; + + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + + targets.remove_if(Trinity::AllWorldObjectsInRange(GetCaster(), 15.0f)); + + if (!targets.empty()) + target = Trinity::Containers::SelectRandomContainerElement(targets); + + targets.clear(); + targets.push_back(target); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (InstanceScript* instance = GetCaster()->GetInstanceScript()) + GetCaster()->CastSpell(GetHitUnit(), SPELL_SUMMON_ROCKET_STRIKE, true, NULL, NULL, instance->GetData64(DATA_VX_001)); + GetCaster()->SetDisplayId(11686); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mimiron_rocket_strike_target_select_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnEffectHitTarget += SpellEffectFn(spell_mimiron_rocket_strike_target_select_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_rocket_strike_target_select_SpellScript(); + } +}; + +// 64383 - Self Repair +class spell_mimiron_self_repair : public SpellScriptLoader +{ + public: + spell_mimiron_self_repair() : SpellScriptLoader("spell_mimiron_self_repair") { } + + class spell_mimiron_self_repair_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_self_repair_SpellScript); + + void HandleScript() + { + if (GetCaster()->GetAI()) + GetCaster()->GetAI()->DoAction(DO_ASSEMBLED_COMBAT); + } + + void Register() override + { + AfterHit += SpellHitFn(spell_mimiron_self_repair_SpellScript::HandleScript); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_self_repair_SpellScript(); + } +}; + +// 63414 - Spinning Up -- HACK! Core will currently not set UNIT_FIELD_CHANNEL_OBJECT automatially if the spell targets more than a single target. +// eff0 will hit both caster and target due to hack in spellmgr.cpp, it is necessary because caster will interrupt itself if aura is not active on caster. +class spell_mimiron_spinning_up : public SpellScriptLoader +{ + public: + spell_mimiron_spinning_up() : SpellScriptLoader("spell_mimiron_spinning_up") { } + + class spell_mimiron_spinning_up_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_spinning_up_SpellScript); + + void OnHit(SpellEffIndex /*effIndex*/) + { + if (GetHitUnit() != GetCaster()) + GetCaster()->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, GetHitUnit()->GetGUID()); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_mimiron_spinning_up_SpellScript::OnHit, EFFECT_0, SPELL_EFFECT_APPLY_AURA); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_spinning_up_SpellScript(); + } +}; + +// 64426 - Summon Scrap Bot +class spell_mimiron_summon_assault_bot : public SpellScriptLoader +{ + public: + spell_mimiron_summon_assault_bot() : SpellScriptLoader("spell_mimiron_summon_assault_bot") { } + + class spell_mimiron_summon_assault_bot_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mimiron_summon_assault_bot_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_ASSAULT_BOT)) + return false; + return true; + } + + void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + if (InstanceScript* instance = caster->GetInstanceScript()) + if (instance->GetBossState(BOSS_MIMIRON) == IN_PROGRESS) + caster->CastSpell(caster, SPELL_SUMMON_ASSAULT_BOT, false, NULL, aurEff, instance->GetData64(DATA_AERIAL_COMMAND_UNIT)); + } + + void Register() override + { + OnEffectRemove += AuraEffectRemoveFn(spell_mimiron_summon_assault_bot_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_mimiron_summon_assault_bot_AuraScript(); + } +}; + +// 64425 - Summon Scrap Bot Trigger +class spell_mimiron_summon_assault_bot_target : public SpellScriptLoader +{ + public: + spell_mimiron_summon_assault_bot_target() : SpellScriptLoader("spell_mimiron_summon_assault_bot_target") { } + + class spell_mimiron_summon_assault_bot_target_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_summon_assault_bot_target_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_ASSAULT_BOT_DUMMY)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell(GetHitUnit(), SPELL_SUMMON_ASSAULT_BOT_DUMMY, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_mimiron_summon_assault_bot_target_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_summon_assault_bot_target_SpellScript(); + } +}; + +// 64621 - Summon Fire Bot +class spell_mimiron_summon_fire_bot : public SpellScriptLoader +{ + public: + spell_mimiron_summon_fire_bot() : SpellScriptLoader("spell_mimiron_summon_fire_bot") { } + + class spell_mimiron_summon_fire_bot_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mimiron_summon_fire_bot_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_FIRE_BOT)) + return false; + + return true; + } + + void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + if (InstanceScript* instance = caster->GetInstanceScript()) + if (instance->GetBossState(BOSS_MIMIRON) == IN_PROGRESS) + caster->CastSpell(caster, SPELL_SUMMON_FIRE_BOT, false, NULL, aurEff, instance->GetData64(DATA_AERIAL_COMMAND_UNIT)); + } + + void Register() override + { + OnEffectRemove += AuraEffectRemoveFn(spell_mimiron_summon_fire_bot_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_mimiron_summon_fire_bot_AuraScript(); + } +}; + +// 64620 - Summon Fire Bot Trigger +class spell_mimiron_summon_fire_bot_target : public SpellScriptLoader +{ + public: + spell_mimiron_summon_fire_bot_target() : SpellScriptLoader("spell_mimiron_summon_fire_bot_target") { } + + class spell_mimiron_summon_fire_bot_target_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_summon_fire_bot_target_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_FIRE_BOT_DUMMY)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell(GetHitUnit(), SPELL_SUMMON_FIRE_BOT_DUMMY, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_mimiron_summon_fire_bot_target_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_summon_fire_bot_target_SpellScript(); + } +}; + +// 64562 - Summon Flames Spread Trigger +class spell_mimiron_summon_flames_spread : public SpellScriptLoader +{ + public: + spell_mimiron_summon_flames_spread() : SpellScriptLoader("spell_mimiron_summon_flames_spread") { } + + class spell_mimiron_summon_flames_spread_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_summon_flames_spread_SpellScript); + + void FilterTargets(std::list& targets) + { + if (targets.empty()) + return; + + // Flames must chase the closest player + WorldObject* target = targets.front(); + + for (std::list::const_iterator iter = targets.begin(); iter != targets.end(); ++iter) + if (GetCaster()->GetDistance2d(*iter) < GetCaster()->GetDistance2d(target)) + target = *iter; + + targets.clear(); + targets.push_back(target); + } + + void OnHit(SpellEffIndex /*effIndex*/) + { + GetCaster()->SetInFront(GetHitUnit()); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mimiron_summon_flames_spread_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnEffectHitTarget += SpellEffectFn(spell_mimiron_summon_flames_spread_SpellScript::OnHit, EFFECT_0, SPELL_EFFECT_APPLY_AURA); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_summon_flames_spread_SpellScript(); + } + + class spell_mimiron_summon_flames_spread_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mimiron_summon_flames_spread_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_FLAMES_SPREAD)) + return false; + return true; + } + + void HandleTick(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); + if (Unit* caster = GetCaster()) + if (caster->HasAura(SPELL_FLAMES_PERIODIC_TRIGGER)) + caster->CastSpell(GetTarget(), SPELL_SUMMON_FLAMES_SPREAD, true); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_mimiron_summon_flames_spread_AuraScript::HandleTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_mimiron_summon_flames_spread_AuraScript(); + } +}; + +// 64623 - Frost Bomb +class spell_mimiron_summon_frost_bomb_target : public SpellScriptLoader +{ + public: + spell_mimiron_summon_frost_bomb_target() : SpellScriptLoader("spell_mimiron_summon_frost_bomb_target") { } + + class spell_mimiron_summon_frost_bomb_target_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_summon_frost_bomb_target_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_FROST_BOMB)) + return false; + return true; + } + + void FilterTargets(std::list& targets) + { + if (targets.empty()) + return; + + targets.remove_if(Trinity::AllWorldObjectsInRange(GetCaster(), 15.0f)); + + if (targets.empty()) + return; + + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + + targets.clear(); + targets.push_back(target); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetHitUnit(), SPELL_SUMMON_FROST_BOMB, true); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mimiron_summon_frost_bomb_target_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnEffectHitTarget += SpellEffectFn(spell_mimiron_summon_frost_bomb_target_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_summon_frost_bomb_target_SpellScript(); + } +}; + +// 64398 - Summon Scrap Bot +class spell_mimiron_summon_junk_bot : public SpellScriptLoader +{ + public: + spell_mimiron_summon_junk_bot() : SpellScriptLoader("spell_mimiron_summon_junk_bot") { } + + class spell_mimiron_summon_junk_bot_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mimiron_summon_junk_bot_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_JUNK_BOT)) + return false; + return true; + } + + void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + if (InstanceScript* instance = caster->GetInstanceScript()) + if (instance->GetBossState(BOSS_MIMIRON) == IN_PROGRESS) + caster->CastSpell(caster, SPELL_SUMMON_JUNK_BOT, false, NULL, aurEff, instance->GetData64(DATA_AERIAL_COMMAND_UNIT)); + } + + void Register() override + { + OnEffectRemove += AuraEffectRemoveFn(spell_mimiron_summon_junk_bot_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_mimiron_summon_junk_bot_AuraScript(); + } +}; + +// 63820 - Summon Scrap Bot Trigger +class spell_mimiron_summon_junk_bot_target : public SpellScriptLoader +{ + public: + spell_mimiron_summon_junk_bot_target() : SpellScriptLoader("spell_mimiron_summon_junk_bot_target") { } + + class spell_mimiron_summon_junk_bot_target_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mimiron_summon_junk_bot_target_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_JUNK_BOT_DUMMY)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell(GetHitUnit(), SPELL_SUMMON_JUNK_BOT_DUMMY, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_mimiron_summon_junk_bot_target_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_mimiron_summon_junk_bot_target_SpellScript(); + } +}; + +// 63339 - Weld +class spell_mimiron_weld : public SpellScriptLoader +{ + public: + spell_mimiron_weld() : SpellScriptLoader("spell_mimiron_weld") { } + + class spell_mimiron_weld_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mimiron_weld_AuraScript); + + void HandleTick(AuraEffect const* aurEff) + { + Unit* caster = GetTarget(); + if (Unit* vehicle = caster->GetVehicleBase()) + { + if (aurEff->GetTickNumber() % 5 == 0) + caster->CastSpell(vehicle, RepairSpells[urand(0, 3)]); + caster->SetFacingToObject(vehicle); + } + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_mimiron_weld_AuraScript::HandleTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_mimiron_weld_AuraScript(); } }; void AddSC_boss_mimiron() { - new spell_ulduar_proximity_mines(); + new spell_mimiron_bomb_bot(); + new spell_mimiron_clear_fires(); + new spell_mimiron_despawn_assault_bots(); + new spell_mimiron_fire_search(); + new spell_mimiron_magnetic_core(); + new spell_mimiron_napalm_shell(); + new spell_mimiron_p3wx2_laser_barrage(); + new spell_mimiron_plasma_blast(); + new spell_mimiron_proximity_explosion(); + new spell_mimiron_proximity_mines(); + new spell_mimiron_proximity_trigger(); + new spell_mimiron_rapid_burst(); + new spell_mimiron_rocket_strike(); + new spell_mimiron_rocket_strike_damage(); + new spell_mimiron_rocket_strike_target_select(); + new spell_mimiron_self_repair(); + new spell_mimiron_spinning_up(); + new spell_mimiron_summon_assault_bot(); + new spell_mimiron_summon_assault_bot_target(); + new spell_mimiron_summon_fire_bot(); + new spell_mimiron_summon_fire_bot_target(); + new spell_mimiron_summon_flames_spread(); + new spell_mimiron_summon_frost_bomb_target(); + new spell_mimiron_summon_junk_bot(); + new spell_mimiron_summon_junk_bot_target(); + new spell_mimiron_weld(); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index 6aa753eac98..79f9283eb40 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -15,13 +15,12 @@ * with this program. If not, see . */ -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "InstanceScript.h" -#include "Player.h" -#include "WorldPacket.h" -#include "SpellScript.h" #include "ulduar.h" +#include "Player.h" +#include "ScriptedCreature.h" +#include "ScriptMgr.h" +#include "SpellScript.h" +#include "WorldPacket.h" static DoorData const doorData[] = { @@ -32,6 +31,9 @@ static DoorData const doorData[] = { GO_HODIR_ENTRANCE, BOSS_HODIR, DOOR_TYPE_ROOM, BOUNDARY_E }, { GO_HODIR_DOOR, BOSS_HODIR, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, { GO_HODIR_ICE_DOOR, BOSS_HODIR, DOOR_TYPE_PASSAGE, BOUNDARY_W }, + { GO_MIMIRON_DOOR_1, BOSS_MIMIRON, DOOR_TYPE_ROOM, BOUNDARY_W }, + { GO_MIMIRON_DOOR_2, BOSS_MIMIRON, DOOR_TYPE_ROOM, BOUNDARY_E }, + { GO_MIMIRON_DOOR_3, BOSS_MIMIRON, DOOR_TYPE_ROOM, BOUNDARY_S }, { GO_VEZAX_DOOR, BOSS_VEZAX, DOOR_TYPE_PASSAGE, BOUNDARY_E }, { GO_YOGG_SARON_DOOR, BOSS_YOGG_SARON, DOOR_TYPE_ROOM, BOUNDARY_S }, { GO_DOODAD_UL_SIGILDOOR_03, BOSS_ALGALON, DOOR_TYPE_ROOM, BOUNDARY_W }, @@ -70,11 +72,14 @@ class instance_ulduar : public InstanceMapScript uint64 AssemblyGUIDs[3]; uint64 KologarnGUID; uint64 AuriayaGUID; - uint64 MimironGUID; uint64 HodirGUID; uint64 ThorimGUID; uint64 FreyaGUID; uint64 ElderGUIDs[3]; + uint64 MimironGUID; + uint64 MimironVehicleGUIDs[3]; + uint64 MimironComputerGUID; + uint64 MimironWorldTriggerGUID; uint64 VezaxGUID; uint64 YoggSaronGUID; uint64 VoiceOfYoggSaronGUID; @@ -92,6 +97,9 @@ class instance_ulduar : public InstanceMapScript uint64 ThorimChestGUID; uint64 HodirRareCacheGUID; uint64 HodirChestGUID; + uint64 MimironTramGUID; + uint64 MimironElevatorGUID; + uint64 MimironButtonGUID; uint64 BrainRoomDoorGUIDs[3]; uint64 AlgalonSigilDoorGUID[3]; uint64 AlgalonFloorGUID[2]; @@ -126,6 +134,8 @@ class instance_ulduar : public InstanceMapScript KologarnGUID = 0; AuriayaGUID = 0; MimironGUID = 0; + MimironComputerGUID = 0; + MimironWorldTriggerGUID = 0; HodirGUID = 0; ThorimGUID = 0; FreyaGUID = 0; @@ -140,6 +150,9 @@ class instance_ulduar : public InstanceMapScript ThorimChestGUID = 0; HodirRareCacheGUID = 0; HodirChestGUID = 0; + MimironTramGUID = 0; + MimironElevatorGUID = 0; + MimironButtonGUID = 0; LeviathanGateGUID = 0; AlgalonUniverseGUID = 0; AlgalonTrapdoorGUID = 0; @@ -166,6 +179,7 @@ class instance_ulduar : public InstanceMapScript memset(AssemblyGUIDs, 0, sizeof(AssemblyGUIDs)); memset(RazorHarpoonGUIDs, 0, sizeof(RazorHarpoonGUIDs)); memset(ElderGUIDs, 0, sizeof(ElderGUIDs)); + memset(MimironVehicleGUIDs, 0, sizeof(MimironVehicleGUIDs)); memset(BrainRoomDoorGUIDs, 0, sizeof(BrainRoomDoorGUIDs)); memset(KeeperGUIDs, 0, sizeof(KeeperGUIDs)); memset(_summonObservationRingKeeper, false, sizeof(_summonObservationRingKeeper)); @@ -289,9 +303,6 @@ class instance_ulduar : public InstanceMapScript case NPC_AURIAYA: AuriayaGUID = creature->GetGUID(); break; - case NPC_MIMIRON: - MimironGUID = creature->GetGUID(); - break; // Hodir case NPC_HODIR: @@ -354,6 +365,26 @@ class instance_ulduar : public InstanceMapScript creature->DespawnOrUnsummon(); break; + // Mimiron + case NPC_MIMIRON: + MimironGUID = creature->GetGUID(); + break; + case NPC_LEVIATHAN_MKII: + MimironVehicleGUIDs[0] = creature->GetGUID(); + break; + case NPC_VX_001: + MimironVehicleGUIDs[1] = creature->GetGUID(); + break; + case NPC_AERIAL_COMMAND_UNIT: + MimironVehicleGUIDs[2] = creature->GetGUID(); + break; + case NPC_COMPUTER: + MimironComputerGUID = creature->GetGUID(); + break; + case NPC_WORLD_TRIGGER_MIMIRON: + MimironWorldTriggerGUID = creature->GetGUID(); + break; + case NPC_VEZAX: VezaxGUID = creature->GetGUID(); break; @@ -470,6 +501,15 @@ class instance_ulduar : public InstanceMapScript case GO_HODIR_CHEST: HodirChestGUID = gameObject->GetGUID(); break; + case GO_MIMIRON_TRAM: + MimironTramGUID = gameObject->GetGUID(); + break; + case GO_MIMIRON_ELEVATOR: + MimironElevatorGUID = gameObject->GetGUID(); + break; + case GO_MIMIRON_BUTTON: + MimironButtonGUID = gameObject->GetGUID(); + break; case GO_LEVIATHAN_GATE: LeviathanGateGUID = gameObject->GetGUID(); if (GetBossState(BOSS_LEVIATHAN) == DONE) @@ -482,6 +522,9 @@ class instance_ulduar : public InstanceMapScript case GO_HODIR_ENTRANCE: case GO_HODIR_DOOR: case GO_HODIR_ICE_DOOR: + case GO_MIMIRON_DOOR_1: + case GO_MIMIRON_DOOR_2: + case GO_MIMIRON_DOOR_3: case GO_VEZAX_DOOR: case GO_YOGG_SARON_DOOR: AddDoor(gameObject, true); @@ -566,6 +609,9 @@ class instance_ulduar : public InstanceMapScript case GO_HODIR_ENTRANCE: case GO_HODIR_DOOR: case GO_HODIR_ICE_DOOR: + case GO_MIMIRON_DOOR_1: + case GO_MIMIRON_DOOR_2: + case GO_MIMIRON_DOOR_3: case GO_VEZAX_DOOR: case GO_YOGG_SARON_DOOR: case GO_DOODAD_UL_SIGILDOOR_03: @@ -774,6 +820,10 @@ class instance_ulduar : public InstanceMapScript break; case DATA_UNBROKEN: Unbroken = data != 0; + break; + case DATA_MIMIRON_ELEVATOR: + if (GameObject* gameObject = instance->GetGameObject(MimironElevatorGUID)) + gameObject->SetGoState((GOState)data); break; case DATA_ILLUSION: illusion = data; @@ -846,8 +896,6 @@ class instance_ulduar : public InstanceMapScript return KologarnGUID; case BOSS_AURIAYA: return AuriayaGUID; - case BOSS_MIMIRON: - return MimironGUID; case BOSS_HODIR: return HodirGUID; case BOSS_THORIM: @@ -863,6 +911,22 @@ class instance_ulduar : public InstanceMapScript case BOSS_STONEBARK: return ElderGUIDs[2]; + // Mimiron + case BOSS_MIMIRON: + return MimironGUID; + case DATA_LEVIATHAN_MK_II: + return MimironVehicleGUIDs[0]; + case DATA_VX_001: + return MimironVehicleGUIDs[1]; + case DATA_AERIAL_COMMAND_UNIT: + return MimironVehicleGUIDs[2]; + case DATA_COMPUTER: + return MimironComputerGUID; + case DATA_MIMIRON_WORLD_TRIGGER: + return MimironWorldTriggerGUID; + case DATA_MIMIRON_BUTTON: + return MimironButtonGUID; + case BOSS_VEZAX: return VezaxGUID; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h index 3544ff3c079..81cb469318f 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h @@ -18,6 +18,7 @@ #ifndef DEF_ULDUAR_H #define DEF_ULDUAR_H +#include "InstanceScript.h" #include "ObjectMgr.h" #define UlduarScriptName "instance_ulduar" @@ -83,6 +84,18 @@ enum UlduarNPCs NPC_LEVIATHAN_MKII = 33432, NPC_VX_001 = 33651, NPC_AERIAL_COMMAND_UNIT = 33670, + NPC_ASSAULT_BOT = 34057, + NPC_BOMB_BOT = 33836, + NPC_JUNK_BOT = 33855, + NPC_EMERGENCY_FIRE_BOT = 34147, + NPC_FROST_BOMB = 34149, + NPC_BURST_TARGET = 34211, + NPC_FLAME = 34363, + NPC_FLAME_SPREAD = 34121, + NPC_DB_TARGET = 33576, + NPC_ROCKET_MIMIRON_VISUAL = 34050, + NPC_WORLD_TRIGGER_MIMIRON = 21252, + NPC_COMPUTER = 34143, // Freya's Keepers NPC_IRONBRANCH = 32913, @@ -204,6 +217,18 @@ enum UlduarGameObjects GO_THORIM_CHEST_HERO = 194315, GO_THORIM_CHEST = 194314, + // Mimiron + GO_MIMIRON_TRAM = 194675, + GO_MIMIRON_ELEVATOR = 194749, + GO_MIMIRON_BUTTON = 194739, + GO_MIMIRON_DOOR_1 = 194774, + GO_MIMIRON_DOOR_2 = 194775, + GO_MIMIRON_DOOR_3 = 194776, + GO_CACHE_OF_INNOVATION = 194789, + GO_CACHE_OF_INNOVATION_FIREFIGHTER = 194957, + GO_CACHE_OF_INNOVATION_HERO = 194956, + GO_CACHE_OF_INNOVATION_FIREFIGHTER_HERO = 194958, + // Vezax GO_VEZAX_DOOR = 194750, @@ -292,6 +317,16 @@ enum UlduarData // Hodir DATA_HODIR_RARE_CACHE, + // Mimiron + DATA_LEVIATHAN_MK_II, + DATA_VX_001, + DATA_AERIAL_COMMAND_UNIT, + DATA_COMPUTER, + DATA_MIMIRON_WORLD_TRIGGER, + DATA_MIMIRON_ELEVATOR, + DATA_MIMIRON_TRAM, + DATA_MIMIRON_BUTTON, + // Yogg-Saron DATA_VOICE_OF_YOGG_SARON, DATA_SARA, From 58c2b66e95270720f77efe8d90faa33822973049 Mon Sep 17 00:00:00 2001 From: Zharvek Date: Mon, 18 Aug 2014 22:06:06 +0100 Subject: [PATCH 03/19] Core/RBAC: Fix RBAC permissions This commit adds three missing commands to the world.commands table. The RBAC.h file is updated to the correct IDs from the auth.rbac_permissions table and the world.commands table. The RBAC.h file also had to be reordered to keep it clean. Closes #12854 Signed-off-by: DDuarte --- .../world/2014_08_14_02_world_command.sql | 8 +++ src/server/game/Accounts/RBAC.h | 56 +++++++++---------- 2 files changed, 36 insertions(+), 28 deletions(-) create mode 100644 sql/updates/world/2014_08_14_02_world_command.sql diff --git a/sql/updates/world/2014_08_14_02_world_command.sql b/sql/updates/world/2014_08_14_02_world_command.sql new file mode 100644 index 00000000000..0a3b44b1991 --- /dev/null +++ b/sql/updates/world/2014_08_14_02_world_command.sql @@ -0,0 +1,8 @@ +DELETE FROM `command` WHERE `permission`='683'; +DELETE FROM `command` WHERE `permission`='684'; +DELETE FROM `command` WHERE `permission`='705'; + +INSERT INTO `command` (`name`, `permission`, `help`) VALUES +('reload reputation_reward_rate', 683, 'Syntax: .reload reputation_reward_rate\r\nReload reputation_reward_rate table.'), +('reload reputation_spillover_template', 684, 'Syntax: .reload reputation_spillover_template\r\nReload reputation_spillover_template table.'), +('reload warden_action', 705, 'Syntax: .reload warden_action\r\nReload warden_action.'); diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index f2637a5febc..855ffd51bb8 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -427,8 +427,8 @@ enum RBACPermissions RBAC_PERM_COMMAND_REPAIRITEMS = 521, RBAC_PERM_COMMAND_RESPAWN = 522, RBAC_PERM_COMMAND_REVIVE = 523, - RBAC_PERM_COMMAND_SAVE = 524, - RBAC_PERM_COMMAND_SAVEALL = 525, + RBAC_PERM_COMMAND_SAVEALL = 524, + RBAC_PERM_COMMAND_SAVE = 525, RBAC_PERM_COMMAND_SETSKILL = 526, RBAC_PERM_COMMAND_SHOWAREA = 527, RBAC_PERM_COMMAND_SUMMON = 528, @@ -549,10 +549,10 @@ enum RBACPermissions RBAC_PERM_COMMAND_RELOAD_EVENT_SCRIPTS = 643, RBAC_PERM_COMMAND_RELOAD_FISHING_LOOT_TEMPLATE = 644, RBAC_PERM_COMMAND_RELOAD_GAME_GRAVEYARD_ZONE = 645, - RBAC_PERM_COMMAND_RELOAD_GAMEOBJECT_QUESTENDER = 646, - RBAC_PERM_COMMAND_RELOAD_GAMEOBJECT_QUEST_LOOT_TEMPLATE = 647, - RBAC_PERM_COMMAND_RELOAD_GAMEOBJECT_QUESTSTARTER = 648, - RBAC_PERM_COMMAND_RELOAD_GAME_TELE = 649, + RBAC_PERM_COMMAND_RELOAD_GAME_TELE = 646, + RBAC_PERM_COMMAND_RELOAD_GAMEOBJECT_QUESTENDER = 647, + RBAC_PERM_COMMAND_RELOAD_GAMEOBJECT_QUEST_LOOT_TEMPLATE = 648, + RBAC_PERM_COMMAND_RELOAD_GAMEOBJECT_QUESTSTARTER = 649, RBAC_PERM_COMMAND_RELOAD_GM_TICKETS = 650, RBAC_PERM_COMMAND_RELOAD_GOSSIP_MENU = 651, RBAC_PERM_COMMAND_RELOAD_GOSSIP_MENU_OPTION = 652, @@ -585,34 +585,34 @@ enum RBACPermissions RBAC_PERM_COMMAND_RELOAD_QUEST_TEMPLATE = 679, RBAC_PERM_COMMAND_RELOAD_RBAC = 680, RBAC_PERM_COMMAND_RELOAD_REFERENCE_LOOT_TEMPLATE = 681, - RBAC_PERM_COMMAND_RELOAD_REPUTATION_REWARD_RATE = 682, - RBAC_PERM_COMMAND_RELOAD_RESERVED_NAME = 683, - RBAC_PERM_COMMAND_RELOAD_SKILL_DISCOVERY_TEMPLATE = 684, - RBAC_PERM_COMMAND_RELOAD_SKILL_EXTRA_ITEM_TEMPLATE = 685, - RBAC_PERM_COMMAND_RELOAD_SKILL_FISHING_BASE_LEVEL = 686, - RBAC_PERM_COMMAND_RELOAD_SKINNING_LOOT_TEMPLATE = 687, - RBAC_PERM_COMMAND_RELOAD_SMART_SCRIPTS = 688, - RBAC_PERM_COMMAND_RELOAD_SPELL_AREA = 689, - RBAC_PERM_COMMAND_RELOAD_SPELL_BONUS_DATA = 690, - RBAC_PERM_COMMAND_RELOAD_SPELL_GROUP = 691, - RBAC_PERM_COMMAND_RELOAD_SPELL_GROUP_STACK_RULES = 692, - RBAC_PERM_COMMAND_RELOAD_SPELL_LEARN_SPELL = 693, - RBAC_PERM_COMMAND_RELOAD_SPELL_LINKED_SPELL = 694, + RBAC_PERM_COMMAND_RELOAD_RESERVED_NAME = 682, + RBAC_PERM_COMMAND_RELOAD_REPUTATION_REWARD_RATE = 683, + RBAC_PERM_COMMAND_RELOAD_SPILLOVER_TEMPLATE = 684, + RBAC_PERM_COMMAND_RELOAD_SKILL_DISCOVERY_TEMPLATE = 685, + RBAC_PERM_COMMAND_RELOAD_SKILL_EXTRA_ITEM_TEMPLATE = 686, + RBAC_PERM_COMMAND_RELOAD_SKILL_FISHING_BASE_LEVEL = 687, + RBAC_PERM_COMMAND_RELOAD_SKINNING_LOOT_TEMPLATE = 688, + RBAC_PERM_COMMAND_RELOAD_SMART_SCRIPTS = 689, + RBAC_PERM_COMMAND_RELOAD_SPELL_REQUIRED = 690, + RBAC_PERM_COMMAND_RELOAD_SPELL_AREA = 691, + RBAC_PERM_COMMAND_RELOAD_SPELL_BONUS_DATA = 692, + RBAC_PERM_COMMAND_RELOAD_SPELL_GROUP = 693, + RBAC_PERM_COMMAND_RELOAD_SPELL_LEARN_SPELL = 694, RBAC_PERM_COMMAND_RELOAD_SPELL_LOOT_TEMPLATE = 695, - RBAC_PERM_COMMAND_RELOAD_SPELL_PET_AURAS = 696, - RBAC_PERM_COMMAND_RELOAD_SPELL_PROC = 697, + RBAC_PERM_COMMAND_RELOAD_SPELL_LINKED_SPELL = 696, + RBAC_PERM_COMMAND_RELOAD_SPELL_PET_AURAS = 697, RBAC_PERM_COMMAND_RELOAD_SPELL_PROC_EVENT = 698, - RBAC_PERM_COMMAND_RELOAD_SPELL_REQUIRED = 699, + RBAC_PERM_COMMAND_RELOAD_SPELL_PROC = 699, RBAC_PERM_COMMAND_RELOAD_SPELL_SCRIPTS = 700, RBAC_PERM_COMMAND_RELOAD_SPELL_TARGET_POSITION = 701, RBAC_PERM_COMMAND_RELOAD_SPELL_THREATS = 702, - RBAC_PERM_COMMAND_RELOAD_SPILLOVER_TEMPLATE = 703, + RBAC_PERM_COMMAND_RELOAD_SPELL_GROUP_STACK_RULES = 703, RBAC_PERM_COMMAND_RELOAD_TRINITY_STRING = 704, - RBAC_PERM_COMMAND_RELOAD_VEHICLE_ACCESORY = 705, - RBAC_PERM_COMMAND_RELOAD_VEHICLE_TEMPLATE_ACCESSORY = 706, - RBAC_PERM_COMMAND_RELOAD_WARDEN_ACTION = 707, - RBAC_PERM_COMMAND_RELOAD_WAYPOINT_DATA = 708, - RBAC_PERM_COMMAND_RELOAD_WAYPOINT_SCRIPTS = 709, + RBAC_PERM_COMMAND_RELOAD_WARDEN_ACTION = 705, + RBAC_PERM_COMMAND_RELOAD_WAYPOINT_SCRIPTS = 706, + RBAC_PERM_COMMAND_RELOAD_WAYPOINT_DATA = 707, + RBAC_PERM_COMMAND_RELOAD_VEHICLE_ACCESORY = 708, + RBAC_PERM_COMMAND_RELOAD_VEHICLE_TEMPLATE_ACCESSORY = 709, RBAC_PERM_COMMAND_RESET = 710, RBAC_PERM_COMMAND_RESET_ACHIEVEMENTS = 711, RBAC_PERM_COMMAND_RESET_HONOR = 712, From a60c902b45b39c4641ccb9442826b567ead60595 Mon Sep 17 00:00:00 2001 From: Duarte Duarte Date: Mon, 18 Aug 2014 22:53:11 +0100 Subject: [PATCH 04/19] Rename 2014_08_14_02_world_command.sql to 2014_08_18_01_world_command.sql --- ...08_14_02_world_command.sql => 2014_08_18_01_world_command.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sql/updates/world/{2014_08_14_02_world_command.sql => 2014_08_18_01_world_command.sql} (100%) diff --git a/sql/updates/world/2014_08_14_02_world_command.sql b/sql/updates/world/2014_08_18_01_world_command.sql similarity index 100% rename from sql/updates/world/2014_08_14_02_world_command.sql rename to sql/updates/world/2014_08_18_01_world_command.sql From 4a3416627de4bac3c98c62a602fac93ebd94f1e4 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Tue, 19 Aug 2014 00:00:54 +0200 Subject: [PATCH 05/19] Core/Creatures: Fixed an arithmetic error in respawn code Creatures should now respawn correctly in their correct time. Issue was caused by single-precision floating-point format losing precision on lower digits with high numbers, for reference http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html Closes #12428 --- src/server/game/Entities/Creature/Creature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 7103654e90f..c04f2845110 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2277,7 +2277,7 @@ void Creature::AllLootRemovedFromCorpse() if (loot.loot_type == LOOT_SKINNING) m_corpseRemoveTime = now; else - m_corpseRemoveTime = now + m_corpseDelay * decayRate; + m_corpseRemoveTime = now + uint32(m_corpseDelay * decayRate); m_respawnTime = m_corpseRemoveTime + m_respawnDelay; } From 87cbe5a2fcb9c381bca87919baee4dad8ae4abd5 Mon Sep 17 00:00:00 2001 From: Brian Swango Date: Mon, 18 Aug 2014 20:03:13 -0400 Subject: [PATCH 06/19] Core/Loot: Fixes lootable items being able to be moved in inventory, and also loot generated that uses conditions from being saved to the DB. --- src/server/game/Entities/Item/Item.cpp | 8 ++++++++ src/server/game/Entities/Player/Player.cpp | 14 -------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 09911fc8f57..eb93c3ef753 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1265,6 +1265,14 @@ void Item::ItemContainerSaveLootToDB() // but we don't want to resave it. if (!_li->canSave) continue; + // Conditions are not checked when loot is generated, it is checked when loot is sent to a player. + // For items that are lootable, loot is saved to the DB immediately, that means that loot can be + // saved to the DB that the player never should have gotten. This check prevents that, so that only + // items that the player should get in loot are in the DB. + // IE: Horde items are not saved to the DB for Ally players. + Player* const guid = GetOwner(); + if (!_li->AllowedForPlayer(guid)) + continue; stmt_items = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEMCONTAINER_ITEMS); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index fa009d94fe2..c9ac4e73374 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -13176,13 +13176,6 @@ void Player::SwapItem(uint16 src, uint16 dst) // SRC checks - if (pSrcItem->m_lootGenerated) // prevent swap looting item - { - //best error message found for attempting to swap while looting - SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pSrcItem, NULL); - return; - } - // check unequip potability for equipped items and bank bags if (IsEquipmentPos(src) || IsBagPos(src)) { @@ -13213,13 +13206,6 @@ void Player::SwapItem(uint16 src, uint16 dst) if (pDstItem) { - if (pDstItem->m_lootGenerated) // prevent swap looting item - { - //best error message found for attempting to swap while looting - SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pDstItem, NULL); - return; - } - // check unequip potability for equipped items and bank bags if (IsEquipmentPos(dst) || IsBagPos(dst)) { From 8d92ccd54af38d79da73bddd86845df87cb791bc Mon Sep 17 00:00:00 2001 From: Brian Swango Date: Mon, 18 Aug 2014 20:06:49 -0400 Subject: [PATCH 07/19] Fixed tabs --- src/server/game/Entities/Item/Item.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index eb93c3ef753..6894dd86493 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1266,10 +1266,10 @@ void Item::ItemContainerSaveLootToDB() if (!_li->canSave) continue; // Conditions are not checked when loot is generated, it is checked when loot is sent to a player. - // For items that are lootable, loot is saved to the DB immediately, that means that loot can be - // saved to the DB that the player never should have gotten. This check prevents that, so that only - // items that the player should get in loot are in the DB. - // IE: Horde items are not saved to the DB for Ally players. + // For items that are lootable, loot is saved to the DB immediately, that means that loot can be + // saved to the DB that the player never should have gotten. This check prevents that, so that only + // items that the player should get in loot are in the DB. + // IE: Horde items are not saved to the DB for Ally players. Player* const guid = GetOwner(); if (!_li->AllowedForPlayer(guid)) continue; From 803d0c3b168bacc7c5a2c09d3c1bf6c7e9227056 Mon Sep 17 00:00:00 2001 From: Dr-J Date: Tue, 19 Aug 2014 11:57:03 +0100 Subject: [PATCH 08/19] DB/Misc:Missing Emotes Add missing emotes for Image of Loken and High Abbot Landgren for quest scripts, --- sql/updates/world/2014_08_19_00_world_misc.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sql/updates/world/2014_08_19_00_world_misc.sql diff --git a/sql/updates/world/2014_08_19_00_world_misc.sql b/sql/updates/world/2014_08_19_00_world_misc.sql new file mode 100644 index 00000000000..49d8f11fbdb --- /dev/null +++ b/sql/updates/world/2014_08_19_00_world_misc.sql @@ -0,0 +1,9 @@ +UPDATE `creature_text` SET `emote`=51 WHERE `entry`=27212; +UPDATE `creature_text` SET `emote`=1 WHERE `entry`=27439 AND `groupid`=0 AND `id`=0; +UPDATE `creature_text` SET `emote`=6 WHERE `entry`=27439 AND `groupid`=1 AND `id`=0; +UPDATE `creature_text` SET `emote`=1 WHERE `entry`=27439 AND `groupid`=2 AND `id`=0; +UPDATE `creature_text` SET `emote`=25 WHERE `entry`=27439 AND `groupid`=3 AND `id`=0; +UPDATE `creature_text` SET `emote`=274 WHERE `entry`=27439 AND `groupid`=4 AND `id`=0; +UPDATE `creature_text` SET `sound`=2943 WHERE `entry`=27439 AND `groupid`=5 AND `id`=0; + +UPDATE `smart_scripts` SET `event_param1`=30 WHERE `entryorguid`=17831 AND `source_type`=0 AND `id`=4 AND `link`=5; From f50cd88a9e4c49d74628bf4648fd5953ac3c280e Mon Sep 17 00:00:00 2001 From: Dr-J Date: Tue, 19 Aug 2014 15:03:58 +0100 Subject: [PATCH 09/19] DB/Misc: Greetings texts for Dalaran Vendors Only one not working is Tiffany Cartier even though sai is same as the rest and texts are added, idk seems theres an invisible wall as unlike other vendors player cannot get behind counter where tiffany is either. --- .../world/2014_08_19_01_world_misc.sql | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sql/updates/world/2014_08_19_01_world_misc.sql diff --git a/sql/updates/world/2014_08_19_01_world_misc.sql b/sql/updates/world/2014_08_19_01_world_misc.sql new file mode 100644 index 00000000000..dd50c4ce027 --- /dev/null +++ b/sql/updates/world/2014_08_19_01_world_misc.sql @@ -0,0 +1,84 @@ +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`= '' WHERE `entry` IN(29491,28994,28721,28725,33027,28727,28715,28714,28726,29523,28989,28997,28723,28718); + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(29491,28994,28721,28725,33027,28727,28715,28714,28726,29523,28989,28997,28723,28718) and `source_type`=0; + +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(29491, 0, 0, 0, 10, 0, 100, 0, 1, 20, 30000, 120000, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Karandonna - OOC LOS - Say Line'), +(28994, 0, 0, 0, 10, 0, 100, 0, 1, 20, 30000, 120000, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Abra Cadabra - OOC LOS - Say Line'), +(28721, 0, 0, 0, 10, 0, 100, 0, 1, 20, 30000, 120000, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Tiffany Cartier - OOC LOS - Say Line'), +(28727, 0, 0, 0, 10, 0, 100, 0, 1, 20, 30000, 120000, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Edward Egan - OOC LOS - Say Line'), +(33027, 0, 0, 0, 10, 0, 100, 0, 1, 20, 30000, 120000, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Jessica Sellers - OOC LOS - Say Line'), +(28725, 0, 0, 0, 10, 0, 100, 0, 1, 20, 30000, 120000, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Patricia Egan - OOC LOS - Say Line'), +(28715, 0, 0, 0, 10, 0, 100, 0, 1, 20, 30000, 120000, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Endora Moorehead - OOC LOS - Say Line'), +(28714, 0, 0, 0, 10, 0, 100, 0, 1, 20, 30000, 120000, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Ildine Sorrowspear - OOC LOS - Say Line'), +(28726, 0, 0, 0, 10, 0, 100, 0, 1, 20, 30000, 120000, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Dominique Stefano - OOC LOS - Say Line'), +(29523, 0, 0, 0, 10, 0, 100, 0, 1, 20, 30000, 120000, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Bragund Brightlink - OOC LOS - Say Line'), +(28989, 0, 0, 0, 10, 0, 100, 0, 1, 20, 30000, 120000, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Aemara - OOC LOS - Say Line'), +(28997, 0, 0, 0, 10, 0, 100, 0, 1, 20, 30000, 120000, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Griselda Hunderland - OOC LOS - Say Line'), +(28723, 0, 0, 0, 10, 0, 100, 0, 1, 20, 30000, 120000, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Larana Drome - OOC LOS - Say Line'), +(28718, 0, 0, 0, 10, 0, 100, 0, 1, 20, 30000, 120000, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Ranid Glowergold - OOC LOS - Say Line'); + +DELETE FROM `creature_text` WHERE `entry` IN(29491,28994,28721,28725,33027,28727,28715,28714,28726,29523,28989,28997,28723,28718); + +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES +(29491, 0, 0, 'Welcome. May I help you find something?', 12, 0, 100, 3, 0, 0, 'Karandonna', 32811), +(29491, 0, 1, 'Welcome.', 12, 0, 100, 3, 0, 0, 'Karandonna',32936), +(28994, 0, 0, 'Greetings.', 12, 0, 100, 3, 0, 0, 'Abra Cadabra',32935), +(28994, 0, 1, 'Welcome. May I help you find something?', 12, 0, 100, 3, 0, 0, 'Abra Cadabra',32811), +(28994, 0, 2, 'Welcome.', 12, 0, 100, 3, 0, 0, 'Abra Cadabra',32936), +(28994, 0, 3, 'Let me know if you need help finding anything, $c.', 12, 0, 100, 3, 0, 0, 'Abra Cadabra',32810), +(28721, 0, 0, 'Greetings! Please have a look around.', 12, 0, 100, 3, 0, 0, 'Tiffany Cartier',32809), +(28721, 0, 1, 'Greetings, $c.', 12, 0, 100, 3, 0, 0, 'Tiffany Cartier',32808), +(28721, 0, 2, 'Greetings.', 12, 0, 100, 3, 0, 0, 'Tiffany Cartier',32935), +(28721, 0, 3, 'Let me know if you need help finding anything, $c.', 12, 0, 100, 3, 0, 0, 'Tiffany Cartier',32810), +(28721, 0, 4, 'Welcome.', 12, 0, 100, 3, 0, 0, 'Tiffany Cartier',32936), +(28721, 0, 5, 'Welcome. May I help you find something?', 12, 0, 100, 3, 0, 0, 'Tiffany Cartier',32811), +(28725, 0, 0, 'Welcome. May I help you find something?', 12, 0, 100, 3, 0, 0, 'Patricia Egan',32811), +(28725, 0, 1, 'Welcome.', 12, 0, 100, 3, 0, 0, 'Patricia Egan',32936), +(28725, 0, 2, 'Greetings! Please have a look around.', 12, 0, 100, 3, 0, 0, 'Patricia Egan',32809), +(28725, 0, 3, 'Welcome!', 12, 0, 100, 3, 0, 0, 'Patricia Egan',32807), +(33027, 0, 0, 'Let me know if you need help finding anything, $c.', 12, 0, 100, 3, 0, 0, 'Jessica Sellers',32810), +(33027, 0, 1, 'Greetings, $c.', 12, 0, 100, 3, 0, 0, 'Jessica Sellers',32808), +(33027, 0, 2, 'Welcome. May I help you find something?', 12, 0, 100, 3, 0, 0, 'Jessica Sellers',32811), +(33027, 0, 3, 'Greetings! Please have a look around.', 12, 0, 100, 3, 0, 0, 'Jessica Sellers',32809), +(33027, 0, 4, 'Welcome.', 12, 0, 100, 3, 0, 0, 'Jessica Sellers',32936), +(28727, 0, 0, 'Welcome!', 12, 0, 100, 3, 0, 0, 'Edward Egan',32807), +(28727, 0, 1, 'Greetings.', 12, 0, 100, 3, 0, 0, 'Edward Egan',32935), +(28727, 0, 2, 'Welcome. May I help you find something?', 12, 0, 100, 3, 0, 0, 'Edward Egan',32811), +(28727, 0, 3, 'Greetings! Please have a look around.', 12, 0, 100, 3, 0, 0, 'Edward Egan', 32809), +(28715, 0, 0, 'Greetings! Please have a look around.', 12, 0, 100, 3, 0, 0, 'Endora Moorehead',32809), +(28715, 0, 1, 'Greetings, $c.', 12, 0, 100, 3, 0, 0, 'Endora Moorehead',32808), +(28715, 0, 2, 'Welcome!', 12, 0, 100, 3, 0, 0, 'Endora Moorehead',32807), +(28714, 0, 0, 'Welcome.', 12, 0, 100, 3, 0, 0, 'Ildine Sorrowspear',32936), +(28714, 0, 1, 'Greetings.', 12, 0, 100, 3, 0, 0, 'Ildine Sorrowspear',32935), +(28714, 0, 2, 'Let me know if you need help finding anything, $c.', 12, 0, 100, 3, 0, 0, 'Ildine Sorrowspear',32810), +(28726, 0, 0, 'Greetings! Please have a look around.', 12, 0, 100, 3, 0, 0, 'Dominique Stefano',32809), +(28726, 0, 1, 'Welcome!', 12, 0, 100, 3, 0, 0, 'Dominique Stefano',32807), +(28726, 0, 2, 'Greetings, $c.', 12, 0, 100, 3, 0, 0, 'Dominique Stefano',32808), +(28726, 0, 3, 'Welcome. May I help you find something?', 12, 0, 100, 3, 0, 0, 'Dominique Stefano',32811), +(28726, 0, 4, 'Greetings.', 12, 0, 100, 3, 0, 0, 'Dominique Stefano',32935), +(28726, 0, 5, 'Let me know if you need help finding anything, $c.', 12, 0, 100, 3, 0, 0, 'Dominique Stefano',32810), +(29523, 0, 0, 'Welcome.', 12, 0, 100, 3, 0, 0, 'Bragund Brightlink',32936), +(29523, 0, 1, 'Welcome!', 12, 0, 100, 3, 0, 0, 'Bragund Brightlink',32807), +(29523, 0, 2, 'Greetings! Please have a look around.', 12, 0, 100, 3, 0, 0, 'Bragund Brightlink',32809), +(29523, 0, 3, 'Let me know if you need help finding anything, $c.', 12, 0, 100, 3, 0, 0, 'Bragund Brightlink',32810), +(28989, 0, 0, 'Greetings! Please have a look around.', 12, 0, 100, 3, 0, 0, 'Aemara',32809), +(28989, 0, 1, 'Greetings.', 12, 0, 100, 3, 0, 0, 'Aemara',32935), +(28989, 0, 2, 'Welcome. May I help you find something?', 12, 0, 100, 3, 0, 0, 'Aemara',32811), +(28989, 0, 3, 'Greetings, $c.', 12, 0, 100, 3, 0, 0, 'Aemara',32808), +(28989, 0, 4, 'Let me know if you need help finding anything, $c.', 12, 0, 100, 3, 0, 0, 'Aemara',32810), +(28989, 0, 5, 'Welcome.', 12, 0, 100, 3, 0, 0, 'Aemara',32936), +(28997, 0, 0, 'Greetings, $c.', 12, 0, 100, 3, 0, 0, 'Griselda Hunderland',32808), +(28997, 0, 1, 'Let me know if you need help finding anything, $c.', 12, 0, 100, 3, 0, 0, 'Griselda Hunderland',32810), +(28997, 0, 2, 'Greetings.', 12, 0, 100, 3, 0, 0, 'Griselda Hunderland',32935), +(28997, 0, 3, 'Welcome!', 12, 0, 100, 3, 0, 0, 'Griselda Hunderland',32807), +(28723, 0, 0, 'Greetings, $c.', 12, 0, 100, 3, 0, 0, 'Larana Drome',32808), +(28723, 0, 1, 'Greetings.', 12, 0, 100, 3, 0, 0, 'Larana Drome',32935), +(28723, 0, 2, 'Welcome.', 12, 0, 100, 3, 0, 0, 'Larana Drome',32936), +(28718, 0, 0, 'Welcome!', 12, 0, 100, 3, 0, 0, 'Ranid Glowergold',32807), +(28718, 0, 1, 'Greetings.', 12, 0, 100, 3, 0, 0, 'Ranid Glowergold',32935), +(28718, 0, 2, 'Welcome. May I help you find something?', 12, 0, 100, 3, 0, 0, 'Ranid Glowergold',32811), +(28718, 0, 3, 'Let me know if you need help finding anything, $c.', 12, 0, 100, 3, 0, 0, 'Ranid Glowergold',32810), +(28718, 0, 4, 'Greetings! Please have a look around.', 12, 0, 100, 3, 0, 0, 'Ranid Glowergold',32809), +(28718, 0, 5, 'Greetings, $c.', 12, 0, 100, 3, 0, 0, 'Ranid Glowergold',32808), +(28718, 0, 6, 'Welcome.', 12, 0, 100, 3, 0, 0, 'Ranid Glowergold',32936); From ba6365fc7a53845026c508e875e24673c656da5b Mon Sep 17 00:00:00 2001 From: Dr-J Date: Tue, 19 Aug 2014 16:02:27 +0100 Subject: [PATCH 10/19] DB/Gameevent: Brew of the Year Adds vendors, events, sai for faction change, change of appearance depending on location (orgrimmar or iron forge), gossip and conditions * To Do * At start of each monthly event mail should be sent to players who are members with a sample of that months brew, this is not currently implemented. * Possibly missing yells from vendors saying beer but cannot confirm this. --- .../world/2014_08_19_01_world_event.sql | 231 ++++++++++++++++++ 1 file changed, 231 insertions(+) create mode 100644 sql/updates/world/2014_08_19_01_world_event.sql diff --git a/sql/updates/world/2014_08_19_01_world_event.sql b/sql/updates/world/2014_08_19_01_world_event.sql new file mode 100644 index 00000000000..7b3bdd86059 --- /dev/null +++ b/sql/updates/world/2014_08_19_01_world_event.sql @@ -0,0 +1,231 @@ +SET @EventEntry := 34; +SET @CGuid := 127312; + +-- Add game events to gameevent table (one per month so different brew vendor spawns each month which sells a different brew + +DELETE FROM `game_event` WHERE `eventEntry` BETWEEN @EventEntry AND @EventEntry+11; + +INSERT INTO `game_event` (`eventEntry`, `start_time`, `end_time`, `occurence`, `length`, `holiday`, `description`, `world_event`, `announce`) VALUES +(@EventEntry, '2012-10-01 00:01:00', '2020-12-31 06:00:00', 525600, 44640, 0, 'Brew of the Month October', 0, 2), +(@EventEntry+1, '2012-11-01 00:01:00', '2020-12-31 06:00:00', 525600, 43200, 0, 'Brew of the Month November', 0, 2), +(@EventEntry+2, '2012-12-01 00:01:00', '2020-12-31 06:00:00', 525600, 44640, 0, 'Brew of the Month December', 0, 2), +(@EventEntry+3, '2012-01-01 00:01:00', '2020-12-31 06:00:00', 525600, 44640, 0, 'Brew of the Month January', 0, 2), +(@EventEntry+4, '2012-02-01 00:01:00', '2020-12-31 06:00:00', 525600, 40320, 0, 'Brew of the Month February', 0, 2), +(@EventEntry+5, '2012-03-01 00:01:00', '2020-12-31 06:00:00', 525600, 44640, 0, 'Brew of the Month March', 0, 2), +(@EventEntry+6, '2012-04-01 00:01:00', '2020-12-31 06:00:00', 525600, 43200, 0, 'Brew of the Month April', 0, 2), +(@EventEntry+7, '2012-05-01 00:01:00', '2020-12-31 06:00:00', 525600, 44640, 0, 'Brew of the Month May', 0, 2), +(@EventEntry+8, '2012-06-01 00:01:00', '2020-12-31 06:00:00', 525600, 43200, 0, 'Brew of the Month June', 0, 2), +(@EventEntry+9, '2012-07-01 00:01:00', '2020-12-31 06:00:00', 525600, 44640, 0, 'Brew of the Month July', 0, 2), +(@EventEntry+10, '2012-08-01 00:01:00', '2020-12-31 06:00:00', 525600, 44640, 0, 'Brew of the Month August', 0, 2), +(@EventEntry+11, '2012-09-01 00:01:00', '2020-12-31 06:00:00', 525600, 44640, 0, 'Brew of the Month September', 0, 2); + +UPDATE `creature_template` SET `minlevel`=50, `maxlevel`=50, `npcflag`=129,`gossip_menu_id`=9549 WHERE `entry` IN(27806,27810,27811,27812,27813,27814,27815,27816,27817,27818,27819,27820); + +-- Add brewfest brews to vendors some of these are already in db but all are here just in case) + +DELETE FROM `npc_vendor` WHERE `entry` IN (27806,27810,27811,27812,27813,27814,27815,27816,27817,27818,27819,27820); + +INSERT INTO `npc_vendor` (`entry`, `slot`, `item`, `maxcount`, `incrtime`, `ExtendedCost`) VALUES +(27806, 0, 37488, 0, 0, 0), -- Wild Winter Pilsner (January) +(27810, 0, 37899, 0, 0, 0), -- Izzard's Ever Flavor (February) +(27811, 0, 37490, 0, 0, 0), -- Aromatic Honey Brew (March) +(27812, 0, 37491, 0, 0, 0), -- Metok's Bubble Bock (April) +(27813, 0, 37492, 0, 0, 0), -- Springtime Stout (May) +(27814, 0, 37493, 0, 0, 0), -- Blackrock Lager (June) +(27815, 0, 37494, 0, 0, 0), -- Stranglethorn Brew (July) +(27816, 0, 37495, 0, 0, 0), -- Draenic Pale Ale (August) +(27817, 0, 37496, 0, 0, 0), -- Binary Brew (September) +(27818, 0, 37497, 0, 0, 0), -- Autumnal Acorn Ale (October) +(27819, 0, 37498, 0, 0, 0), -- Bartlett's Bitter Brew (November) +(27820, 0, 37499, 0, 0, 0); -- Lord of Frost's Private Label (December) + +-- Set buycount to 6 and make duration of these items so the duration is in realtime and not game time +UPDATE `item_template` SET `BuyCount`=6, `flagsCustom`=1 WHERE `entry` IN(37488,37899,37490,37491,37492,37493,37494,37495,37496,37497,37498,37499,37496); + +-- Link brew vendors to monthly events +DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @CGuid AND @CGuid+23; + +INSERT INTO `game_event_creature` (`eventEntry`, `guid`) VALUES +(@EventEntry+3, @CGuid), +(@EventEntry+3, @CGuid+1), +(@EventEntry+4, @CGuid+2), +(@EventEntry+4, @CGuid+3), +(@EventEntry+5, @CGuid+4), +(@EventEntry+5, @CGuid+5), +(@EventEntry+6, @CGuid+6), +(@EventEntry+6, @CGuid+7), +(@EventEntry+7, @CGuid+8), +(@EventEntry+7, @CGuid+9), +(@EventEntry+8, @CGuid+10), +(@EventEntry+8, @CGuid+11), +(@EventEntry+9, @CGuid+12), +(@EventEntry+9, @CGuid+13), +(@EventEntry+10, @CGuid+14), +(@EventEntry+10, @CGuid+15), +(@EventEntry+11, @CGuid+16), +(@EventEntry+11, @CGuid+17), +(@EventEntry, @CGuid+18), +(@EventEntry, @CGuid+19), +(@EventEntry+1, @CGuid+20), +(@EventEntry+1, @CGuid+21), +(@EventEntry+2, @CGuid+22), +(@EventEntry+2, @CGuid+23); + + +-- Add some missing gossips and conditions for these which are needed so only players who completed brew of the month quest can access vendors +UPDATE `gossip_menu_option` SET `npc_option_npcflag`=128,`option_id`=3 WHERE `menu_id`=9554 AND `id`=0; + +DELETE FROM `gossip_menu_option` WHERE `menu_id`=9548; + +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES +(9548, 0, 0, 'What do you have for me?', 26695, 3, 128, 0, 0, 0, 0, '', 0); + + +DELETE FROM `gossip_menu_option` WHERE `menu_id`=9549; + +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES +(9549, 0, 1, 'I''d like to buy this month''s brew.', 26693, 3, 128, 0, 0, 0, 0, '', 0); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`IN(9549,9548); + +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 9548, 0, 0, 0, 2, 0, 37829, 1, 0, 0, 0, 0, '', 'Only show gossip menu if player has at least 1 brewfest prize token'), + +(15, 9549, 0, 0, 0, 8, 0, 12421, 0, 0, 0, 0, 0, '', 'Only allow players who have completed brew of the month quest to access vendor'), +(15, 9549, 0, 0, 2, 8, 0, 12420, 0, 0, 0, 0, 0, '', 'Only allow players who have completed brew of the month quest to access vendor'); + +DELETE FROM `creature` WHERE `id` IN (27806,27810,27811,27812,27813,27814,27815,27816,27817,27818,27819,27820); + +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES +(@CGuid, 27806, 0, 1, 1, 24979, 1, -4845.949, -861.9443, 501.9972, 4.485496, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+1, 27806, 1, 1, 1, 24979, 1, 1475.8, -4210.233, 43.2693, 4.014257, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+2, 27810, 0, 1, 1, 24980, 1, -4845.949, -861.9443, 501.9972, 4.485496, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+3, 27810, 1, 1, 1, 24980, 1, 1475.8, -4210.233, 43.2693, 4.014257, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+4, 27811, 0, 1, 1, 24981, 1, -4845.949, -861.9443, 501.9972, 4.485496, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+5, 27811, 1, 1, 1, 24981, 1, 1475.8, -4210.233, 43.2693, 4.014257, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+6, 27812, 0, 1, 1, 24982, 1, -4845.949, -861.9443, 501.9972, 4.485496, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+7, 27812, 1, 1, 1, 24982, 1, 1475.8, -4210.233, 43.2693, 4.014257, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+8, 27813, 0, 1, 1, 24983, 1, -4845.949, -861.9443, 501.9972, 4.485496, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+9, 27813, 1, 1, 1, 24983, 1, 1475.8, -4210.233, 43.2693, 4.014257, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+10, 27814, 0, 1, 1, 24984, 1, -4845.949, -861.9443, 501.9972, 4.485496, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+11, 27814, 1, 1, 1, 24984, 1, 1475.8, -4210.233, 43.2693, 4.014257, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+12, 27815, 0, 1, 1, 24985, 1, -4845.949, -861.9443, 501.9972, 4.485496, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+13, 27815, 1, 1, 1, 24985, 1, 1475.8, -4210.233, 43.2693, 4.014257, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+14, 27816, 0, 1, 1, 24986, 1, -4845.949, -861.9443, 501.9972, 4.485496, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+15, 27816, 1, 1, 1, 24986, 1, 1475.8, -4210.233, 43.2693, 4.014257, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+16, 27817, 0, 1, 1, 24987, 1, -4845.949, -861.9443, 501.9972, 4.485496, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+17, 27817, 1, 1, 1, 24987, 1, 1475.8, -4210.233, 43.2693, 4.014257, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+18, 27818, 0, 1, 1, 24988, 1, -4845.949, -861.9443, 501.9972, 4.485496, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+19, 27818, 1, 1, 1, 24988, 1, 1475.8, -4210.233, 43.2693, 4.014257, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+20, 27819, 0, 1, 1, 24989, 1, -4845.949, -861.9443, 501.9972, 4.485496, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+21, 27819, 1, 1, 1, 24989, 1, 1475.8, -4210.233, 43.2693, 4.014257, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+22, 27820, 0, 1, 1, 24990, 1, -4845.949, -861.9443, 501.9972, 4.485496, 120, 0, 0, 2215, 0, 0, 0, 0, 0), +(@CGuid+23, 27820, 1, 1, 1, 24990, 1, 1475.8, -4210.233, 43.2693, 4.014257, 120, 0, 0, 2215, 0, 0, 0, 0, 0); + +-- Spawn Larkin Thunderbrew who is needed so alliance can turn quest to unlock vendors +DELETE FROM `creature` WHERE `guid`=@CGuid+24; + +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES +(@CGuid+24, 27478, 0, 1, 1, 22396, 0, -4849.41, -862.255, 501.997, 4.85202, 300, 0, 0, 2215, 0, 0, 0, 0, 0); + +-- Smart scripts to dynamically change faction on brew vendors depending on location +-- 774 = Alliance only alliance can access vendor, vendor still appears neutral to horde but wont allow interaction +-- 775 = Horde only horde can access vendor, vendor still appears neutral to alliance but wont allow interaction + + +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry` IN (27806,27810,27811,27812,27813,27814,27815,27816,27817,27818,27819,27820); + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (27806,27810,27811,27812,27813,27814,27815,27816,27817,27818,27819,27820); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(27806, 0, 0, 2, 11, 0, 100, 0, 0, 0, 0, 0, 2, 774 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Alliance)'), +(27806, 0, 1, 3, 11, 0, 100, 0, 0, 0, 0, 0, 2, 775 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Horde)'), +(27806, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49672 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Alliance'), +(27806, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49673 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Horde'), +(27810, 0, 0, 2, 11, 0, 100, 0, 0, 0, 0, 0, 2, 774 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Alliance)'), +(27810, 0, 1, 3, 11, 0, 100, 0, 0, 0, 0, 0, 2, 775 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Horde)'), +(27810, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49672 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Alliance'), +(27810, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49673 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Horde'), +(27811, 0, 0, 2, 11, 0, 100, 0, 0, 0, 0, 0, 2, 774 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Alliance)'), +(27811, 0, 1, 3, 11, 0, 100, 0, 0, 0, 0, 0, 2, 775 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Horde)'), +(27811, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49672 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Alliance'), +(27811, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49673 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Horde'), +(27812, 0, 0, 2, 11, 0, 100, 0, 0, 0, 0, 0, 2, 774 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Alliance)'), +(27812, 0, 1, 3, 11, 0, 100, 0, 0, 0, 0, 0, 2, 775 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Horde)'), +(27812, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49672 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Alliance'), +(27812, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49673 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Horde'), +(27813, 0, 0, 2, 11, 0, 100, 0, 0, 0, 0, 0, 2, 774 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Alliance)'), +(27813, 0, 1, 3, 11, 0, 100, 0, 0, 0, 0, 0, 2, 775 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Horde)'), +(27813, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49672 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Alliance'), +(27813, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49673 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Horde'), +(27814, 0, 0, 2, 11, 0, 100, 0, 0, 0, 0, 0, 2, 774 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Alliance)'), +(27814, 0, 1, 3, 11, 0, 100, 0, 0, 0, 0, 0, 2, 775 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Horde)'), +(27814, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49672 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Alliance'), +(27814, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49673 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Horde'), +(27815, 0, 0, 2, 11, 0, 100, 0, 0, 0, 0, 0, 2, 774 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Alliance)'), +(27815, 0, 1, 3, 11, 0, 100, 0, 0, 0, 0, 0, 2, 775 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Horde)'), +(27815, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49672 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Alliance'), +(27815, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49673 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Horde'), +(27816, 0, 0, 2, 11, 0, 100, 0, 0, 0, 0, 0, 2, 774 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Alliance)'), +(27816, 0, 1, 3, 11, 0, 100, 0, 0, 0, 0, 0, 2, 775 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Horde)'), +(27816, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49672 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Alliance'), +(27816, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49673 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Horde'), +(27817, 0, 0, 2, 11, 0, 100, 0, 0, 0, 0, 0, 2, 774 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Alliance)'), +(27817, 0, 1, 3, 11, 0, 100, 0, 0, 0, 0, 0, 2, 775 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Horde)'), +(27817, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49672 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Alliance'), +(27817, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49673 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Horde'), +(27818, 0, 0, 2, 11, 0, 100, 0, 0, 0, 0, 0, 2, 774 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Alliance)'), +(27818, 0, 1, 3, 11, 0, 100, 0, 0, 0, 0, 0, 2, 775 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Horde)'), +(27818, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49672 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Alliance'), +(27818, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49673 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Horde'), +(27819, 0, 0, 2, 11, 0, 100, 0, 0, 0, 0, 0, 2, 774 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Alliance)'), +(27819, 0, 1, 3, 11, 0, 100, 0, 0, 0, 0, 0, 2, 775 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Horde)'), +(27819, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49672 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Alliance'), +(27819, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49673 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Horde'), +(27820, 0, 0, 2, 11, 0, 100, 0, 0, 0, 0, 0, 2, 774 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Alliance)'), +(27820, 0, 1, 3, 11, 0, 100, 0, 0, 0, 0, 0, 2, 775 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Set Faction (Horde)'), +(27820, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49672 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Alliance'), +(27820, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 49673 , 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brew Vendor - On Spawn - Cast BOTM - Vendor - Transform - Horde'); + + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry` IN (27806,27810,27811,27812,27813,27814,27815,27816,27817,27818,27819,27820); + +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(22,1,27806,0,0,23,1,1537,0,0,0,0,'','Only Run AI in Ironforge'), +(22,2,27806,0,0,23,1,1637,0,0,0,0,'','Only Run AI in Ogrimmar'), +(22,1,27810,0,0,23,1,1537,0,0,0,0,'','Only Run AI in Ironforge'), +(22,2,27810,0,0,23,1,1637,0,0,0,0,'','Only Run AI in Ogrimmar'), +(22,1,27811,0,0,23,1,1537,0,0,0,0,'','Only Run AI in Ironforge'), +(22,2,27811,0,0,23,1,1637,0,0,0,0,'','Only Run AI in Ogrimmar'), +(22,1,27812,0,0,23,1,1537,0,0,0,0,'','Only Run AI in Ironforge'), +(22,2,27812,0,0,23,1,1637,0,0,0,0,'','Only Run AI in Ogrimmar'), +(22,1,27813,0,0,23,1,1537,0,0,0,0,'','Only Run AI in Ironforge'), +(22,2,27813,0,0,23,1,1637,0,0,0,0,'','Only Run AI in Ogrimmar'), +(22,1,27814,0,0,23,1,1537,0,0,0,0,'','Only Run AI in Ironforge'), +(22,2,27814,0,0,23,1,1637,0,0,0,0,'','Only Run AI in Ogrimmar'), +(22,1,27815,0,0,23,1,1537,0,0,0,0,'','Only Run AI in Ironforge'), +(22,2,27815,0,0,23,1,1637,0,0,0,0,'','Only Run AI in Ogrimmar'), +(22,1,27816,0,0,23,1,1537,0,0,0,0,'','Only Run AI in Ironforge'), +(22,2,27816,0,0,23,1,1637,0,0,0,0,'','Only Run AI in Ogrimmar'), +(22,1,27817,0,0,23,1,1537,0,0,0,0,'','Only Run AI in Ironforge'), +(22,2,27817,0,0,23,1,1637,0,0,0,0,'','Only Run AI in Ogrimmar'), +(22,1,27818,0,0,23,1,1537,0,0,0,0,'','Only Run AI in Ironforge'), +(22,2,27818,0,0,23,1,1637,0,0,0,0,'','Only Run AI in Ogrimmar'), +(22,1,27819,0,0,23,1,1537,0,0,0,0,'','Only Run AI in Ironforge'), +(22,2,27819,0,0,23,1,1637,0,0,0,0,'','Only Run AI in Ogrimmar'), +(22,1,27820,0,0,23,1,1537,0,0,0,0,'','Only Run AI in Ironforge'), +(22,2,27820,0,0,23,1,1637,0,0,0,0,'','Only Run AI in Ogrimmar'); + +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN(42256,42255,42254,43961,42263,42257,43959,42264,42259,42260,42258,42261); +INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES +(42256, 51655, 0, 'BOTM - Create Empty Brew Bottle'), +(42255, 51655, 0, 'BOTM - Create Empty Brew Bottle'), +(42254, 51655, 0, 'BOTM - Create Empty Brew Bottle'), +(43961, 51655, 0, 'BOTM - Create Empty Brew Bottle'), +(42263, 51655, 0, 'BOTM - Create Empty Brew Bottle'), +(42257, 51655, 0, 'BOTM - Create Empty Brew Bottle'), +(43959, 51655, 0, 'BOTM - Create Empty Brew Bottle'), +(42264, 51655, 0, 'BOTM - Create Empty Brew Bottle'), +(42259, 51655, 0, 'BOTM - Create Empty Brew Bottle'), +(42260, 51655, 0, 'BOTM - Create Empty Brew Bottle'), +(42258, 51655, 0, 'BOTM - Create Empty Brew Bottle'), +(42261, 51655, 0, 'BOTM - Create Empty Brew Bottle'); From ecf399e2378bebed8add43be0cbd3208ed80a8ea Mon Sep 17 00:00:00 2001 From: cemak Date: Tue, 19 Aug 2014 19:26:26 +0400 Subject: [PATCH 11/19] Core/Arena: Fix exploit on delete member with team during fights. --- src/server/game/Handlers/ArenaTeamHandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/game/Handlers/ArenaTeamHandler.cpp b/src/server/game/Handlers/ArenaTeamHandler.cpp index 3bb3edac500..20d89d9efb5 100644 --- a/src/server/game/Handlers/ArenaTeamHandler.cpp +++ b/src/server/game/Handlers/ArenaTeamHandler.cpp @@ -311,6 +311,10 @@ void WorldSession::HandleArenaTeamRemoveOpcode(WorldPacket& recvData) SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, "", "", ERR_ARENA_TEAM_LEADER_LEAVE_S); return; } + + // Player cannot be removed during fights + if (arenaTeam->IsFighting()) + return; arenaTeam->DelMember(member->Guid, true); From 36e32cc242b3d0eefa8cb19ca97eb9b2f0824bd8 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 19 Aug 2014 19:32:06 +0200 Subject: [PATCH 12/19] Core/NetworkIO: Restored opcode and size checks lost during ace->boost changes, fixes crashes caused by players sending invalid opcodes/too big packets --- src/server/game/Server/WorldSocket.cpp | 22 ++++++++++++++++++++-- src/server/game/Server/WorldSocket.h | 2 ++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index d2602e83944..5945d9fe868 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -16,13 +16,14 @@ * with this program. If not, see . */ -#include #include "WorldSocket.h" #include "BigNumber.h" #include "Opcodes.h" +#include "Player.h" #include "ScriptMgr.h" #include "SHA1.h" #include "PacketLog.h" +#include using boost::asio::ip::tcp; @@ -63,6 +64,22 @@ void WorldSocket::ReadHeaderHandler() EndianConvertReverse(header->size); EndianConvert(header->cmd); + if (!header->IsValid()) + { + if (_worldSession) + { + Player* player = _worldSession->GetPlayer(); + TC_LOG_ERROR("network", "WorldSocket::ReadHeaderHandler(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %hu, cmd: %u)", + _worldSession->GetAccountId(), player ? player->GetGUIDLow() : 0, player ? player->GetName().c_str() : "", header->size, header->cmd); + } + else + TC_LOG_ERROR("network", "WorldSocket::ReadHeaderHandler(): client %s sent malformed packet (size: %hu, cmd: %u)", + GetRemoteIpAddress().to_string().c_str(), header->size, header->cmd); + + CloseSocket(); + return; + } + AsyncReadData(header->size - sizeof(header->cmd)); } @@ -106,7 +123,8 @@ void WorldSocket::ReadDataHandler() if (!_worldSession) { TC_LOG_ERROR("network.opcode", "ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); - break; + CloseSocket(); + return; } // Our Idle timer will reset on any non PING opcodes. diff --git a/src/server/game/Server/WorldSocket.h b/src/server/game/Server/WorldSocket.h index faa57b58f93..0667c1b090a 100644 --- a/src/server/game/Server/WorldSocket.h +++ b/src/server/game/Server/WorldSocket.h @@ -48,6 +48,8 @@ struct ClientPktHeader { uint16 size; uint32 cmd; + + bool IsValid() const { return size >= 4 && size < 10240 && cmd < NUM_MSG_TYPES; } }; #pragma pack(pop) From 87b973c2806fa635648dde39bef2bd1c65d28c50 Mon Sep 17 00:00:00 2001 From: Dr-J Date: Wed, 20 Aug 2014 03:24:53 +0100 Subject: [PATCH 13/19] DB/SAI: All is Well That Ends Well Script turn in event with Rhonin and Brann Bronzebeard for turn in of either version of all is well that ends well rhonin will respawn a few seconds after despawning after using the teleport visual due to script on Archmage Aethas Sunreaver to respawn him, on retail he is there right after he teleports but since in sai teleport does not work for npcs have had to use a work around to get to respawn otherwise been a faction leader takes a long time to respawn on tc. --- sql/updates/world/2014_08_20_00_world_sai.sql | 191 ++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 sql/updates/world/2014_08_20_00_world_sai.sql diff --git a/sql/updates/world/2014_08_20_00_world_sai.sql b/sql/updates/world/2014_08_20_00_world_sai.sql new file mode 100644 index 00000000000..b1ff32d4b9b --- /dev/null +++ b/sql/updates/world/2014_08_20_00_world_sai.sql @@ -0,0 +1,191 @@ +SET @CGUID := 74528; + +DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID AND @CGUID+10; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES +(@CGUID+0, 28332, 571, 1, 1, 5711.057, 645.7639, 672.0823, 0, 120, 0, 0), -- top +(@CGUID+1, 28332, 571, 1, 1, 5713.228, 646.6321, 653.1444, 0, 120, 0, 0), +(@CGUID+2, 28332, 571, 1, 1, 5713.016, 648.0272, 657.1592, 0, 120, 0, 0), +(@CGUID+3, 28332, 571, 1, 1, 5710.699, 648.6166, 656.5358, 0, 120, 0, 0), +(@CGUID+4, 28332, 571, 1, 1, 5711.029, 645.7101, 653.7773, 0, 120, 0, 0), +(@CGUID+5, 28332, 571, 1, 1, 5712.544, 644.6033, 656.4701, 0, 120, 0, 0), +(@CGUID+6, 28332, 571, 1, 1, 5709.351, 644.943, 655.8727, 0, 120, 0, 0), +(@CGUID+7, 28332, 571, 1, 1, 5711.693, 645.9358, 737.1865, 0, 120, 0, 0), +(@CGUID+8, 28332, 571, 1, 1, 5711.447, 646.1441, 761.046, 0, 120, 0, 0), +(@CGUID+9, 28332, 571, 1, 1, 5711.718, 645.9705, 796.1944, 0, 120, 0, 0), +(@CGUID+10, 28332, 571, 1, 1, 5711.647, 645.8472, 856.7622, 0, 120, 0, 0); + +UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry` IN(34044,16128,28332,30116); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(34044,16128,28332,30116) AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(-@CGUID-0,-@CGUID-1,-@CGUID-2,-@CGUID-3,-@CGUID-4,-@CGUID-5,-@CGUID-6,-@CGUID-7,-@CGUID-8,-@CGUID-9,-@CGUID-10) AND `source_type`=0; + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(1612800,1612801,1612802,2833200,3011600) AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(30116, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 80, 3011600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Archmage Aethas Sunreaver - On Data Set - Run Script'), -- On retail Rhonin teleports back to original position since on tc teleport does not work for npcs this script is to respawn rhonin otherwise takes a long time to respawn. + +(16128, 0, 0, 5, 20, 0, 100, 0, 13631, 0, 0, 0, 80, 1612800, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rhonin - On Quest Reward (All Is Well That Ends Well) - Run Script'), +(16128, 0, 1, 5, 20, 0, 100, 0, 13819, 0, 0, 0, 80, 1612800, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rhonin - On Quest Reward (Heroic: All Is Well That Ends Well) - Run Script'), +(16128, 0, 2, 0, 38, 0, 100, 0, 1, 1, 0, 0, 80, 1612801, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rhonin - On Data Set 1 1 - Run Script 2'), +(16128, 0, 3, 0, 40, 0, 100, 0, 11, 16128, 0, 0, 80, 1612802, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rhonin - On Reached WP11 - Run Script 3'), +(16128, 0, 4, 5, 38, 0, 100, 0, 6, 6, 0, 0, 80, 1612800, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rhonin - On Quest Reward (All Is Well That Ends Well) - Run Script'), +(16128, 0, 5, 0, 61, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 30116, 0, 0, 0, 0, 0, 0, 'Rhonin - Link - Set Data to Archmage Aethas Sunreaver '), -- To trigger respawn script +(34044, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 53, 0, 34044, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brann Bronzebeard - On On Spawn - Start WP'), +(34044, 0, 1, 2, 40, 0, 100, 0, 11, 34044, 0, 0, 54, 4000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brann Bronzebeard - On Reached WP13 - Pause WP'), +(34044, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brann Bronzebeard - On Reached WP13 - Say Line 1'), +(34044, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 16128, 0, 0, 0, 0, 0, 0, 'Brann Bronzebeard - On Reached WP13 - Set Data On Rhonin'), +(34044, 0, 4, 0, 38, 0, 100, 0, 1, 1, 0, 0, 41, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Brann Bronzebeard - On Data Set - Despawn'), +(-@CGUID-1, 0, 0, 0, 38, 0, 100, 0, 32, 32, 0, 0, 11, 64367, 0, 0, 0, 0, 0, 9, 28332, 20, 200, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Cast Algalon Event Beam'), +(-@CGUID-2, 0, 0, 0, 38, 0, 100, 0, 32, 32, 0, 0, 11, 64367, 0, 0, 0, 0, 0, 9, 28332, 20, 200, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Cast Algalon Event Beam'), +(-@CGUID-3, 0, 0, 0, 38, 0, 100, 0, 32, 32, 0, 0, 11, 64367, 0, 0, 0, 0, 0, 9, 28332, 20, 200, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Cast Algalon Event Beam'), +(-@CGUID-4, 0, 0, 0, 38, 0, 100, 0, 32, 32, 0, 0, 11, 64367, 0, 0, 0, 0, 0, 9, 28332, 20, 200, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Cast Algalon Event Beam'), +(-@CGUID-5, 0, 0, 0, 38, 0, 100, 0, 32, 32, 0, 0, 11, 64367, 0, 0, 0, 0, 0, 9, 28332, 20, 200, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Cast Algalon Event Beam'), +(-@CGUID-6, 0, 0, 0, 38, 0, 100, 0, 32, 32, 0, 0, 11, 64367, 0, 0, 0, 0, 0, 9, 28332, 20, 200, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Cast Algalon Event Beam'), +(-@CGUID-0, 0, 0, 0, 38, 0, 100, 0, 30, 30, 0, 0, 11, 64580, 2, 0, 0, 0, 0, 10, @CGUID+7, 28332, 0, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Cast Reply-Code Alpha (Phase 2)'), +(-@CGUID-7, 0, 0, 0, 38, 0, 100, 0, 30, 30, 0, 0, 11, 64580, 2, 0, 0, 0, 0, 10, @CGUID+8, 28332, 0, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Cast Reply-Code Alpha (Phase 2)'), +(-@CGUID-8, 0, 0, 0, 38, 0, 100, 0, 30, 30, 0, 0, 11, 64580, 2, 0, 0, 0, 0, 10, @CGUID+9, 28332, 0, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Cast Reply-Code Alpha (Phase 2)'), +(-@CGUID-9, 0, 0, 0, 38, 0, 100, 0, 30, 30, 0, 0, 11, 64580, 2, 0, 0, 0, 0, 10, @CGUID+10, 28332, 0, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Cast Reply-Code Alpha (Phase 2)'), +(-@CGUID-10, 0, 0, 0, 38, 0, 100, 0, 29, 29, 0, 0, 11, 64581, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Cast Reply-Code Alpha (Phase 2)'), +(-@CGUID-10, 0, 1, 0, 38, 0, 100, 0, 31, 31, 0, 0, 11, 64510, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Cast Reply-Code Alpha (Phase 2)'), +(-@CGUID-0, 0, 1, 0, 38, 0, 100, 0, 28, 28, 0, 0, 80, 2833200, 2, 0, 0, 0, 0, 9, 28332, 20, 200, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Run Script'), +(-@CGUID-1, 0, 1, 0, 38, 0, 100, 0, 28, 28, 0, 0, 80, 2833200, 2, 0, 0, 0, 0, 9, 28332, 20, 200, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Run Script'), +(-@CGUID-2, 0, 1, 0, 38, 0, 100, 0, 28, 28, 0, 0, 80, 2833200, 2, 0, 0, 0, 0, 9, 28332, 20, 200, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Run Script'), +(-@CGUID-3, 0, 1, 0, 38, 0, 100, 0, 28, 28, 0, 0, 80, 2833200, 2, 0, 0, 0, 0, 9, 28332, 20, 200, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Run Script'), +(-@CGUID-4, 0, 1, 0, 38, 0, 100, 0, 28, 28, 0, 0, 80, 2833200, 2, 0, 0, 0, 0, 9, 28332, 20, 200, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Run Script'), +(-@CGUID-5, 0, 1, 0, 38, 0, 100, 0, 28, 28, 0, 0, 80, 2833200, 2, 0, 0, 0, 0, 9, 28332, 20, 200, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Run Script'), +(-@CGUID-6, 0, 1, 0, 38, 0, 100, 0, 28, 28, 0, 0, 80, 2833200, 2, 0, 0, 0, 0, 9, 28332, 20, 200, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Run Script'), +(-@CGUID-7, 0, 1, 0, 38, 0, 100, 0, 28, 28, 0, 0, 80, 2833200, 2, 0, 0, 0, 0, 9, 28332, 20, 200, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Run Script'), +(-@CGUID-8, 0, 1, 0, 38, 0, 100, 0, 28, 28, 0, 0, 80, 2833200, 2, 0, 0, 0, 0, 9, 28332, 20, 200, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Run Script'), +(-@CGUID-9, 0, 1, 0, 38, 0, 100, 0, 28, 28, 0, 0, 80, 2833200, 2, 0, 0, 0, 0, 9, 28332, 20, 200, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Run Script'), +(-@CGUID-10, 0, 2, 0, 38, 0, 100, 0, 28, 28, 0, 0, 80, 2833200, 2, 0, 0, 0, 0, 9, 28332, 20, 200, 0, 0, 0, 0, 'Generic Trigger LAB (Large AOI) - On Data Set - Run Script'), +(3011600, 9, 0, 0, 0, 0, 100, 0, 205000, 205000, 0, 0, 70, 0, 0, 0, 0, 0, 0, 10, 95366, 16128, 0, 0, 0, 0, 0, 'Archmage Aethas Sunreaver - Script - Respawn Rhonin'), +(2833200, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 28, 64367, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Generic Trigger LAB - Script - Remove aura'), +(2833200, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 28, 64510, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Generic Trigger LAB - Script - Remove aura'), +(2833200, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 28, 64580, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Generic Trigger LAB - Script - Remove aura'), +(1612800, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rhonin - Script - Set NPC Flags'), +(1612800, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 34044, 1, 300000, 0, 0, 0, 8, 0, 0, 0, 5800.296, 822.4527, 668.519, 4.812811, 'Rhonin - Script - Summon Brann Bronzebeard'), +(1612800, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 'Rhonin - Script - Say Line 1'), +(1612801, 9, 0, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 53, 0, 16128, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rhonin - Script 2 - Start WP'), +(1612802, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 32, 32, 0, 0, 0, 0, 10, @CGUID+1, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 32, 32, 0, 0, 0, 0, 10, @CGUID+2, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 32, 32, 0, 0, 0, 0, 10, @CGUID+3, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 32, 32, 0, 0, 0, 0, 10, @CGUID+4, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 32, 32, 0, 0, 0, 0, 10, @CGUID+5, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 32, 32, 0, 0, 0, 0, 10, @CGUID+6, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 30, 30, 0, 0, 0, 0, 10, @CGUID+0, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 30, 30, 0, 0, 0, 0, 10, @CGUID+7, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 8, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 30, 30, 0, 0, 0, 0, 10, @CGUID+8, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 9, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 30, 30, 0, 0, 0, 0, 10, @CGUID+9, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 10, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 31, 31, 0, 0, 0, 0, 10, @CGUID+10, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 11, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Say Line 2'), +(1612802, 9, 12, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Say Line 3'), +(1612802, 9, 13, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Say Line 3'), +(1612802, 9, 14, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Say Line 3'), +(1612802, 9, 15, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Say Line 3'), +(1612802, 9, 16, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Say Line 3'), +(1612802, 9, 17, 0, 0, 0, 100, 0, 14000, 14000, 0, 0, 1, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Say Line 3'), +(1612802, 9, 18, 0, 0, 0, 100, 0, 60000, 60000, 0, 0, 45, 29, 29, 0, 0, 0, 0, 10, @CGUID+10, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 19, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 28, 28, 0, 0, 0, 0, 10, @CGUID+0, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 20, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 28, 28, 0, 0, 0, 0, 10, @CGUID+1, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 21, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 28, 28, 0, 0, 0, 0, 10, @CGUID+2, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 22, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 28, 28, 0, 0, 0, 0, 10, @CGUID+3, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 23, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 28, 28, 0, 0, 0, 0, 10, @CGUID+4, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 24, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 28, 28, 0, 0, 0, 0, 10, @CGUID+5, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 25, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 28, 28, 0, 0, 0, 0, 10, @CGUID+6, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 26, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 28, 28, 0, 0, 0, 0, 10, @CGUID+7, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 27, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 28, 28, 0, 0, 0, 0, 10, @CGUID+8, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 28, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 28, 28, 0, 0, 0, 0, 10, @CGUID+9, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 29, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 28, 28, 0, 0, 0, 0, 10, @CGUID+10, 28332, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Generic Trigger LAB (Large AOI)'), +(1612802, 9, 30, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 34044, 0, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Brann Bronzebeard'), +(1612802, 9, 31, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 11, 51347, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Set Data on Brann Bronzebeard'), +(1612802, 9, 32, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rhonin - Script 3 - Despawn'); + + + +DELETE FROM `creature_text` WHERE `entry` IN(34044,16128); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES +(34044, 0, 0, 'Just in time. Let''s see this thing off, then.', 12, 0, 100, 0, 0, 15826, 'Brann Bronzebeard',34084), +(16128, 0, 0, 'We received Brann''s message, and we have begun preparations.', 12, 0, 100, 1, 0, 15649, 'Rhonin',33982), +(16128, 1, 0, 'Citizens of Dalaran! Raise your eyes to the skies and observe!', 14, 0, 100, 0, 0, 15650, 'Rhonin',33983), +(16128, 2, 0, 'Today our world''s destruction has been averted in defiance of our very makers!', 14, 0, 100, 0, 0, 15651, 'Rhonin',33984), +(16128, 3, 0, 'Algalon the Observer, herald of the titans, has been defeated by our brave comrades in the depths of the titan city of Ulduar.', 14, 0, 100, 0, 0, 15652, 'Rhonin',33985), +(16128, 4, 0, 'Algalon was sent here to judge the fate of our world.', 14, 0, 100, 0, 0, 15653, 'Rhonin',33986), +(16128, 5, 0, 'He found a planet whose races had deviated from the titans'' blueprints. A planet where not everything had gone according to plan.', 14, 0, 100, 0, 0, 15654, 'Rhonin',33987), +(16128, 6, 0, 'Cold logic deemed our world not worth saving. Cold logic, however, does not account for the power of free will. It''s up to each of us to prove this is a world worth saving.', 14, 0, 100, 0, 0, 15655, 'Rhonin',33988), +(16128, 7, 0, 'That our lives... our lives are worth living.', 14, 0, 100, 0, 0, 15656, 'Rhonin',33989); + +DELETE FROM `waypoints` WHERE `entry` IN(34044,16128); +INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES +(34044,1, 5799.257, 822.8445, 668.8303,'Brann Bronzebeard'), +(34044,2, 5800.257, 822.8445, 668.8303,'Brann Bronzebeard'), +(34044,3, 5800.367, 821.7542, 667.9642,'Brann Bronzebeard'), +(34044,4, 5800.662, 818.8298, 666.119,'Brann Bronzebeard'), +(34044,5, 5801.204, 813.4578, 662.2362,'Brann Bronzebeard'), +(34044,6, 5801.204, 813.4578, 662.2362,'Brann Bronzebeard'), +(34044,7, 5801.473, 813.3398, 662.5571,'Brann Bronzebeard'), +(34044,8, 5801.478, 811.0238, 662.2334,'Brann Bronzebeard'), +(34044,9, 5801.978, 807.0238, 662.2334,'Brann Bronzebeard'), +(34044,10, 5801.978, 806.2738, 662.2334,'Brann Bronzebeard'), +(34044,11, 5800.728, 802.5238, 662.2334,'Brann Bronzebeard'), -- Say 1 +(34044,12, 5799.999, 799.77, 662.1868,'Brann Bronzebeard'), +(34044,13, 5798.749, 789.02, 662.1868,'Brann Bronzebeard'), +(34044,14, 5798.749, 787.77, 662.1868,'Brann Bronzebeard'), +(34044,15, 5798.499, 786.52, 662.1868,'Brann Bronzebeard'), +(34044,16, 5798.366, 786.4135, 662.1921,'Brann Bronzebeard'), +(34044,17, 5798.116, 784.4135, 662.1921,'Brann Bronzebeard'), +(34044,18, 5797.866, 783.6635, 662.6921,'Brann Bronzebeard'), +(34044,19, 5797.866, 779.4135, 662.6921,'Brann Bronzebeard'), +(34044,20, 5797.866, 775.6635, 661.9421,'Brann Bronzebeard'), +(34044,21, 5797.866, 774.6635, 661.6921,'Brann Bronzebeard'), +(34044,22, 5797.628, 774.3326, 661.3541,'Brann Bronzebeard'), +(34044,23, 5797.378, 772.5826, 661.3541,'Brann Bronzebeard'), +(34044,24, 5797.378, 772.0826, 661.3541,'Brann Bronzebeard'), +(34044,25, 5796.628, 766.8326, 661.6041,'Brann Bronzebeard'), +(34044,26, 5796.378, 761.8326, 658.3541,'Brann Bronzebeard'), +(34044,27, 5795.75, 756.938, 654.6126,'Brann Bronzebeard'), +(34044,28, 5795.75, 754.438, 652.8626,'Brann Bronzebeard'), +(34044,29, 5795.75, 745.438, 646.8626,'Brann Bronzebeard'), +(34044,30, 5795.75, 737.188, 640.8626,'Brann Bronzebeard'), +(34044,31, 5795.75, 736.188, 640.6126,'Brann Bronzebeard'), +(34044,32, 5795.629, 732.4694, 640.3873,'Brann Bronzebeard'), +(34044,33, 5795.379, 731.2194, 640.3873,'Brann Bronzebeard'), +(34044,34, 5794.879, 722.7194, 640.6373,'Brann Bronzebeard'), +(34044,35, 5794.379, 720.2194, 640.6373,'Brann Bronzebeard'), +(34044,36, 5794.141, 719.7362, 641.0156,'Brann Bronzebeard'), +(34044,37, 5794.141, 719.4862, 641.0156,'Brann Bronzebeard'), +(34044,38, 5793.391, 718.2362, 641.0156,'Brann Bronzebeard'), +(34044,39, 5792.141, 716.7362, 641.0156,'Brann Bronzebeard'), +(34044,40, 5788.391, 710.9862, 641.5156,'Brann Bronzebeard'), +(34044,41, 5784.409, 705.4751, 642.0784,'Brann Bronzebeard'), +(34044,42, 5780.409, 699.9751, 642.3284,'Brann Bronzebeard'), +(34044,43, 5778.909, 697.9751, 642.5784,'Brann Bronzebeard'), +(34044,44, 5778.659, 697.4751, 642.5784,'Brann Bronzebeard'), +(34044,45, 5773.409, 690.4751, 642.8284,'Brann Bronzebeard'), +(34044,46, 5772.659, 689.2251, 642.8284,'Brann Bronzebeard'), +(34044,47, 5772.451, 688.9385, 643.1041,'Brann Bronzebeard'), +(34044,48, 5769.951, 685.9385, 643.1041,'Brann Bronzebeard'), +(34044,49, 5767.951, 683.4385, 643.1041,'Brann Bronzebeard'), +(34044,50, 5761.951, 676.6885, 642.8541,'Brann Bronzebeard'), +(34044,51, 5758.701, 672.6885, 643.1041,'Brann Bronzebeard'), +(34044,52, 5757.701, 671.9385, 643.1041,'Brann Bronzebeard'), +(34044,53, 5756.951, 670.9385, 643.1041,'Brann Bronzebeard'), +(34044,54, 5755.701, 669.4385, 643.1041,'Brann Bronzebeard'), +(34044,55, 5754.951, 668.6885, 643.3541,'Brann Bronzebeard'), +(34044,56, 5750.951, 663.9385, 643.6041,'Brann Bronzebeard'), +(34044,57, 5750.721, 663.7521, 643.809,'Brann Bronzebeard'), +(34044,58, 5750.221, 663.2521, 643.809,'Brann Bronzebeard'), +(34044,59, 5745.221, 659.0021, 644.559,'Brann Bronzebeard'), +(34044,60, 5740.221, 654.7521, 645.559,'Brann Bronzebeard'), +(34044,61, 5740.14, 654.6359, 645.801,'Brann Bronzebeard'), +(34044,62, 5736.89, 651.8859, 646.051,'Brann Bronzebeard'), +(34044,63, 5734.89, 651.1359, 646.301,'Brann Bronzebeard'), +(34044,64, 5731.39, 649.8859, 646.801,'Brann Bronzebeard'), +(16128,1, 5797.603, 793.3063, 662.1119,'Rhonin'), +(16128,2, 5796.103, 777.5563, 662.3619,'Rhonin'), +(16128,3, 5794.603, 767.0563, 661.6119,'Rhonin'), +(16128,4, 5793.103, 753.0563, 651.8619,'Rhonin'), +(16128,5, 5790.603, 736.8063, 640.6119,'Rhonin'), +(16128,6, 5786.353, 717.5563, 641.1119,'Rhonin'), +(16128,7, 5773.603, 702.0563, 642.1119,'Rhonin'), +(16128,8, 5759.103, 683.5563, 642.6119,'Rhonin'), +(16128,9, 5746.853, 669.0563, 644.3619,'Rhonin'), +(16128,10, 5736.353, 658.8063, 645.8619,'Rhonin'), +(16128,11, 5727.353, 653.8063, 646.8619,'Rhonin'); From a49fce68dc39b1a0bc53a4ae27b756e8f85c62c3 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Wed, 20 Aug 2014 12:30:22 +0200 Subject: [PATCH 14/19] Rename 2014_08_19_01_world_misc.sql to 2014_08_19_02_world_misc.sql --- ...{2014_08_19_01_world_misc.sql => 2014_08_19_02_world_misc.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sql/updates/world/{2014_08_19_01_world_misc.sql => 2014_08_19_02_world_misc.sql} (100%) diff --git a/sql/updates/world/2014_08_19_01_world_misc.sql b/sql/updates/world/2014_08_19_02_world_misc.sql similarity index 100% rename from sql/updates/world/2014_08_19_01_world_misc.sql rename to sql/updates/world/2014_08_19_02_world_misc.sql From f28a8f0df25822ad429910738ad1faf519492ad0 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Thu, 21 Aug 2014 15:16:06 +0200 Subject: [PATCH 15/19] DB/Conditions: Add gossip conditions to Highlord Darion Mograine Closes #12868 --- sql/updates/world/2014_08_21_00_world_conditions.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2014_08_21_00_world_conditions.sql diff --git a/sql/updates/world/2014_08_21_00_world_conditions.sql b/sql/updates/world/2014_08_21_00_world_conditions.sql new file mode 100644 index 00000000000..6a34d273f20 --- /dev/null +++ b/sql/updates/world/2014_08_21_00_world_conditions.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=10027; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `ConditionTypeOrReference`, `ConditionValue1`, `Comment`) VALUES +(15, 10027, 15, 32, 'Show gossip option if player is a Death knight'); From c8e8d3396c4b48737a7aee25639d5da3e0d4884b Mon Sep 17 00:00:00 2001 From: Aokromes Date: Thu, 21 Aug 2014 15:44:00 +0200 Subject: [PATCH 16/19] DB/Warsong Gulch: Supreme Defender By horn, closes #3859 --- .../2014_08_21_01_world_achievement_criteria_data.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2014_08_21_01_world_achievement_criteria_data.sql diff --git a/sql/updates/world/2014_08_21_01_world_achievement_criteria_data.sql b/sql/updates/world/2014_08_21_01_world_achievement_criteria_data.sql new file mode 100644 index 00000000000..afa5fc6d1d4 --- /dev/null +++ b/sql/updates/world/2014_08_21_01_world_achievement_criteria_data.sql @@ -0,0 +1,7 @@ +-- Supreme Defender +DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (3698, 3699); +INSERT INTO `achievement_criteria_data` VALUES +(3698,6,3277,0,''), +(3698,7,23335,0,''), -- Alliance target should have Alliance Flag buff +(3699,6,3277,0,''), +(3699,7,23333,0,''); -- Horde target should have Horde Flag buff From abfd29ab61b8a6d853a4df016dba9cd8f19fc746 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 21 Aug 2014 18:18:13 +0200 Subject: [PATCH 17/19] Core/WorldSession: Added research notes about CMSG_AUTH_SESSION values and reordered checks during login to always initialize encryption first to make sure the client can read failure packet --- src/server/authserver/Server/AuthSession.cpp | 12 +- src/server/game/Server/WorldSocket.cpp | 121 +++++++++++-------- src/server/shared/Networking/Socket.h | 10 +- 3 files changed, 82 insertions(+), 61 deletions(-) diff --git a/src/server/authserver/Server/AuthSession.cpp b/src/server/authserver/Server/AuthSession.cpp index 9931595e860..8276183fb10 100644 --- a/src/server/authserver/Server/AuthSession.cpp +++ b/src/server/authserver/Server/AuthSession.cpp @@ -83,8 +83,8 @@ typedef struct AUTH_LOGON_PROOF_S uint8 cmd; uint8 error; uint8 M2[20]; - uint32 unk1; - uint32 unk2; + uint32 AccountFlags; + uint32 SurveyId; uint16 unk3; } sAuthLogonProof_S; @@ -540,9 +540,9 @@ bool AuthSession::HandleLogonProof() memcpy(proof.M2, sha.GetDigest(), 20); proof.cmd = AUTH_LOGON_PROOF; proof.error = 0; - proof.unk1 = 0x00800000; // Accountflags. 0x01 = GM, 0x08 = Trial, 0x00800000 = Pro pass (arena tournament) - proof.unk2 = 0x00; // SurveyId - proof.unk3 = 0x00; + proof.AccountFlags = 0x00800000; // 0x01 = GM, 0x08 = Trial, 0x00800000 = Pro pass (arena tournament) + proof.SurveyId = 0; + proof.unk3 = 0; packet.resize(sizeof(proof)); std::memcpy(packet.contents(), &proof, sizeof(proof)); @@ -831,7 +831,7 @@ bool AuthSession::HandleRealmList() pkt << AmountOfCharacters; pkt << realm.timezone; // realm category if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients - pkt << uint8(0x2C); // unk, may be realm number/id? + pkt << uint8(realm.m_ID); else pkt << uint8(0x0); // 1.12.1 and 1.12.2 clients diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 5945d9fe868..ca8e2cd5a34 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -87,8 +87,6 @@ void WorldSocket::ReadDataHandler() { ClientPktHeader* header = reinterpret_cast(GetHeaderBuffer()); - header->size -= sizeof(header->cmd); - uint16 opcode = uint16(header->cmd); std::string opcodeName = GetOpcodeNameForLogging(opcode); @@ -173,35 +171,30 @@ void WorldSocket::HandleAuthSession(WorldPacket& recvPacket) std::string account; SHA1Hash sha; uint32 clientBuild; - uint32 unk2, unk3, unk5, unk6, unk7; + uint32 serverId, loginServerType, region, battlegroup, realmIndex; uint64 unk4; WorldPacket packet, SendAddonPacked; BigNumber k; bool wardenActive = sWorld->getBoolConfig(CONFIG_WARDEN_ENABLED); - if (sWorld->IsClosed()) - { - SendAuthResponseError(AUTH_REJECT); - TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteIpAddress().to_string().c_str()); - return; - } - // Read the content of the packet recvPacket >> clientBuild; - recvPacket >> unk2; + recvPacket >> serverId; // Used for GRUNT only recvPacket >> account; - recvPacket >> unk3; + recvPacket >> loginServerType; // 0 GRUNT, 1 Battle.net recvPacket >> clientSeed; - recvPacket >> unk5 >> unk6 >> unk7; + recvPacket >> region >> battlegroup; // Used for Battle.net only + recvPacket >> realmIndex; // realmId from auth_database.realmlist table recvPacket >> unk4; recvPacket.read(digest, 20); - TC_LOG_DEBUG("network", "WorldSocket::HandleAuthSession: client %u, unk2 %u, account %s, unk3 %u, clientseed %u", + TC_LOG_INFO("network", "WorldSocket::HandleAuthSession: client %u, serverId %u, account %s, loginServerType %u, clientseed %u, realmIndex %u", clientBuild, - unk2, + serverId, account.c_str(), - unk3, - clientSeed); + loginServerType, + clientSeed, + realmIndex); // Get the account information from the auth database // 0 1 2 3 4 5 6 7 8 @@ -218,6 +211,7 @@ void WorldSocket::HandleAuthSession(WorldPacket& recvPacket) // We can not log here, as we do not know the account. Thus, no accountId. SendAuthResponseError(AUTH_UNKNOWN_ACCOUNT); TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: Sent Auth Response (unknown account)."); + DelayedCloseSocket(); return; } @@ -243,6 +237,57 @@ void WorldSocket::HandleAuthSession(WorldPacket& recvPacket) // id has to be fetched at this point, so that first actual account response that fails can be logged id = fields[0].GetUInt32(); + k.SetHexStr(fields[1].GetCString()); + + // even if auth credentials are bad, try using the session key we have - client cannot read auth response error without it + _authCrypt.Init(&k); + + // First reject the connection if packet contains invalid data or realm state doesn't allow logging in + if (sWorld->IsClosed()) + { + SendAuthResponseError(AUTH_REJECT); + TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteIpAddress().to_string().c_str()); + DelayedCloseSocket(); + return; + } + + if (realmIndex != realmID) + { + SendAuthResponseError(REALM_LIST_REALM_NOT_FOUND); + TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: Sent Auth Response (bad realm)."); + DelayedCloseSocket(); + return; + } + + std::string os = fields[8].GetString(); + + // Must be done before WorldSession is created + if (wardenActive && os != "Win" && os != "OSX") + { + SendAuthResponseError(AUTH_REJECT); + TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: Client %s attempted to log in using invalid client OS (%s).", address.c_str(), os.c_str()); + DelayedCloseSocket(); + return; + } + + // Check that Key and account name are the same on client and server + uint32 t = 0; + + sha.UpdateData(account); + sha.UpdateData((uint8*)&t, 4); + sha.UpdateData((uint8*)&clientSeed, 4); + sha.UpdateData((uint8*)&_authSeed, 4); + sha.UpdateBigNumbers(&k, NULL); + sha.Finalize(); + + if (memcmp(sha.GetDigest(), digest, 20)) + { + SendAuthResponseError(AUTH_FAILED); + TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: Authentication failed for account: %u ('%s') address: %s", id, account.c_str(), address.c_str()); + DelayedCloseSocket(); + return; + } + ///- Re-check ip locking (same check as in auth). if (fields[3].GetUInt8() == 1) // if ip is locked { @@ -252,12 +297,11 @@ void WorldSocket::HandleAuthSession(WorldPacket& recvPacket) TC_LOG_DEBUG("network", "WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs. Original IP: %s, new IP: %s).", fields[2].GetCString(), address.c_str()); // We could log on hook only instead of an additional db log, however action logger is config based. Better keep DB logging as well sScriptMgr->OnFailedAccountLogin(id); + DelayedCloseSocket(); return; } } - k.SetHexStr(fields[1].GetCString()); - int64 mutetime = fields[5].GetInt64(); //! Negative mutetime indicates amount of seconds to be muted effective on next login - which is now. if (mutetime < 0) @@ -277,16 +321,6 @@ void WorldSocket::HandleAuthSession(WorldPacket& recvPacket) locale = LOCALE_enUS; uint32 recruiter = fields[7].GetUInt32(); - std::string os = fields[8].GetString(); - - // Must be done before WorldSession is created - if (wardenActive && os != "Win" && os != "OSX") - { - SendAuthResponseError(AUTH_REJECT); - TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: Client %s attempted to log in using invalid client OS (%s).", address.c_str(), os.c_str()); - return; - } - // Checks gmlevel per Realm stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_GMLEVEL_BY_REALMID); @@ -316,6 +350,7 @@ void WorldSocket::HandleAuthSession(WorldPacket& recvPacket) SendAuthResponseError(AUTH_BANNED); TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: Sent Auth Response (Account banned)."); sScriptMgr->OnFailedAccountLogin(id); + DelayedCloseSocket(); return; } @@ -327,23 +362,7 @@ void WorldSocket::HandleAuthSession(WorldPacket& recvPacket) SendAuthResponseError(AUTH_UNAVAILABLE); TC_LOG_INFO("network", "WorldSocket::HandleAuthSession: User tries to login but his security level is not enough"); sScriptMgr->OnFailedAccountLogin(id); - return; - } - - // Check that Key and account name are the same on client and server - uint32 t = 0; - - sha.UpdateData(account); - sha.UpdateData((uint8*)&t, 4); - sha.UpdateData((uint8*)&clientSeed, 4); - sha.UpdateData((uint8*)&_authSeed, 4); - sha.UpdateBigNumbers(&k, NULL); - sha.Finalize(); - - if (memcmp(sha.GetDigest(), digest, 20)) - { - SendAuthResponseError(AUTH_FAILED); - TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: Authentication failed for account: %u ('%s') address: %s", id, account.c_str(), address.c_str()); + DelayedCloseSocket(); return; } @@ -370,19 +389,15 @@ void WorldSocket::HandleAuthSession(WorldPacket& recvPacket) LoginDatabase.Execute(stmt); - // NOTE ATM the socket is single-threaded, have this in mind ... + // At this point, we can safely hook a successful login + sScriptMgr->OnAccountLogin(id); + _worldSession = new WorldSession(id, shared_from_this(), AccountTypes(security), expansion, mutetime, locale, recruiter, isRecruiter); - - _authCrypt.Init(&k); - _worldSession->LoadGlobalAccountData(); _worldSession->LoadTutorialsData(); _worldSession->ReadAddonsInfo(recvPacket); _worldSession->LoadPermissions(); - // At this point, we can safely hook a successful login - sScriptMgr->OnAccountLogin(id); - // Initialize Warden system only if it is enabled by config if (wardenActive) _worldSession->InitWarden(&k, os); diff --git a/src/server/shared/Networking/Socket.h b/src/server/shared/Networking/Socket.h index a13a079ff6c..3bd30bd731b 100644 --- a/src/server/shared/Networking/Socket.h +++ b/src/server/shared/Networking/Socket.h @@ -42,7 +42,7 @@ class Socket : public std::enable_shared_from_this public: Socket(tcp::socket&& socket, std::size_t headerSize) : _socket(std::move(socket)), _remoteAddress(_socket.remote_endpoint().address()), - _remotePort(_socket.remote_endpoint().port()), _readHeaderBuffer(), _readDataBuffer(), _closed(false) + _remotePort(_socket.remote_endpoint().port()), _readHeaderBuffer(), _readDataBuffer(), _closed(false), _closing(false) { _readHeaderBuffer.Grow(headerSize); } @@ -126,7 +126,7 @@ public: std::placeholders::_1, std::placeholders::_2)); } - bool IsOpen() const { return !_closed; } + bool IsOpen() const { return !_closed && !_closing; } virtual void CloseSocket() { @@ -140,6 +140,9 @@ public: shutdownError.value(), shutdownError.message().c_str()); } + /// Marks the socket for closing after write buffer becomes empty + void DelayedCloseSocket() { _closing = true; } + virtual bool IsHeaderReady() const { return _readHeaderBuffer.IsMessageReady(); } virtual bool IsDataReady() const { return _readDataBuffer.IsMessageReady(); } @@ -221,6 +224,8 @@ private: if (!_writeQueue.empty()) AsyncWrite(_writeQueue.front()); + else if (_closing) + CloseSocket(); } else CloseSocket(); @@ -241,6 +246,7 @@ private: MessageBuffer _readDataBuffer; std::atomic _closed; + std::atomic _closing; }; #endif // __SOCKET_H__ From 558f6e17b9f54d71e208aa090cf578b4c750a4af Mon Sep 17 00:00:00 2001 From: Dr-J Date: Thu, 21 Aug 2014 21:14:59 +0100 Subject: [PATCH 18/19] DB/Misc: Various Frenzyheart/Oracles Chain fixes * Rescripted Injured Rainspeaker oracle and both Just Following Orders and Fortunate Misunderstandings and works properly now ie when you find the injured rainspeaker oracle you find lying on ground, you select gossip option to pull injured rainspeaker oracle to his feet crocodile attacks, once crocodile is killed Shaman Vekjik turns up and says a few lines * New waypoints for a Rough Ride from sniff, the crocofile no longer goes through texture but camera is still glitchy * Mosswalker victims will now summon mosswalker pocessions if the event of them deciding to die while doing the mosswalker saviour * Correct text for softknuckle matrat for when summoned * Spawn Shaman Jakjek and Lightningcaller Soo-met and phasing for these, however phasing does not work exactly as should do as you should only be able to see these two npcs while you are working towards that faction but since quests stay rewarded even after you change faction there is no way of doing this using quest and spell area is limited, there are two faction choice tracker quests (hidden) for wolvar and gorloc and spells which add this quests to player but also once these are rewarded they stay rewarded. --- .../world/2014_08_21_02_world_misc.sql | 481 ++++++++++++++++++ 1 file changed, 481 insertions(+) create mode 100644 sql/updates/world/2014_08_21_02_world_misc.sql diff --git a/sql/updates/world/2014_08_21_02_world_misc.sql b/sql/updates/world/2014_08_21_02_world_misc.sql new file mode 100644 index 00000000000..041c9820b04 --- /dev/null +++ b/sql/updates/world/2014_08_21_02_world_misc.sql @@ -0,0 +1,481 @@ +SET @CGuid := 29974; + +-- These two gossip menus on Injured rainspeaker oracle are not meant to be linked, they are two +-- seperate gossips the first one for Just Following Orders to help the injured rainspeaker oracle and start event +-- The second is to start the event for fortunate misunderstandings + +UPDATE `gossip_menu_option` SET `action_menu_id`=0 WHERE `menu_id`=9677 AND `id`=0; + +-- Delete Ravenous Mangal Crocolisk as this is not meant to be spawned, it is summoned from spell +DELETE FROM `creature` WHERE `guid`=111427; + +-- Spawn Shaman Jakjek and Lightningcaller Soo-met +DELETE FROM `creature` WHERE `id` IN(28106,28107); +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES +(@CGUID+0, 28106, 571, 1, 1, 4869.281, 5912.271, -40.38539, 5.166174, 120, 0, 0), -- 28106 (Area: 3711) +(@CGUID+1, 28107, 571, 1, 1, 5116.647, 5469.729, -91.70967, 1.605703, 120, 0, 0); -- 28107 (Area: 3711) + +DELETE FROM `creature_template_addon` WHERE `entry` IN(28106,28107); +INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES +(28106, 0, 0x10000, 0x1, '52215'), -- 28106 - 52215 +(28107, 0, 0x10000, 0x1, '52215'); -- 28107 - 52215 + +DELETE FROM `gossip_menu` WHERE `entry` IN(9744,9745); +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES +(9745, 13364), -- 28106 +(9744, 13363); -- 28107 + +-- The below spell area for phasing is not working correctly as these npcs should only be visible after a player has killed artruis and is working towards that faction +-- If a player swaps faction they are meant to no longer be able to see the npc for that faction +-- Currenly with below npc becomes visible once player unlocks dailies for that faction but will remain +-- visible even if player switches faction as there is no way of telling which faction player is working towards +-- as all quests remain completed, there a couple of hidden faction choice tracker quests too but even this stay rewarded +-- once spell is cast which adds hidden quest, other way would be by reputation but this is not possible with spell area either +-- My guess is a wolvar faction choice tracker and gorlok faction choice tracker quest and spells to engage these, cant find how these +-- would reset though + +DELETE FROM `spell_area` WHERE `spell`=52217 AND `area` IN(4287,4288); +INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`, `quest_start_status`, `quest_end_status`) VALUES +(52217,4287, 12692, 0, 0, 0, 2, 1, 64, 11), +(52217,4288, 12695, 0, 0, 0, 2, 1, 64, 11); + +UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry` IN(28217,28325,28327); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(28217,28325,28327) AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(28077) AND `source_type`=0 and `id`>14; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(28133) AND `source_type`=0 and `id`=4; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(2811301) AND `source_type`=9 and `id`>0; +UPDATE `smart_scripts` SET `event_param1`=290 WHERE `entryorguid`=28308 AND `source_type`=0 AND `id`=2 AND `link`=3; + + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(2821700,2821701,2832700) AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(28217, 0, 0, 1, 11, 0, 100, 0, 0, 0, 0, 0, 11, 51329, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - On Spawn - Cast Feign Death'), +(28217, 0, 1, 14, 61, 0, 100, 0, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - On Spawn - Set NPC Flags (Gossip Only)'), +(28217, 0, 2, 3, 62, 0, 100, 0, 9677, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - On Gossip Option Select - Say Line 1'), +(28217, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 28, 51329, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - On Gossip Option Select - Remove Aura - Feign Death'), +(28217, 0, 4, 5, 61, 0, 100, 0, 0, 0, 0, 0, 81, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - On Gossip Option Select - Remove Aura - Set NPC Flags - Quest + Gossip'), +(28217, 0, 5, 15, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - On Gossip Option Select - Close Gossip'), +(28217, 0, 6, 0, 62, 0, 100, 0, 9677, 0, 0, 0, 85, 51382, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - On Gossip Option Select - Invoker Cast Forcecast Summon Huge Crocolisk'), +(28217, 0, 7, 0, 64, 0, 100, 0, 0, 0, 0, 0, 98, 9684, 13124, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - On Gossip Hello - Send Gossip Menu'), +(28217, 0, 8, 10, 62, 0, 100, 0, 9684, 0, 0, 0, 2, 774, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - On Gossip Option Select - Set Faction (Alliance)'), +(28217, 0, 9, 10, 62, 0, 100, 0, 9684, 0, 0, 0, 2, 775, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - On Gossip Option Select - Set Faction (Horde)'), +(28217, 0, 10, 11, 61, 0, 100, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - On Gossip Option Select - Store Targetlist'), +(28217, 0, 11, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, 2821700, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - On Gossip Option Select - Run Script'), +(28217, 0, 12, 0, 19, 0, 100, 0, 12570, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - On On Quest Accept - Fortunate Misunderstandings - Say Line 2'), +(28217, 0, 13, 0, 40, 0, 100, 0, 64, 28217, 0, 0, 80, 2821701, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - On Reached WP80 - Run Script'), +(28217, 0, 14, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 58806, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - On Spawn - Add Aura Permanent Feign Death'), +(28217, 0, 15, 0, 61, 0, 100, 0, 0, 0, 0, 0, 28, 58806, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - On Gossip Select - Remove Aura Permanent Feign Death'), +(28077, 0, 15, 16, 54, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 21, 50, 0, 0, 0, 0, 0, 0, 'Frenzyheart Tracker - On Just Summoned - Set Orientation'), +(28077, 0, 16, 17, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frenzyheart Tracker - On Just Summoned - Say Line 1'), +(28077, 0, 17, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 8000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frenzyheart Tracker - On Just Summoned - Despawn After 8 seconds'), +(28325, 0, 0, 0, 0, 0, 100, 0, 5000, 9000, 9000, 14000, 11, 34370, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Ravenous Mangal Crocolisk - In Combat - Cast Jagged Tooth Snap'), +(28325, 0, 1, 2, 54, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravenous Mangal Crocolisk - On Just Summoned - Say Line 1'), +(28325, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 50, 0, 0, 0, 0, 0, 0, 'Ravenous Mangal Crocolisk - On Just Summoned - Attack'), +(28325, 0, 3, 0, 6, 0, 100, 0, 0, 0, 0, 0, 11, 51321, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ravenous Mangal Crocolisk - On Death - Cast Summon Shaman Vekjik'), +(28327, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Shaman Vekjik - On Just Summoned - Say Line 1'), +(28327, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Shaman Vekjik - On Just Summoned - Move to Position'), +(28327, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, 2832700, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Shaman Vekjik - On Just Summoned - Run Script'), +(28113, 0, 4, 0, 64, 0, 100, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mosswalker Victim - On Gossip Hello - Say Line 3'), +(2821700, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - Script - Set NPC Flags'), +(2821700, 9, 1, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - Script - Say Line 3'), +(2821700, 9, 2, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 53, 1, 28217, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - Script - Start WP'), +(2821701, 9, 0, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - Script 2 - Say Line 4'), +(2821701, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 51448, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - Script 2 - Cast Oracle Intro Quest Complete'), +(2821701, 9, 2, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - Script 2 - Say Line 5'), +(2821701, 9, 3, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 11, 52100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - Script 2 - Cast Summon Frenyheart Tracker'), +(2821701, 9, 4, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Injured Rainspeaker Oracle - Script 2 - Despawn'), +(2811301, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 52156, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Mosswalker Victim - On Script - Cast Summon Shinies'), +(2811301, 9, 2, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 37, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mosswalker Victim - On Script - Kill Self'), +(2832700, 9, 0, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Shaman Vekjik - Script - Say Line 2'), +(2832700, 9, 1, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Shaman Vekjik - Script - Say Line 3'), +(2832700, 9, 2, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Shaman Vekjik - Script - Say Line 4'), +(2832700, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Shaman Vekjik - Script - Set Run On'), +(2832700, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 46, 50, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Shaman Vekjik - Script - Move Foward'), +(2832700, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 41, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Shaman Vekjik - Script - Despawn After 5 seconds'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9677; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=28217; + +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 9677, 0, 0, 0, 1, 1, 51329, 0, 0, 0, 0, 0, '', 'Injured Rainspeaker Oracle only display gossip if injured rainspeaker oracle has aura Feign Death'), +(22, 7, 28217, 0, 0, 9, 0, 12540, 0, 0, 0, 0, 0, '', 'Injured Rainspeaker Oracle - Only run SAI if player has Just Following Orders taken'), +(22, 8, 28217, 0, 0, 9, 0, 12570, 0, 0, 0, 0, 0, '', 'Injured Rainspeaker Oracle - Only run SAI if player has Fortunate Misunderstandings Taken'), +(22, 9, 28217, 0, 0, 16, 0, 1101, 0, 0, 0, 0, 0, '', 'Injured Rainspeaker Oracle - Only run SAI if player is Alliance'), +(22, 10, 28217, 0, 0, 16, 0, 690, 0, 0, 0, 0, 0, '', 'Injured Rainspeaker Oracle - Only run SAI if player is Horde'); + +DELETE FROM `creature_text` WHERE `entry` IN(28217,28325,28327,28077,28213); +DELETE FROM `creature_text` WHERE `entry` IN(28113) AND `groupid`=3; + +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES +(28217, 0, 0, 'The Injured Rainspeaker Oracle rises clumsily to its feet.', 16, 0, 100, 0, 0, 0, 'Injured Rainspeaker Oracle',27785), +(28217, 1, 0, 'You tell us when it home time.', 12, 0, 100, 0, 0, 0, 'Injured Rainspeaker Oracle',27826), +(28217, 2, 0, 'Home not far. Come!', 12, 0, 100, 0, 0, 0, 'Injured Rainspeaker Oracle',27753), +(28217, 3, 0, 'Thanks!', 12, 0, 100, 0, 0, 0, 'Injured Rainspeaker Oracle',27752), +(28217, 4, 0, 'Oh no! Some puppy-men followed!', 12, 0, 100, 0, 0, 0, 'Injured Rainspeaker Oracle',27799), +(28325, 0, 0, 'You hear a low guttural growl from nearby.', 16, 0, 100, 0, 0, 0, 'Ravenous Mangal Crocolisk',27831), +(28327, 0, 0, 'Shaman Vekjik comes out of the underbrush nearby.', 16, 0, 100, 0, 0, 0, 'Shaman Vekjik',27738), +(28327, 1, 0, 'You help Rainspeaker! I saw you help Rainspeaker! Traitor thing!', 12, 0, 100, 0, 0, 0, 'Shaman Vekjik',27739), +(28327, 2, 0, 'If you want to be friends with big-tongues, you not friends with Frenzyheart! I tell village! We no trust you anymore!', 12, 0, 100, 0, 0, 0, 'Shaman Vekjik',27740), +(28327, 3, 0, 'Shaman Vekjik scurries off towards Frenzyheart Hill.', 16, 0, 100, 0, 0, 0, 'Shaman Vekjik',27741), +(28077, 0, 0, 'Dumb big-tongue lover! You not friend of Frenzyheart no more. Frenzyheart will get you good.', 14, 0, 100, 0, 0, 0, 'Frenzyheart Tracker',27798), +(28213, 0, 0, 'The %s screams with rage and rushes to the aid of her babies.', 16, 0, 100, 0, 0, 0, 'Hardknuckle Matriarch',27607), +(28113, 3, 0, 'The mosswalker victim groans in pain.', 16, 0, 100, 0, 0, 0, 'Mosswalker Victim',28638); + +DELETE FROM `waypoints` WHERE `entry` IN(28217,28308); +DELETE FROM `script_waypoint` WHERE `entry` IN(28217); + +INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES +(28217, 1,5462.371, 4514.91, -133.6022, 'Injured Rainspeaker Oracle'), +(28217, 2,5483.05, 4514.717, -141.1091, 'Injured Rainspeaker Oracle'), +(28217, 3,5485.3, 4516.467, -142.1091, 'Injured Rainspeaker Oracle'), +(28217, 4,5485.8, 4516.967, -143.3591, 'Injured Rainspeaker Oracle'), +(28217, 5,5486.8, 4517.717, -145.3591, 'Injured Rainspeaker Oracle'), +(28217, 6,5494.231, 4523.077, -149.136, 'Injured Rainspeaker Oracle'), +(28217, 7,5497.242, 4543.376, -146.9484, 'Injured Rainspeaker Oracle'), +(28217, 8,5499.492, 4544.876, -145.6984, 'Injured Rainspeaker Oracle'), +(28217, 9,5500.992, 4546.376, -145.1984, 'Injured Rainspeaker Oracle'), +(28217, 10,5502.492, 4547.626, -144.6984, 'Injured Rainspeaker Oracle'), +(28217, 11,5504.492, 4549.626, -143.9484, 'Injured Rainspeaker Oracle'), +(28217, 12,5507.492, 4552.126, -142.9484, 'Injured Rainspeaker Oracle'), +(28217, 13,5507.9, 4552.293, -142.7217, 'Injured Rainspeaker Oracle'), +(28217, 14,5509.15, 4553.793, -142.2217, 'Injured Rainspeaker Oracle'), +(28217, 15,5509.4, 4555.793, -141.7217, 'Injured Rainspeaker Oracle'), +(28217, 16,5509.4, 4558.793, -140.2217, 'Injured Rainspeaker Oracle'), +(28217, 17,5509.65, 4560.793, -139.4717, 'Injured Rainspeaker Oracle'), +(28217, 18,5509.9, 4563.543, -138.9717, 'Injured Rainspeaker Oracle'), +(28217, 19,5509.9, 4566.543, -137.9717, 'Injured Rainspeaker Oracle'), +(28217, 20,5510.15, 4568.543, -136.9717, 'Injured Rainspeaker Oracle'), +(28217, 21,5510.44, 4568.722, -136.8404, 'Injured Rainspeaker Oracle'), +(28217, 22,5510.44, 4571.722, -135.5904, 'Injured Rainspeaker Oracle'), +(28217, 23,5510.69, 4572.722, -135.3404, 'Injured Rainspeaker Oracle'), +(28217, 24,5510.69, 4575.722, -135.8404, 'Injured Rainspeaker Oracle'), +(28217, 25,5511.19, 4586.472, -135.0904, 'Injured Rainspeaker Oracle'), +(28217, 26,5511.44, 4589.472, -134.5904, 'Injured Rainspeaker Oracle'), +(28217, 27,5511.69, 4591.472, -133.8404, 'Injured Rainspeaker Oracle'), +(28217, 28,5511.69, 4593.472, -133.3404, 'Injured Rainspeaker Oracle'), +(28217, 29,5511.94, 4595.222, -132.5904, 'Injured Rainspeaker Oracle'), +(28217, 30,5512.074, 4593.584, -133.326, 'Injured Rainspeaker Oracle'), +(28217, 31,5512.074, 4595.584, -132.576, 'Injured Rainspeaker Oracle'), +(28217, 32,5512.324, 4597.584, -132.326, 'Injured Rainspeaker Oracle'), +(28217, 33,5513.824, 4600.334, -131.826, 'Injured Rainspeaker Oracle'), +(28217, 34,5514.824, 4601.834, -132.826, 'Injured Rainspeaker Oracle'), +(28217, 35,5515.324, 4602.834, -133.326, 'Injured Rainspeaker Oracle'), +(28217, 36,5518.074, 4607.084, -132.076, 'Injured Rainspeaker Oracle'), +(28217, 37,5520.074, 4610.334, -133.076, 'Injured Rainspeaker Oracle'), +(28217, 38,5520.324, 4611.084, -133.826, 'Injured Rainspeaker Oracle'), +(28217, 39,5520.824, 4611.834, -134.576, 'Injured Rainspeaker Oracle'), +(28217, 40,5521.324, 4612.834, -135.326, 'Injured Rainspeaker Oracle'), +(28217, 41,5521.824, 4613.584, -135.576, 'Injured Rainspeaker Oracle'), +(28217, 42,5524.574, 4617.834, -136.576, 'Injured Rainspeaker Oracle'), +(28217, 43,5528.879, 4624.343, -136.8704, 'Injured Rainspeaker Oracle'), +(28217, 44,5532.879, 4624.343, -137.1204, 'Injured Rainspeaker Oracle'), +(28217, 45,5550.51, 4624.694, -136.8637, 'Injured Rainspeaker Oracle'), +(28217, 46,5552.26, 4625.444, -137.3637, 'Injured Rainspeaker Oracle'), +(28217, 47,5565.26, 4629.944, -136.8637, 'Injured Rainspeaker Oracle'), +(28217, 48,5568.01, 4630.944, -136.3637, 'Injured Rainspeaker Oracle'), +(28217, 49,5571.01, 4631.944, -135.1137, 'Injured Rainspeaker Oracle'), +(28217, 50,5574.76, 4633.194, -134.3637, 'Injured Rainspeaker Oracle'), +(28217, 51,5577.51, 4634.194, -135.1137, 'Injured Rainspeaker Oracle'), +(28217, 52,5577.733, 4634.199, -135.0235, 'Injured Rainspeaker Oracle'), +(28217, 53,5580.983, 4635.449, -135.7735, 'Injured Rainspeaker Oracle'), +(28217, 54,5584.983, 4634.949, -136.0235, 'Injured Rainspeaker Oracle'), +(28217, 55,5587.983, 4634.449, -136.7735, 'Injured Rainspeaker Oracle'), +(28217, 56,5589.733, 4634.199, -138.0235, 'Injured Rainspeaker Oracle'), +(28217, 57,5594.733, 4633.699, -138.2735, 'Injured Rainspeaker Oracle'), +(28217, 58,5596.733, 4633.449, -137.5235, 'Injured Rainspeaker Oracle'), +(28217, 59,5599.733, 4633.199, -136.7735, 'Injured Rainspeaker Oracle'), +(28217, 60,5606.606, 4632.268, -136.4532, 'Injured Rainspeaker Oracle'), +(28217, 61,5612.106, 4626.518, -137.2032, 'Injured Rainspeaker Oracle'), +(28217, 62,5616.856, 4621.768, -137.7032, 'Injured Rainspeaker Oracle'), +(28217, 63,5620.638, 4618.1, -137.5758, 'Injured Rainspeaker Oracle'), +(28217, 64,5625.388, 4612.85, -137.0758, 'Injured Rainspeaker Oracle'), +(28308,1, 5295.424, 4436.538, -97.6029,'Captive Crocolisk'), +(28308,2, 5291.674, 4435.038, -97.1029,'Captive Crocolisk'), +(28308,3, 5287.924, 4433.538, -96.3529,'Captive Crocolisk'), +(28308,4, 5277.924, 4429.538, -95.8529,'Captive Crocolisk'), +(28308,5, 5277.777, 4429.427, -95.94301,'Captive Crocolisk'), +(28308,6, 5268.277, 4425.427, -95.44301,'Captive Crocolisk'), +(28308,7, 5249.84, 4405.99, -95.93161,'Captive Crocolisk'), +(28308,8, 5251.84, 4401.24, -95.18161,'Captive Crocolisk'), +(28308,9, 5262.34, 4376.74, -95.68161,'Captive Crocolisk'), +(28308,10, 5263.34, 4373.99, -96.43161,'Captive Crocolisk'), +(28308,11, 5264.34, 4371.99, -96.93161,'Captive Crocolisk'), +(28308,12, 5265.34, 4369.24, -97.68161,'Captive Crocolisk'), +(28308,13, 5262.209, 4376.323, -95.75699,'Captive Crocolisk'), +(28308,14, 5263.459, 4373.823, -96.50699,'Captive Crocolisk'), +(28308,15, 5264.209, 4372.073, -97.25699,'Captive Crocolisk'), +(28308,16, 5265.459, 4369.323, -98.00699,'Captive Crocolisk'), +(28308,17, 5266.959, 4365.823, -98.00699,'Captive Crocolisk'), +(28308,18, 5272.959, 4366.073, -99.00699,'Captive Crocolisk'), +(28308,19, 5274.709, 4366.073, -99.50699,'Captive Crocolisk'), +(28308,20, 5277.709, 4366.323, -100.257,'Captive Crocolisk'), +(28308,21, 5284.709, 4366.573, -101.007,'Captive Crocolisk'), +(28308,22, 5288.709, 4366.823, -101.757,'Captive Crocolisk'), +(28308,23, 5284.895, 4366.406, -101.2539,'Captive Crocolisk'), +(28308,24, 5288.895, 4366.656, -102.0039,'Captive Crocolisk'), +(28308,25, 5289.395, 4366.656, -102.0039,'Captive Crocolisk'), +(28308,26, 5291.395, 4366.406, -103.0039,'Captive Crocolisk'), +(28308,27, 5293.395, 4366.156, -104.2539,'Captive Crocolisk'), +(28308,28, 5294.395, 4366.156, -105.0039,'Captive Crocolisk'), +(28308,29, 5295.395, 4366.156, -106.0039,'Captive Crocolisk'), +(28308,30, 5296.395, 4365.906, -106.5039,'Captive Crocolisk'), +(28308,31, 5297.395, 4365.906, -107.2539,'Captive Crocolisk'), +(28308,32, 5298.395, 4365.906, -108.0039,'Captive Crocolisk'), +(28308,33, 5299.145, 4365.656, -108.7539,'Captive Crocolisk'), +(28308,34, 5300.145, 4365.656, -109.5039,'Captive Crocolisk'), +(28308,35, 5302.145, 4365.406, -110.0039,'Captive Crocolisk'), +(28308,36, 5304.145, 4365.406, -110.5039,'Captive Crocolisk'), +(28308,37, 5305.145, 4365.156, -111.2539,'Captive Crocolisk'), +(28308,38, 5306.145, 4365.156, -112.0039,'Captive Crocolisk'), +(28308,39, 5307.145, 4365.156, -112.5039,'Captive Crocolisk'), +(28308,40, 5308.145, 4365.156, -113.2539,'Captive Crocolisk'), +(28308,41, 5309.145, 4364.906, -114.0039,'Captive Crocolisk'), +(28308,42, 5311.145, 4364.906, -115.0039,'Captive Crocolisk'), +(28308,43, 5313.145, 4364.656, -116.0039,'Captive Crocolisk'), +(28308,44, 5316.145, 4364.406, -116.7539,'Captive Crocolisk'), +(28308,45, 5318.145, 4364.406, -117.5039,'Captive Crocolisk'), +(28308,46, 5320.145, 4364.406, -118.2539,'Captive Crocolisk'), +(28308,47, 5322.145, 4364.156, -119.0039,'Captive Crocolisk'), +(28308,48, 5325.145, 4363.906, -120.0039,'Captive Crocolisk'), +(28308,49, 5325.253, 4363.768, -120.1149,'Captive Crocolisk'), +(28308,50, 5330.003, 4363.268, -120.8649,'Captive Crocolisk'), +(28308,51, 5334.503, 4358.018, -121.6149,'Captive Crocolisk'), +(28308,52, 5336.503, 4355.768, -122.3649,'Captive Crocolisk'), +(28308,53, 5339.253, 4353.018, -123.3649,'Captive Crocolisk'), +(28308,54, 5341.253, 4350.768, -124.3649,'Captive Crocolisk'), +(28308,55, 5343.003, 4348.518, -126.1149,'Captive Crocolisk'), +(28308,56, 5345.003, 4346.018, -128.1149,'Captive Crocolisk'), +(28308,57, 5346.253, 4344.518, -129.6149,'Captive Crocolisk'), +(28308,58, 5347.003, 4343.768, -130.8649,'Captive Crocolisk'), +(28308,59, 5348.253, 4342.268, -132.3649,'Captive Crocolisk'), +(28308,60, 5349.003, 4341.518, -133.8649,'Captive Crocolisk'), +(28308,61, 5350.473, 4340.604, -135.0103,'Captive Crocolisk'), +(28308,62, 5351.223, 4340.104, -136.2603,'Captive Crocolisk'), +(28308,63, 5353.223, 4339.604, -137.2603,'Captive Crocolisk'), +(28308,64, 5354.973, 4338.854, -138.2603,'Captive Crocolisk'), +(28308,65, 5357.473, 4337.604, -139.0103,'Captive Crocolisk'), +(28308,66, 5359.223, 4336.604, -139.5103,'Captive Crocolisk'), +(28308,67, 5361.973, 4335.354, -140.5103,'Captive Crocolisk'), +(28308,68, 5363.723, 4334.604, -141.0103,'Captive Crocolisk'), +(28308,69, 5364.094, 4334.348, -141.0889,'Captive Crocolisk'), +(28308,70, 5365.344, 4333.598, -141.0889,'Captive Crocolisk'), +(28308,71, 5369.594, 4331.098, -142.5889,'Captive Crocolisk'), +(28308,72, 5372.844, 4328.848, -143.5889,'Captive Crocolisk'), +(28308,73, 5376.344, 4326.598, -144.5889,'Captive Crocolisk'), +(28308,74, 5379.344, 4324.598, -145.3389,'Captive Crocolisk'), +(28308,75, 5382.594, 4322.598, -146.0889,'Captive Crocolisk'), +(28308,76, 5402.844, 4309.598, -144.5889,'Captive Crocolisk'), +(28308,77, 5403.844, 4309.098, -143.3389,'Captive Crocolisk'), +(28308,78, 5403.236, 4309.773, -144.7202,'Captive Crocolisk'), +(28308,79, 5403.986, 4309.273, -143.2202,'Captive Crocolisk'), +(28308,80, 5405.736, 4308.023, -141.7202,'Captive Crocolisk'), +(28308,81, 5407.736, 4308.023, -141.2202,'Captive Crocolisk'), +(28308,82, 5409.736, 4307.773, -140.4702,'Captive Crocolisk'), +(28308,83, 5412.486, 4307.523, -139.7202,'Captive Crocolisk'), +(28308,84, 5416.486, 4307.273, -138.2202,'Captive Crocolisk'), +(28308,85, 5419.486, 4307.023, -137.7202,'Captive Crocolisk'), +(28308,86, 5424.486, 4306.773, -136.9702,'Captive Crocolisk'), +(28308,87, 5432.486, 4306.023, -136.4702,'Captive Crocolisk'), +(28308,88, 5432.637, 4305.777, -136.2332,'Captive Crocolisk'), +(28308,89, 5435.137, 4305.777, -135.9832,'Captive Crocolisk'), +(28308,90, 5439.137, 4305.277, -135.4832,'Captive Crocolisk'), +(28308,91, 5442.887, 4304.777, -134.7332,'Captive Crocolisk'), +(28308,92, 5445.887, 4304.527, -134.2332,'Captive Crocolisk'), +(28308,93, 5450.887, 4304.027, -133.4832,'Captive Crocolisk'), +(28308,94, 5458.887, 4303.027, -132.9832,'Captive Crocolisk'), +(28308,95, 5459.032, 4302.869, -132.6968,'Captive Crocolisk'), +(28308,96, 5465.032, 4302.119, -132.6968,'Captive Crocolisk'), +(28308,97, 5481.032, 4297.369, -131.9468,'Captive Crocolisk'), +(28308,98, 5483.032, 4296.869, -131.1968,'Captive Crocolisk'), +(28308,99, 5484.782, 4296.369, -130.6968,'Captive Crocolisk'), +(28308,100, 5485.782, 4296.119, -129.9468,'Captive Crocolisk'), +(28308,101, 5487.782, 4295.619, -128.9468,'Captive Crocolisk'), +(28308,102, 5489.532, 4294.869, -127.4468,'Captive Crocolisk'), +(28308,103, 5489.61, 4294.574, -127.3404,'Captive Crocolisk'), +(28308,104, 5490.61, 4294.324, -127.0904,'Captive Crocolisk'), +(28308,105, 5491.11, 4293.574, -126.3404,'Captive Crocolisk'), +(28308,106, 5491.86, 4291.824, -125.3404,'Captive Crocolisk'), +(28308,107, 5492.86, 4290.074, -124.0904,'Captive Crocolisk'), +(28308,108, 5493.86, 4288.324, -122.5904,'Captive Crocolisk'), +(28308,109, 5494.86, 4286.574, -121.5904,'Captive Crocolisk'), +(28308,110, 5495.36, 4285.574, -121.0904,'Captive Crocolisk'), +(28308,111, 5496.36, 4284.074, -119.3404,'Captive Crocolisk'), +(28308,112, 5496.61, 4283.074, -118.8404,'Captive Crocolisk'), +(28308,113, 5496.464, 4283.905, -119.1085,'Captive Crocolisk'), +(28308,114, 5496.964, 4282.905, -118.6085,'Captive Crocolisk'), +(28308,115, 5497.464, 4282.155, -117.3585,'Captive Crocolisk'), +(28308,116, 5497.964, 4281.155, -116.8585,'Captive Crocolisk'), +(28308,117, 5498.964, 4279.405, -115.8585,'Captive Crocolisk'), +(28308,118, 5499.214, 4278.655, -114.8585,'Captive Crocolisk'), +(28308,119, 5500.214, 4276.655, -113.6085,'Captive Crocolisk'), +(28308,120, 5501.714, 4274.155, -112.3585,'Captive Crocolisk'), +(28308,121, 5502.714, 4272.405, -111.6085,'Captive Crocolisk'), +(28308,122, 5503.714, 4270.655, -110.6085,'Captive Crocolisk'), +(28308,123, 5503.964, 4269.905, -110.1085,'Captive Crocolisk'), +(28308,124, 5505.464, 4268.655, -109.3585,'Captive Crocolisk'), +(28308,125, 5507.464, 4266.405, -107.8585,'Captive Crocolisk'), +(28308,126, 5508.714, 4265.155, -107.3585,'Captive Crocolisk'), +(28308,127, 5510.214, 4263.655, -106.1085,'Captive Crocolisk'), +(28308,128, 5511.714, 4262.155, -105.1085,'Captive Crocolisk'), +(28308,129, 5513.714, 4260.155, -104.3585,'Captive Crocolisk'), +(28308,130, 5515.964, 4257.905, -103.6085,'Captive Crocolisk'), +(28308,131, 5517.964, 4255.905, -103.1085,'Captive Crocolisk'), +(28308,132, 5518.275, 4255.893, -103.0304,'Captive Crocolisk'), +(28308,133, 5518.525, 4255.643, -102.7804,'Captive Crocolisk'), +(28308,134, 5521.525, 4256.143, -102.2804,'Captive Crocolisk'), +(28308,135, 5540.806, 4259.841, -102.1478,'Captive Crocolisk'), +(28308,136, 5552.306, 4261.591, -102.6478,'Captive Crocolisk'), +(28308,137, 5552.562, 4261.524, -102.5733,'Captive Crocolisk'), +(28308,138, 5564.562, 4263.524, -102.3233,'Captive Crocolisk'), +(28308,139, 5567.062, 4263.024, -101.8233,'Captive Crocolisk'), +(28308,140, 5570.062, 4262.774, -101.0733,'Captive Crocolisk'), +(28308,141, 5573.062, 4262.524, -100.5733,'Captive Crocolisk'), +(28308,142, 5581.062, 4261.524, -100.0733,'Captive Crocolisk'), +(28308,143, 5585.062, 4261.274, -99.32326,'Captive Crocolisk'), +(28308,144, 5585.636, 4261.419, -99.31418,'Captive Crocolisk'), +(28308,145, 5607.386, 4259.919, -98.81418,'Captive Crocolisk'), +(28308,146, 5607.644, 4260.124, -98.76741,'Captive Crocolisk'), +(28308,147, 5609.894, 4259.874, -98.76741,'Captive Crocolisk'), +(28308,148, 5620.644, 4259.624, -98.01741,'Captive Crocolisk'), +(28308,149, 5620.918, 4259.831, -98.01412,'Captive Crocolisk'), +(28308,150, 5633.668, 4259.581, -98.26412,'Captive Crocolisk'), +(28308,151, 5652.418, 4260.331, -98.76412,'Captive Crocolisk'), +(28308,152, 5652.634, 4260.799, -99.03739,'Captive Crocolisk'), +(28308,153, 5660.884, 4261.299, -98.53739,'Captive Crocolisk'), +(28308,154, 5681.829, 4266.604, -99.07877,'Captive Crocolisk'), +(28308,155, 5683.829, 4267.104, -99.57877,'Captive Crocolisk'), +(28308,156, 5686.579, 4267.604, -100.3288,'Captive Crocolisk'), +(28308,157, 5688.329, 4268.104, -100.8288,'Captive Crocolisk'), +(28308,158, 5691.329, 4268.854, -101.3288,'Captive Crocolisk'), +(28308,159, 5695.079, 4269.854, -102.0788,'Captive Crocolisk'), +(28308,160, 5699.079, 4270.854, -102.8288,'Captive Crocolisk'), +(28308,161, 5699.236, 4271.2, -103.1089,'Captive Crocolisk'), +(28308,162, 5708.486, 4273.7, -102.8589,'Captive Crocolisk'), +(28308,163, 5714.236, 4275.2, -103.3589,'Captive Crocolisk'), +(28308,164, 5717.736, 4275.95, -104.1089,'Captive Crocolisk'), +(28308,165, 5721.736, 4276.95, -104.8589,'Captive Crocolisk'), +(28308,166, 5725.486, 4277.95, -105.3589,'Captive Crocolisk'), +(28308,167, 5729.486, 4278.95, -106.1089,'Captive Crocolisk'), +(28308,168, 5732.236, 4279.7, -106.3589,'Captive Crocolisk'), +(28308,169, 5735.236, 4280.45, -106.8589,'Captive Crocolisk'), +(28308,170, 5737.986, 4281.2, -107.8589,'Captive Crocolisk'), +(28308,171, 5739.986, 4281.7, -108.6089,'Captive Crocolisk'), +(28308,172, 5741.986, 4282.45, -109.3589,'Captive Crocolisk'), +(28308,173, 5743.986, 4282.95, -110.1089,'Captive Crocolisk'), +(28308,174, 5746.736, 4283.7, -110.8589,'Captive Crocolisk'), +(28308,175, 5750.526, 4285.622, -112.3181,'Captive Crocolisk'), +(28308,176, 5752.526, 4287.872, -113.0681,'Captive Crocolisk'), +(28308,177, 5754.776, 4289.872, -113.8181,'Captive Crocolisk'), +(28308,178, 5757.026, 4291.872, -114.5681,'Captive Crocolisk'), +(28308,179, 5759.276, 4293.872, -113.0681,'Captive Crocolisk'), +(28308,180, 5836.026, 4365.122, -114.5681,'Captive Crocolisk'), +(28308,181, 5838.276, 4367.122, -113.0681,'Captive Crocolisk'), +(28308,182, 5840.798, 4369.525, -110.6656,'Captive Crocolisk'), +(28308,183, 5842.548, 4370.525, -109.9156,'Captive Crocolisk'), +(28308,184, 5843.298, 4371.025, -109.4156,'Captive Crocolisk'), +(28308,185, 5845.048, 4372.275, -108.4156,'Captive Crocolisk'), +(28308,186, 5846.548, 4373.525, -107.6656,'Captive Crocolisk'), +(28308,187, 5850.048, 4375.775, -106.6656,'Captive Crocolisk'), +(28308,188, 5852.298, 4377.275, -105.6656,'Captive Crocolisk'), +(28308,189, 5855.798, 4379.775, -104.4156,'Captive Crocolisk'), +(28308,190, 5857.298, 4380.775, -103.6656,'Captive Crocolisk'), +(28308,191, 5858.048, 4381.275, -102.9156,'Captive Crocolisk'), +(28308,192, 5859.048, 4382.025, -100.9156,'Captive Crocolisk'), +(28308,193, 5859.798, 4382.525, -100.1656,'Captive Crocolisk'), +(28308,194, 5862.298, 4384.275, -99.41559,'Captive Crocolisk'), +(28308,195, 5863.798, 4385.275, -100.4156,'Captive Crocolisk'), +(28308,196, 5868.048, 4388.275, -99.91559,'Captive Crocolisk'), +(28308,197, 5871.048, 4390.275, -99.16559,'Captive Crocolisk'), +(28308,198, 5874.298, 4392.525, -98.41559,'Captive Crocolisk'), +(28308,199, 5878.548, 4395.275, -97.91559,'Captive Crocolisk'), +(28308,200, 5889.048, 4402.775, -97.16559,'Captive Crocolisk'), +(28308,201, 5890.798, 4404.025, -96.41559,'Captive Crocolisk'), +(28308,202, 5893.298, 4405.525, -95.91559,'Captive Crocolisk'), +(28308,203, 5896.548, 4407.775, -95.16559,'Captive Crocolisk'), +(28308,204, 5889.418, 4402.901, -97.02716,'Captive Crocolisk'), +(28308,205, 5891.168, 4404.151, -96.27716,'Captive Crocolisk'), +(28308,206, 5893.418, 4405.901, -95.77716,'Captive Crocolisk'), +(28308,207, 5896.918, 4408.151, -95.27716,'Captive Crocolisk'), +(28308,208, 5897.418, 4408.651, -95.02716,'Captive Crocolisk'), +(28308,209, 5901.418, 4413.151, -94.52716,'Captive Crocolisk'), +(28308,210, 5906.418, 4419.151, -93.77716,'Captive Crocolisk'), +(28308,211, 5910.418, 4423.401, -93.27716,'Captive Crocolisk'), +(28308,212, 5922.168, 4437.151, -93.77716,'Captive Crocolisk'), +(28308,213, 5924.918, 4440.151, -94.52716,'Captive Crocolisk'), +(28308,214, 5922.623, 4437.382, -93.73592,'Captive Crocolisk'), +(28308,215, 5925.123, 4440.382, -94.23592,'Captive Crocolisk'), +(28308,216, 5925.623, 4440.882, -94.23592,'Captive Crocolisk'), +(28308,217, 5927.373, 4443.132, -94.73592,'Captive Crocolisk'), +(28308,218, 5929.873, 4446.382, -95.48592,'Captive Crocolisk'), +(28308,219, 5932.373, 4449.632, -95.98592,'Captive Crocolisk'), +(28308,220, 5935.123, 4453.382, -96.73592,'Captive Crocolisk'), +(28308,221, 5940.623, 4460.382, -95.98592,'Captive Crocolisk'), +(28308,222, 5941.873, 4461.882, -95.23592,'Captive Crocolisk'), +(28308,223, 5944.373, 4465.132, -94.48592,'Captive Crocolisk'), +(28308,224, 5947.373, 4469.132, -93.98592,'Captive Crocolisk'), +(28308,225, 5947.696, 4469.354, -94.11644,'Captive Crocolisk'), +(28308,226, 5953.196, 4476.604, -94.11644,'Captive Crocolisk'), +(28308,227, 5955.196, 4482.104, -93.61644,'Captive Crocolisk'), +(28308,228, 5956.696, 4485.604, -92.86644,'Captive Crocolisk'), +(28308,229, 5955.557, 4482.148, -93.45278,'Captive Crocolisk'), +(28308,230, 5957.057, 4485.898, -92.95278,'Captive Crocolisk'), +(28308,231, 5964.307, 4503.898, -92.70278,'Captive Crocolisk'), +(28308,232, 5962.057, 4529.648, -93.45278,'Captive Crocolisk'), +(28308,233, 5961.557, 4533.648, -93.95278,'Captive Crocolisk'), +(28308,234, 5961.307, 4536.648, -94.45278,'Captive Crocolisk'), +(28308,235, 5960.807, 4543.648, -94.95278,'Captive Crocolisk'), +(28308,236, 5962.334, 4529.804, -93.40747,'Captive Crocolisk'), +(28308,237, 5961.834, 4533.804, -93.90747,'Captive Crocolisk'), +(28308,238, 5961.584, 4536.804, -94.65747,'Captive Crocolisk'), +(28308,239, 5961.084, 4543.804, -95.15747,'Captive Crocolisk'), +(28308,240, 5960.834, 4546.804, -95.40747,'Captive Crocolisk'), +(28308,241, 5963.334, 4564.304, -95.90747,'Captive Crocolisk'), +(28308,242, 5963.584, 4566.304, -96.65747,'Captive Crocolisk'), +(28308,243, 5963.834, 4569.304, -97.65747,'Captive Crocolisk'), +(28308,244, 5963.431, 4564.66, -96.028,'Captive Crocolisk'), +(28308,245, 5963.681, 4566.66, -96.778,'Captive Crocolisk'), +(28308,246, 5963.931, 4569.66, -97.528,'Captive Crocolisk'), +(28308,247, 5965.431, 4579.41, -97.028,'Captive Crocolisk'), +(28308,248, 5969.632, 4614.113, -97.93755,'Captive Crocolisk'), +(28308,249, 5970.632, 4621.863, -98.43755,'Captive Crocolisk'), +(28308,250, 5976.144, 4659.492, -99.19481,'Captive Crocolisk'), +(28308,251, 5979.644, 4667.742, -98.44481,'Captive Crocolisk'), +(28308,252, 5980.644, 4670.492, -97.94481,'Captive Crocolisk'), +(28308,253, 5983.644, 4677.742, -97.19481,'Captive Crocolisk'), +(28308,254, 5990.394, 4693.242, -97.94481,'Captive Crocolisk'), +(28308,255, 5991.394, 4695.992, -98.44481,'Captive Crocolisk'), +(28308,256, 5983.768, 4677.933, -97.22537,'Captive Crocolisk'), +(28308,257, 5990.518, 4693.683, -97.47537,'Captive Crocolisk'), +(28308,258, 5991.768, 4696.433, -98.22537,'Captive Crocolisk'), +(28308,259, 5993.268, 4699.683, -98.97537,'Captive Crocolisk'), +(28308,260, 5995.518, 4704.183, -98.22537,'Captive Crocolisk'), +(28308,261, 5996.768, 4706.933, -97.47537,'Captive Crocolisk'), +(28308,262, 5998.518, 4710.433, -96.97537,'Captive Crocolisk'), +(28308,263, 6015.43, 4744.089, -96.98655,'Captive Crocolisk'), +(28308,264, 6021.18, 4757.589, -96.48655,'Captive Crocolisk'), +(28308,265, 6023.68, 4762.839, -95.98655,'Captive Crocolisk'), +(28308,266, 6029.43, 4775.839, -95.48655,'Captive Crocolisk'), +(28308,267, 6032.68, 4783.089, -94.73655,'Captive Crocolisk'), +(28308,268, 6029.549, 4775.949, -95.34583,'Captive Crocolisk'), +(28308,269, 6032.799, 4783.199, -94.84583,'Captive Crocolisk'), +(28308,270, 6035.549, 4788.949, -94.59583,'Captive Crocolisk'), +(28308,271, 6040.799, 4796.199, -93.84583,'Captive Crocolisk'), +(28308,272, 6052.299, 4810.949, -94.34583,'Captive Crocolisk'), +(28308,273, 6055.299, 4814.949, -93.34583,'Captive Crocolisk'), +(28308,274, 6058.299, 4818.949, -93.84583,'Captive Crocolisk'), +(28308,275, 6056.549, 4816.449, -92.84583,'Captive Crocolisk'), +(28308,276, 6059.549, 4820.449, -94.34583,'Captive Crocolisk'), +(28308,277, 6055.51, 4815.281, -93.31942,'Captive Crocolisk'), +(28308,278, 6056.76, 4816.781, -92.81942,'Captive Crocolisk'), +(28308,279, 6058.51, 4819.281, -93.81942,'Captive Crocolisk'), +(28308,280, 6059.76, 4820.781, -94.06942,'Captive Crocolisk'), +(28308,281, 6065.01, 4827.781, -94.06942,'Captive Crocolisk'), +(28308,282, 6065.26, 4840.781, -93.56942,'Captive Crocolisk'), +(28308,283, 6065.26, 4841.781, -92.81942,'Captive Crocolisk'), +(28308,284, 6065.26, 4848.531, -93.81942,'Captive Crocolisk'), +(28308,285, 6065.731, 4870.604, -94.3074,'Captive Crocolisk'), +(28308,286, 6077.481, 4876.354, -93.8074,'Captive Crocolisk'), +(28308,287, 6096.964, 4885.957, -94.31221,'Captive Crocolisk'), +(28308,288, 6119.714, 4901.457, -94.56221,'Captive Crocolisk'), +(28308,289, 6120.019, 4901.537, -94.72534,'Captive Crocolisk'), +(28308,290, 6120.519, 4902.037, -94.72534,'Captive Crocolisk'); From 0c1587cc916de846eedf3ccf48f80caf053f427b Mon Sep 17 00:00:00 2001 From: Dr-J Date: Thu, 21 Aug 2014 21:19:36 +0100 Subject: [PATCH 19/19] Remove Injured rainspeaker oracle cpp script Unneeded script --- .../scripts/Northrend/zone_sholazar_basin.cpp | 139 +----------------- 1 file changed, 1 insertion(+), 138 deletions(-) diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index f9fb3801955..c56739c783f 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -18,12 +18,11 @@ /* ScriptData SDName: Sholazar_Basin SD%Complete: 100 -SDComment: Quest support: 12570, 12573, 12621, 12726 +SDComment: Quest support: 12573, 12621, 12726 SDCategory: Sholazar_Basin EndScriptData */ /* ContentData -npc_injured_rainspeaker_oracle npc_vekjik avatar_of_freya npc_haiphoon (Quest: "Song of Wind and Water") @@ -39,141 +38,6 @@ EndContentData */ #include "CombatAI.h" #include "Player.h" -/*###### -## npc_injured_rainspeaker_oracle -######*/ - -#define GOSSIP_ITEM1 "I am ready to travel to your village now." - -enum Rainspeaker -{ - SAY_START_IRO = 0, - SAY_QUEST_ACCEPT_IRO = 1, - SAY_END_IRO = 2, - - QUEST_FORTUNATE_MISUNDERSTANDINGS = 12570, - FACTION_ESCORTEE_A = 774, - FACTION_ESCORTEE_H = 775 -}; - -class npc_injured_rainspeaker_oracle : public CreatureScript -{ -public: - npc_injured_rainspeaker_oracle() : CreatureScript("npc_injured_rainspeaker_oracle") { } - - struct npc_injured_rainspeaker_oracleAI : public npc_escortAI - { - npc_injured_rainspeaker_oracleAI(Creature* creature) : npc_escortAI(creature) { c_guid = creature->GetGUID(); } - - uint64 c_guid; - - void Reset() override - { - me->RestoreFaction(); - // if we will have other way to assign this to only one npc remove this part - if (GUID_LOPART(me->GetGUID()) != 101030) - { - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - } - } - - void WaypointReached(uint32 waypointId) override - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) - { - case 1: - SetRun(); - break; - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING); - me->SetSpeed(MOVE_SWIM, 0.85f, true); - me->SetSwim(true); - me->SetDisableGravity(true); - break; - case 19: - me->GetMotionMaster()->MoveFall(); - break; - case 28: - player->GroupEventHappens(QUEST_FORTUNATE_MISUNDERSTANDINGS, me); - // me->RestoreFaction(); - Talk(SAY_END_IRO); - SetRun(false); - break; - } - } - - void JustDied(Unit* /*killer*/) override - { - if (!HasEscortState(STATE_ESCORT_ESCORTING)) - return; - - if (Player* player = GetPlayerForEscort()) - { - if (player->GetQuestStatus(QUEST_FORTUNATE_MISUNDERSTANDINGS) != QUEST_STATUS_COMPLETE) - player->FailQuest(QUEST_FORTUNATE_MISUNDERSTANDINGS); - } - } - }; - - bool OnGossipHello(Player* player, Creature* creature) override - { - if (creature->IsQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(QUEST_FORTUNATE_MISUNDERSTANDINGS) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - ENSURE_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); - ENSURE_AI(npc_escortAI, (creature->AI()))->SetMaxPlayerDistance(35.0f); - creature->AI()->Talk(SAY_START_IRO); - - switch (player->GetTeam()){ - case ALLIANCE: - creature->setFaction(FACTION_ESCORTEE_A); - break; - case HORDE: - creature->setFaction(FACTION_ESCORTEE_H); - break; - } - } - return true; - } - - bool OnQuestAccept(Player* /*player*/, Creature* creature, Quest const* /*_Quest*/) override - { - creature->AI()->Talk(SAY_QUEST_ACCEPT_IRO); - return false; - } - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_injured_rainspeaker_oracleAI(creature); - } -}; - /*###### ## npc_vekjik ######*/ @@ -1143,7 +1007,6 @@ public: void AddSC_sholazar_basin() { - new npc_injured_rainspeaker_oracle(); new npc_vekjik(); new npc_avatar_of_freya(); new npc_bushwhacker();