diff options
Diffstat (limited to 'src/server/scripts')
20 files changed, 245 insertions, 441 deletions
diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt index 7df42e158de..79d3cea0868 100644 --- a/src/server/scripts/CMakeLists.txt +++ b/src/server/scripts/CMakeLists.txt @@ -51,6 +51,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Recast/Include ${CMAKE_SOURCE_DIR}/dep/g3dlite/include ${CMAKE_SOURCE_DIR}/dep/SFMT + ${CMAKE_SOURCE_DIR}/dep/cppformat ${CMAKE_SOURCE_DIR}/dep/zlib ${CMAKE_SOURCE_DIR}/src/server/shared ${CMAKE_SOURCE_DIR}/src/server/shared/Configuration @@ -63,6 +64,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/shared/Logging ${CMAKE_SOURCE_DIR}/src/server/shared/Packets ${CMAKE_SOURCE_DIR}/src/server/shared/Threading + ${CMAKE_SOURCE_DIR}/src/server/shared/Updater ${CMAKE_SOURCE_DIR}/src/server/shared/Utilities ${CMAKE_SOURCE_DIR}/src/server/ipc ${CMAKE_SOURCE_DIR}/src/server/collision diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index 7a34ba55110..d41c9c5d2c2 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -211,7 +211,7 @@ public: return true; } - static bool HandleLearnAllMyPetTalentsCommand(ChatHandler* handler, char const* /*args*/) + static bool HandleLearnAllMyPetTalentsCommand(ChatHandler* /*handler*/, char const* /*args*/) { /* TODO: 6.x remove pet talents Player* player = handler->GetSession()->GetPlayer(); diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index d437e72b933..b57efc07a74 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -238,7 +238,8 @@ public: zoneId, (zoneEntry ? zoneEntry->ZoneName : unknown), areaId, (areaEntry ? areaEntry->ZoneName : unknown), object->GetPhaseMask(), - object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(), + object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation()); + handler->PSendSysMessage(LANG_GRID_POSITION, cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(), zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap, haveMMap); @@ -2625,7 +2626,7 @@ public: return true; } - static bool HandleAurasCommand(ChatHandler* handler, char const* args) + static bool HandleAurasCommand(ChatHandler* handler, char const* /*args*/) { Unit* target = handler->GetSession()->GetPlayer()->GetSelectedUnit(); diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 5af9b150572..c1f90c7ac96 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -418,7 +418,7 @@ public: } //Edit Player TP - static bool HandleModifyTalentCommand (ChatHandler* handler, const char* args) + static bool HandleModifyTalentCommand(ChatHandler* /*handler*/, const char* /*args*/) { /* TODO: 6.x remove this if (!*args) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 59f2ce1a2c9..92c3f83034d 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -360,17 +360,17 @@ public: case GOSSIP_ACTION_INFO_DEF+3: player->CLOSE_GOSSIP_MENU(); pBarnesAI->m_uiEventId = EVENT_OZ; - TC_LOG_INFO("scripts", "player (%s) manually set Opera event to EVENT_OZ", player->GetGUID().ToString().c_str()); + TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_OZ", player->GetGUID().ToString().c_str()); break; case GOSSIP_ACTION_INFO_DEF+4: player->CLOSE_GOSSIP_MENU(); pBarnesAI->m_uiEventId = EVENT_HOOD; - TC_LOG_INFO("scripts", "player (%s) manually set Opera event to EVENT_HOOD", player->GetGUID().ToString().c_str()); + TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_HOOD", player->GetGUID().ToString().c_str()); break; case GOSSIP_ACTION_INFO_DEF+5: player->CLOSE_GOSSIP_MENU(); pBarnesAI->m_uiEventId = EVENT_RAJ; - TC_LOG_INFO("scripts", "player (%s) manually set Opera event to EVENT_RAJ", player->GetGUID().ToString().c_str()); + TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_RAJ", player->GetGUID().ToString().c_str()); break; } diff --git a/src/server/scripts/EasternKingdoms/zone_undercity.cpp b/src/server/scripts/EasternKingdoms/zone_undercity.cpp index 9ce694fb76c..ca281bab60a 100644 --- a/src/server/scripts/EasternKingdoms/zone_undercity.cpp +++ b/src/server/scripts/EasternKingdoms/zone_undercity.cpp @@ -40,25 +40,44 @@ EndContentData */ enum Sylvanas { - QUEST_JOURNEY_TO_UNDERCITY = 9180, - EMOTE_LAMENT_END = 0, - SAY_LAMENT_END = 1, + QUEST_JOURNEY_TO_UNDERCITY = 9180, - SOUND_CREDIT = 10896, - ENTRY_HIGHBORNE_LAMENTER = 21628, - ENTRY_HIGHBORNE_BUNNY = 21641, + EMOTE_LAMENT_END = 0, + SAY_LAMENT_END = 1, + EMOTE_LAMENT = 2, - SPELL_HIGHBORNE_AURA = 37090, - SPELL_SYLVANAS_CAST = 36568, - SPELL_RIBBON_OF_SOULS = 34432, // the real one to use might be 37099 + // Ambassador Sunsorrow + SAY_SUNSORROW_WHISPER = 0, + + SOUND_CREDIT = 10896, + + NPC_HIGHBORNE_LAMENTER = 21628, + NPC_HIGHBORNE_BUNNY = 21641, + NPC_AMBASSADOR_SUNSORROW = 16287, + + SPELL_HIGHBORNE_AURA = 37090, + SPELL_SYLVANAS_CAST = 36568, + //SPELL_RIBBON_OF_SOULS = 34432, the real one to use might be 37099 + SPELL_RIBBON_OF_SOULS = 37099, // Combat spells - SPELL_BLACK_ARROW = 59712, - SPELL_FADE = 20672, - SPELL_FADE_BLINK = 29211, - SPELL_MULTI_SHOT = 59713, - SPELL_SHOT = 59710, - SPELL_SUMMON_SKELETON = 59711 + SPELL_BLACK_ARROW = 59712, + SPELL_FADE = 20672, + SPELL_FADE_BLINK = 29211, + SPELL_MULTI_SHOT = 59713, + SPELL_SHOT = 59710, + SPELL_SUMMON_SKELETON = 59711, + + // Events + EVENT_FADE = 1, + EVENT_SUMMON_SKELETON = 2, + EVENT_BLACK_ARROW = 3, + EVENT_SHOOT = 4, + EVENT_MULTI_SHOT = 5, + EVENT_LAMENT_OF_THE_HIGHBORN = 6, + EVENT_SUNSORROW_WHISPER = 7, + + GUID_EVENT_INVOKER = 1, }; float HighborneLoc[4][3]= @@ -77,26 +96,14 @@ class npc_lady_sylvanas_windrunner : public CreatureScript public: npc_lady_sylvanas_windrunner() : CreatureScript("npc_lady_sylvanas_windrunner") { } - bool OnQuestReward(Player* /*player*/, Creature* creature, const Quest *_Quest, uint32 /*slot*/) override + bool OnQuestReward(Player* player, Creature* creature, const Quest *_Quest, uint32 /*slot*/) override { if (_Quest->GetQuestId() == QUEST_JOURNEY_TO_UNDERCITY) - { - ENSURE_AI(npc_lady_sylvanas_windrunner::npc_lady_sylvanas_windrunnerAI, creature->AI())->LamentEvent = true; - ENSURE_AI(npc_lady_sylvanas_windrunner::npc_lady_sylvanas_windrunnerAI, creature->AI())->DoPlaySoundToSet(creature, SOUND_CREDIT); - creature->CastSpell(creature, SPELL_SYLVANAS_CAST, false); - - for (uint8 i = 0; i < 4; ++i) - creature->SummonCreature(ENTRY_HIGHBORNE_LAMENTER, HighborneLoc[i][0], HighborneLoc[i][1], HIGHBORNE_LOC_Y, HighborneLoc[i][2], TEMPSUMMON_TIMED_DESPAWN, 160000); - } + creature->AI()->SetGUID(player->GetGUID(), GUID_EVENT_INVOKER); return true; } - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_lady_sylvanas_windrunnerAI(creature); - } - struct npc_lady_sylvanas_windrunnerAI : public ScriptedAI { npc_lady_sylvanas_windrunnerAI(Creature* creature) : ScriptedAI(creature) @@ -106,41 +113,51 @@ public: void Initialize() { - LamentEventTimer = 5000; LamentEvent = false; targetGUID.Clear(); - - FadeTimer = 30000; - SummonSkeletonTimer = 20000; - BlackArrowTimer = 15000; - ShotTimer = 8000; - MultiShotTimer = 10000; + playerGUID.Clear(); } - uint32 LamentEventTimer; - bool LamentEvent; - ObjectGuid targetGUID; - - uint32 FadeTimer; - uint32 SummonSkeletonTimer; - uint32 BlackArrowTimer; - uint32 ShotTimer; - uint32 MultiShotTimer; - void Reset() override { Initialize(); + _events.Reset(); } - void EnterCombat(Unit* /*who*/) override { } + void EnterCombat(Unit* /*who*/) override + { + _events.ScheduleEvent(EVENT_FADE, 30000); + _events.ScheduleEvent(EVENT_SUMMON_SKELETON, 20000); + _events.ScheduleEvent(EVENT_BLACK_ARROW, 15000); + _events.ScheduleEvent(EVENT_SHOOT, 8000); + _events.ScheduleEvent(EVENT_MULTI_SHOT, 10000); + } + + void SetGUID(ObjectGuid guid, int32 type) override + { + if (type == GUID_EVENT_INVOKER) + { + Talk(EMOTE_LAMENT); + DoPlaySoundToSet(me, SOUND_CREDIT); + DoCast(me, SPELL_SYLVANAS_CAST, false); + playerGUID = guid; + LamentEvent = true; + + for (uint8 i = 0; i < 4; ++i) + me->SummonCreature(NPC_HIGHBORNE_LAMENTER, HighborneLoc[i][0], HighborneLoc[i][1], HIGHBORNE_LOC_Y, HighborneLoc[i][2], TEMPSUMMON_TIMED_DESPAWN, 160000); + + _events.ScheduleEvent(EVENT_LAMENT_OF_THE_HIGHBORN, 2000); + _events.ScheduleEvent(EVENT_SUNSORROW_WHISPER, 10000); + } + } void JustSummoned(Creature* summoned) override { - if (summoned->GetEntry() == ENTRY_HIGHBORNE_BUNNY) + if (summoned->GetEntry() == NPC_HIGHBORNE_BUNNY) { if (Creature* target = ObjectAccessor::GetCreature(*summoned, targetGUID)) { - target->MonsterMoveWithSpeed(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0); + target->GetMotionMaster()->MoveJump(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ() + 15.0f, 0); target->SetPosition(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0.0f); summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false); } @@ -152,75 +169,86 @@ public: void UpdateAI(uint32 diff) override { - if (LamentEvent) - { - if (LamentEventTimer <= diff) - { - DoSummon(ENTRY_HIGHBORNE_BUNNY, me, 10.0f, 3000, TEMPSUMMON_TIMED_DESPAWN); - - LamentEventTimer = 2000; - if (!me->HasAura(SPELL_SYLVANAS_CAST)) - { - Talk(SAY_LAMENT_END); - Talk(EMOTE_LAMENT_END); - LamentEvent = false; - } - } else LamentEventTimer -= diff; - } - - if (!UpdateVictim()) + if (!UpdateVictim() && !LamentEvent) return; - // Combat spells - - if (FadeTimer <= diff) - { - DoCast(me, SPELL_FADE); - // add a blink to simulate a stealthed movement and reappearing elsewhere - DoCast(me, SPELL_FADE_BLINK); - FadeTimer = 30000 + rand32() % 5000; - // if the victim is out of melee range she cast multi shot - if (Unit* victim = me->GetVictim()) - if (me->GetDistance(victim) > 10.0f) - DoCast(victim, SPELL_MULTI_SHOT); - } else FadeTimer -= diff; - - if (SummonSkeletonTimer <= diff) - { - DoCast(me, SPELL_SUMMON_SKELETON); - SummonSkeletonTimer = 20000 + rand32() % 10000; - } else SummonSkeletonTimer -= diff; - - if (BlackArrowTimer <= diff) - { - if (Unit* victim = me->GetVictim()) - { - DoCast(victim, SPELL_BLACK_ARROW); - BlackArrowTimer = 15000 + rand32() % 5000; - } - } else BlackArrowTimer -= diff; + _events.Update(diff); - if (ShotTimer <= diff) - { - if (Unit* victim = me->GetVictim()) - { - DoCast(victim, SPELL_SHOT); - ShotTimer = 8000 + rand32() % 2000; - } - } else ShotTimer -= diff; + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; - if (MultiShotTimer <= diff) + while (uint32 eventId = _events.ExecuteEvent()) { - if (Unit* victim = me->GetVictim()) + switch (eventId) { - DoCast(victim, SPELL_MULTI_SHOT); - MultiShotTimer = 10000 + rand32() % 3000; + case EVENT_FADE: + DoCast(me, SPELL_FADE); + // add a blink to simulate a stealthed movement and reappearing elsewhere + DoCast(me, SPELL_FADE_BLINK); + // if the victim is out of melee range she cast multi shot + if (Unit* victim = me->GetVictim()) + if (me->GetDistance(victim) > 10.0f) + DoCast(victim, SPELL_MULTI_SHOT); + _events.ScheduleEvent(EVENT_FADE, urand(30000, 35000)); + break; + case EVENT_SUMMON_SKELETON: + DoCast(me, SPELL_SUMMON_SKELETON); + _events.ScheduleEvent(EVENT_SUMMON_SKELETON, urand(20000, 30000)); + break; + case EVENT_BLACK_ARROW: + if (Unit* victim = me->GetVictim()) + DoCast(victim, SPELL_BLACK_ARROW); + _events.ScheduleEvent(EVENT_BLACK_ARROW, urand(15000, 20000)); + break; + case EVENT_SHOOT: + if (Unit* victim = me->GetVictim()) + DoCast(victim, SPELL_SHOT); + _events.ScheduleEvent(EVENT_SHOOT, urand(8000, 10000)); + break; + case EVENT_MULTI_SHOT: + if (Unit* victim = me->GetVictim()) + DoCast(victim, SPELL_MULTI_SHOT); + _events.ScheduleEvent(EVENT_MULTI_SHOT, urand(10000, 13000)); + break; + case EVENT_LAMENT_OF_THE_HIGHBORN: + if (!me->HasAura(SPELL_SYLVANAS_CAST)) + { + Talk(SAY_LAMENT_END); + Talk(EMOTE_LAMENT_END); + LamentEvent = false; + me->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL); + Reset(); + } + else + { + DoSummon(NPC_HIGHBORNE_BUNNY, me, 10.0f, 3000, TEMPSUMMON_TIMED_DESPAWN); + _events.ScheduleEvent(EVENT_LAMENT_OF_THE_HIGHBORN, 2000); + } + break; + case EVENT_SUNSORROW_WHISPER: + if (Creature* ambassador = me->FindNearestCreature(NPC_AMBASSADOR_SUNSORROW, 20.0f)) + if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID)) + ambassador->AI()->Talk(SAY_SUNSORROW_WHISPER, player); + break; + default: + break; } - } else MultiShotTimer -= diff; + } DoMeleeAttackIfReady(); } + + private: + EventMap _events; + bool LamentEvent; + ObjectGuid targetGUID; + ObjectGuid playerGUID; }; + + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_lady_sylvanas_windrunnerAI(creature); + } }; /*###### diff --git a/src/server/scripts/Kalimdor/CMakeLists.txt b/src/server/scripts/Kalimdor/CMakeLists.txt index d5e445230bd..8c3f3216e91 100644 --- a/src/server/scripts/Kalimdor/CMakeLists.txt +++ b/src/server/scripts/Kalimdor/CMakeLists.txt @@ -92,7 +92,6 @@ set(scripts_STAT_SRCS Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp - Kalimdor/zone_mulgore.cpp Kalimdor/zone_bloodmyst_isle.cpp Kalimdor/zone_thunder_bluff.cpp Kalimdor/zone_azshara.cpp diff --git a/src/server/scripts/Kalimdor/zone_mulgore.cpp b/src/server/scripts/Kalimdor/zone_mulgore.cpp deleted file mode 100644 index b6db431d0b2..00000000000 --- a/src/server/scripts/Kalimdor/zone_mulgore.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> - * - * 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 - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -/* ScriptData -SDName: Mulgore -SD%Complete: 100 -SDComment: Support for quest: 11129, 861 -SDCategory: Mulgore -EndScriptData */ - -/* ContentData -npc_kyle_frenzied -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "Player.h" -#include "SpellInfo.h" - -/*##### -# npc_kyle_frenzied -######*/ - -enum KyleFrenzied -{ - EMOTE_SEE_LUNCH = 0, - EMOTE_EAT_LUNCH = 1, - EMOTE_DANCE = 2, - - SPELL_LUNCH = 42222, - NPC_KYLE_FRENZIED = 23616, - NPC_KYLE_FRIENDLY = 23622, - POINT_ID = 1 -}; - -class npc_kyle_frenzied : public CreatureScript -{ -public: - npc_kyle_frenzied() : CreatureScript("npc_kyle_frenzied") { } - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_kyle_frenziedAI (creature); - } - - struct npc_kyle_frenziedAI : public ScriptedAI - { - npc_kyle_frenziedAI(Creature* creature) : ScriptedAI(creature) - { - Initialize(); - } - - void Initialize() - { - EventActive = false; - IsMovingToLunch = false; - PlayerGUID.Clear(); - EventTimer = 5000; - EventPhase = 0; - } - - bool EventActive; - bool IsMovingToLunch; - ObjectGuid PlayerGUID; - uint32 EventTimer; - uint8 EventPhase; - - void Reset() override - { - Initialize(); - - if (me->GetEntry() == NPC_KYLE_FRIENDLY) - me->UpdateEntry(NPC_KYLE_FRENZIED); - } - - void SpellHit(Unit* Caster, SpellInfo const* Spell) - { - if (!me->GetVictim() && !EventActive && Spell->Id == SPELL_LUNCH) - { - if (Caster->GetTypeId() == TYPEID_PLAYER) - PlayerGUID = Caster->GetGUID(); - - if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) - { - me->GetMotionMaster()->MovementExpired(); - me->GetMotionMaster()->MoveIdle(); - me->StopMoving(); - } - - EventActive = true; - Talk(EMOTE_SEE_LUNCH); - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_CREATURE_SPECIAL); - } - } - - void MovementInform(uint32 type, uint32 pointId) override - { - if (type != POINT_MOTION_TYPE || !EventActive) - return; - - if (pointId == POINT_ID) - IsMovingToLunch = false; - } - - void UpdateAI(uint32 diff) override - { - if (EventActive) - { - if (IsMovingToLunch) - return; - - if (EventTimer <= diff) - { - EventTimer = 5000; - ++EventPhase; - - switch (EventPhase) - { - case 1: - if (Unit* unit = ObjectAccessor::GetUnit(*me, PlayerGUID)) - { - if (GameObject* go = unit->GetGameObject(SPELL_LUNCH)) - { - IsMovingToLunch = true; - me->GetMotionMaster()->MovePoint(POINT_ID, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ()); - } - } - break; - case 2: - Talk(EMOTE_EAT_LUNCH); - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING); - break; - case 3: - if (Player* unit = ObjectAccessor::GetPlayer(*me, PlayerGUID)) - unit->TalkedToCreature(me->GetEntry(), me->GetGUID()); - - me->UpdateEntry(NPC_KYLE_FRIENDLY); - break; - case 4: - EventTimer = 30000; - Talk(EMOTE_DANCE); - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DANCESPECIAL); - break; - case 5: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); - Reset(); - me->GetMotionMaster()->Clear(); - break; - } - } - else - EventTimer -= diff; - } - } - }; - -}; - -void AddSC_mulgore() -{ - new npc_kyle_frenzied(); -} diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp index 232261df951..1c9d5cf2c62 100644 --- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp +++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp @@ -654,6 +654,7 @@ public: if (quest->GetQuestId() == QUEST_ESCAPE) { creature->setFaction(FACTION_RATCHET); + creature->AI()->Talk(SAY_START); if (npc_escortAI* pEscortAI = CAST_AI(npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI, creature->AI())) pEscortAI->Start(true, false, player->GetGUID()); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp index 7148d0149af..b751c1db10d 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp @@ -255,12 +255,6 @@ class instance_trial_of_the_crusader : public InstanceMapScript if (GetBossState(BOSS_VALKIRIES) == SPECIAL) state = DONE; break; - case DONE: - if (instance->GetPlayers().getFirst()->GetSource()->GetTeam() == ALLIANCE) - EventStage = 4020; - else - EventStage = 4030; - break; default: break; } @@ -336,7 +330,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript if (type < MAX_ENCOUNTERS) { - TC_LOG_INFO("scripts", "[ToCr] BossState(type %u) %u = state %u;", type, GetBossState(type), state); + TC_LOG_DEBUG("scripts", "[ToCr] BossState(type %u) %u = state %u;", type, GetBossState(type), state); if (state == FAIL) { if (instance->IsHeroic()) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index 16526b694e9..974bd4672f1 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -133,7 +133,7 @@ class npc_announcer_toc10 : public CreatureScript char const* _message = "We are ready!"; - if (player->IsInCombat() || instance->IsEncounterInProgress() || instance->GetData(TYPE_EVENT)) + if (player->IsInCombat() || instance->IsEncounterInProgress()) return true; uint8 i = 0; @@ -199,17 +199,11 @@ class npc_announcer_toc10 : public CreatureScript } else if (instance->GetBossState(BOSS_LICH_KING) != DONE) { - if (GameObject* floor = ObjectAccessor::GetGameObject(*player, instance->GetGuidData(GO_ARGENT_COLISEUM_FLOOR))) - floor->SetDestructibleState(GO_DESTRUCTIBLE_DAMAGED); - - creature->CastSpell(creature, SPELL_CORPSE_TELEPORT, false); - creature->CastSpell(creature, SPELL_DESTROY_FLOOR_KNOCKUP, false); - - if (!ObjectAccessor::GetCreature(*creature, instance->GetGuidData(NPC_ANUBARAK))) - creature->SummonCreature(NPC_ANUBARAK, AnubarakLoc[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME); - - if (creature->IsVisible()) - creature->SetVisible(false); + if (creature->GetMap()->GetPlayers().getFirst()->GetSource()->GetTeam() == ALLIANCE) + instance->SetData(TYPE_EVENT, 4020); + else + instance->SetData(TYPE_EVENT, 4030); + instance->SetBossState(BOSS_LICH_KING, NOT_STARTED); } creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); return true; diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index 5b3be128b32..20add695394 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -2640,13 +2640,7 @@ class npc_quel_delar_sword : public CreatureScript break; case EVENT_QUEL_DELAR_FLIGHT: { - Movement::MoveSplineInit init(me); - FillCirclePath(QuelDelarCenterPos, 18.0f, 718.046f, init.Path(), true); - init.SetFly(); - init.SetCyclic(); - init.SetAnimation(Movement::ToFly); - init.Launch(); - + me->GetMotionMaster()->MoveCirclePath(QuelDelarCenterPos.GetPositionX(), QuelDelarCenterPos.GetPositionY(), 718.046f, 18.0f, true, 16); _events.ScheduleEvent(EVENT_QUEL_DELAR_LAND, 15000); break; } @@ -2694,21 +2688,6 @@ class npc_quel_delar_sword : public CreatureScript } private: - void FillCirclePath(Position const& centerPos, float radius, float z, Movement::PointsArray& path, bool clockwise) - { - float step = clockwise ? -M_PI / 8.0f : M_PI / 8.0f; - float angle = centerPos.GetAngle(me->GetPositionX(), me->GetPositionY()); - - for (uint8 i = 0; i < 16; angle += step, ++i) - { - G3D::Vector3 point; - point.x = centerPos.GetPositionX() + radius * cosf(angle); - point.y = centerPos.GetPositionY() + radius * sinf(angle); - point.z = z; - path.push_back(point); - } - } - EventMap _events; InstanceScript* _instance; bool _intro; diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index abbc7acb004..0c79b42f20c 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -520,11 +520,7 @@ public: _despawned = false; break; case ACTION_CYCLIC_MOVEMENT: - Movement::MoveSplineInit init(me); - FillCirclePath(MalygosPositions[3], 120.0f, 283.2763f, init.Path(), true); - init.SetFly(); - init.SetCyclic(); - init.Launch(); + me->GetMotionMaster()->MoveCirclePath(MalygosPositions[3].GetPositionX(), MalygosPositions[3].GetPositionY(), 283.2763f, 120.0f, true, 16); break; } } @@ -1020,22 +1016,6 @@ public: } private: - // Used to generate perfect cyclic movements (Enter Circle). - void FillCirclePath(Position const& centerPos, float radius, float z, Movement::PointsArray& path, bool clockwise) - { - float step = clockwise ? float(-M_PI) / 8.0f : float(M_PI) / 8.0f; - float angle = centerPos.GetAngle(me->GetPositionX(), me->GetPositionY()); - - for (uint8 i = 0; i < 16; angle += step, ++i) - { - G3D::Vector3 point; - point.x = centerPos.GetPositionX() + radius * cosf(angle); - point.y = centerPos.GetPositionY() + radius * sinf(angle); - point.z = z; // Don't use any height getters unless all bugs are fixed. - path.push_back(point); - } - } - uint8 _phase; // Counter for phases used with a getter. uint8 _summonDeaths; // Keeps count of arcane trash. uint8 _preparingPulsesChecker; // In retail they use 2 preparing pulses with 7 sec CD, after they pass 2 seconds. @@ -1326,11 +1306,7 @@ public: { if (action < ACTION_DELAYED_DESPAWN) { - Movement::MoveSplineInit init(me); - FillCirclePath(MalygosPositions[3], 35.0f, 282.3402f, init.Path(), true); - init.SetFly(); - init.SetCyclic(); - init.Launch(); + me->GetMotionMaster()->MoveCirclePath(MalygosPositions[3].GetPositionX(), MalygosPositions[3].GetPositionY(), 282.3402f, 35.0f, true, 16); } else { @@ -1339,21 +1315,6 @@ public: } private: - void FillCirclePath(Position const& centerPos, float radius, float z, Movement::PointsArray& path, bool clockwise) - { - float step = clockwise ? float(-M_PI) / 9.0f : float(M_PI) / 9.0f; - float angle = centerPos.GetAngle(me->GetPositionX(), me->GetPositionY()); - - for (uint8 i = 0; i < 18; angle += step, ++i) - { - G3D::Vector3 point; - point.x = centerPos.GetPositionX() + radius * cosf(angle); - point.y = centerPos.GetPositionY() + radius * sinf(angle); - point.z = z; // Don't use any height getters unless all bugs are fixed. - path.push_back(point); - } - } - InstanceScript* _instance; }; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp index c37cf28ab78..134783ccf07 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp @@ -1126,30 +1126,11 @@ class npc_ominous_cloud : public CreatureScript DoCast(me, SPELL_OMINOUS_CLOUD_VISUAL); } - void FillCirclePath(Position const& centerPos, float radius, float z, Movement::PointsArray& path, bool clockwise) - { - float step = clockwise ? float(-M_PI) / 8.0f : float(M_PI) / 8.0f; - float angle = centerPos.GetAngle(me->GetPositionX(), me->GetPositionY()); - - for (uint8 i = 0; i < 16; angle += step, ++i) - { - G3D::Vector3 point; - point.x = centerPos.GetPositionX() + radius * cosf(angle); - point.y = centerPos.GetPositionY() + radius * sinf(angle); - point.z = me->GetMap()->GetHeight(me->GetPhaseMask(), point.x, point.y, z + 5.0f); - path.push_back(point); - } - } - void UpdateAI(uint32 /*diff*/) override { } - void DoAction(int32 action) override + void DoAction(int32 /*action*/) override { - Movement::MoveSplineInit init(me); - FillCirclePath(YoggSaronSpawnPos, me->GetDistance2d(YoggSaronSpawnPos.GetPositionX(), YoggSaronSpawnPos.GetPositionY()), me->GetPositionZ(), init.Path(), action != 0); - init.SetWalk(true); - init.SetCyclic(); - init.Launch(); + me->GetMotionMaster()->MoveCirclePath(YoggSaronSpawnPos.GetPositionX(), YoggSaronSpawnPos.GetPositionY(), me->GetPositionZ() + 5.0f, me->GetDistance2d(YoggSaronSpawnPos.GetPositionX(), YoggSaronSpawnPos.GetPositionY()), true, 16); } }; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index 56148480e11..32d3b35f35c 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -16,6 +16,7 @@ */ #include "InstanceScript.h" +#include "Vehicle.h" #include "Player.h" #include "ScriptedCreature.h" #include "ScriptMgr.h" @@ -91,6 +92,7 @@ class instance_ulduar : public InstanceMapScript // Creatures ObjectGuid LeviathanGUID; + GuidVector LeviathanVehicleGUIDs; ObjectGuid IgnisGUID; ObjectGuid RazorscaleGUID; ObjectGuid RazorscaleController; @@ -217,6 +219,11 @@ class instance_ulduar : public InstanceMapScript case NPC_LEVIATHAN: LeviathanGUID = creature->GetGUID(); break; + case NPC_SALVAGED_DEMOLISHER: + case NPC_SALVAGED_SIEGE_ENGINE: + case NPC_SALVAGED_CHOPPER: + LeviathanVehicleGUIDs.push_back(creature->GetGUID()); + break; case NPC_IGNIS: IgnisGUID = creature->GetGUID(); break; @@ -682,6 +689,24 @@ class instance_ulduar : public InstanceMapScript switch (type) { case BOSS_LEVIATHAN: + if (state == DONE) + { + // Eject all players from vehicles and make them untargetable. + // They will be despawned after a while + for (auto const& vehicleGuid : LeviathanVehicleGUIDs) + { + if (Creature* vehicleCreature = instance->GetCreature(vehicleGuid)) + { + if (Vehicle* vehicle = vehicleCreature->GetVehicleKit()) + { + vehicle->RemoveAllPassengers(); + vehicleCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + vehicleCreature->DespawnOrUnsummon(5 * MINUTE * IN_MILLISECONDS); + } + } + } + } + break; case BOSS_IGNIS: case BOSS_RAZORSCALE: case BOSS_XT002: @@ -1143,6 +1168,34 @@ class instance_ulduar : public InstanceMapScript } } + void UpdateDoorState(GameObject* door) override + { + // Leviathan doors are set to DOOR_TYPE_ROOM except the one it uses to enter the room + // which has to be set to DOOR_TYPE_PASSAGE + if (door->GetEntry() == GO_LEVIATHAN_DOOR && door->GetPositionX() > 400.f) + door->SetGoState(GetBossState(BOSS_LEVIATHAN) == DONE ? GO_STATE_ACTIVE : GO_STATE_READY); + else + InstanceScript::UpdateDoorState(door); + } + + void AddDoor(GameObject* door, bool add) override + { + // Leviathan doors are South except the one it uses to enter the room + // which is North and should not be used for boundary checks in BossAI::CheckBoundary() + if (door->GetEntry() == GO_LEVIATHAN_DOOR && door->GetPositionX() > 400.f) + { + if (add) + GetBossInfo(BOSS_LEVIATHAN)->door[DOOR_TYPE_PASSAGE].insert(door->GetGUID()); + else + GetBossInfo(BOSS_LEVIATHAN)->door[DOOR_TYPE_PASSAGE].erase(door->GetGUID()); + + if (add) + UpdateDoorState(door); + } + else + InstanceScript::AddDoor(door, add); + } + private: EventMap _events; uint32 _algalonTimer; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h index ddf293dd8b8..d40fb698658 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h @@ -54,6 +54,7 @@ enum UlduarNPCs NPC_LEVIATHAN = 33113, NPC_SALVAGED_DEMOLISHER = 33109, NPC_SALVAGED_SIEGE_ENGINE = 33060, + NPC_SALVAGED_CHOPPER = 33062, NPC_IGNIS = 33118, NPC_RAZORSCALE = 33186, NPC_RAZORSCALE_CONTROLLER = 33233, diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp index 3e3ce5cde75..a462c68e084 100644 --- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp @@ -133,6 +133,7 @@ public: uiCyanigosaEventTimer = 3 * IN_MILLISECONDS; bActive = false; + bWiped = false; bIsDoorSpellCast = false; bCrystalActivated = false; defenseless = true; diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index f6b9f9fb6be..b58d9419e95 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -29,7 +29,6 @@ npc_corastrasza npc_sinkhole_kill_credit npc_khunok_the_behemoth npc_nerubar_victim -npc_keristrasza npc_nesingwary_trapper npc_lurgglbr npc_nexus_drake_hatchling @@ -223,48 +222,6 @@ public: }; /*###### -## npc_keristrasza -######*/ - -enum Keristrasza -{ - SPELL_TELEPORT_TO_SARAGOSA = 46772 -}; - -#define GOSSIP_HELLO_KERI "I am prepared to face Saragosa!" - -class npc_keristrasza : public CreatureScript -{ -public: - npc_keristrasza() : CreatureScript("npc_keristrasza") { } - - bool OnGossipHello(Player* player, Creature* creature) override - { - if (creature->IsQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(11957) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_KERI, 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) - { - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_TELEPORT_TO_SARAGOSA, true); - } - - return true; - } -}; - -/*###### ## npc_corastrasza ######*/ @@ -2488,7 +2445,6 @@ void AddSC_borean_tundra() { new npc_sinkhole_kill_credit(); new npc_khunok_the_behemoth(); - new npc_keristrasza(); new npc_corastrasza(); new npc_iruk(); new npc_nerubar_victim(); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 8105f7de5ff..91ef240a1a3 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -548,7 +548,7 @@ class spell_mage_fire_frost_ward : public SpellScriptLoader } } - void Absorb(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount) + void Absorb(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& /*absorbAmount*/) { /*Unit* target = GetTarget(); if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_FROST_WARDING_R1, EFFECT_0)) diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 287e3591f5d..f3c8396832c 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2495,6 +2495,36 @@ public: } }; +class spell_q12414_hand_over_reins : public SpellScriptLoader +{ + public: + spell_q12414_hand_over_reins() : SpellScriptLoader("spell_q12414_hand_over_reins") { } + + class spell_q12414_hand_over_reins_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12414_hand_over_reins_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Creature* caster = GetCaster()->ToCreature(); + GetHitUnit()->ExitVehicle(); + + if (caster) + caster->DespawnOrUnsummon(); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12414_hand_over_reins_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_q12414_hand_over_reins_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -2555,4 +2585,5 @@ void AddSC_quest_spell_scripts() new spell_q10929_fumping(); new spell_q28813_get_our_boys_back_dummy(); new spell_q28813_set_health_random(); + new spell_q12414_hand_over_reins(); } |
