From 014adaa0fd14a3f316588b0829ceea1960af12d5 Mon Sep 17 00:00:00 2001 From: Nyeriah Date: Wed, 3 Sep 2014 17:25:36 -0300 Subject: [PATCH 01/12] Core/Tickets: Send global GM system messages on ticket complete --- .../world/2014_09_03_01_world_trinity_string.sql | 5 +++++ src/server/game/Miscellaneous/Language.h | 3 ++- src/server/game/Tickets/TicketMgr.cpp | 4 +++- src/server/game/Tickets/TicketMgr.h | 2 +- src/server/scripts/Commands/cs_ticket.cpp | 13 ++++++++----- 5 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 sql/updates/world/2014_09_03_01_world_trinity_string.sql diff --git a/sql/updates/world/2014_09_03_01_world_trinity_string.sql b/sql/updates/world/2014_09_03_01_world_trinity_string.sql new file mode 100644 index 00000000000..0586c31e3d2 --- /dev/null +++ b/sql/updates/world/2014_09_03_01_world_trinity_string.sql @@ -0,0 +1,5 @@ +-- Implements in-game gm message when tickets are completed +SET @LANG_COMMAND_TICKETCOMPLETED := 2030; +DELETE FROM `trinity_string` WHERE `entry` = @LANG_COMMAND_TICKETCOMPLETED; +INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES (@LANG_COMMAND_TICKETCOMPLETED, '|cff00ff00Completed by|r:|cff00ccff %s|r'); + diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 66cae69cb33..6f86d550a71 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -1014,7 +1014,7 @@ enum TrinityStrings LANG_BG_AV_START_TWO_MINUTES = 1333, // FREE IDS 1334-1999 - // Ticket Strings 2000-2029 + // Ticket Strings 2000-2030 LANG_COMMAND_TICKETNEW = 2000, LANG_COMMAND_TICKETUPDATED = 2001, LANG_COMMAND_TICKETPLAYERABANDON = 2002, @@ -1045,6 +1045,7 @@ enum TrinityStrings LANG_COMMAND_TICKETPENDING = 2027, LANG_COMMAND_TICKETRESET = 2028, LANG_COMMAND_TICKETLISTRESPONSE = 2029, + LANG_COMMAND_TICKETCOMPLETED = 2030, // Trinity strings 5000-9999 LANG_COMMAND_FREEZE = 5000, diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index 71d51153b4c..d1f45ba88bf 100644 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -179,7 +179,7 @@ std::string GmTicket::FormatMessageString(ChatHandler& handler, bool detailed) c return ss.str(); } -std::string GmTicket::FormatMessageString(ChatHandler& handler, const char* szClosedName, const char* szAssignedToName, const char* szUnassignedName, const char* szDeletedName) const +std::string GmTicket::FormatMessageString(ChatHandler& handler, const char* szClosedName, const char* szAssignedToName, const char* szUnassignedName, const char* szDeletedName, const char* szCompletedName) const { std::stringstream ss; ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTGUID, _id); @@ -192,6 +192,8 @@ std::string GmTicket::FormatMessageString(ChatHandler& handler, const char* szCl ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTUNASSIGNED, szUnassignedName); if (szDeletedName) ss << handler.PGetParseString(LANG_COMMAND_TICKETDELETED, szDeletedName); + if (szCompletedName) + ss << handler.PGetParseString(LANG_COMMAND_TICKETCOMPLETED, szCompletedName); return ss.str(); } diff --git a/src/server/game/Tickets/TicketMgr.h b/src/server/game/Tickets/TicketMgr.h index 5ad44365e7f..8b1c8fbc0f9 100644 --- a/src/server/game/Tickets/TicketMgr.h +++ b/src/server/game/Tickets/TicketMgr.h @@ -142,7 +142,7 @@ public: void TeleportTo(Player* player) const; std::string FormatMessageString(ChatHandler& handler, bool detailed = false) const; - std::string FormatMessageString(ChatHandler& handler, const char* szClosedName, const char* szAssignedToName, const char* szUnassignedName, const char* szDeletedName) const; + std::string FormatMessageString(ChatHandler& handler, const char* szClosedName, const char* szAssignedToName, const char* szUnassignedName, const char* szDeletedName, const char* szCompletedName) const; void SetChatLog(std::list time, std::string const& log); std::string const& GetChatLog() const { return _chatLog; } diff --git a/src/server/scripts/Commands/cs_ticket.cpp b/src/server/scripts/Commands/cs_ticket.cpp index a2f1c75106b..364b698743a 100644 --- a/src/server/scripts/Commands/cs_ticket.cpp +++ b/src/server/scripts/Commands/cs_ticket.cpp @@ -126,7 +126,7 @@ public: ticket->SaveToDB(trans); sTicketMgr->UpdateLastChange(); - std::string msg = ticket->FormatMessageString(*handler, NULL, target.c_str(), NULL, NULL); + std::string msg = ticket->FormatMessageString(*handler, NULL, target.c_str(), NULL, NULL, NULL); handler->SendGlobalGMSysMessage(msg.c_str()); return true; } @@ -156,7 +156,7 @@ public: sTicketMgr->CloseTicket(ticket->GetId(), player ? player->GetGUID() : -1); sTicketMgr->UpdateLastChange(); - std::string msg = ticket->FormatMessageString(*handler, player ? player->GetName().c_str() : "Console", NULL, NULL, NULL); + std::string msg = ticket->FormatMessageString(*handler, player ? player->GetName().c_str() : "Console", NULL, NULL, NULL, NULL); handler->SendGlobalGMSysMessage(msg.c_str()); // Inform player, who submitted this ticket, that it is closed @@ -205,7 +205,7 @@ public: ticket->SaveToDB(trans); sTicketMgr->UpdateLastChange(); - std::string msg = ticket->FormatMessageString(*handler, NULL, ticket->GetAssignedToName().c_str(), NULL, NULL); + std::string msg = ticket->FormatMessageString(*handler, NULL, ticket->GetAssignedToName().c_str(), NULL, NULL, NULL); msg += handler->PGetParseString(LANG_COMMAND_TICKETLISTADDCOMMENT, player ? player->GetName().c_str() : "Console", comment); handler->SendGlobalGMSysMessage(msg.c_str()); @@ -239,6 +239,9 @@ public: ticket->SetCompleted(); ticket->SaveToDB(trans); + std::string msg = ticket->FormatMessageString(*handler, NULL, NULL, + NULL, NULL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console"); + handler->SendGlobalGMSysMessage(msg.c_str()); sTicketMgr->UpdateLastChange(); return true; } @@ -262,7 +265,7 @@ public: return true; } - std::string msg = ticket->FormatMessageString(*handler, NULL, NULL, NULL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console"); + std::string msg = ticket->FormatMessageString(*handler, NULL, NULL, NULL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console", NULL); handler->SendGlobalGMSysMessage(msg.c_str()); sTicketMgr->RemoveTicket(ticket->GetId()); @@ -394,7 +397,7 @@ public: sTicketMgr->UpdateLastChange(); std::string msg = ticket->FormatMessageString(*handler, NULL, assignedTo.c_str(), - handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console", NULL); + handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console", NULL, NULL); handler->SendGlobalGMSysMessage(msg.c_str()); return true; From 87ed5de7e655ca7fec389415d67569c4aa755fdb Mon Sep 17 00:00:00 2001 From: mik1893 Date: Mon, 1 Sep 2014 13:06:21 +0200 Subject: [PATCH 02/12] Scripts/Onyxia Lair: small rework - fix crash on boss death - avoid abusing during phase switch - added better facing through trigger - corrected some timers - corrected inhabit type - cleanup and inheriting some BossAI functionalities instead of custom stuff --- .../world/2014_09_01_01_world_onyxia.sql | 2 + .../Kalimdor/OnyxiasLair/boss_onyxia.cpp | 114 ++++++++++-------- .../OnyxiasLair/instance_onyxias_lair.cpp | 17 +++ .../Kalimdor/OnyxiasLair/onyxias_lair.h | 7 +- 4 files changed, 90 insertions(+), 50 deletions(-) create mode 100644 sql/updates/world/2014_09_01_01_world_onyxia.sql diff --git a/sql/updates/world/2014_09_01_01_world_onyxia.sql b/sql/updates/world/2014_09_01_01_world_onyxia.sql new file mode 100644 index 00000000000..99824d2d47a --- /dev/null +++ b/sql/updates/world/2014_09_01_01_world_onyxia.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET InhabitType = 5 WHERE entry = 10184; +UPDATE creature_template SET InhabitType = 5 WHERE entry = 36538; diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index f04b5634616..347c87b160b 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -111,6 +111,7 @@ static OnyxMove MoveData[8]= Position const MiddleRoomLocation = {-23.6155f, -215.357f, -55.7344f, 0.0f}; Position const Phase2Location = {-80.924f, -214.299f, -82.942f, 0.0f}; +Position const Phase2Floating = { -80.924f, -214.299f, -57.942f, 0.0f }; Position const SpawnLocations[3]= { @@ -128,7 +129,7 @@ public: struct boss_onyxiaAI : public BossAI { - boss_onyxiaAI(Creature* creature) : BossAI(creature, DATA_ONYXIA), Summons(me) + boss_onyxiaAI(Creature* creature) : BossAI(creature, DATA_ONYXIA) { Reset(); } @@ -138,16 +139,16 @@ public: if (!IsCombatMovementAllowed()) SetCombatMovement(true); + _Reset(); + Phase = PHASE_START; MovePoint = urand(0, 5); PointData = GetMoveData(); - Summons.DespawnAll(); SummonWhelpCount = 0; IsMoving = false; - instance->SetBossState(DATA_ONYXIA, NOT_STARTED); instance->SetData(DATA_ONYXIA_PHASE, Phase); - instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); + instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } void EnterCombat(Unit* /*who*/) override @@ -155,20 +156,15 @@ public: Talk(SAY_AGGRO); me->SetInCombatWithZone(); - events.ScheduleEvent(EVENT_FLAME_BREATH, urand (10000, 20000)); - events.ScheduleEvent(EVENT_TAIL_SWEEP, urand (15000, 20000)); - events.ScheduleEvent(EVENT_CLEAVE, urand (2000, 5000)); - events.ScheduleEvent(EVENT_WING_BUFFET, urand (10000, 20000)); + events.Reset(); + + events.ScheduleEvent(EVENT_FLAME_BREATH, urand(10000, 20000)); + events.ScheduleEvent(EVENT_TAIL_SWEEP, urand(15000, 20000)); + events.ScheduleEvent(EVENT_CLEAVE, urand(2000, 5000)); + events.ScheduleEvent(EVENT_WING_BUFFET, urand(10000, 20000)); instance->SetBossState(DATA_ONYXIA, IN_PROGRESS); - instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); - } - - void JustDied(Unit* /*killer*/) override - { - instance->SetBossState(DATA_ONYXIA, DONE); - - Summons.DespawnAll(); + instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } void JustSummoned(Creature* summoned) override @@ -186,13 +182,9 @@ public: summoned->setActive(true); break; } - Summons.Summon(summoned); + summons.Summon(summoned); } - void SummonedCreatureDespawn(Creature* summon) override - { - Summons.Despawn(summon); - } void KilledUnit(Unit* /*victim*/) override { @@ -231,22 +223,43 @@ public: } break; case 9: - me->GetMotionMaster()->MoveChase(me->GetVictim()); - events.ScheduleEvent(EVENT_BELLOWING_ROAR, 1000); + me->SetCanFly(false); + me->SetDisableGravity(false); + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); + if (Creature* trigger = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_TRIGGER_GUID))) + me->Kill(trigger); + me->SetReactState(REACT_AGGRESSIVE); + // tank selection based on phase one. If tank is not there i take nearest one + if (Unit* tank = ObjectAccessor::GetUnit(*me, instance->GetData64(DATA_TANK_GUID))) + me->GetMotionMaster()->MoveChase(tank); + else if (Unit* newtarget = SelectTarget(SELECT_TARGET_NEAREST, 0)) + me->GetMotionMaster()->MoveChase(newtarget); + events.ScheduleEvent(EVENT_BELLOWING_ROAR, 5000); + events.ScheduleEvent(EVENT_FLAME_BREATH, urand(10000, 20000)); + events.ScheduleEvent(EVENT_TAIL_SWEEP, urand(15000, 20000)); + events.ScheduleEvent(EVENT_CLEAVE, urand(2000, 5000)); + events.ScheduleEvent(EVENT_WING_BUFFET, urand(15000, 30000)); break; case 10: me->SetCanFly(true); - me->GetMotionMaster()->MovePoint(11, Phase2Location.GetPositionX(), Phase2Location.GetPositionY(), Phase2Location.GetPositionZ()+25); + me->SetDisableGravity(true); + me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); + me->SetFacingTo(me->GetOrientation() + float(M_PI)); + if (Creature * trigger = me->SummonCreature(NPC_TRIGGER, MiddleRoomLocation, TEMPSUMMON_CORPSE_DESPAWN)) + instance->SetData64(DATA_TRIGGER_GUID, trigger->GetGUID()); + me->GetMotionMaster()->MoveTakeoff(11, Phase2Floating); me->SetSpeed(MOVE_FLIGHT, 1.0f); Talk(SAY_PHASE_2_TRANS); instance->SetData(DATA_ONYXIA_PHASE, Phase); events.ScheduleEvent(EVENT_WHELP_SPAWN, 5000); events.ScheduleEvent(EVENT_LAIR_GUARD, 15000); + events.ScheduleEvent(EVENT_DEEP_BREATH, 75000); + events.ScheduleEvent(EVENT_MOVEMENT, 10000); + events.ScheduleEvent(EVENT_FIREBALL, 18000); break; case 11: if (PointData) me->GetMotionMaster()->MovePoint(PointData->LocId, PointData->fX, PointData->fY, PointData->fZ); - me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->MoveIdle(); break; default: @@ -272,13 +285,13 @@ public: (Spell->Id >= 22267 && Spell->Id <= 22268)) && (target->GetTypeId() == TYPEID_PLAYER)) { - instance->SetData(DATA_SHE_DEEP_BREATH_MORE, FAIL); + instance->SetData(DATA_SHE_DEEP_BREATH_MORE, FAIL); } } OnyxMove* GetMoveData() { - uint8 MaxCount = sizeof(MoveData)/sizeof(OnyxMove); + uint8 MaxCount = sizeof(MoveData) / sizeof(OnyxMove); for (uint8 i = 0; i < MaxCount; ++i) { @@ -291,9 +304,9 @@ public: void SetNextRandomPoint() { - uint8 MaxCount = sizeof(MoveData)/sizeof(OnyxMove); + uint8 MaxCount = sizeof(MoveData) / sizeof(OnyxMove); - uint8 iTemp = urand(0, MaxCount-1); + uint8 iTemp = urand(0, MaxCount - 1); if (iTemp >= MovePoint) ++iTemp; @@ -312,15 +325,13 @@ public: //Specific to PHASE_START || PHASE_END if (Phase == PHASE_START) { - if (HealthBelowPct(60)) + if (HealthBelowPct(65)) { SetCombatMovement(false); Phase = PHASE_BREATH; - events.ScheduleEvent(EVENT_DEEP_BREATH, 85000); - events.ScheduleEvent(EVENT_MOVEMENT, 14000); - events.ScheduleEvent(EVENT_FIREBALL, 15000); - events.ScheduleEvent(EVENT_LAIR_GUARD, 60000); - events.ScheduleEvent(EVENT_WHELP_SPAWN, 60000); + instance->SetData64(DATA_TANK_GUID, me->GetVictim()->GetGUID()); + me->SetReactState(REACT_PASSIVE); + me->AttackStop(); me->GetMotionMaster()->MovePoint(10, Phase2Location); return; } @@ -347,19 +358,19 @@ public: } case EVENT_FLAME_BREATH: // Phase PHASE_START and PHASE_END DoCastVictim(SPELL_FLAME_BREATH); - events.ScheduleEvent(EVENT_FLAME_BREATH, urand (10000, 20000)); + events.ScheduleEvent(EVENT_FLAME_BREATH, urand(10000, 20000)); break; case EVENT_TAIL_SWEEP: // Phase PHASE_START and PHASE_END DoCastAOE(SPELL_TAIL_SWEEP); - events.ScheduleEvent(EVENT_TAIL_SWEEP, urand (15000, 20000)); + events.ScheduleEvent(EVENT_TAIL_SWEEP, urand(15000, 20000)); break; case EVENT_CLEAVE: // Phase PHASE_START and PHASE_END DoCastVictim(SPELL_CLEAVE); - events.ScheduleEvent(EVENT_CLEAVE, urand (2000, 5000)); + events.ScheduleEvent(EVENT_CLEAVE, urand(2000, 5000)); break; case EVENT_WING_BUFFET: // Phase PHASE_START and PHASE_END DoCastVictim(SPELL_WING_BUFFET); - events.ScheduleEvent(EVENT_WING_BUFFET, urand (15000, 30000)); + events.ScheduleEvent(EVENT_WING_BUFFET, urand(15000, 30000)); break; default: break; @@ -374,15 +385,18 @@ public: Phase = PHASE_END; instance->SetData(DATA_ONYXIA_PHASE, PHASE_END); Talk(SAY_PHASE_3_TRANS); - SetCombatMovement(true); - me->SetCanFly(false); IsMoving = false; - me->GetMotionMaster()->MovePoint(9, me->GetHomePosition()); + Position const pos = me->GetHomePosition(); + me->GetMotionMaster()->MovePoint(9, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ() + 12.0f); events.ScheduleEvent(EVENT_BELLOWING_ROAR, 30000); return; } + if (!me->isMoving()) + if (Creature* trigger = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_TRIGGER_GUID))) + me->SetFacingToObject(trigger); + events.Update(diff); while (uint32 eventId = events.ExecuteEvent()) @@ -398,8 +412,10 @@ public: Talk(EMOTE_BREATH); if (PointData) /// @todo: In what cases is this null? What should we do? DoCast(me, PointData->SpellId); - events.ScheduleEvent(EVENT_DEEP_BREATH, 70000); + events.ScheduleEvent(EVENT_DEEP_BREATH, 75000); } + else + events.ScheduleEvent(EVENT_DEEP_BREATH, 1000); break; case EVENT_MOVEMENT: // Phase PHASE_BREATH if (!IsMoving && !(me->HasUnitState(UNIT_STATE_CASTING))) @@ -414,18 +430,21 @@ public: IsMoving = true; events.ScheduleEvent(EVENT_MOVEMENT, 25000); } + else + events.ScheduleEvent(EVENT_MOVEMENT, 500); break; case EVENT_FIREBALL: // Phase PHASE_BREATH - if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE) + if (!IsMoving) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_FIREBALL); - events.ScheduleEvent(EVENT_FIREBALL, 8000); } + else + events.ScheduleEvent(EVENT_FIREBALL, 1000); break; case EVENT_LAIR_GUARD: // Phase PHASE_BREATH - me->SummonCreature(NPC_LAIRGUARD, SpawnLocations[2], TEMPSUMMON_CORPSE_DESPAWN); + me->SummonCreature(NPC_LAIRGUARD, SpawnLocations[2], TEMPSUMMON_CORPSE_DESPAWN); events.ScheduleEvent(EVENT_LAIR_GUARD, 30000); break; case EVENT_WHELP_SPAWN: // Phase PHASE_BREATH @@ -437,7 +456,7 @@ public: events.ScheduleEvent(EVENT_WHELP_SPAWN, 90000); } else - events.ScheduleEvent(EVENT_WHELP_SPAWN, 500); + events.ScheduleEvent(EVENT_WHELP_SPAWN, 500); break; default: break; @@ -447,7 +466,6 @@ public: } private: - SummonList Summons; OnyxMove* PointData; uint8 Phase; uint8 MovePoint; diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp index e6a08ade87f..36314366f12 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp @@ -53,6 +53,8 @@ public: SetBossNumber(EncounterCount); onyxiaGUID = 0; + triggerGUID = 0; + tankGUID = 0; onyxiaLiftoffTimer = 0; manyWhelpsCounter = 0; eruptTimer = 0; @@ -181,6 +183,12 @@ public: FloorEruptionGUIDQueue.push(data); eruptTimer = 2500; break; + case DATA_TRIGGER_GUID: + triggerGUID = data; + break; + case DATA_TANK_GUID: + tankGUID = data; + break; } } @@ -190,6 +198,13 @@ public: { case NPC_ONYXIA: return onyxiaGUID; + break; + case DATA_TRIGGER_GUID: + return triggerGUID; + break; + case DATA_TANK_GUID: + return tankGUID; + break; } return 0; @@ -298,6 +313,8 @@ public: std::map FloorEruptionGUID[2]; std::queue FloorEruptionGUIDQueue; uint64 onyxiaGUID; + uint64 triggerGUID; + uint64 tankGUID; uint32 onyxiaLiftoffTimer; uint32 manyWhelpsCounter; uint32 eruptTimer; diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h b/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h index cacbd8b2787..f98d1a83655 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h +++ b/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h @@ -35,7 +35,9 @@ enum Data32 enum Data64 { DATA_ONYXIA_GUID = 0, - DATA_FLOOR_ERUPTION_GUID = 1 + DATA_FLOOR_ERUPTION_GUID = 1, + DATA_TRIGGER_GUID = 2, + DATA_TANK_GUID = 3 }; enum OnyxiaPhases @@ -49,7 +51,8 @@ enum CreatureIds { NPC_WHELP = 11262, NPC_LAIRGUARD = 36561, - NPC_ONYXIA = 10184 + NPC_ONYXIA = 10184, + NPC_TRIGGER = 14495 }; enum GameObjectIds From 5efd2579e5666a5330dd1f58028f3c30695746a8 Mon Sep 17 00:00:00 2001 From: Odyssey Date: Fri, 5 Sep 2014 12:38:31 +0200 Subject: [PATCH 03/12] Scripts/Commands: Move cs_misc command output hardcoded strings to DB so they can be localized too --- .../2014_XX_XX_XX_world_trinity_string.sql | 11 ++++ src/server/game/Miscellaneous/Language.h | 16 ++++-- src/server/scripts/Commands/cs_ban.cpp | 4 +- src/server/scripts/Commands/cs_misc.cpp | 57 ++++++++++--------- 4 files changed, 53 insertions(+), 35 deletions(-) create mode 100644 sql/updates/world/2014_XX_XX_XX_world_trinity_string.sql diff --git a/sql/updates/world/2014_XX_XX_XX_world_trinity_string.sql b/sql/updates/world/2014_XX_XX_XX_world_trinity_string.sql new file mode 100644 index 00000000000..172a4bdc381 --- /dev/null +++ b/sql/updates/world/2014_XX_XX_XX_world_trinity_string.sql @@ -0,0 +1,11 @@ +-- Move cs_misc command output hardcoded strings to DB so they can be localized too +DELETE FROM `trinity_string` WHERE `entry` IN (5030,5035,5039,5040,5041,5042,5043,5044); +INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES +(5030, ''), +(5035, 'No reason'), +(5039, 'Console'), +(5040, 'Character'), +(5041, 'Permanently'), +(5042, 'You are outdoors'), +(5043, 'You are indoors'), +(5044, 'no VMAP available for area info'); diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 66cae69cb33..cb26e63f6fe 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -404,8 +404,8 @@ enum TrinityStrings LANG_BANINFO_HISTORYENTRY = 418, LANG_BANINFO_INFINITE = 419, LANG_BANINFO_NEVER = 420, - LANG_BANINFO_YES = 421, - LANG_BANINFO_NO = 422, + LANG_YES = 421, + LANG_NO = 422, LANG_BANINFO_IPENTRY = 423, LANG_BANLIST_NOIP = 424, @@ -1078,16 +1078,22 @@ enum TrinityStrings LANG_GOINFO_NAME = 5027, LANG_GOINFO_LOOTID = 5028, LANG_COMMAND_LOOKUP_MAX_RESULTS = 5029, - // unused = 5030, + LANG_UNAUTHORIZED = 5030, LANG_NPCINFO_AIINFO = 5031, LANG_COMMAND_NO_BATTLEGROUND_FOUND = 5032, LANG_COMMAND_NO_ACHIEVEMENT_CRITERIA_FOUND = 5033, LANG_COMMAND_NO_OUTDOOR_PVP_FORUND = 5034, - // unused = 5035, + LANG_NO_REASON = 5035, LANG_NPCINFO_EQUIPMENT = 5036, LANG_NPCINFO_MECHANIC_IMMUNE = 5037, LANG_NPCINFO_UNIT_FIELD_FLAGS = 5038, - // Room for more Trinity strings 5039-9999 + LANG_CONSOLE = 5039, + LANG_CHARACTER = 5040, + LANG_PERMANENTLY = 5041, + LANG_GPS_POSITION_OUTDOORS = 5042, + LANG_GPS_POSITION_INDOORS = 5043, + LANG_GPS_NO_VMAP = 5044, + // Room for more Trinity strings 5045-9999 // Level requirement notifications LANG_SAY_REQ = 6604, diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp index a90bbd69e24..6143a4ca344 100644 --- a/src/server/scripts/Commands/cs_ban.cpp +++ b/src/server/scripts/Commands/cs_ban.cpp @@ -287,7 +287,7 @@ public: bool permanent = (fields[1].GetUInt64() == uint64(0)); std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true); handler->PSendSysMessage(LANG_BANINFO_HISTORYENTRY, - fields[0].GetCString(), banTime.c_str(), active ? handler->GetTrinityString(LANG_BANINFO_YES) : handler->GetTrinityString(LANG_BANINFO_NO), fields[4].GetCString(), fields[5].GetCString()); + fields[0].GetCString(), banTime.c_str(), active ? handler->GetTrinityString(LANG_YES) : handler->GetTrinityString(LANG_NO), fields[4].GetCString(), fields[5].GetCString()); } while (result->NextRow()); @@ -340,7 +340,7 @@ public: bool permanent = (fields[1].GetUInt32() == uint32(0)); std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt32(), true); handler->PSendSysMessage(LANG_BANINFO_HISTORYENTRY, - fields[0].GetCString(), banTime.c_str(), active ? handler->GetTrinityString(LANG_BANINFO_YES) : handler->GetTrinityString(LANG_BANINFO_NO), fields[4].GetCString(), fields[5].GetCString()); + fields[0].GetCString(), banTime.c_str(), active ? handler->GetTrinityString(LANG_YES) : handler->GetTrinityString(LANG_NO), fields[4].GetCString(), fields[5].GetCString()); } while (result->NextRow()); diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 9cb7173556a..80b7710cd21 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -192,17 +192,17 @@ public: if (haveVMap) { if (map->IsOutdoors(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ())) - handler->PSendSysMessage("You are outdoors"); + handler->PSendSysMessage(LANG_GPS_POSITION_OUTDOORS); else - handler->PSendSysMessage("You are indoors"); + handler->PSendSysMessage(LANG_GPS_POSITION_INDOORS); } else - handler->PSendSysMessage("no VMAP available for area info"); + handler->PSendSysMessage(LANG_GPS_NO_VMAP); handler->PSendSysMessage(LANG_MAP_POSITION, - mapId, (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : ""), - zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : ""), - areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : ""), + mapId, (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : handler->GetTrinityString(LANG_UNKNOWN)), + zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : handler->GetTrinityString(LANG_UNKNOWN)), + areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : handler->GetTrinityString(LANG_UNKNOWN)), object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(), cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(), @@ -808,7 +808,7 @@ public: if (handler->HasLowerSecurity(target, 0)) return false; - std::string kickReasonStr = "No reason"; + std::string kickReasonStr = handler->GetTrinityString(LANG_NO_REASON); if (*args != '\0') { char const* kickReason = strtok(NULL, "\r"); @@ -1441,22 +1441,22 @@ public: std::string lastLogin = handler->GetTrinityString(LANG_ERROR); uint32 failedLogins = 0; uint32 latency = 0; - std::string OS = "None"; + std::string OS = handler->GetTrinityString(LANG_UNKNOWN); // Mute data print variables int64 muteTime = -1; - std::string muteReason = "unknown"; - std::string muteBy = "unknown"; + std::string muteReason = handler->GetTrinityString(LANG_NO_REASON); + std::string muteBy = handler->GetTrinityString(LANG_UNKNOWN); // Ban data print variables int64 banTime = -1; - std::string banType = "None"; - std::string banReason = "Unknown"; - std::string bannedBy = "Unknown"; + std::string banType = handler->GetTrinityString(LANG_UNKNOWN); + std::string banReason = handler->GetTrinityString(LANG_NO_REASON); + std::string bannedBy = handler->GetTrinityString(LANG_UNKNOWN); // Character data print variables uint8 raceid, classid = 0; //RACE_NONE, CLASS_NONE - std::string raceStr, classStr = "None"; + std::string raceStr, classStr = handler->GetTrinityString(LANG_UNKNOWN); uint8 gender = 0; int8 locale = handler->GetSessionDbcLocale(); uint32 totalPlayerTime = 0; @@ -1470,8 +1470,8 @@ public: uint32 mapId; uint32 areaId; uint32 phase = 0; - std::string areaName = ""; - std::string zoneName = ""; + std::string areaName = handler->GetTrinityString(LANG_UNKNOWN); + std::string zoneName = handler->GetTrinityString(LANG_UNKNOWN); // Guild data print variables defined so that they exist, but are not necessarily used uint32 guildId = 0; @@ -1499,7 +1499,7 @@ public: muteTime = target->GetSession()->m_muteTime; mapId = target->GetMapId(); areaId = target->GetAreaId(); - alive = target->IsAlive() ? "Yes" : "No"; + alive = target->IsAlive() ? handler->GetTrinityString(LANG_YES) : handler->GetTrinityString(LANG_NO); gender = target->getGender(); phase = target->GetPhaseMask(); } @@ -1532,9 +1532,9 @@ public: uint32 playerFlags = fields[10].GetUInt32(); if (!health || playerFlags & PLAYER_FLAGS_GHOST) - alive = "No"; + alive = handler->GetTrinityString(LANG_NO); else - alive = "Yes"; + alive = handler->GetTrinityString(LANG_YES); } // Query the prepared statement for login data @@ -1574,9 +1574,10 @@ public: } else { - eMail = "Unauthorized"; - lastIp = "Unauthorized"; - lastLogin = "Unauthorized"; + eMail = handler->GetTrinityString(LANG_UNAUTHORIZED); + regMail = handler->GetTrinityString(LANG_UNAUTHORIZED); + lastIp = handler->GetTrinityString(LANG_UNAUTHORIZED); + lastLogin = handler->GetTrinityString(LANG_UNAUTHORIZED); } muteTime = fields[6].GetUInt64(); muteReason = fields[7].GetString(); @@ -1595,7 +1596,7 @@ public: PreparedQueryResult result2 = LoginDatabase.Query(stmt2); if (!result2) { - banType = "Character"; + banType = handler->GetTrinityString(LANG_CHARACTER); stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_BANS); stmt->setUInt32(0, lowguid); result2 = CharacterDatabase.Query(stmt); @@ -1652,7 +1653,7 @@ public: // Output III. LANG_PINFO_BANNED if ban exists and is applied if (banTime >= 0) - handler->PSendSysMessage(LANG_PINFO_BANNED, banType.c_str(), banReason.c_str(), banTime > 0 ? secsToTimeString(banTime - time(NULL), true).c_str() : "permanently", bannedBy.c_str()); + handler->PSendSysMessage(LANG_PINFO_BANNED, banType.c_str(), banReason.c_str(), banTime > 0 ? secsToTimeString(banTime - time(NULL), true).c_str() : handler->GetTrinityString(LANG_PERMANENTLY), bannedBy.c_str()); // Output IV. LANG_PINFO_MUTED if mute is applied if (muteTime > 0) @@ -1671,7 +1672,7 @@ public: handler->PSendSysMessage(LANG_PINFO_ACC_REGMAILS, regMail.c_str(), eMail.c_str()); // Output IX. LANG_PINFO_ACC_IP - handler->PSendSysMessage(LANG_PINFO_ACC_IP, lastIp.c_str(), locked ? "Yes" : "No"); + handler->PSendSysMessage(LANG_PINFO_ACC_IP, lastIp.c_str(), locked ? handler->GetTrinityString(LANG_YES) : handler->GetTrinityString(LANG_NO)); // Output X. LANG_PINFO_CHR_LEVEL if (level != sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) @@ -1710,7 +1711,7 @@ public: } if (target) - handler->PSendSysMessage(LANG_PINFO_CHR_MAP, map->name[locale], (!zoneName.empty() ? zoneName.c_str() : ""), (!areaName.empty() ? areaName.c_str() : "")); + handler->PSendSysMessage(LANG_PINFO_CHR_MAP, map->name[locale], (!zoneName.empty() ? zoneName.c_str() : handler->GetTrinityString(LANG_UNKNOWN)), (!areaName.empty() ? areaName.c_str() : handler->GetTrinityString(LANG_UNKNOWN))); // Output XVII. - XVIX. if they are not empty if (!guildName.empty()) @@ -1790,7 +1791,7 @@ public: return false; char const* muteReason = strtok(NULL, "\r"); - std::string muteReasonStr = "No reason"; + std::string muteReasonStr = handler->GetTrinityString(LANG_NO_REASON); if (muteReason != NULL) muteReasonStr = muteReason; @@ -1818,7 +1819,7 @@ public: if (handler->GetSession()) muteBy = handler->GetSession()->GetPlayerName(); else - muteBy = "Console"; + muteBy = handler->GetTrinityString(LANG_CONSOLE); if (target) { From 245be07d2c8eb4fb1902378fbeacf0fae7245508 Mon Sep 17 00:00:00 2001 From: Dr-J Date: Fri, 5 Sep 2014 18:24:20 +0100 Subject: [PATCH 04/12] DB/SAI: To Rule the Skies Proper script for Obsidia / Obsidia's Egg for quest http://www.wowhead.com/quest=11078/to-rule-the-skies Now reagents are taken and Obsidia spawned using correct spells Ie http://www.wowhead.com/spell=41035 (Four Dragons: Force Cast - Obsidia) which is cast on player as invoker cast when gossip option selected which triggers http://www.wowhead.com/spell=41036 (Four Dragons: Reagents - Obsidia) which requires 35 apexis shards as reagents this deducting these and then triggers http://www.wowhead.com/spell=40682 (http://www.wowhead.com/spell=40682) which triggers event to spawn Previous script was not using spells and was using sai to deduct shards and spawn obsidia. --- sql/updates/world/2014_09_05_02_world_sai.sql | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 sql/updates/world/2014_09_05_02_world_sai.sql diff --git a/sql/updates/world/2014_09_05_02_world_sai.sql b/sql/updates/world/2014_09_05_02_world_sai.sql new file mode 100644 index 00000000000..1c6b1f02213 --- /dev/null +++ b/sql/updates/world/2014_09_05_02_world_sai.sql @@ -0,0 +1,50 @@ +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=23282; + + +DELETE FROM `smart_scripts` WHERE `entryorguid`=185932 AND `source_type`=1; + +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 +(185932, 1, 0, 1, 62, 0, 100, 0, 8685, 0, 0, 0, 85, 41035, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Obsidia\'s Egg - On Gossip Option 0 Selected - Invoker Cast 41035 Four Dragons: Force Cast - Obsidia'), +(185932, 1, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Obsidia\'s Egg - On Gossip Option 0 Selected - Close Gossip'); + +DELETE FROM `event_scripts` WHERE `id`=15005; +INSERT INTO `event_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`) VALUES +(15005, 1, 10, 23364, 100000, 0, 2426.954, 7001.479, 367.3824, 0), +(15005, 0, 10, 23282, 300000, 0, 2424.975, 6933.425, 409.5501, 1.43117); + + +UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry` =23364; +DELETE FROM `smart_scripts` WHERE `entryorguid` =23364 AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` =23282 AND `source_type`=0 AND `id`>4; + +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 +(23364, 0, 0, 1, 11, 0, 100, 0, 0, 0, 0, 0, 11, 15750, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Black Dragon Whelpling - On Spawn - Cast Rookery Whelp Spawn-in Spell'), +(23364, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Black Dragon Whelpling - On Spawn - Say'), +(23364, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 18, 33536, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Black Dragon Whelpling - On Spawn - Set Unit Flags'), +(23364, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 70, 300, 0, 0, 0, 0, 0, 14, 27915, 185932, 0, 0, 0, 0, 0, 'Black Dragon Whelpling - On Spawn - Despawn Obsidia\'s Egg'), +(23364, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 23364, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Black Dragon Whelpling - On Spawn - Start WP'), +(23364, 0, 5, 6, 40, 0, 100, 0, 2, 23364, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 23282, 0, 0, 0, 0, 0, 0, 'Black Dragon Whelpling - On Reached WP2 - Set Data on Obsidia'), +(23364, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Black Dragon Whelpling - Reached WP2 - Despawn'), +(23282, 0, 5, 0, 11, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - On Spawn - Set Unit Flags'), +(23282, 0, 6, 7, 38, 0, 100, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - On Data Set - Say'), +(23282, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 1, 23282, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - On Data Set - Start WP'), +(23282, 0, 8, 9, 40, 0, 100, 0, 1, 23282, 0, 0, 94, 280, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - On Reached WP1 - Set Dynamic Flags'), +(23282, 0, 9, 10, 61, 0, 100, 0, 0, 0, 0, 0, 19, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - On Reached WP1 - Set Unit Flags'), +(23282, 0, 10, 11, 61, 0, 100, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - On Reached WP1 - Set Home Position'), +(23282, 0, 11, 0, 61, 0, 100, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - On Reached WP1 - Set Aggresive'); + +DELETE FROM `creature_text` WHERE `entry` IN(23364,23282); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES +(23364, 0, 0, 'The %s screams out for its mother.', 16, 0, 100, 0, 0, 431, 'Black Dragon Whelpling',21420), +(23282, 0, 0, 'I believe that I shall feast upon both $r and ogre flesh tonight.', 14, 0, 100, 0, 0, 7274, 'Obsidia',21718); + + +DELETE FROM `waypoints` WHERE `entry` IN(23364,23282); + +INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES +(23364, 1,2425.253, 6994.862, 368.0848, 'Black Dragon Whelpling'), +(23364, 2,2424.881, 6998.754, 367.8495, 'Black Dragon Whelpling'), +(23282, 1,2428.085, 6980.77, 369.7684, 'Obsidia'); + + + From 8b9726514f2b34bbbd102987310fd69e7d2a8282 Mon Sep 17 00:00:00 2001 From: Nyeriah Date: Fri, 5 Sep 2014 14:41:13 -0300 Subject: [PATCH 05/12] Scripts/Auchindoun: Updates Pandemonius to EventMaps/BossAI --- .../Auchindoun/ManaTombs/boss_pandemonius.cpp | 101 +++++++++--------- 1 file changed, 53 insertions(+), 48 deletions(-) diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp index b74c800c01b..1b903fad188 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp @@ -25,18 +25,26 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "mana_tombs.h" -enum Pandemonius +enum Texts { SAY_AGGRO = 0, SAY_KILL = 1, SAY_DEATH = 2, - EMOTE_DARK_SHELL = 3, + EMOTE_DARK_SHELL = 3 +}; - SPELL_VOID_BLAST = 32325, - H_SPELL_VOID_BLAST = 38760, - SPELL_DARK_SHELL = 32358, - H_SPELL_DARK_SHELL = 38759 +enum Spells +{ + SPELL_VOID_BLAST = 32325, + SPELL_DARK_SHELL = 32358 +}; + +enum Events +{ + EVENT_VOID_BLAST = 1, + EVENT_DARK_SHELL }; @@ -45,26 +53,17 @@ class boss_pandemonius : public CreatureScript public: boss_pandemonius() : CreatureScript("boss_pandemonius") { } - CreatureAI* GetAI(Creature* creature) const override + struct boss_pandemoniusAI : public BossAI { - return new boss_pandemoniusAI(creature); - } - - struct boss_pandemoniusAI : public ScriptedAI - { - boss_pandemoniusAI(Creature* creature) : ScriptedAI(creature) + boss_pandemoniusAI(Creature* creature) : BossAI(creature, DATA_PANDEMONIUS) { + VoidBlastCounter = 0; } - uint32 VoidBlast_Timer; - uint32 DarkShell_Timer; - uint32 VoidBlast_Counter; - void Reset() override { - VoidBlast_Timer = 8000 + rand32() % 15000; - DarkShell_Timer = 20000; - VoidBlast_Counter = 0; + _Reset(); + VoidBlastCounter = 0; } void JustDied(Unit* /*killer*/) override @@ -79,48 +78,54 @@ public: void EnterCombat(Unit* /*who*/) override { + _EnterCombat(); Talk(SAY_AGGRO); + events.ScheduleEvent(EVENT_DARK_SHELL, 20000); + events.ScheduleEvent(EVENT_VOID_BLAST, urand(8000, 23000)); } - void UpdateAI(uint32 diff) override + void ExecuteEvent(uint32 eventId) override { - if (!UpdateVictim()) - return; - - if (VoidBlast_Timer <= diff) + switch (eventId) { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_VOID_BLAST); - VoidBlast_Timer = 500; - ++VoidBlast_Counter; - } + case EVENT_VOID_BLAST: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target, SPELL_VOID_BLAST); + ++VoidBlastCounter; + } - if (VoidBlast_Counter == 5) - { - VoidBlast_Timer = 15000 + rand32() % 10000; - VoidBlast_Counter = 0; - } - } else VoidBlast_Timer -= diff; - - if (!VoidBlast_Counter) - { - if (DarkShell_Timer <= diff) - { + if (VoidBlastCounter == 5) + { + VoidBlastCounter = 0; + events.ScheduleEvent(EVENT_VOID_BLAST, urand(15000, 25000)); + } + else + { + events.ScheduleEvent(EVENT_VOID_BLAST, 500); + events.DelayEvents(EVENT_DARK_SHELL, 500); + } + break; + case EVENT_DARK_SHELL: if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(true); - Talk(EMOTE_DARK_SHELL); - DoCast(me, SPELL_DARK_SHELL); - DarkShell_Timer = 20000; - } else DarkShell_Timer -= diff; + events.ScheduleEvent(EVENT_DARK_SHELL, 20000); + break; + default: + break; } - - DoMeleeAttackIfReady(); } + + private: + uint32 VoidBlastCounter; }; + CreatureAI* GetAI(Creature* creature) const override + { + return GetManaTombsAI(creature); + } }; void AddSC_boss_pandemonius() From 31c00b0ce40b96e486bb47d1c66e627e0f49bd25 Mon Sep 17 00:00:00 2001 From: MrSmite Date: Sun, 2 Mar 2014 18:09:02 -0500 Subject: [PATCH 06/12] Allow players to track both herbs and minerals at the same time Note: The following are client limitations and cannot be coded for: * The minimap tracking icon will display whichever skill is activated second * The minimap tracking list will only show a check mark next to the last skill activated (sometimes this bugs out and doesn't switch the check mark. It has no effect on the actual tracking though). * The minimap dots are yellow for both resources --- src/server/game/Handlers/SpellHandler.cpp | 20 ++++++++++++++++++++ src/server/game/Spells/Auras/SpellAuras.cpp | 10 ++++++++++ src/server/game/World/World.cpp | 1 + src/server/game/World/World.h | 1 + src/server/worldserver/worldserver.conf.dist | 14 ++++++++++++++ 5 files changed, 46 insertions(+) diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 13f79fb88c5..9cce494a522 100644 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -33,6 +33,7 @@ #include "GameObjectAI.h" #include "SpellAuraEffects.h" #include "Player.h" +#include "Config.h" void WorldSession::HandleClientCastFlags(WorldPacket& recvPacket, uint8 castFlags, SpellCastTargets& targets) { @@ -436,6 +437,25 @@ void WorldSession::HandleCancelAuraOpcode(WorldPacket& recvPacket) // maybe should only remove one buff when there are multiple? _player->RemoveOwnedAura(spellId, 0, 0, AURA_REMOVE_BY_CANCEL); + + // If spell being removed is a resource tracker, see if player was tracking both (herbs / minerals) and remove the other + if (sWorld->getBoolConfig(CONFIG_ALLOW_TRACK_BOTH_RESOURCES) && spellInfo->HasAura(SPELL_AURA_TRACK_RESOURCES)) + { + Unit::AuraEffectList const& auraEffects = _player->GetAuraEffectsByType(SPELL_AURA_TRACK_RESOURCES); + if (!auraEffects.empty()) + { + // Build list of spell IDs to cancel. Trying to cancel the aura while iterating + // over AuraEffectList caused "incompatible iterator" errors on second pass + std::list spellIDs; + + for (Unit::AuraEffectList::const_iterator auraEffect = auraEffects.begin(); auraEffect != auraEffects.end(); auraEffect++) + spellIDs.push_back((*auraEffect)->GetId()); + + // Remove all auras related to resource tracking (only Herbs and Minerals in 3.3.5a) + for (std::list::iterator it = spellIDs.begin(); it != spellIDs.end(); it++) + _player->RemoveOwnedAura(*it, 0, 0, AURA_REMOVE_BY_CANCEL); + } + } } void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket) diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 07cfa80f297..5bc2c41b6ce 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -35,6 +35,7 @@ #include "ScriptMgr.h" #include "SpellScript.h" #include "Vehicle.h" +#include "Config.h" AuraApplication::AuraApplication(Unit* target, Unit* caster, Aura* aura, uint8 effMask): _target(target), _base(aura), _removeMode(AURA_REMOVE_NONE), _slot(MAX_AURAS), @@ -1785,6 +1786,15 @@ bool Aura::CanStackWith(Aura const* existingAura) const return true; } + // Check for custom server setting to allow tracking both Herbs and Minerals + // Note: The following are client limitations and cannot be coded for: + // * The minimap tracking icon will display whichever skill is activated second + // * The minimap tracking list will only show a check mark next to the last skill activated + // Sometimes this bugs out and doesn't switch the check mark. It has no effect on the actual tracking though. + // * The minimap dots are yellow for both resources + if (m_spellInfo->HasAura(SPELL_AURA_TRACK_RESOURCES) && existingSpellInfo->HasAura(SPELL_AURA_TRACK_RESOURCES)) + return sWorld->getBoolConfig(CONFIG_ALLOW_TRACK_BOTH_RESOURCES); + // check spell specific stack rules if (m_spellInfo->IsAuraExclusiveBySpecificWith(existingSpellInfo) || (sameCaster && m_spellInfo->IsAuraExclusiveBySpecificPerCasterWith(existingSpellInfo))) diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index f9c8c800ca5..750ed5a380e 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1169,6 +1169,7 @@ void World::LoadConfigSettings(bool reload) if (m_int_configs[CONFIG_PVP_TOKEN_COUNT] < 1) m_int_configs[CONFIG_PVP_TOKEN_COUNT] = 1; + m_bool_configs[CONFIG_ALLOW_TRACK_BOTH_RESOURCES] = sConfigMgr->GetBoolDefault("AllowTrackBothResources", false); m_bool_configs[CONFIG_NO_RESET_TALENT_COST] = sConfigMgr->GetBoolDefault("NoResetTalentsCost", false); m_bool_configs[CONFIG_SHOW_KICK_IN_WORLD] = sConfigMgr->GetBoolDefault("ShowKickInWorld", false); m_bool_configs[CONFIG_SHOW_MUTE_IN_WORLD] = sConfigMgr->GetBoolDefault("ShowMuteInWorld", false); diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index b77f8777bdc..d169fa587fe 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -156,6 +156,7 @@ enum WorldBoolConfigs CONFIG_STATS_LIMITS_ENABLE, CONFIG_INSTANCES_RESET_ANNOUNCE, CONFIG_IP_BASED_ACTION_LOGGING, + CONFIG_ALLOW_TRACK_BOTH_RESOURCES, BOOL_CONFIG_VALUE_COUNT }; diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 9a78d74bb45..ca53e91737b 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -2431,6 +2431,20 @@ CharDelete.KeepDays = 30 ################################################################################################### # CUSTOM SERVER OPTIONS +# +# AllowTrackBothResources +# Description: Allows players to track herbs and minerals at the same time (if they have the skills) +# Default: 0 (do not allow) +# 1 (allow) +# +# Note: The following are client limitations and cannot be coded for: +# * The minimap tracking icon will display whichever skill is activated second +# * The minimap tracking list will only show a check mark next to the last skill activated (sometimes this +# bugs out and doesn't switch the check mark. It has no effect on the actual tracking though). +# * The minimap dots are yellow for both resources + +AllowTrackBothResources = 0 + # # PlayerStart.AllReputation # Description: Players will start with most of the high level reputations that are needed From b3c9d44d36836a1f956f08f535d2db0b083058c3 Mon Sep 17 00:00:00 2001 From: Dr-J Date: Fri, 5 Sep 2014 20:21:32 +0100 Subject: [PATCH 07/12] DB/SAI: Also fix the other of the four dragons Already fixed Obsidia from sniff I dont have sniffs of the other 3 but can still make these so the summon and payment occurs in properway. As with Obsidia all dragons are spawned by event script which is triggered from spell, egg despawns to prevent multiple spawns (even though this would be rather stupid as costs 35 shards to call each dragon. --- sql/updates/world/2014_09_05_03_world_sai.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 sql/updates/world/2014_09_05_03_world_sai.sql diff --git a/sql/updates/world/2014_09_05_03_world_sai.sql b/sql/updates/world/2014_09_05_03_world_sai.sql new file mode 100644 index 00000000000..37deab39085 --- /dev/null +++ b/sql/updates/world/2014_09_05_03_world_sai.sql @@ -0,0 +1,17 @@ +DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid` IN (185937,185938,185936); +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 +(185937, 1, 0, 1, 62, 0, 100, 0, 8690, 0, 0, 0, 85, 41050, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Furywing\'s Egg - On Gossip Option 0 Selected - Invoker cast Four Dragons: Force Cast - Furywing'), +(185938, 1, 0, 1, 62, 0, 100, 0, 8691, 0, 0, 0, 85, 41052, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Insidion\'s Egg - On Gossip Option 0 Selected - Invoker cast Four Dragons: Force Cast - Insidion'), +(185936, 1, 0, 1, 62, 0, 100, 0, 8689, 0, 0, 0, 85, 41044, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Rivendark\'s Egg - On Gossip Option 0 Selected - Invoker cast Four Dragons: Force Cast - Rivendark'), +(185937, 1, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Furywing\'s Egg - On Gossip Option 0 Selected - Close Gossip'), +(185938, 1, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Insidion\'s Egg - On Gossip Option 0 Selected - Close Gossip'), +(185936, 1, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Rivendark\'s Egg - On Gossip Option 0 Selected - Close Gossip'), +(185937, 1, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Furywing\'s Egg - On Gossip Option 0 Selected - Despawn GO'), +(185938, 1, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Insidion\'s Egg - On Gossip Option 0 Selected - Despawn GO'), +(185936, 1, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rivendark\'s Egg - On Gossip Option 0 Selected - Despawn GO'); + +DELETE FROM `event_scripts` WHERE `id` IN(15004,15002); +INSERT INTO `event_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`) VALUES +(15004, 0, 10, 23061, 300000, 0, 2060.6, 7418.53, 391.098, 0), +(15002, 0, 10, 23281, 300000, 0, 4176.5, 5452.21, 291.923, 0), +(15003, 0, 10, 23261, 300000, 0, 3845.31, 5220.04, 295.412, 0); From 6df2ff5efa0a84c5423804d713acd0e8952db86e Mon Sep 17 00:00:00 2001 From: jackpoz Date: Thu, 4 Sep 2014 23:05:03 +0200 Subject: [PATCH 08/12] Core/Misc: Refactor scripts to fix static analysis warnings Third batch of fixes targeting 100 issues reported by Coverity --- .../zone_western_plaguelands.cpp | 28 +++--- .../scripts/EasternKingdoms/zone_wetlands.cpp | 12 ++- src/server/scripts/Events/childrens_week.cpp | 82 ++++++++++++++--- .../BlackfathomDeeps/blackfathom_deeps.cpp | 16 +++- .../BlackfathomDeeps/boss_aku_mai.cpp | 12 ++- .../BlackfathomDeeps/boss_gelihast.cpp | 8 +- .../Kalimdor/BlackfathomDeeps/boss_kelris.cpp | 10 +- .../BattleForMountHyjal/boss_anetheron.cpp | 16 +++- .../BattleForMountHyjal/boss_archimonde.cpp | 72 +++++++++------ .../BattleForMountHyjal/boss_azgalor.cpp | 20 ++-- .../BattleForMountHyjal/boss_kazrogal.cpp | 16 +++- .../boss_rage_winterchill.cpp | 16 +++- .../BattleForMountHyjal/hyjalAI.cpp | 65 +++++++------ .../BattleForMountHyjal/hyjalAI.h | 2 + .../BattleForMountHyjal/hyjal_trash.cpp | 19 +++- .../boss_chrono_lord_epoch.cpp | 18 ++-- .../CullingOfStratholme/boss_mal_ganis.cpp | 25 +++-- .../CullingOfStratholme/boss_meathook.cpp | 12 ++- .../boss_salramm_the_fleshcrafter.cpp | 18 ++-- .../culling_of_stratholme.cpp | 67 ++++++++------ .../boss_captain_skarloc.cpp | 18 ++-- .../boss_epoch_hunter.cpp | 14 ++- .../boss_leutenant_drake.cpp | 24 +++-- .../EscapeFromDurnholdeKeep/old_hillsbrad.cpp | 8 +- .../TheBlackMorass/the_black_morass.cpp | 31 +++++-- .../Maraudon/boss_celebras_the_cursed.cpp | 16 +++- .../Kalimdor/Maraudon/boss_landslide.cpp | 16 +++- .../Kalimdor/Maraudon/boss_noxxion.cpp | 20 ++-- .../Maraudon/boss_princess_theradras.cpp | 18 +++- .../boss_amnennar_the_coldbringer.cpp | 16 +++- .../Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp | 10 +- .../Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp | 1 + .../RuinsOfAhnQiraj/boss_kurinnaxx.cpp | 8 +- .../Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp | 8 +- .../RuinsOfAhnQiraj/boss_ossirian.cpp | 12 ++- .../Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp | 8 +- .../TempleOfAhnQiraj/boss_bug_trio.cpp | 50 ++++++---- .../Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp | 74 ++++++++------- .../TempleOfAhnQiraj/boss_fankriss.cpp | 24 +++-- .../TempleOfAhnQiraj/boss_huhuran.cpp | 28 ++++-- .../Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp | 28 ++++-- .../TempleOfAhnQiraj/boss_sartura.cpp | 61 +++++++----- .../Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp | 12 ++- .../TempleOfAhnQiraj/boss_twinemperors.cpp | 66 ++++++++----- .../TempleOfAhnQiraj/boss_viscidus.cpp | 14 ++- .../mob_anubisath_sentinel.cpp | 18 ++-- .../Kalimdor/ZulFarrak/boss_zum_rah.cpp | 16 +++- .../scripts/Kalimdor/ZulFarrak/zulfarrak.cpp | 12 ++- src/server/scripts/Kalimdor/boss_azuregos.cpp | 5 +- .../scripts/Kalimdor/zone_ashenvale.cpp | 28 ++++-- src/server/scripts/Kalimdor/zone_azshara.cpp | 40 ++++++-- .../scripts/Kalimdor/zone_azuremyst_isle.cpp | 92 +++++++++++++------ .../scripts/Kalimdor/zone_darkshore.cpp | 12 ++- src/server/scripts/Kalimdor/zone_durotar.cpp | 25 ++++- .../scripts/Kalimdor/zone_moonglade.cpp | 20 ++-- src/server/scripts/Kalimdor/zone_mulgore.cpp | 36 ++++++-- .../scripts/Kalimdor/zone_orgrimmar.cpp | 34 +++++-- src/server/scripts/Kalimdor/zone_silithus.cpp | 80 ++++++++++------ src/server/scripts/Kalimdor/zone_tanaris.cpp | 43 ++++++--- .../scripts/Kalimdor/zone_the_barrens.cpp | 46 ++++++---- .../Kalimdor/zone_thousand_needles.cpp | 13 ++- .../scripts/Kalimdor/zone_thunder_bluff.cpp | 20 ++-- .../scripts/Kalimdor/zone_ungoro_crater.cpp | 30 ++++-- .../scripts/Kalimdor/zone_winterspring.cpp | 14 ++- .../AzjolNerub/Ahnkahet/boss_elder_nadox.cpp | 14 ++- .../Ahnkahet/boss_herald_volazj.cpp | 16 +++- .../Ahnkahet/boss_jedoga_shadowseeker.cpp | 38 +++++--- .../AzjolNerub/AzjolNerub/boss_anubarak.cpp | 33 +++++-- .../AzjolNerub/AzjolNerub/boss_hadronox.cpp | 18 ++-- .../ObsidianSanctum/boss_sartharion.cpp | 18 +++- 70 files changed, 1278 insertions(+), 562 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp index dbcf5998bdb..d242d17806c 100644 --- a/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp @@ -319,19 +319,24 @@ public: struct npc_anchorite_truuenAI : public npc_escortAI { - npc_anchorite_truuenAI(Creature* creature) : npc_escortAI(creature) { } + npc_anchorite_truuenAI(Creature* creature) : npc_escortAI(creature) + { + Initialize(); + UghostGUID = 0; + } + + void Initialize() + { + m_uiChatTimer = 7000; + } uint32 m_uiChatTimer; uint64 UghostGUID; - uint64 TheldanisGUID; - - Creature* Ughost; - Creature* Theldanis; void Reset() override { - m_uiChatTimer = 7000; + Initialize(); } void JustSummoned(Creature* summoned) override @@ -364,26 +369,25 @@ public: Talk(SAY_WP_2); break; case 21: - Theldanis = GetClosestCreatureWithEntry(me, NPC_THEL_DANIS, 150); - if (Theldanis) + if (Creature* Theldanis = GetClosestCreatureWithEntry(me, NPC_THEL_DANIS, 150)) Theldanis->AI()->Talk(SAY_WP_3); break; case 23: - Ughost = me->SummonCreature(NPC_GHOST_UTHER, 971.86f, -1825.42f, 81.99f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - if (Ughost) + if (Creature* Ughost = me->SummonCreature(NPC_GHOST_UTHER, 971.86f, -1825.42f, 81.99f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) { + UghostGUID = Ughost->GetGUID(); Ughost->SetDisableGravity(true); Ughost->AI()->Talk(SAY_WP_4, me); } m_uiChatTimer = 4000; break; case 24: - if (Ughost) + if (Creature* Ughost = ObjectAccessor::GetCreature(*me, UghostGUID)) Ughost->AI()->Talk(SAY_WP_5, me); m_uiChatTimer = 4000; break; case 25: - if (Ughost) + if (Creature* Ughost = ObjectAccessor::GetCreature(*me, UghostGUID)) Ughost->AI()->Talk(SAY_WP_6, me); m_uiChatTimer = 4000; break; diff --git a/src/server/scripts/EasternKingdoms/zone_wetlands.cpp b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp index e6c844b1b1e..94cea417b04 100644 --- a/src/server/scripts/EasternKingdoms/zone_wetlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp @@ -59,14 +59,22 @@ public: struct npc_tapoke_slim_jahnAI : public npc_escortAI { - npc_tapoke_slim_jahnAI(Creature* creature) : npc_escortAI(creature) { } + npc_tapoke_slim_jahnAI(Creature* creature) : npc_escortAI(creature) + { + Initialize(); + } + + void Initialize() + { + IsFriendSummoned = false; + } bool IsFriendSummoned; void Reset() override { if (!HasEscortState(STATE_ESCORT_ESCORTING)) - IsFriendSummoned = false; + Initialize(); } void WaypointReached(uint32 waypointId) override diff --git a/src/server/scripts/Events/childrens_week.cpp b/src/server/scripts/Events/childrens_week.cpp index 683b8d36011..6a338c2f03a 100644 --- a/src/server/scripts/Events/childrens_week.cpp +++ b/src/server/scripts/Events/childrens_week.cpp @@ -150,9 +150,12 @@ class npc_winterfin_playmate : public CreatureScript struct npc_winterfin_playmateAI : public ScriptedAI { - npc_winterfin_playmateAI(Creature* creature) : ScriptedAI(creature) { } + npc_winterfin_playmateAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } - void Reset() + void Initialize() { timer = 0; phase = 0; @@ -160,6 +163,11 @@ class npc_winterfin_playmate : public CreatureScript orphanGUID = 0; } + void Reset() + { + Initialize(); + } + void MoveInLineOfSight(Unit* who) override { @@ -249,9 +257,12 @@ class npc_snowfall_glade_playmate : public CreatureScript struct npc_snowfall_glade_playmateAI : public ScriptedAI { - npc_snowfall_glade_playmateAI(Creature* creature) : ScriptedAI(creature) { } + npc_snowfall_glade_playmateAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } - void Reset() + void Initialize() { timer = 0; phase = 0; @@ -259,6 +270,11 @@ class npc_snowfall_glade_playmate : public CreatureScript orphanGUID = 0; } + void Reset() + { + Initialize(); + } + void MoveInLineOfSight(Unit* who) override { @@ -349,10 +365,11 @@ class npc_the_biggest_tree : public CreatureScript { npc_the_biggest_treeAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); me->SetDisplayId(DISPLAY_INVISIBLE); } - void Reset() + void Initialize() { timer = 1000; phase = 0; @@ -360,8 +377,12 @@ class npc_the_biggest_tree : public CreatureScript orphanGUID = 0; } - void MoveInLineOfSight(Unit* who) override + void Reset() + { + Initialize(); + } + void MoveInLineOfSight(Unit* who) override { if (!phase && who && who->GetDistance2d(me) < 10.0f) if (Player* player = who->ToPlayer()) @@ -437,9 +458,12 @@ class npc_high_oracle_soo_roo : public CreatureScript struct npc_high_oracle_soo_rooAI : public ScriptedAI { - npc_high_oracle_soo_rooAI(Creature* creature) : ScriptedAI(creature) { } + npc_high_oracle_soo_rooAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } - void Reset() + void Initialize() { timer = 0; phase = 0; @@ -447,6 +471,11 @@ class npc_high_oracle_soo_roo : public CreatureScript orphanGUID = 0; } + void Reset() + { + Initialize(); + } + void MoveInLineOfSight(Unit* who) override { @@ -526,9 +555,12 @@ class npc_elder_kekek : public CreatureScript struct npc_elder_kekekAI : public ScriptedAI { - npc_elder_kekekAI(Creature* creature) : ScriptedAI(creature) { } + npc_elder_kekekAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } - void Reset() + void Initialize() { timer = 0; phase = 0; @@ -536,6 +568,11 @@ class npc_elder_kekek : public CreatureScript orphanGUID = 0; } + void Reset() + { + Initialize(); + } + void MoveInLineOfSight(Unit* who) override { @@ -615,9 +652,12 @@ class npc_the_etymidian : public CreatureScript struct npc_the_etymidianAI : public ScriptedAI { - npc_the_etymidianAI(Creature* creature) : ScriptedAI(creature) { } + npc_the_etymidianAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } - void Reset() + void Initialize() { timer = 0; phase = 0; @@ -625,8 +665,12 @@ class npc_the_etymidian : public CreatureScript orphanGUID = 0; } - void MoveInLineOfSight(Unit* who) override + void Reset() + { + Initialize(); + } + void MoveInLineOfSight(Unit* who) override { if (!phase && who && who->GetDistance2d(me) < 10.0f) if (Player* player = who->ToPlayer()) @@ -711,9 +755,12 @@ class npc_alexstraza_the_lifebinder : public CreatureScript struct npc_alexstraza_the_lifebinderAI : public ScriptedAI { - npc_alexstraza_the_lifebinderAI(Creature* creature) : ScriptedAI(creature) { } + npc_alexstraza_the_lifebinderAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } - void Reset() + void Initialize() { timer = 0; phase = 0; @@ -721,6 +768,11 @@ class npc_alexstraza_the_lifebinder : public CreatureScript orphanGUID = 0; } + void Reset() + { + Initialize(); + } + void SetData(uint32 type, uint32 data) override { // Existing SmartAI diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp index e7beb4cf454..f8ba2ab6646 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp @@ -80,6 +80,7 @@ public: { npc_blackfathom_deeps_eventAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); if (creature->IsSummon()) { creature->SetHomePosition(HomePosition); @@ -89,6 +90,15 @@ public: instance = creature->GetInstanceScript(); } + void Initialize() + { + Flee = false; + + ravageTimer = urand(5000, 8000); + frostNovaTimer = urand(9000, 12000); + frostBoltVolleyTimer = urand(2000, 4000); + } + InstanceScript* instance; uint32 ravageTimer; @@ -99,11 +109,7 @@ public: void Reset() override { - Flee = false; - - ravageTimer = urand(5000, 8000); - frostNovaTimer = urand(9000, 12000); - frostBoltVolleyTimer = urand(2000, 4000); + Initialize(); } void AttackPlayer() diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp index f6c34c6b555..b510a84b949 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp @@ -38,11 +38,19 @@ public: struct boss_aku_maiAI : public BossAI { - boss_aku_maiAI(Creature* creature) : BossAI(creature, TYPE_AKU_MAI) { } + boss_aku_maiAI(Creature* creature) : BossAI(creature, TYPE_AKU_MAI) + { + Initialize(); + } + + void Initialize() + { + IsEnraged = false; + } void Reset() override { - IsEnraged = false; + Initialize(); _Reset(); } diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp index 9e25de817fa..0eba1a14fa5 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp @@ -38,16 +38,22 @@ public: { boss_gelihastAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + netTimer = urand(2000, 4000); + } + uint32 netTimer; InstanceScript* instance; void Reset() override { - netTimer = urand(2000, 4000); + Initialize(); instance->SetData(TYPE_GELIHAST, NOT_STARTED); } diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp index 37fac0fa7de..d5860e4dbf7 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp @@ -43,9 +43,16 @@ public: { boss_kelrisAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + mindBlastTimer = urand(2000, 5000); + sleepTimer = urand(9000, 12000); + } + uint32 mindBlastTimer; uint32 sleepTimer; @@ -53,8 +60,7 @@ public: void Reset() override { - mindBlastTimer = urand(2000, 5000); - sleepTimer = urand(9000, 12000); + Initialize(); instance->SetData(TYPE_KELRIS, NOT_STARTED); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index 7aaa2239745..782632602b3 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -54,10 +54,20 @@ public: { boss_anetheronAI(Creature* creature) : hyjal_trashAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); go = false; } + void Initialize() + { + SwarmTimer = 45000; + SleepTimer = 60000; + AuraTimer = 5000; + InfernoTimer = 45000; + damageTaken = 0; + } + uint32 SwarmTimer; uint32 SleepTimer; uint32 AuraTimer; @@ -66,11 +76,7 @@ public: void Reset() override { - damageTaken = 0; - SwarmTimer = 45000; - SleepTimer = 60000; - AuraTimer = 5000; - InfernoTimer = 45000; + Initialize(); if (IsEvent) instance->SetData(DATA_ANETHERONEVENT, NOT_STARTED); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index 576b3dbdb39..2885a838cee 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -90,7 +90,13 @@ public: { npc_ancient_wispAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); + } + + void Initialize() + { + CheckTimer = 1000; ArchimondeGUID = 0; } @@ -100,7 +106,7 @@ public: void Reset() override { - CheckTimer = 1000; + Initialize(); ArchimondeGUID = instance->GetData64(DATA_ARCHIMONDE); @@ -174,15 +180,23 @@ public: struct npc_doomfire_targettingAI : public ScriptedAI { - npc_doomfire_targettingAI(Creature* creature) : ScriptedAI(creature) { } + npc_doomfire_targettingAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + TargetGUID = 0; + ChangeTargetTimer = 5000; + } uint64 TargetGUID; uint32 ChangeTargetTimer; void Reset() override { - TargetGUID = 0; - ChangeTargetTimer = 5000; + Initialize(); } void MoveInLineOfSight(Unit* who) override @@ -244,9 +258,36 @@ public: { boss_archimondeAI(Creature* creature) : hyjal_trashAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + DoomfireSpiritGUID = 0; + damageTaken = 0; + WorldTreeGUID = 0; + + DrainNordrassilTimer = 0; + FearTimer = 42000; + AirBurstTimer = 30000; + GripOfTheLegionTimer = urand(5000, 25000); + DoomfireTimer = 20000; + SoulChargeTimer = urand(2000, 30000); + SoulChargeCount = 0; + MeleeRangeCheckTimer = 15000; + HandOfDeathTimer = 2000; + WispCount = 0; // When ~30 wisps are summoned, Archimonde dies + EnrageTimer = 600000; // 10 minutes + CheckDistanceTimer = 30000; // This checks if he's too close to the World Tree (75 yards from a point on the tree), if true then he will enrage + SummonWispTimer = 0; + + Enraged = false; + BelowTenPercent = false; + HasProtected = false; + IsChanneling = false; + } + InstanceScript* instance; uint64 DoomfireSpiritGUID; @@ -275,28 +316,7 @@ public: { instance->SetData(DATA_ARCHIMONDEEVENT, NOT_STARTED); - DoomfireSpiritGUID = 0; - damageTaken = 0; - WorldTreeGUID = 0; - - DrainNordrassilTimer = 0; - FearTimer = 42000; - AirBurstTimer = 30000; - GripOfTheLegionTimer = urand(5000, 25000); - DoomfireTimer = 20000; - SoulChargeTimer = urand(2000, 30000); - SoulChargeCount = 0; - MeleeRangeCheckTimer = 15000; - HandOfDeathTimer = 2000; - WispCount = 0; // When ~30 wisps are summoned, Archimonde dies - EnrageTimer = 600000; // 10 minutes - CheckDistanceTimer = 30000; // This checks if he's too close to the World Tree (75 yards from a point on the tree), if true then he will enrage - SummonWispTimer = 0; - - Enraged = false; - BelowTenPercent = false; - HasProtected = false; - IsChanneling = false; + Initialize(); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index 38e398f3d5b..7e50fd7b775 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -55,10 +55,22 @@ public: { boss_azgalorAI(Creature* creature) : hyjal_trashAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); go = false; } + void Initialize() + { + damageTaken = 0; + RainTimer = 20000; + DoomTimer = 50000; + HowlTimer = 30000; + CleaveTimer = 10000; + EnrageTimer = 600000; + enraged = false; + } + uint32 RainTimer; uint32 DoomTimer; uint32 HowlTimer; @@ -70,13 +82,7 @@ public: void Reset() override { - damageTaken = 0; - RainTimer = 20000; - DoomTimer = 50000; - HowlTimer = 30000; - CleaveTimer = 10000; - EnrageTimer = 600000; - enraged = false; + Initialize(); if (IsEvent) instance->SetData(DATA_AZGALOREVENT, NOT_STARTED); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index c5fcb150d3f..d3c137b67e8 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -56,10 +56,20 @@ public: { boss_kazrogalAI(Creature* creature) : hyjal_trashAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); go = false; } + void Initialize() + { + damageTaken = 0; + CleaveTimer = 5000; + WarStompTimer = 15000; + MarkTimer = 45000; + MarkTimerBase = 45000; + } + uint32 CleaveTimer; uint32 WarStompTimer; uint32 MarkTimer; @@ -68,11 +78,7 @@ public: void Reset() override { - damageTaken = 0; - CleaveTimer = 5000; - WarStompTimer = 15000; - MarkTimer = 45000; - MarkTimerBase = 45000; + Initialize(); if (IsEvent) instance->SetData(DATA_KAZROGALEVENT, NOT_STARTED); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp index c37b9d910e7..5ce9b30eb58 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -51,10 +51,20 @@ public: { boss_rage_winterchillAI(Creature* creature) : hyjal_trashAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); go = false; } + void Initialize() + { + damageTaken = 0; + FrostArmorTimer = 37000; + DecayTimer = 45000; + NovaTimer = 15000; + IceboltTimer = 10000; + } + uint32 FrostArmorTimer; uint32 DecayTimer; uint32 NovaTimer; @@ -63,11 +73,7 @@ public: void Reset() override { - damageTaken = 0; - FrostArmorTimer = 37000; - DecayTimer = 45000; - NovaTimer = 15000; - IceboltTimer = 10000; + Initialize(); if (IsEvent) instance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index b9c6025b91c..34b55da72de 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -317,6 +317,7 @@ float HordeFirePos[65][8]=//spawn points for the fire visuals (GO) in the horde hyjalAI::hyjalAI(Creature* creature) : npc_escortAI(creature), Summons(me) { + Initialize(); instance = creature->GetInstanceScript(); VeinsSpawned[0] = false; VeinsSpawned[1] = false; @@ -332,11 +333,45 @@ hyjalAI::hyjalAI(Creature* creature) : npc_escortAI(creature), Summons(me) InfernalPoint = 0; RespawnTimer = 10000; DoRespawn = false; - DoHide = false; MassTeleportTimer = 0; DoMassTeleport = false; } +void hyjalAI::Initialize() +{ + IsDummy = false; + + // GUIDs + PlayerGUID = 0; + BossGUID[0] = 0; + BossGUID[1] = 0; + + // Timers + NextWaveTimer = 10000; + CheckTimer = 0; + RetreatTimer = 1000; + + // Misc + WaveCount = 0; + EnemyCount = 0; + + //Bools + EventBegun = false; + FirstBossDead = false; + SecondBossDead = false; + Summon = false; + bRetreat = false; + Debug = false; + + //Visibility + DoHide = true; + + //Initialize spells + memset(Spells, 0, sizeof(Spell) * HYJAL_AI_MAX_SPELLS); + + Faction = 0; +} + void hyjalAI::JustSummoned(Creature* summoned) { Summons.Summon(summoned); @@ -349,21 +384,9 @@ void hyjalAI::SummonedCreatureDespawn(Creature* summoned) void hyjalAI::Reset() { - IsDummy = false; me->setActive(true); - // GUIDs - PlayerGUID = 0; - BossGUID[0] = 0; - BossGUID[1] = 0; - // Timers - NextWaveTimer = 10000; - CheckTimer = 0; - RetreatTimer = 1000; - - // Misc - WaveCount = 0; - EnemyCount = 0; + Initialize(); // Set faction properly based on Creature entry switch (me->GetEntry()) @@ -382,20 +405,9 @@ void hyjalAI::Reset() break; } - //Bools - EventBegun = false; - FirstBossDead = false; - SecondBossDead = false; - Summon = false; - bRetreat = false; - Debug = false; - //Flags me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - //Initialize spells - memset(Spells, 0, sizeof(Spell) * HYJAL_AI_MAX_SPELLS); - //Reset Instance Data for trash count if ((!instance->GetData(DATA_ALLIANCE_RETREAT) && me->GetEntry() == JAINA) || (instance->GetData(DATA_ALLIANCE_RETREAT) && me->GetEntry() == THRALL)) { @@ -405,9 +417,6 @@ void hyjalAI::Reset() instance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0); instance->SetData(DATA_RESET_TRASH_COUNT, 0); } - - //Visibility - DoHide = true; } void hyjalAI::EnterEvadeMode() diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h index c91414eba9d..43afc58879c 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h @@ -119,6 +119,8 @@ struct hyjalAI : public npc_escortAI { hyjalAI(Creature* creature); + void Initialize(); + void Reset(); // Generically used to reset our variables. Do *not* call in EnterEvadeMode as this may make problems if the raid is still in combat void EnterEvadeMode(); // Send creature back to spawn location and evade. diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index 7537654c09c..8e1a78ea5f2 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -1135,9 +1135,15 @@ public: { npc_frost_wyrmAI(Creature* creature) : hyjal_trashAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); go = false; - Reset(); + } + + void Initialize() + { + FrostBreathTimer = 5000; + MoveTimer = 0; } bool go; @@ -1146,8 +1152,7 @@ public: void Reset() override { - FrostBreathTimer = 5000; - MoveTimer = 0; + Initialize(); me->SetDisableGravity(true); } @@ -1388,9 +1393,15 @@ public: { alliance_riflemanAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); SetCombatMovement(false); } + void Initialize() + { + ExplodeTimer = 5000 + rand32() % 5000; + } + uint32 ExplodeTimer; void JustDied(Unit* /*killer*/) override @@ -1399,7 +1410,7 @@ public: void Reset() override { - ExplodeTimer = 5000 + rand32() % 5000; + Initialize(); } void MoveInLineOfSight(Unit* who) override diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp index 44e1067498d..0a666488e84 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp @@ -59,9 +59,20 @@ public: { boss_epochAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + uiStep = 1; + uiStepTimer = 26000; + uiCurseOfExertionTimer = 9300; + uiTimeWarpTimer = 25300; + uiTimeStopTimer = 21300; + uiWoundingStrikeTimer = 5300; + } + uint8 uiStep; uint32 uiStepTimer; @@ -74,12 +85,7 @@ public: void Reset() override { - uiStep = 1; - uiStepTimer = 26000; - uiCurseOfExertionTimer = 9300; - uiTimeWarpTimer = 25300; - uiTimeStopTimer = 21300; - uiWoundingStrikeTimer = 5300; + Initialize(); instance->SetData(DATA_EPOCH_EVENT, NOT_STARTED); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp index 6d36a933687..d9356b724c0 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp @@ -73,7 +73,21 @@ public: { boss_mal_ganisAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); + uiOutroStep = 0; + } + + void Initialize() + { + bYelled = false; + bYelled2 = false; + Phase = COMBAT; + uiCarrionSwarmTimer = 6000; + uiMindBlastTimer = 11000; + uiVampiricTouchTimer = urand(10000, 15000); + uiSleepTimer = urand(15000, 20000); + uiOutroTimer = 1000; } uint32 uiCarrionSwarmTimer; @@ -93,16 +107,9 @@ public: void Reset() override { - bYelled = false; - bYelled2 = false; - Phase = COMBAT; - uiCarrionSwarmTimer = 6000; - uiMindBlastTimer = 11000; - uiVampiricTouchTimer = urand(10000, 15000); - uiSleepTimer = urand(15000, 20000); - uiOutroTimer = 1000; + Initialize(); - instance->SetData(DATA_MAL_GANIS_EVENT, NOT_STARTED); + instance->SetData(DATA_MAL_GANIS_EVENT, NOT_STARTED); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp index 4c26b30947f..c961bf9b2c6 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp @@ -58,10 +58,18 @@ public: { boss_meathookAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); Talk(SAY_SPAWN); } + void Initialize() + { + uiChainTimer = urand(12000, 17000); //seen on video 13, 17, 15, 12, 16 + uiDiseaseTimer = urand(2000, 4000); //approx 3s + uiFrenzyTimer = urand(21000, 26000); //made it up + } + uint32 uiChainTimer; uint32 uiDiseaseTimer; uint32 uiFrenzyTimer; @@ -70,9 +78,7 @@ public: void Reset() override { - uiChainTimer = urand(12000, 17000); //seen on video 13, 17, 15, 12, 16 - uiDiseaseTimer = urand(2000, 4000); //approx 3s - uiFrenzyTimer = urand(21000, 26000); //made it up + Initialize(); instance->SetData(DATA_MEATHOOK_EVENT, NOT_STARTED); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp index 7c299b1feaa..1c35a38a5e3 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp @@ -63,10 +63,20 @@ public: { boss_salrammAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); Talk(SAY_SPAWN); } + void Initialize() + { + uiCurseFleshTimer = 30000; //30s DBM + uiExplodeGhoulTimer = urand(25000, 28000); //approx 6 sec after summon ghouls + uiShadowBoltTimer = urand(8000, 12000); // approx 10s + uiStealFleshTimer = 12345; + uiSummonGhoulsTimer = urand(19000, 24000); //on a video approx 24s after aggro + } + uint32 uiCurseFleshTimer; uint32 uiExplodeGhoulTimer; uint32 uiShadowBoltTimer; @@ -77,13 +87,9 @@ public: void Reset() override { - uiCurseFleshTimer = 30000; //30s DBM - uiExplodeGhoulTimer = urand(25000, 28000); //approx 6 sec after summon ghouls - uiShadowBoltTimer = urand(8000, 12000); // approx 10s - uiStealFleshTimer = 12345; - uiSummonGhoulsTimer = urand(19000, 24000); //on a video approx 24s after aggro + Initialize(); - instance->SetData(DATA_SALRAMM_EVENT, NOT_STARTED); + instance->SetData(DATA_SALRAMM_EVENT, NOT_STARTED); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp index fd832051421..b8a9b295161 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -351,35 +351,15 @@ public: { npc_arthasAI(Creature* creature) : npc_escortAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); - Reset(); + bStepping = false; + step = 0; + gossipStep = 0; + bossEvent = 0; } - InstanceScript* instance; - - bool bStepping; - uint32 step; - uint32 phaseTimer; - uint32 gossipStep; - uint32 playerFaction; - uint32 bossEvent; - uint32 wave; - - uint64 utherGUID; - uint64 jainaGUID; - uint64 citymenGUID[2]; - uint64 waveGUID[ENCOUNTER_WAVES_MAX_SPAWNS]; - uint64 infiniteDraconianGUID[ENCOUNTER_DRACONIAN_NUMBER]; - uint64 stalkerGUID; - - uint64 bossGUID; - uint64 epochGUID; - uint64 malganisGUID; - uint64 infiniteGUID; - - uint32 exorcismTimer; - - void Reset() override + void Initialize() { utherGUID = 0; jainaGUID = 0; @@ -399,6 +379,38 @@ public: malganisGUID = 0; infiniteGUID = 0; + phaseTimer = 1000; + exorcismTimer = 7300; + wave = 0; + } + + InstanceScript* instance; + + bool bStepping; + uint32 step; + uint32 phaseTimer; + uint32 gossipStep; + uint32 bossEvent; + uint32 wave; + + uint64 utherGUID; + uint64 jainaGUID; + uint64 citymenGUID[2]; + uint64 waveGUID[ENCOUNTER_WAVES_MAX_SPAWNS]; + uint64 infiniteDraconianGUID[ENCOUNTER_DRACONIAN_NUMBER]; + uint64 stalkerGUID; + + uint64 bossGUID; + uint64 epochGUID; + uint64 malganisGUID; + uint64 infiniteGUID; + + uint32 exorcismTimer; + + void Reset() override + { + Initialize(); + instance->SetData(DATA_ARTHAS_EVENT, NOT_STARTED); switch (instance->GetData(DATA_ARTHAS_EVENT)) { @@ -410,9 +422,6 @@ public: gossipStep = 0; break; } - phaseTimer = 1000; - exorcismTimer = 7300; - wave = 0; } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp index b63075b681a..611ef38d626 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp @@ -61,9 +61,20 @@ public: { boss_captain_skarlocAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + Holy_Light_Timer = urand(20000, 30000); + Cleanse_Timer = 10000; + HammerOfJustice_Timer = urand(20000, 35000); + HolyShield_Timer = 240000; + DevotionAura_Timer = 3000; + Consecration_Timer = 8000; + } + InstanceScript* instance; uint32 Holy_Light_Timer; @@ -75,12 +86,7 @@ public: void Reset() override { - Holy_Light_Timer = urand(20000, 30000); - Cleanse_Timer = 10000; - HammerOfJustice_Timer = urand(20000, 35000); - HolyShield_Timer = 240000; - DevotionAura_Timer = 3000; - Consecration_Timer = 8000; + Initialize(); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp index e27dec09802..1916e184dbb 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp @@ -59,9 +59,18 @@ public: { boss_epoch_hunterAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + SandBreath_Timer = urand(8000, 16000); + ImpendingDeath_Timer = urand(25000, 30000); + WingBuffet_Timer = 35000; + Mda_Timer = 40000; + } + InstanceScript* instance; uint32 SandBreath_Timer; @@ -71,10 +80,7 @@ public: void Reset() override { - SandBreath_Timer = urand(8000, 16000); - ImpendingDeath_Timer = urand(25000, 30000); - WingBuffet_Timer = 35000; - Mda_Timer = 40000; + Initialize(); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp index 2cf5169b530..8d23cf0a3e4 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp @@ -114,7 +114,21 @@ public: struct boss_lieutenant_drakeAI : public ScriptedAI { - boss_lieutenant_drakeAI(Creature* creature) : ScriptedAI(creature) { } + boss_lieutenant_drakeAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + CanPatrol = true; + wpId = 0; + + Whirlwind_Timer = 20000; + Fear_Timer = 30000; + MortalStrike_Timer = 45000; + ExplodingShout_Timer = 25000; + } bool CanPatrol; uint32 wpId; @@ -126,13 +140,7 @@ public: void Reset() override { - CanPatrol = true; - wpId = 0; - - Whirlwind_Timer = 20000; - Fear_Timer = 30000; - MortalStrike_Timer = 45000; - ExplodingShout_Timer = 25000; + Initialize(); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp index 1dc86cd4ad4..56e95fafece 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp @@ -276,11 +276,17 @@ public: { npc_thrall_old_hillsbradAI(Creature* creature) : npc_escortAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); HadMount = false; me->setActive(true); } + void Initialize() + { + LowHp = false; + } + InstanceScript* instance; bool LowHp; @@ -451,7 +457,7 @@ public: void Reset() override { - LowHp = false; + Initialize(); if (HadMount) DoMount(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp index a1c4f057161..1fa104ada00 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp @@ -77,9 +77,19 @@ public: { npc_medivh_bmAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + SpellCorrupt_Timer = 0; + Check_Timer = 0; + Life75 = true; + Life50 = true; + Life25 = true; + } + InstanceScript* instance; uint32 SpellCorrupt_Timer; @@ -91,11 +101,7 @@ public: void Reset() override { - SpellCorrupt_Timer = 0; - Check_Timer = 0; - Life75 = true; - Life50 = true; - Life25 = true; + Initialize(); if (instance->GetData(TYPE_MEDIVH) == IN_PROGRESS) DoCast(me, SPELL_CHANNEL, true); @@ -265,23 +271,28 @@ public: { npc_time_riftAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + TimeRiftWave_Timer = 15000; + mRiftWaveCount = 0; + mWaveId = 0; + } + InstanceScript* instance; uint32 TimeRiftWave_Timer; uint8 mRiftWaveCount; - uint8 mPortalCount; uint8 mWaveId; void Reset() override { + Initialize(); - TimeRiftWave_Timer = 15000; - mRiftWaveCount = 0; - - mPortalCount = instance->GetData(DATA_PORTAL_COUNT); + uint8 mPortalCount = instance->GetData(DATA_PORTAL_COUNT); if (mPortalCount < 6) mWaveId = 0; diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp index 15330643bd3..b8eb489461c 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp @@ -45,7 +45,17 @@ public: struct celebras_the_cursedAI : public ScriptedAI { - celebras_the_cursedAI(Creature* creature) : ScriptedAI(creature) { } + celebras_the_cursedAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + WrathTimer = 8000; + EntanglingRootsTimer = 2000; + CorruptForcesTimer = 30000; + } uint32 WrathTimer; uint32 EntanglingRootsTimer; @@ -53,9 +63,7 @@ public: void Reset() override { - WrathTimer = 8000; - EntanglingRootsTimer = 2000; - CorruptForcesTimer = 30000; + Initialize(); } void EnterCombat(Unit* /*who*/) override { } diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp index 12016d2223a..59bcdc89171 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp @@ -45,7 +45,17 @@ public: struct boss_landslideAI : public ScriptedAI { - boss_landslideAI(Creature* creature) : ScriptedAI(creature) { } + boss_landslideAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + KnockAwayTimer = 8000; + TrampleTimer = 2000; + LandslideTimer = 0; + } uint32 KnockAwayTimer; uint32 TrampleTimer; @@ -53,9 +63,7 @@ public: void Reset() override { - KnockAwayTimer = 8000; - TrampleTimer = 2000; - LandslideTimer = 0; + Initialize(); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp index 8c7197b2942..a7aa487db90 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp @@ -44,7 +44,19 @@ public: struct boss_noxxionAI : public ScriptedAI { - boss_noxxionAI(Creature* creature) : ScriptedAI(creature) { } + boss_noxxionAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + ToxicVolleyTimer = 7000; + UppercutTimer = 16000; + AddsTimer = 19000; + InvisibleTimer = 15000; //Too much too low? + Invisible = false; + } uint32 ToxicVolleyTimer; uint32 UppercutTimer; @@ -54,11 +66,7 @@ public: void Reset() override { - ToxicVolleyTimer = 7000; - UppercutTimer = 16000; - AddsTimer = 19000; - InvisibleTimer = 15000; //Too much too low? - Invisible = false; + Initialize(); } void EnterCombat(Unit* /*who*/) override { } diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp index 0d48d8f43c6..a36e8f09d21 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp @@ -47,7 +47,18 @@ public: struct boss_ptheradrasAI : public ScriptedAI { - boss_ptheradrasAI(Creature* creature) : ScriptedAI(creature) { } + boss_ptheradrasAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + DustfieldTimer = 8000; + BoulderTimer = 2000; + ThrashTimer = 5000; + RepulsiveGazeTimer = 23000; + } uint32 DustfieldTimer; uint32 BoulderTimer; @@ -56,10 +67,7 @@ public: void Reset() override { - DustfieldTimer = 8000; - BoulderTimer = 2000; - ThrashTimer = 5000; - RepulsiveGazeTimer = 23000; + Initialize(); } void EnterCombat(Unit* /*who*/) override { } diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp index e0a30eba2c9..ba7934e18a3 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp @@ -50,14 +50,22 @@ public: struct boss_amnennar_the_coldbringerAI : public BossAI { - boss_amnennar_the_coldbringerAI(Creature* creature) : BossAI(creature, DATA_AMNENNAR_THE_COLD_BRINGER) { } + boss_amnennar_the_coldbringerAI(Creature* creature) : BossAI(creature, DATA_AMNENNAR_THE_COLD_BRINGER) + { + Initialize(); + } + + void Initialize() + { + hp60Spectrals = false; + hp30Spectrals = false; + hp50 = false; + } void Reset() override { _Reset(); - hp60Spectrals = false; - hp30Spectrals = false; - hp50 = false; + Initialize(); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp index 162ce9b5359..19cc5316fa4 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp @@ -80,13 +80,19 @@ class boss_ayamiss : public CreatureScript { boss_ayamissAI(Creature* creature) : BossAI(creature, DATA_AYAMISS) { + Initialize(); + } + + void Initialize() + { + _phase = PHASE_AIR; + _enraged = false; } void Reset() override { _Reset(); - _phase = PHASE_AIR; - _enraged = false; + Initialize(); SetCombatMovement(false); } diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp index ac490b1440d..cf6703a01f5 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp @@ -69,6 +69,7 @@ class boss_buru : public CreatureScript { boss_buruAI(Creature* creature) : BossAI(creature, DATA_BURU) { + _phase = 0; } void EnterEvadeMode() override diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp index f0e582dee95..adb6723d2af 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp @@ -53,12 +53,18 @@ class boss_kurinnaxx : public CreatureScript { boss_kurinnaxxAI(Creature* creature) : BossAI(creature, DATA_KURINNAXX) { + Initialize(); + } + + void Initialize() + { + _enraged = false; } void Reset() override { _Reset(); - _enraged = false; + Initialize(); events.ScheduleEvent(EVENT_MORTAL_WOUND, 8000); events.ScheduleEvent(EVENT_SANDTRAP, urand(5000, 15000)); events.ScheduleEvent(EVENT_TRASH, 1000); diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp index e123a84f88e..65de64fe6c5 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp @@ -60,13 +60,19 @@ class boss_moam : public CreatureScript { boss_moamAI(Creature* creature) : BossAI(creature, DATA_MOAM) { + Initialize(); + } + + void Initialize() + { + _isStonePhase = false; } void Reset() override { _Reset(); me->SetPower(POWER_MANA, 0); - _isStonePhase = false; + Initialize(); events.ScheduleEvent(EVENT_STONE_PHASE, 90000); //events.ScheduleEvent(EVENT_WIDE_SLASH, 11000); } diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp index 256f76337b4..0180bbeddac 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp @@ -88,9 +88,17 @@ class boss_ossirian : public CreatureScript { boss_ossirianAI(Creature* creature) : BossAI(creature, DATA_OSSIRIAN) { + Initialize(); SaidIntro = false; } + void Initialize() + { + CrystalIterator = 0; + TriggerGUID = 0; + CrystalGUID = 0; + } + uint64 TriggerGUID; uint64 CrystalGUID; uint8 CrystalIterator; @@ -99,9 +107,7 @@ class boss_ossirian : public CreatureScript void Reset() override { _Reset(); - CrystalIterator = 0; - TriggerGUID = 0; - CrystalGUID = 0; + Initialize(); } void SpellHit(Unit* caster, SpellInfo const* spell) override diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp index 0bb35f3842a..8369c343de4 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp @@ -65,12 +65,18 @@ class boss_rajaxx : public CreatureScript { boss_rajaxxAI(Creature* creature) : BossAI(creature, DATA_RAJAXX) { + Initialize(); + } + + void Initialize() + { + enraged = false; } void Reset() override { _Reset(); - enraged = false; + Initialize(); events.ScheduleEvent(EVENT_DISARM, 10000); events.ScheduleEvent(EVENT_THUNDERCRASH, 12000); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index 189cb7854ad..be103541989 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -55,9 +55,20 @@ public: { boss_kriAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + Cleave_Timer = urand(4000, 8000); + ToxicVolley_Timer = urand(6000, 12000); + Check_Timer = 2000; + + VemDead = false; + Death = false; + } + InstanceScript* instance; uint32 Cleave_Timer; @@ -69,12 +80,7 @@ public: void Reset() override { - Cleave_Timer = urand(4000, 8000); - ToxicVolley_Timer = urand(6000, 12000); - Check_Timer = 2000; - - VemDead = false; - Death = false; + Initialize(); } void EnterCombat(Unit* /*who*/) override @@ -148,9 +154,19 @@ public: { boss_vemAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + Charge_Timer = urand(15000, 27000); + KnockBack_Timer = urand(8000, 20000); + Enrage_Timer = 120000; + + Enraged = false; + } + InstanceScript* instance; uint32 Charge_Timer; @@ -161,11 +177,7 @@ public: void Reset() override { - Charge_Timer = urand(15000, 27000); - KnockBack_Timer = urand(8000, 20000); - Enrage_Timer = 120000; - - Enraged = false; + Initialize(); } void JustDied(Unit* /*killer*/) override @@ -237,9 +249,19 @@ public: { boss_yaujAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + Heal_Timer = urand(25000, 40000); + Fear_Timer = urand(12000, 24000); + Check_Timer = 2000; + + VemDead = false; + } + InstanceScript* instance; uint32 Heal_Timer; @@ -250,11 +272,7 @@ public: void Reset() override { - Heal_Timer = urand(25000, 40000); - Fear_Timer = urand(12000, 24000); - Check_Timer = 2000; - - VemDead = false; + Initialize(); } void JustDied(Unit* /*killer*/) override diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index 2cfd977fe99..c9795133d14 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -160,11 +160,29 @@ public: { eye_of_cthunAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); SetCombatMovement(false); } + void Initialize() + { + //Phase information + PhaseTimer = 50000; //First dark glare in 50 seconds + + //Eye beam phase 50 seconds + BeamTimer = 3000; + EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam + ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn during Dark beam) + + //Dark Beam phase 35 seconds (each tick = 1 second, 35 ticks) + DarkGlareTick = 0; + DarkGlareTickTimer = 1000; + DarkGlareAngle = 0; + ClockWise = false; + } + InstanceScript* instance; //Global variables @@ -183,19 +201,7 @@ public: void Reset() override { - //Phase information - PhaseTimer = 50000; //First dark glare in 50 seconds - - //Eye beam phase 50 seconds - BeamTimer = 3000; - EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam - ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn during Dark beam) - - //Dark Beam phase 35 seconds (each tick = 1 second, 35 ticks) - DarkGlareTick = 0; - DarkGlareTickTimer = 1000; - DarkGlareAngle = 0; - ClockWise = false; + Initialize(); //Reset flags me->RemoveAurasDueToSpell(SPELL_RED_COLORATION); @@ -454,11 +460,34 @@ public: { cthunAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); SetCombatMovement(false); instance = creature->GetInstanceScript(); } + void Initialize() + { + //One random wisper every 90 - 300 seconds + WisperTimer = 90000; + + //Phase information + PhaseTimer = 10000; //Emerge in 10 seconds + + //No hold player for transition + HoldPlayer = 0; + + //Body Phase + EyeTentacleTimer = 30000; + FleshTentaclesKilled = 0; + GiantClawTentacleTimer = 15000; //15 seconds into body phase (1 min repeat) + GiantEyeTentacleTimer = 45000; //15 seconds into body phase (1 min repeat) + StomachAcidTimer = 4000; //Every 4 seconds + StomachEnterTimer = 10000; //Every 10 seconds + StomachEnterVisTimer = 0; //Always 3.5 seconds after Stomach Enter Timer + StomachEnterTarget = 0; //Target to be teleported to stomach + } + InstanceScript* instance; //Out of combat whisper timer @@ -487,24 +516,7 @@ public: void Reset() override { - //One random wisper every 90 - 300 seconds - WisperTimer = 90000; - - //Phase information - PhaseTimer = 10000; //Emerge in 10 seconds - - //No hold player for transition - HoldPlayer = 0; - - //Body Phase - EyeTentacleTimer = 30000; - FleshTentaclesKilled = 0; - GiantClawTentacleTimer = 15000; //15 seconds into body phase (1 min repeat) - GiantEyeTentacleTimer = 45000; //15 seconds into body phase (1 min repeat) - StomachAcidTimer = 4000; //Every 4 seconds - StomachEnterTimer = 10000; //Every 10 seconds - StomachEnterVisTimer = 0; //Always 3.5 seconds after Stomach Enter Timer - StomachEnterTarget = 0; //Target to be teleported to stomach + Initialize(); //Clear players in stomach and outside Stomach_Map.clear(); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp index 5947c9860ec..a98f3843d97 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp @@ -53,23 +53,28 @@ public: struct boss_fankrissAI : public ScriptedAI { - boss_fankrissAI(Creature* creature) : ScriptedAI(creature) { } + boss_fankrissAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + MortalWound_Timer = urand(10000, 15000); + SpawnHatchlings_Timer = urand(6000, 12000); + SpawnSpawns_Timer = urand(15000, 45000); + } uint32 MortalWound_Timer; uint32 SpawnHatchlings_Timer; uint32 SpawnSpawns_Timer; - int Rand; - float RandX; - float RandY; Creature* Hatchling; Creature* Spawn; void Reset() override { - MortalWound_Timer = urand(10000, 15000); - SpawnHatchlings_Timer = urand(6000, 12000); - SpawnSpawns_Timer = urand(15000, 45000); + Initialize(); } void SummonSpawn(Unit* victim) @@ -77,7 +82,10 @@ public: if (!victim) return; - Rand = 10 + (rand32() % 10); + int Rand = 10 + (rand32() % 10); + float RandX = 0.f; + float RandY = 0.f; + switch (rand32() % 2) { case 0: RandX = 0.0f - Rand; break; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp index 5cc1670d8fb..b5512f29589 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp @@ -51,7 +51,23 @@ public: struct boss_huhuranAI : public ScriptedAI { - boss_huhuranAI(Creature* creature) : ScriptedAI(creature) { } + boss_huhuranAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + Frenzy_Timer = urand(25000, 35000); + Wyvern_Timer = urand(18000, 28000); + Spit_Timer = 8000; + PoisonBolt_Timer = 4000; + NoxiousPoison_Timer = urand(10000, 20000); + FrenzyBack_Timer = 15000; + + Frenzy = false; + Berserk = false; + } uint32 Frenzy_Timer; uint32 Wyvern_Timer; @@ -65,15 +81,7 @@ public: void Reset() override { - Frenzy_Timer = urand(25000, 35000); - Wyvern_Timer = urand(18000, 28000); - Spit_Timer = 8000; - PoisonBolt_Timer = 4000; - NoxiousPoison_Timer = urand(10000, 20000); - FrenzyBack_Timer = 15000; - - Frenzy = false; - Berserk = false; + Initialize(); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp index 26866de9aa8..092d7ed2a3b 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp @@ -48,7 +48,23 @@ public: struct boss_ouroAI : public ScriptedAI { - boss_ouroAI(Creature* creature) : ScriptedAI(creature) { } + boss_ouroAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + Sweep_Timer = urand(5000, 10000); + SandBlast_Timer = urand(20000, 35000); + Submerge_Timer = urand(90000, 150000); + Back_Timer = urand(30000, 45000); + ChangeTarget_Timer = urand(5000, 8000); + Spawn_Timer = urand(10000, 20000); + + Enrage = false; + Submerged = false; + } uint32 Sweep_Timer; uint32 SandBlast_Timer; @@ -62,15 +78,7 @@ public: void Reset() override { - Sweep_Timer = urand(5000, 10000); - SandBlast_Timer = urand(20000, 35000); - Submerge_Timer = urand(90000, 150000); - Back_Timer = urand(30000, 45000); - ChangeTarget_Timer = urand(5000, 8000); - Spawn_Timer = urand(10000, 20000); - - Enrage = false; - Submerged = false; + Initialize(); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp index e9eb9d58ca8..b73a79506a9 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp @@ -53,7 +53,25 @@ public: struct boss_sarturaAI : public ScriptedAI { - boss_sarturaAI(Creature* creature) : ScriptedAI(creature) { } + boss_sarturaAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + WhirlWind_Timer = 30000; + WhirlWindRandom_Timer = urand(3000, 7000); + WhirlWindEnd_Timer = 15000; + AggroReset_Timer = urand(45000, 55000); + AggroResetEnd_Timer = 5000; + EnrageHard_Timer = 10 * 60000; + + WhirlWind = false; + AggroReset = false; + Enraged = false; + EnragedHard = false; + } uint32 WhirlWind_Timer; uint32 WhirlWindRandom_Timer; @@ -69,18 +87,7 @@ public: void Reset() override { - WhirlWind_Timer = 30000; - WhirlWindRandom_Timer = urand(3000, 7000); - WhirlWindEnd_Timer = 15000; - AggroReset_Timer = urand(45000, 55000); - AggroResetEnd_Timer = 5000; - EnrageHard_Timer = 10*60000; - - WhirlWind = false; - AggroReset = false; - Enraged = false; - EnragedHard = false; - + Initialize(); } void EnterCombat(Unit* /*who*/) override @@ -196,7 +203,23 @@ public: struct npc_sartura_royal_guardAI : public ScriptedAI { - npc_sartura_royal_guardAI(Creature* creature) : ScriptedAI(creature) { } + npc_sartura_royal_guardAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + WhirlWind_Timer = 30000; + WhirlWindRandom_Timer = urand(3000, 7000); + WhirlWindEnd_Timer = 15000; + AggroReset_Timer = urand(45000, 55000); + AggroResetEnd_Timer = 5000; + KnockBack_Timer = 10000; + + WhirlWind = false; + AggroReset = false; + } uint32 WhirlWind_Timer; uint32 WhirlWindRandom_Timer; @@ -210,15 +233,7 @@ public: void Reset() override { - WhirlWind_Timer = 30000; - WhirlWindRandom_Timer = urand(3000, 7000); - WhirlWindEnd_Timer = 15000; - AggroReset_Timer = urand(45000, 55000); - AggroResetEnd_Timer = 5000; - KnockBack_Timer = 10000; - - WhirlWind = false; - AggroReset = false; + Initialize(); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index 51384cc117d..62de8fbd607 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -55,12 +55,20 @@ class boss_skeram : public CreatureScript struct boss_skeramAI : public BossAI { - boss_skeramAI(Creature* creature) : BossAI(creature, DATA_SKERAM) { } + boss_skeramAI(Creature* creature) : BossAI(creature, DATA_SKERAM) + { + Initialize(); + } - void Reset() override + void Initialize() { _flag = 0; _hpct = 75.0f; + } + + void Reset() override + { + Initialize(); me->SetVisible(true); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index 3e02406b93d..cd250a50fb7 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -69,9 +69,24 @@ struct boss_twinemperorsAI : public ScriptedAI { boss_twinemperorsAI(Creature* creature): ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + Heal_Timer = 0; // first heal immediately when they get close together + Teleport_Timer = TELEPORTTIME; + AfterTeleport = false; + tspellcast = false; + AfterTeleportTimer = 0; + Abuse_Bug_Timer = urand(10000, 17000); + BugsTimer = 2000; + + DontYellWhenDead = false; + EnrageTimer = 15 * 60000; + } + InstanceScript* instance; uint32 Heal_Timer; @@ -89,16 +104,8 @@ struct boss_twinemperorsAI : public ScriptedAI void TwinReset() { - Heal_Timer = 0; // first heal immediately when they get close together - Teleport_Timer = TELEPORTTIME; - AfterTeleport = false; - tspellcast = false; - AfterTeleportTimer = 0; - Abuse_Bug_Timer = urand(10000, 17000); - BugsTimer = 2000; + Initialize(); me->ClearUnitState(UNIT_STATE_STUNNED); - DontYellWhenDead = false; - EnrageTimer = 15*60000; } Creature* GetOtherBoss() @@ -394,24 +401,28 @@ public: struct boss_veknilashAI : public boss_twinemperorsAI { bool IAmVeklor() {return false;} - boss_veknilashAI(Creature* creature) : boss_twinemperorsAI(creature) { } + boss_veknilashAI(Creature* creature) : boss_twinemperorsAI(creature) + { + Initialize(); + } + + void Initialize() + { + UpperCut_Timer = urand(14000, 29000); + UnbalancingStrike_Timer = urand(8000, 18000); + Scarabs_Timer = urand(7000, 14000); + } uint32 UpperCut_Timer; uint32 UnbalancingStrike_Timer; uint32 Scarabs_Timer; - int Rand; - int RandX; - int RandY; Creature* Summoned; void Reset() override { TwinReset(); - UpperCut_Timer = urand(14000, 29000); - UnbalancingStrike_Timer = urand(8000, 18000); - Scarabs_Timer = urand(7000, 14000); - + Initialize(); //Added. Can be removed if its included in DB. me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); } @@ -480,25 +491,30 @@ public: struct boss_veklorAI : public boss_twinemperorsAI { bool IAmVeklor() {return true;} - boss_veklorAI(Creature* creature) : boss_twinemperorsAI(creature) { } + boss_veklorAI(Creature* creature) : boss_twinemperorsAI(creature) + { + Initialize(); + } + + void Initialize() + { + ShadowBolt_Timer = 0; + Blizzard_Timer = urand(15000, 20000); + ArcaneBurst_Timer = 1000; + Scorpions_Timer = urand(7000, 14000); + } uint32 ShadowBolt_Timer; uint32 Blizzard_Timer; uint32 ArcaneBurst_Timer; uint32 Scorpions_Timer; - int Rand; - int RandX; - int RandY; Creature* Summoned; void Reset() override { TwinReset(); - ShadowBolt_Timer = 0; - Blizzard_Timer = urand(15000, 20000); - ArcaneBurst_Timer = 1000; - Scorpions_Timer = urand(7000, 14000); + Initialize(); //Added. Can be removed if its included in DB. me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp index a9ec3007e5d..7f223f21269 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp @@ -91,13 +91,21 @@ class boss_viscidus : public CreatureScript struct boss_viscidusAI : public BossAI { - boss_viscidusAI(Creature* creature) : BossAI(creature, DATA_VISCIDUS) { } + boss_viscidusAI(Creature* creature) : BossAI(creature, DATA_VISCIDUS) + { + Initialize(); + } + + void Initialize() + { + _hitcounter = 0; + _phase = PHASE_FROST; + } void Reset() override { _Reset(); - _hitcounter = 0; - _phase = PHASE_FROST; + Initialize(); } void DamageTaken(Unit* attacker, uint32& /*damage*/) override diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp index a0d57481c75..b8f6c0ed80e 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp @@ -92,8 +92,15 @@ public: aqsentinelAI(Creature* creature) : ScriptedAI(creature) { - ClearBuddyList(); + Initialize(); abselected = 0; // just initialization of variable + ability = 0; + } + + void Initialize() + { + ClearBuddyList(); + gatherOthersWhenAggro = true; } uint64 NearbyGUID[3]; @@ -183,8 +190,8 @@ public: void GetOtherSentinels(Unit* who) { - bool *chosenAbilities = new bool[9]; - memset(chosenAbilities, 0, 9*sizeof(bool)); + bool chosenAbilities[9]; + memset(chosenAbilities, 0, sizeof(chosenAbilities)); selectAbility(pickAbilityRandom(chosenAbilities)); ClearBuddyList(); @@ -207,8 +214,6 @@ public: DoYell("I dont have enough buddies.", LANG_NEUTRAL, 0);*/ SendMyListToBuddies(); CallBuddiesToAttack(who); - - delete[] chosenAbilities; } bool gatherOthersWhenAggro; @@ -228,8 +233,7 @@ public: } } } - ClearBuddyList(); - gatherOthersWhenAggro = true; + Initialize(); } void GainSentinelAbility(uint32 id) diff --git a/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp b/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp index f0035cc921c..4a2425d879f 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp @@ -59,14 +59,22 @@ public: struct boss_zum_rahAI : public BossAI { - boss_zum_rahAI(Creature* creature) : BossAI(creature, DATA_ZUM_RAH) { } + boss_zum_rahAI(Creature* creature) : BossAI(creature, DATA_ZUM_RAH) + { + Initialize(); + } + + void Initialize() + { + _ward80 = false; + _ward40 = false; + _heal30 = false; + } void Reset() override { me->setFaction(ZUMRAH_FRIENDLY_FACTION); // areatrigger sets faction to enemy - _ward80 = false; - _ward40 = false; - _heal30 = false; + Initialize(); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index 7c02ecdb8f2..47d269a00ff 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -104,8 +104,17 @@ public: { npc_sergeant_blyAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); postGossipStep = 0; + Text_Timer = 0; + PlayerGUID = 0; + } + + void Initialize() + { + ShieldBash_Timer = 5000; + Revenge_Timer = 8000; } InstanceScript* instance; @@ -118,8 +127,7 @@ public: void Reset() override { - ShieldBash_Timer = 5000; - Revenge_Timer = 8000; + Initialize(); me->setFaction(FACTION_FRIENDLY); } diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp index db41213e94e..df0c9a9c16c 100644 --- a/src/server/scripts/Kalimdor/boss_azuregos.cpp +++ b/src/server/scripts/Kalimdor/boss_azuregos.cpp @@ -58,7 +58,10 @@ class boss_azuregos : public CreatureScript struct boss_azuregosAI : public WorldBossAI { - boss_azuregosAI(Creature* creature) : WorldBossAI(creature) { } + boss_azuregosAI(Creature* creature) : WorldBossAI(creature) + { + _enraged = false; + } void Reset() override { diff --git a/src/server/scripts/Kalimdor/zone_ashenvale.cpp b/src/server/scripts/Kalimdor/zone_ashenvale.cpp index 2b8dbdaab6c..500739b9404 100644 --- a/src/server/scripts/Kalimdor/zone_ashenvale.cpp +++ b/src/server/scripts/Kalimdor/zone_ashenvale.cpp @@ -61,13 +61,21 @@ public: struct npc_torekAI : public npc_escortAI { - npc_torekAI(Creature* creature) : npc_escortAI(creature) { } + npc_torekAI(Creature* creature) : npc_escortAI(creature) + { + Initialize(); + } + + void Initialize() + { + rend_Timer = 5000; + thunderclap_Timer = 8000; + _completed = false; + } void Reset() override { - rend_Timer = 5000; - thunderclap_Timer = 8000; - _completed = false; + Initialize(); } void EnterCombat(Unit* /*who*/) override { } @@ -298,15 +306,23 @@ public: struct npc_muglashAI : public npc_escortAI { - npc_muglashAI(Creature* creature) : npc_escortAI(creature) { } + npc_muglashAI(Creature* creature) : npc_escortAI(creature) + { + Initialize(); + } - void Reset() override + void Initialize() { eventTimer = 10000; waveId = 0; _isBrazierExtinguished = false; } + void Reset() override + { + Initialize(); + } + void EnterCombat(Unit* /*who*/) override { if (Player* player = GetPlayerForEscort()) diff --git a/src/server/scripts/Kalimdor/zone_azshara.cpp b/src/server/scripts/Kalimdor/zone_azshara.cpp index e62e17593ba..cec94617454 100644 --- a/src/server/scripts/Kalimdor/zone_azshara.cpp +++ b/src/server/scripts/Kalimdor/zone_azshara.cpp @@ -58,15 +58,23 @@ public: struct npc_spitelashesAI : public ScriptedAI { - npc_spitelashesAI(Creature* creature) : ScriptedAI(creature) { } + npc_spitelashesAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + morphtimer = 0; + spellhit = false; + } uint32 morphtimer; bool spellhit; void Reset() override { - morphtimer = 0; - spellhit = false; + Initialize(); } void EnterCombat(Unit* /*who*/) override { } @@ -292,9 +300,12 @@ public: struct npc_rizzle_sprysprocketAI : public ScriptedAI { - npc_rizzle_sprysprocketAI(Creature* creature) : ScriptedAI(creature) { } + npc_rizzle_sprysprocketAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } - void Reset() override + void Initialize() { SpellEscapeTimer = 1300; TeleportTimer = 3500; @@ -311,6 +322,11 @@ public: Reached = false; } + void Reset() override + { + Initialize(); + } + void EnterCombat(Unit* /*who*/) override { } void AttackStart(Unit* who) override @@ -475,7 +491,16 @@ public: struct npc_depth_chargeAI : public ScriptedAI { - npc_depth_chargeAI(Creature* creature) : ScriptedAI(creature) { } + npc_depth_chargeAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + WeMustDie = false; + WeMustDieTimer = 1000; + } bool WeMustDie; uint32 WeMustDieTimer; @@ -485,8 +510,7 @@ public: me->SetHover(true); me->SetSwim(true); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - WeMustDie = false; - WeMustDieTimer = 1000; + Initialize(); } void EnterCombat(Unit* /*who*/) override { } diff --git a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp index 6f02752d2fb..e6869dbf0f5 100644 --- a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp @@ -61,7 +61,21 @@ public: struct npc_draenei_survivorAI : public ScriptedAI { - npc_draenei_survivorAI(Creature* creature) : ScriptedAI(creature) { } + npc_draenei_survivorAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + pCaster = 0; + + SayThanksTimer = 0; + RunAwayTimer = 0; + SayHelpTimer = 10000; + + CanSayHelp = true; + } uint64 pCaster; @@ -73,13 +87,7 @@ public: void Reset() override { - pCaster = 0; - - SayThanksTimer = 0; - RunAwayTimer = 0; - SayHelpTimer = 10000; - - CanSayHelp = true; + Initialize(); DoCast(me, SPELL_IRRIDATION, true); @@ -193,22 +201,28 @@ public: { npc_engineer_spark_overgrindAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); NormFaction = creature->getFaction(); NpcFlags = creature->GetUInt32Value(UNIT_NPC_FLAGS); - - if (creature->GetAreaId() == AREA_COVE || creature->GetAreaId() == AREA_ISLE) - IsTreeEvent = true; } - void Reset() override + void Initialize() { DynamiteTimer = 8000; EmoteTimer = urand(120000, 150000); + if (me->GetAreaId() == AREA_COVE || me->GetAreaId() == AREA_ISLE) + IsTreeEvent = true; + else + IsTreeEvent = false; + } + + void Reset() override + { + Initialize(); + me->setFaction(NormFaction); me->SetUInt32Value(UNIT_NPC_FLAGS, NpcFlags); - - IsTreeEvent = false; } void EnterCombat(Unit* who) override @@ -410,7 +424,18 @@ public: struct npc_geezleAI : public ScriptedAI { - npc_geezleAI(Creature* creature) : ScriptedAI(creature) { } + npc_geezleAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + SparkGUID = 0; + Step = 0; + EventStarted = false; + SayTimer = 0; + } uint64 SparkGUID; @@ -421,8 +446,7 @@ public: void Reset() override { - SparkGUID = 0; - Step = 0; + Initialize(); StartEvent(); } @@ -582,15 +606,23 @@ public: struct npc_death_ravagerAI : public ScriptedAI { - npc_death_ravagerAI(Creature* creature) : ScriptedAI(creature){ } + npc_death_ravagerAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + RendTimer = 30000; + EnragingBiteTimer = 20000; + } uint32 RendTimer; uint32 EnragingBiteTimer; void Reset() override { - RendTimer = 30000; - EnragingBiteTimer = 20000; + Initialize(); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetReactState(REACT_PASSIVE); @@ -648,7 +680,16 @@ class npc_stillpine_capitive : public CreatureScript struct npc_stillpine_capitiveAI : public ScriptedAI { - npc_stillpine_capitiveAI(Creature* creature) : ScriptedAI(creature) { } + npc_stillpine_capitiveAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + _playerGUID = 0; + _movementComplete = false; + } void Reset() override { @@ -658,8 +699,7 @@ class npc_stillpine_capitive : public CreatureScript cage->SetGoState(GO_STATE_READY); } _events.Reset(); - _player = NULL; - _movementComplete = false; + Initialize(); } void StartMoving(Player* owner) @@ -667,7 +707,7 @@ class npc_stillpine_capitive : public CreatureScript if (owner) { Talk(CAPITIVE_SAY, owner); - _player = owner; + _playerGUID = owner->GetGUID(); } Position pos = me->GetNearPosition(3.0f, 0.0f); me->GetMotionMaster()->MovePoint(POINT_INIT, pos); @@ -678,7 +718,7 @@ class npc_stillpine_capitive : public CreatureScript if (type != POINT_MOTION_TYPE || id != POINT_INIT) return; - if (_player) + if (Player* _player = ObjectAccessor::GetPlayer(*me, _playerGUID)) _player->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); _movementComplete = true; @@ -697,7 +737,7 @@ class npc_stillpine_capitive : public CreatureScript } private: - Player* _player; + uint64 _playerGUID; EventMap _events; bool _movementComplete; }; diff --git a/src/server/scripts/Kalimdor/zone_darkshore.cpp b/src/server/scripts/Kalimdor/zone_darkshore.cpp index 43a533ada01..22c619f9a90 100644 --- a/src/server/scripts/Kalimdor/zone_darkshore.cpp +++ b/src/server/scripts/Kalimdor/zone_darkshore.cpp @@ -65,13 +65,21 @@ public: struct npc_kerlonianAI : public FollowerAI { - npc_kerlonianAI(Creature* creature) : FollowerAI(creature) { } + npc_kerlonianAI(Creature* creature) : FollowerAI(creature) + { + Initialize(); + } + + void Initialize() + { + FallAsleepTimer = urand(10000, 45000); + } uint32 FallAsleepTimer; void Reset() override { - FallAsleepTimer = urand(10000, 45000); + Initialize(); } void MoveInLineOfSight(Unit* who) override diff --git a/src/server/scripts/Kalimdor/zone_durotar.cpp b/src/server/scripts/Kalimdor/zone_durotar.cpp index a1df70522a8..e2f8dd0854d 100644 --- a/src/server/scripts/Kalimdor/zone_durotar.cpp +++ b/src/server/scripts/Kalimdor/zone_durotar.cpp @@ -51,7 +51,17 @@ public: struct npc_lazy_peonAI : public ScriptedAI { - npc_lazy_peonAI(Creature* creature) : ScriptedAI(creature) { } + npc_lazy_peonAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + PlayerGUID = 0; + RebuffTimer = 0; + work = false; + } uint64 PlayerGUID; @@ -60,9 +70,7 @@ public: void Reset() override { - PlayerGUID = 0; - RebuffTimer = 0; - work = false; + Initialize(); } void MovementInform(uint32 /*type*/, uint32 id) override @@ -360,6 +368,13 @@ class npc_troll_volunteer : public CreatureScript { npc_troll_volunteerAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); + _mountModel = 0; + } + + void Initialize() + { + _complete = false; } void InitializeAI() override @@ -391,7 +406,7 @@ class npc_troll_volunteer : public CreatureScript void Reset() override { - _complete = false; + Initialize(); me->AddAura(SPELL_VOLUNTEER_AURA, me); me->AddAura(SPELL_MOUNTING_CHECK, me); DoCast(me, SPELL_PETACT_AURA); diff --git a/src/server/scripts/Kalimdor/zone_moonglade.cpp b/src/server/scripts/Kalimdor/zone_moonglade.cpp index 0c07d5dc6df..268db8da779 100644 --- a/src/server/scripts/Kalimdor/zone_moonglade.cpp +++ b/src/server/scripts/Kalimdor/zone_moonglade.cpp @@ -298,9 +298,20 @@ public: public: npc_clintar_spiritAI(Creature* creature) : npc_escortAI(creature) { + Initialize(); PlayerGUID = 0; } + void Initialize() + { + Step = 0; + CurrWP = 0; + EventTimer = 0; + PlayerGUID = 0; + checkPlayerTimer = 1000; + EventOnWait = false; + } + uint8 Step; uint32 CurrWP; uint32 EventTimer; @@ -313,14 +324,7 @@ public: void Reset() override { if (!PlayerGUID) - { - Step = 0; - CurrWP = 0; - EventTimer = 0; - PlayerGUID = 0; - checkPlayerTimer = 1000; - EventOnWait = false; - } + Initialize(); } void IsSummonedBy(Unit* /*summoner*/) override diff --git a/src/server/scripts/Kalimdor/zone_mulgore.cpp b/src/server/scripts/Kalimdor/zone_mulgore.cpp index fa35371f3f2..289d7282ac6 100644 --- a/src/server/scripts/Kalimdor/zone_mulgore.cpp +++ b/src/server/scripts/Kalimdor/zone_mulgore.cpp @@ -62,7 +62,19 @@ public: struct npc_kyle_frenziedAI : public ScriptedAI { - npc_kyle_frenziedAI(Creature* creature) : ScriptedAI(creature) { } + npc_kyle_frenziedAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + EventActive = false; + IsMovingToLunch = false; + PlayerGUID = 0; + EventTimer = 5000; + EventPhase = 0; + } bool EventActive; bool IsMovingToLunch; @@ -72,11 +84,7 @@ public: void Reset() override { - EventActive = false; - IsMovingToLunch = false; - PlayerGUID = 0; - EventTimer = 5000; - EventPhase = 0; + Initialize(); if (me->GetEntry() == NPC_KYLE_FRIENDLY) me->UpdateEntry(NPC_KYLE_FRENZIED); @@ -235,7 +243,17 @@ public: struct npc_plains_visionAI : public ScriptedAI { - npc_plains_visionAI(Creature* creature) : ScriptedAI(creature) { } + npc_plains_visionAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + WayPointId = 0; + newWaypoint = true; + amountWP = 49; + } bool newWaypoint; uint8 WayPointId; @@ -243,9 +261,7 @@ public: void Reset() override { - WayPointId = 0; - newWaypoint = true; - amountWP = 49; + Initialize(); } void EnterCombat(Unit* /*who*/) override { } diff --git a/src/server/scripts/Kalimdor/zone_orgrimmar.cpp b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp index 5ae50ff7c8e..fd666b7fcd7 100644 --- a/src/server/scripts/Kalimdor/zone_orgrimmar.cpp +++ b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp @@ -64,7 +64,19 @@ public: struct npc_shenthulAI : public ScriptedAI { - npc_shenthulAI(Creature* creature) : ScriptedAI(creature) { } + npc_shenthulAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + CanTalk = false; + CanEmote = false; + SaluteTimer = 6000; + ResetTimer = 0; + PlayerGUID = 0; + } bool CanTalk; bool CanEmote; @@ -74,11 +86,7 @@ public: void Reset() override { - CanTalk = false; - CanEmote = false; - SaluteTimer = 6000; - ResetTimer = 0; - PlayerGUID = 0; + Initialize(); } void EnterCombat(Unit* /*who*/) override { } @@ -211,15 +219,23 @@ public: struct npc_thrall_warchiefAI : public ScriptedAI { - npc_thrall_warchiefAI(Creature* creature) : ScriptedAI(creature) { } + npc_thrall_warchiefAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + ChainLightningTimer = 2000; + ShockTimer = 8000; + } uint32 ChainLightningTimer; uint32 ShockTimer; void Reset() override { - ChainLightningTimer = 2000; - ShockTimer = 8000; + Initialize(); } void EnterCombat(Unit* /*who*/) override { } diff --git a/src/server/scripts/Kalimdor/zone_silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp index 3ddf97c164d..55f36779145 100644 --- a/src/server/scripts/Kalimdor/zone_silithus.cpp +++ b/src/server/scripts/Kalimdor/zone_silithus.cpp @@ -422,7 +422,23 @@ public: struct npc_anachronos_the_ancientAI : public ScriptedAI { - npc_anachronos_the_ancientAI(Creature* creature) : ScriptedAI(creature) { } + npc_anachronos_the_ancientAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + AnimationTimer = 1500; + AnimationCount = 0; + AnachronosQuestTriggerGUID = 0; + MerithraGUID = 0; + ArygosGUID = 0; + CaelestraszGUID = 0; + FandralGUID = 0; + PlayerGUID = 0; + eventEnd = false; + } uint32 AnimationTimer; uint8 AnimationCount; @@ -437,15 +453,7 @@ public: void Reset() override { - AnimationTimer = 1500; - AnimationCount = 0; - AnachronosQuestTriggerGUID = 0; - MerithraGUID = 0; - ArygosGUID = 0; - CaelestraszGUID = 0; - FandralGUID = 0; - PlayerGUID = 0; - eventEnd = false; + Initialize(); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -750,7 +758,22 @@ public: struct npc_qiraj_war_spawnAI : public ScriptedAI { - npc_qiraj_war_spawnAI(Creature* creature) : ScriptedAI(creature) { } + npc_qiraj_war_spawnAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + SpellTimer1 = 0; + SpellTimer2 = 0; + SpellTimer3 = 0; + SpellTimer4 = 0; + } + + void Initialize() + { + MobGUID = 0; + PlayerGUID = 0; + Timers = false; + hasTarget = false; + } uint64 MobGUID; uint64 PlayerGUID; @@ -760,10 +783,7 @@ public: void Reset() override { - MobGUID = 0; - PlayerGUID = 0; - Timers = false; - hasTarget = false; + Initialize(); } void EnterCombat(Unit* /*who*/) override { } @@ -863,7 +883,24 @@ public: struct npc_anachronos_quest_triggerAI : public ScriptedAI { - npc_anachronos_quest_triggerAI(Creature* creature) : ScriptedAI(creature) { } + npc_anachronos_quest_triggerAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + PlayerGUID = 0; + + WaveTimer = 2000; + AnnounceTimer = 1000; + LiveCount = 0; + WaveCount = 0; + + EventStarted = false; + Announced = false; + Failed = false; + } uint64 PlayerGUID; @@ -879,16 +916,7 @@ public: void Reset() override { - PlayerGUID = 0; - - WaveTimer = 2000; - AnnounceTimer = 1000; - LiveCount = 0; - WaveCount = 0; - - EventStarted = false; - Announced = false; - Failed = false; + Initialize(); me->SetVisible(false); } diff --git a/src/server/scripts/Kalimdor/zone_tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp index 23e8e2f26ff..fce0608faaf 100644 --- a/src/server/scripts/Kalimdor/zone_tanaris.cpp +++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp @@ -64,7 +64,21 @@ public: struct npc_aquementasAI : public ScriptedAI { - npc_aquementasAI(Creature* creature) : ScriptedAI(creature) { } + npc_aquementasAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + SendItemTimer = 0; + SwitchFactionTimer = 10000; + + isFriendly = true; + + AquaJetTimer = 5000; + FrostShockTimer = 1000; + } uint32 SendItemTimer; uint32 SwitchFactionTimer; @@ -75,13 +89,8 @@ public: void Reset() override { - SendItemTimer = 0; - SwitchFactionTimer = 10000; + Initialize(); me->setFaction(35); - isFriendly = true; - - AquaJetTimer = 5000; - FrostShockTimer = 1000; } void SendItem(Unit* receiver) @@ -526,7 +535,19 @@ public: struct npc_toogaAI : public FollowerAI { - npc_toogaAI(Creature* creature) : FollowerAI(creature) { } + npc_toogaAI(Creature* creature) : FollowerAI(creature) + { + Initialize(); + } + + void Initialize() + { + CheckSpeechTimer = 2500; + PostEventTimer = 1000; + PhasePostEvent = 0; + + TortaGUID = 0; + } uint32 CheckSpeechTimer; uint32 PostEventTimer; @@ -536,11 +557,7 @@ public: void Reset() override { - CheckSpeechTimer = 2500; - PostEventTimer = 1000; - PhasePostEvent = 0; - - TortaGUID = 0; + Initialize(); } void MoveInLineOfSight(Unit* who) override diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp index b158422054f..ced964048c2 100644 --- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp +++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp @@ -200,9 +200,17 @@ public: { npc_taskmaster_fizzuleAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); factionNorm = creature->getFaction(); } + void Initialize() + { + IsFriend = false; + ResetTimer = 120000; + FlareCount = 0; + } + uint32 factionNorm; bool IsFriend; uint32 ResetTimer; @@ -210,9 +218,7 @@ public: void Reset() override { - IsFriend = false; - ResetTimer = 120000; - FlareCount = 0; + Initialize(); me->setFaction(factionNorm); } @@ -314,20 +320,12 @@ public: struct npc_twiggy_flatheadAI : public ScriptedAI { - npc_twiggy_flatheadAI(Creature* creature) : ScriptedAI(creature) { } + npc_twiggy_flatheadAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } - bool EventInProgress; - bool EventGrate; - bool EventBigWill; - bool ChallengerDown[6]; - uint8 Wave; - uint32 WaveTimer; - uint32 ChallengerChecker; - uint64 PlayerGUID; - uint64 AffrayChallenger[6]; - uint64 BigWill; - - void Reset() override + void Initialize() { EventInProgress = false; EventGrate = false; @@ -345,6 +343,22 @@ public: BigWill = 0; } + bool EventInProgress; + bool EventGrate; + bool EventBigWill; + bool ChallengerDown[6]; + uint8 Wave; + uint32 WaveTimer; + uint32 ChallengerChecker; + uint64 PlayerGUID; + uint64 AffrayChallenger[6]; + uint64 BigWill; + + void Reset() override + { + Initialize(); + } + void MoveInLineOfSight(Unit* who) override { if (!who || !who->IsAlive() || EventInProgress) diff --git a/src/server/scripts/Kalimdor/zone_thousand_needles.cpp b/src/server/scripts/Kalimdor/zone_thousand_needles.cpp index b36037d9995..9092d4e06e5 100644 --- a/src/server/scripts/Kalimdor/zone_thousand_needles.cpp +++ b/src/server/scripts/Kalimdor/zone_thousand_needles.cpp @@ -324,14 +324,23 @@ public: struct npc_pluckyAI : public ScriptedAI { - npc_pluckyAI(Creature* creature) : ScriptedAI(creature) { NormFaction = creature->getFaction(); } + npc_pluckyAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + NormFaction = creature->getFaction(); + } + + void Initialize() + { + ResetTimer = 120000; + } uint32 NormFaction; uint32 ResetTimer; void Reset() override { - ResetTimer = 120000; + Initialize(); if (me->getFaction() != NormFaction) me->setFaction(NormFaction); diff --git a/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp b/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp index 3b303ffa463..40b68270c9d 100644 --- a/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp +++ b/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp @@ -79,7 +79,19 @@ public: struct npc_cairne_bloodhoofAI : public ScriptedAI { - npc_cairne_bloodhoofAI(Creature* creature) : ScriptedAI(creature) { } + npc_cairne_bloodhoofAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + BerserkerChargeTimer = 30000; + CleaveTimer = 5000; + MortalStrikeTimer = 10000; + ThunderclapTimer = 15000; + UppercutTimer = 10000; + } uint32 BerserkerChargeTimer; uint32 CleaveTimer; @@ -89,11 +101,7 @@ public: void Reset() override { - BerserkerChargeTimer = 30000; - CleaveTimer = 5000; - MortalStrikeTimer = 10000; - ThunderclapTimer = 15000; - UppercutTimer = 10000; + Initialize(); } void EnterCombat(Unit* /*who*/) override { } diff --git a/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp b/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp index a1e4467e9fb..ea4c743b8a5 100644 --- a/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp +++ b/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp @@ -77,7 +77,15 @@ public: struct npc_ameAI : public npc_escortAI { - npc_ameAI(Creature* creature) : npc_escortAI(creature) { } + npc_ameAI(Creature* creature) : npc_escortAI(creature) + { + Initialize(); + } + + void Initialize() + { + DemoralizingShoutTimer = 5000; + } uint32 DemoralizingShoutTimer; @@ -112,7 +120,7 @@ public: void Reset() override { - DemoralizingShoutTimer = 5000; + Initialize(); } void JustSummoned(Creature* summoned) override @@ -194,7 +202,18 @@ public: struct npc_ringoAI : public FollowerAI { - npc_ringoAI(Creature* creature) : FollowerAI(creature) { } + npc_ringoAI(Creature* creature) : FollowerAI(creature) + { + Initialize(); + } + + void Initialize() + { + FaintTimer = urand(30000, 60000); + EndEventProgress = 0; + EndEventTimer = 1000; + SpraggleGUID = 0; + } uint32 FaintTimer; uint32 EndEventProgress; @@ -204,10 +223,7 @@ public: void Reset() override { - FaintTimer = urand(30000, 60000); - EndEventProgress = 0; - EndEventTimer = 1000; - SpraggleGUID = 0; + Initialize(); } void MoveInLineOfSight(Unit* who) override diff --git a/src/server/scripts/Kalimdor/zone_winterspring.cpp b/src/server/scripts/Kalimdor/zone_winterspring.cpp index 11b720ad8d5..58d9b115398 100644 --- a/src/server/scripts/Kalimdor/zone_winterspring.cpp +++ b/src/server/scripts/Kalimdor/zone_winterspring.cpp @@ -317,7 +317,17 @@ public: npc_ranshallaAI(Creature* creature) : npc_escortAI(creature), DialogueHelper(introDialogue) { - Reset(); + Initialize(); + _firstPriestessGUID = 0; + _secondPriestessGUID = 0; + _guardEluneGUID = 0; + _voiceEluneGUID = 0; + _altarGUID = 0; + } + + void Initialize() + { + _delayTimer = 0; } uint32 _delayTimer; @@ -330,7 +340,7 @@ public: void Reset() override { - _delayTimer = 0; + Initialize(); } // Called when the player activates the torch / altar diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp index d4dc5efb6d5..79449723a16 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp @@ -61,13 +61,21 @@ class boss_elder_nadox : public CreatureScript struct boss_elder_nadoxAI : public BossAI { - boss_elder_nadoxAI(Creature* creature) : BossAI(creature, DATA_ELDER_NADOX) { } + boss_elder_nadoxAI(Creature* creature) : BossAI(creature, DATA_ELDER_NADOX) + { + Initialize(); + } + + void Initialize() + { + GuardianSummoned = false; + GuardianDied = false; + } void Reset() override { _Reset(); - GuardianSummoned = false; - GuardianDied = false; + Initialize(); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp index 1c042f4d185..b200a4e9825 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp @@ -63,9 +63,19 @@ public: { boss_volazjAI(Creature* creature) : ScriptedAI(creature), Summons(me) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + uiMindFlayTimer = 8 * IN_MILLISECONDS; + uiShadowBoltVolleyTimer = 5 * IN_MILLISECONDS; + uiShiverTimer = 15 * IN_MILLISECONDS; + // Used for Insanity handling + insanityHandled = 0; + } + InstanceScript* instance; uint32 uiMindFlayTimer; @@ -145,17 +155,13 @@ public: void Reset() override { - uiMindFlayTimer = 8*IN_MILLISECONDS; - uiShadowBoltVolleyTimer = 5*IN_MILLISECONDS; - uiShiverTimer = 15*IN_MILLISECONDS; + Initialize(); instance->SetBossState(DATA_HERALD_VOLAZJ, NOT_STARTED); instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_QUICK_DEMISE_START_EVENT); // Visible for all players in insanity me->SetPhaseMask((1|16|32|64|128|256), true); - // Used for Insanity handling - insanityHandled = 0; ResetPlayersPhaseMask(); diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp index 905761ce359..7ae8730d57b 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp @@ -64,11 +64,27 @@ public: { boss_jedoga_shadowseekerAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); bFirstTime = true; bPreDone = false; } + void Initialize() + { + uiOpFerTimer = urand(15 * IN_MILLISECONDS, 20 * IN_MILLISECONDS); + + uiCycloneTimer = 3 * IN_MILLISECONDS; + uiBoltTimer = 7 * IN_MILLISECONDS; + uiThunderTimer = 12 * IN_MILLISECONDS; + + bOpFerok = false; + bOpFerokFail = false; + bOnGround = false; + bCanDown = false; + volunteerWork = true; + } + InstanceScript* instance; uint32 uiOpFerTimer; @@ -86,17 +102,7 @@ public: void Reset() override { - uiOpFerTimer = urand(15*IN_MILLISECONDS, 20*IN_MILLISECONDS); - - uiCycloneTimer = 3*IN_MILLISECONDS; - uiBoltTimer = 7*IN_MILLISECONDS; - uiThunderTimer = 12*IN_MILLISECONDS; - - bOpFerok = false; - bOpFerokFail = false; - bOnGround = false; - bCanDown = false; - volunteerWork = true; + Initialize(); if (!bFirstTime) instance->SetBossState(DATA_JEDOGA_SHADOWSEEKER, FAIL); @@ -331,9 +337,16 @@ public: { npc_jedoga_initiandAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + bWalking = false; + bCheckTimer = 2 * IN_MILLISECONDS; + } + InstanceScript* instance; uint32 bCheckTimer; @@ -342,8 +355,7 @@ public: void Reset() override { - bWalking = false; - bCheckTimer = 2*IN_MILLISECONDS; + Initialize(); if (instance->GetBossState(DATA_JEDOGA_SHADOWSEEKER) != IN_PROGRESS) { diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp index bf5855c3318..49d0840f08a 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp @@ -87,7 +87,29 @@ public: { boss_anub_arakAI(Creature* creature) : ScriptedAI(creature), Summons(me) { + Initialize(); instance = creature->GetInstanceScript(); + GuardianSummoned = false; + VenomancerSummoned = false; + DatterSummoned = false; + UndergroundTimer = 0; + VenomancerTimer = 0; + DatterTimer = 0; + DelayTimer = 0; + ImpaleTarget = 0; + } + + void Initialize() + { + CarrionBeetlesTimer = 8 * IN_MILLISECONDS; + LeechingSwarmTimer = 20 * IN_MILLISECONDS; + ImpaleTimer = 9 * IN_MILLISECONDS; + PoundTimer = 15 * IN_MILLISECONDS; + + Phase = PHASE_MELEE; + UndergroundPhase = 0; + Channeling = false; + ImpalePhase = IMPALE_PHASE_TARGET; } InstanceScript* instance; @@ -101,7 +123,6 @@ public: uint32 CarrionBeetlesTimer; uint32 LeechingSwarmTimer; uint32 PoundTimer; - uint32 SubmergeTimer; uint32 UndergroundTimer; uint32 VenomancerTimer; uint32 DatterTimer; @@ -115,15 +136,7 @@ public: void Reset() override { - CarrionBeetlesTimer = 8*IN_MILLISECONDS; - LeechingSwarmTimer = 20*IN_MILLISECONDS; - ImpaleTimer = 9*IN_MILLISECONDS; - PoundTimer = 15*IN_MILLISECONDS; - - Phase = PHASE_MELEE; - UndergroundPhase = 0; - Channeling = false; - ImpalePhase = IMPALE_PHASE_TARGET; + Initialize(); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); me->RemoveAura(SPELL_SUBMERGE); diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp index 10d34be46b6..f8c5c63cf91 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp @@ -54,11 +54,22 @@ public: { boss_hadronoxAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); fMaxDistance = 50.0f; bFirstTime = true; } + void Initialize() + { + uiAcidTimer = urand(10 * IN_MILLISECONDS, 14 * IN_MILLISECONDS); + uiLeechTimer = urand(3 * IN_MILLISECONDS, 9 * IN_MILLISECONDS); + uiPierceTimer = urand(1 * IN_MILLISECONDS, 3 * IN_MILLISECONDS); + uiGrabTimer = urand(15 * IN_MILLISECONDS, 19 * IN_MILLISECONDS); + uiDoorsTimer = urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS); + uiCheckDistanceTimer = 2 * IN_MILLISECONDS; + } + InstanceScript* instance; uint32 uiAcidTimer; @@ -77,12 +88,7 @@ public: me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 9.0f); me->SetFloatValue(UNIT_FIELD_COMBATREACH, 9.0f); - uiAcidTimer = urand(10*IN_MILLISECONDS, 14*IN_MILLISECONDS); - uiLeechTimer = urand(3*IN_MILLISECONDS, 9*IN_MILLISECONDS); - uiPierceTimer = urand(1*IN_MILLISECONDS, 3*IN_MILLISECONDS); - uiGrabTimer = urand(15*IN_MILLISECONDS, 19*IN_MILLISECONDS); - uiDoorsTimer = urand(20*IN_MILLISECONDS, 30*IN_MILLISECONDS); - uiCheckDistanceTimer = 2*IN_MILLISECONDS; + Initialize(); if (instance->GetBossState(DATA_HADRONOX) != DONE && !bFirstTime) instance->SetBossState(DATA_HADRONOX, FAIL); diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp index 4c3ca322574..77ced6acef1 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp @@ -130,14 +130,22 @@ public: struct boss_sartharionAI : public BossAI { - boss_sartharionAI(Creature* creature) : BossAI(creature, DATA_SARTHARION) { } + boss_sartharionAI(Creature* creature) : BossAI(creature, DATA_SARTHARION) + { + Initialize(); + } + + void Initialize() + { + _isBerserk = false; + _isSoftEnraged = false; + _isHardEnraged = false; + drakeCount = 0; + } void Reset() override { - _isBerserk = false; - _isSoftEnraged = false; - _isHardEnraged = false; - drakeCount = 0; + Initialize(); if (me->HasAura(SPELL_TWILIGHT_REVENGE)) me->RemoveAurasDueToSpell(SPELL_TWILIGHT_REVENGE); From 40ed666521e0e671478aa8306ec01e9a25ffc0c9 Mon Sep 17 00:00:00 2001 From: DDuarte Date: Fri, 5 Sep 2014 21:59:55 +0100 Subject: [PATCH 09/12] SQLs: Rename SQLs after recent PR merges --- ...=> 2014_09_05_04_world_trinity_string.sql} | 10 ++++----- ...=> 2014_09_05_05_world_trinity_string.sql} | 22 +++++++++---------- ...xia.sql => 2014_09_05_06_world_onyxia.sql} | 0 3 files changed, 16 insertions(+), 16 deletions(-) rename sql/updates/world/{2014_09_03_01_world_trinity_string.sql => 2014_09_05_04_world_trinity_string.sql} (98%) rename sql/updates/world/{2014_XX_XX_XX_world_trinity_string.sql => 2014_09_05_05_world_trinity_string.sql} (97%) rename sql/updates/world/{2014_09_01_01_world_onyxia.sql => 2014_09_05_06_world_onyxia.sql} (100%) diff --git a/sql/updates/world/2014_09_03_01_world_trinity_string.sql b/sql/updates/world/2014_09_05_04_world_trinity_string.sql similarity index 98% rename from sql/updates/world/2014_09_03_01_world_trinity_string.sql rename to sql/updates/world/2014_09_05_04_world_trinity_string.sql index 0586c31e3d2..f7a7c3d9684 100644 --- a/sql/updates/world/2014_09_03_01_world_trinity_string.sql +++ b/sql/updates/world/2014_09_05_04_world_trinity_string.sql @@ -1,5 +1,5 @@ --- Implements in-game gm message when tickets are completed -SET @LANG_COMMAND_TICKETCOMPLETED := 2030; -DELETE FROM `trinity_string` WHERE `entry` = @LANG_COMMAND_TICKETCOMPLETED; -INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES (@LANG_COMMAND_TICKETCOMPLETED, '|cff00ff00Completed by|r:|cff00ccff %s|r'); - +-- Implements in-game gm message when tickets are completed +SET @LANG_COMMAND_TICKETCOMPLETED := 2030; +DELETE FROM `trinity_string` WHERE `entry` = @LANG_COMMAND_TICKETCOMPLETED; +INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES (@LANG_COMMAND_TICKETCOMPLETED, '|cff00ff00Completed by|r:|cff00ccff %s|r'); + diff --git a/sql/updates/world/2014_XX_XX_XX_world_trinity_string.sql b/sql/updates/world/2014_09_05_05_world_trinity_string.sql similarity index 97% rename from sql/updates/world/2014_XX_XX_XX_world_trinity_string.sql rename to sql/updates/world/2014_09_05_05_world_trinity_string.sql index 172a4bdc381..616a77f36f1 100644 --- a/sql/updates/world/2014_XX_XX_XX_world_trinity_string.sql +++ b/sql/updates/world/2014_09_05_05_world_trinity_string.sql @@ -1,11 +1,11 @@ --- Move cs_misc command output hardcoded strings to DB so they can be localized too -DELETE FROM `trinity_string` WHERE `entry` IN (5030,5035,5039,5040,5041,5042,5043,5044); -INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES -(5030, ''), -(5035, 'No reason'), -(5039, 'Console'), -(5040, 'Character'), -(5041, 'Permanently'), -(5042, 'You are outdoors'), -(5043, 'You are indoors'), -(5044, 'no VMAP available for area info'); +-- Move cs_misc command output hardcoded strings to DB so they can be localized too +DELETE FROM `trinity_string` WHERE `entry` IN (5030,5035,5039,5040,5041,5042,5043,5044); +INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES +(5030, ''), +(5035, 'No reason'), +(5039, 'Console'), +(5040, 'Character'), +(5041, 'Permanently'), +(5042, 'You are outdoors'), +(5043, 'You are indoors'), +(5044, 'no VMAP available for area info'); diff --git a/sql/updates/world/2014_09_01_01_world_onyxia.sql b/sql/updates/world/2014_09_05_06_world_onyxia.sql similarity index 100% rename from sql/updates/world/2014_09_01_01_world_onyxia.sql rename to sql/updates/world/2014_09_05_06_world_onyxia.sql From d6a11924a60219a637580b604a2d3d5a6b613db7 Mon Sep 17 00:00:00 2001 From: Dr-J Date: Fri, 5 Sep 2014 22:10:39 +0100 Subject: [PATCH 10/12] DB/Misc: Fel Crystal Prism * Spawn missing spawns of Fel Crystal Prism http://www.wowhead.com/object=185927 * Script these to be usable to summon demons (needed in order to properly complete a Felwhip for Gahk!) at a cost of 35 Apexis shards * Scripts for the 4 demons * Adjustments to the egg scripts I made earlier have had to add the spell to take reagents to script (even though is meant to be triggered from other spell) but was failing ie not taking reagents. --- sql/updates/world/2014_09_05_07_world_sai.sql | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 sql/updates/world/2014_09_05_07_world_sai.sql diff --git a/sql/updates/world/2014_09_05_07_world_sai.sql b/sql/updates/world/2014_09_05_07_world_sai.sql new file mode 100644 index 00000000000..de4921fd9d4 --- /dev/null +++ b/sql/updates/world/2014_09_05_07_world_sai.sql @@ -0,0 +1,129 @@ +SET @OGUID := 21036; + +-- respawn Fel Crystal Prism (Currently only 1 is spawned) + +DELETE FROM `gameobject` WHERE `id`=185927; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +(@OGUID+0, 185927, 530, 1, 1, 2909.894, 6797.157, 365.7202, 2.391098, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+1, 185927, 530, 1, 1, 2988.61, 7129.965, 368.9746, 1.029743, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+2, 185927, 530, 1, 1, 3080.931, 6914.941, 369.3258, 4.32842, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+3, 185927, 530, 1, 1, 2810.343, 7006.054, 376.0882, 1.151916, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+4, 185927, 530, 1, 1, 1385.925, 7392.285, 371.1215, 0.5585039, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+5, 185927, 530, 1, 1, 1280.611, 7164.499, 377.1786, 5.585054, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+6, 185927, 530, 1, 1, 1616.641, 7207.047, 375.4805, 5.131269, 0, 0, 0, 1, 120, 255, 1), +(@OGUID+9, 185927, 530, 1, 1, 1673.486, 7377.358, 375.558, 1.308995, 0, 0, 0, 1, 120, 255, 1); + +-- SAI for Fel Crystal Prism +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=185927; +DELETE FROM `smart_scripts` WHERE `entryorguid`=185927 AND `source_type`=1; +DELETE FROM `smart_scripts` WHERE `entryorguid` BETWEEN 18592700 AND 18592703 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 +(185927, 1, 0, 1, 62, 0, 100, 0, 8671, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Fel Crystal Prism - On Gossip Option 0 Selected - Store Targetlist'), +(185927, 1, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 85, 40958, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Fel Crystal Prism - On Gossip Option 0 Selected - Invoker Cast Blades Edge Terrace Demon Boss Summon Trigger'), +(185927, 1, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 85, 40962, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Fel Crystal Prism - On Gossip Option 0 Selected - Invoker Cast Blades Edge Terrace Demon Boss Summon Branch'), +(185927, 1, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 87, 18592700, 18592701, 18592702, 18592703, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fel Crystal Prism - On Gossip Option 0 Selected - Run Random Timed Action list'), +(18592700, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 85, 40957, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Fel Crystal Prism - Script 1 - Invoker Cast Blades Edge Terrace Demon Boss Summon 1'), +(18592700, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fel Crystal Prism - Script 1 - Despawn GO'), +(18592700, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Fel Crystal Prism - Script 1 - Close Gossip'), +(18592701, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 85, 40959, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Fel Crystal Prism - Script 2 - Invoker Cast Blades Edge Terrace Demon Boss Summon 2'), +(18592701, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fel Crystal Prism - Script 2 - Despawn GO'), +(18592701, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Fel Crystal Prism - Script 2 - Close Gossip'), +(18592702, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 85, 40960, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Fel Crystal Prism - Script 3 - Invoker Cast Blades Edge Terrace Demon Boss Summon 3'), +(18592702, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fel Crystal Prism - Script 3 - Despawn GO'), +(18592702, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Fel Crystal Prism - Script 3 - Close Gossip'), +(18592703, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 85, 40961, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Fel Crystal Prism - Script 4 - Invoker Cast Blades Edge Terrace Demon Boss Summon 4'), +(18592703, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fel Crystal Prism - Script 4 - Despawn GO'), +(18592703, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Fel Crystal Prism - Script 4 - Close Gossip'); + +-- SAI for Demons +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(22281,23353,23354,23355) AND `source_type`=0; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN(22281,23353,23354,23355); +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 +(22281,0,0,0,11,0,100,0,0,0,0,0,2,14,0,0,0,0,0,1,0,0,0,0,0,0,0,'Galvanoth - On Spawn - Set Faction'), +(22281,0,1,0,9,0,100,0,0,30,8000,11000,11,39139,0,0,0,0,0,7,0,0,0,0,0,0,0,'Galvanoth - On Range - Cast Fel Flamestike'), +(22281,0,2,0,9,0,100,0,0,10,13000,23000,11,38750,0,0,0,0,0,1,0,0,0,0,0,0,0,'Galvanoth - On Range - Cast War Stomp'), +(22281,0,3,0,9,0,100,0,0,5,11000,18000,11,15708,0,0,0,0,0,7,0,0,0,0,0,0,0,'Galvanoth - On Range - Cast Mortal Strike'), +(23353,0,0,0,11,0,100,0,0,0,0,0,2,14,0,0,0,0,0,1,0,0,0,0,0,0,0,'Braxxus - On Spawn - Set Faction'), +(23353,0,1,0,9,0,100,0,0,5,4000,8000,11,41437,0,0,0,0,0,7,0,0,0,0,0,0,0,'Braxxus - On Range - Cast Double Breath'), +(23353,0,2,0,9,0,100,0,0,10,15000,25000,11,41439,2,0,0,0,0,7,0,0,0,0,0,0,0,'Braxxus - On Range - Cast Mangle'), +(23353,0,3,0,0,0,100,0,5000,8000,7000,11000,11,41436,0,0,0,0,0,1,0,0,0,0,0,0,0,'Braxxus - IC - Cast Panic'), +(23354,0,0,0,11,0,100,0,0,0,0,0,2,14,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mo arg Incinerator - On Spawn - Set Faction'), +(23354,0,1,0,9,0,100,0,0,40,5000,8000,11,44431,0,0,0,0,0,7,0,0,0,0,0,0,0,'Mo arg Incinerator - On Range - Cast Acid Geyser'), +(23354,0,2,0,9,0,100,0,10,60,10000,15000,11,36606,0,0,0,0,0,7,0,0,0,0,0,0,0,'Mo arg Incinerator - On Range - Cast Mighty Charge'), +(23354,0,3,0,9,0,100,0,0,5,15000,25000,11,25174,2,0,0,0,0,7,0,0,0,0,0,0,0,'Mo arg Incinerator - On Range - Cast Sundering Cleave'), +(23355,0,0,0,11,0,100,0,0,0,0,0,2,14,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zarcsin - On Spawn - Set Faction'), +(23355,0,1,0,9,0,100,0,0,5,5000,8000,11,41444,0,0,0,0,0,7,0,0,0,0,0,0,0,'Zarcsin - On Range - Cast Fel Flames'), +(23355,0,2,0,2,0,100,1,0,50,5000,8000,11,41447,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zarcsin - 50% HP - Cast Enrage'); + +-- ALL 4 of these should have 100% chance to drop an apexis crystal, this is rolled if in party +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=100 WHERE `entry`IN(22281,23353,23354,23355) AND `item`=32572; +-- Fel Whip to complete quest is meant to have 100% chance to drop if on quest as all comments state you only have to kill 1 demon to complete the quest +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry`IN(22281,23353,23354,23355) AND `item`=32733; + +DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid` IN (185937,185938,185936,185932); +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 +(185937, 1, 0, 1, 62, 0, 100, 0, 8690, 0, 0, 0, 85, 41050, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Furywing\'s Egg - On Gossip Option 0 Selected - Invoker cast Four Dragons: Force Cast - Furywing'), +(185938, 1, 0, 1, 62, 0, 100, 0, 8691, 0, 0, 0, 85, 41052, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Insidion\'s Egg - On Gossip Option 0 Selected - Invoker cast Four Dragons: Force Cast - Insidion'), +(185936, 1, 0, 1, 62, 0, 100, 0, 8689, 0, 0, 0, 85, 41044, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Rivendark\'s Egg - On Gossip Option 0 Selected - Invoker cast Four Dragons: Force Cast - Rivendark'), +(185937, 1, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 85, 41049, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Furywing\'s Egg - On Gossip Option 0 Selected - Invoker Cast Four Dragons: Reagents - Furywing'), +(185938, 1, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 85, 41051, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Insidion\'s Egg - On Gossip Option 0 Selected - Invoker Cast Four Dragons: Reagents - Insidion'), +(185936, 1, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 85, 41045, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Rivendark\'s Egg - On Gossip Option 0 Selected - Invoker Cast Four Dragons: Reagents - Rivendark'), +(185937, 1, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Furywing\'s Egg - On Gossip Option 0 Selected - Close Gossip'), +(185938, 1, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Insidion\'s Egg - On Gossip Option 0 Selected - Close Gossip'), +(185936, 1, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Rivendark\'s Egg - On Gossip Option 0 Selected - Close Gossip'), +(185937, 1, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Furywing\'s Egg - On Gossip Option 0 Selected - Despawn GO'), +(185938, 1, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Insidion\'s Egg - On Gossip Option 0 Selected - Despawn GO'), +(185936, 1, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rivendark\'s Egg - On Gossip Option 0 Selected - Despawn GO'), +(185932, 1, 0, 1, 62, 0, 100, 0, 8685, 0, 0, 0, 85, 41035, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Obsidia\'s Egg - On Gossip Option 0 Selected - Invoker Cast 41035 Four Dragons: Force Cast - Obsidia'), +(185932, 1, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 85, 41036, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Obsidia\'s Egg - On Gossip Option 0 Selected - Invoker Cast Four Dragons: Reagents - Obsidia'), +(185932, 1, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Obsidia\'s Egg - On Gossip Option 0 Selected - Close Gossip'); + +DELETE FROM `event_scripts` WHERE `id` IN(15004,15002); +INSERT INTO `event_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`) VALUES +(15004, 0, 10, 23061, 300000, 0, 2060.6, 7418.53, 391.098, 0), +(15002, 0, 10, 23281, 300000, 0, 4176.5, 5452.21, 291.923, 0), +(15003, 0, 10, 23261, 300000, 0, 3845.31, 5220.04, 295.412, 0); + +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=23282; + +UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry` =23364; +DELETE FROM `smart_scripts` WHERE `entryorguid` =23364 AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` =23282 AND `source_type`=0 AND `id`>4; + +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 +(23364, 0, 0, 1, 11, 0, 100, 0, 0, 0, 0, 0, 11, 15750, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Black Dragon Whelpling - On Spawn - Cast Rookery Whelp Spawn-in Spell'), +(23364, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Black Dragon Whelpling - On Spawn - Say'), +(23364, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 18, 33536, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Black Dragon Whelpling - On Spawn - Set Unit Flags'), +(23364, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 70, 300, 0, 0, 0, 0, 0, 14, 27915, 185932, 0, 0, 0, 0, 0, 'Black Dragon Whelpling - On Spawn - Despawn Obsidia\'s Egg'), +(23364, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 23364, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Black Dragon Whelpling - On Spawn - Start WP'), +(23364, 0, 5, 6, 40, 0, 100, 0, 2, 23364, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 23282, 0, 0, 0, 0, 0, 0, 'Black Dragon Whelpling - On Reached WP2 - Set Data on Obsidia'), +(23364, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Black Dragon Whelpling - Reached WP2 - Despawn'), +(23282, 0, 5, 0, 11, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - On Spawn - Set Unit Flags'), +(23282, 0, 6, 7, 38, 0, 100, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - On Data Set - Say'), +(23282, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 1, 23282, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - On Data Set - Start WP'), +(23282, 0, 8, 9, 40, 0, 100, 0, 1, 23282, 0, 0, 94, 280, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - On Reached WP1 - Set Dynamic Flags'), +(23282, 0, 9, 10, 61, 0, 100, 0, 0, 0, 0, 0, 19, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - On Reached WP1 - Set Unit Flags'), +(23282, 0, 10, 11, 61, 0, 100, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - On Reached WP1 - Set Home Position'), +(23282, 0, 11, 0, 61, 0, 100, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - On Reached WP1 - Set Aggresive'); + +DELETE FROM `creature_text` WHERE `entry` IN(23364,23282); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES +(23364, 0, 0, 'The %s screams out for its mother.', 16, 0, 100, 0, 0, 431, 'Black Dragon Whelpling',21420), +(23282, 0, 0, 'I believe that I shall feast upon both $r and ogre flesh tonight.', 14, 0, 100, 0, 0, 7274, 'Obsidia',21718); + + +DELETE FROM `waypoints` WHERE `entry` IN(23364,23282); + +INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES +(23364, 1,2425.253, 6994.862, 368.0848, 'Black Dragon Whelpling'), +(23364, 2,2424.881, 6998.754, 367.8495, 'Black Dragon Whelpling'), +(23282, 1,2428.085, 6980.77, 369.7684, 'Obsidia'); + +DELETE FROM `event_scripts` WHERE `id` IN(15004,15002,15003,15005); +INSERT INTO `event_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`) VALUES +(15004, 0, 10, 23061, 300000, 0, 2060.6, 7418.53, 391.098, 0), +(15002, 0, 10, 23281, 300000, 0, 4176.5, 5452.21, 291.923, 0), +(15003, 0, 10, 23261, 300000, 0, 3845.31, 5220.04, 295.412, 0), +(15005, 1, 10, 23364, 100000, 0, 2426.954, 7001.479, 367.3824, 0), +(15005, 0, 10, 23282, 300000, 0, 2424.975, 6933.425, 409.5501, 1.43117); From 0b4a2c6ca6df7a53e46782f7814c29f36747b9d6 Mon Sep 17 00:00:00 2001 From: DDuarte Date: Sat, 6 Sep 2014 00:27:04 +0100 Subject: [PATCH 11/12] DB/NPCs: Remove dynamicflags that should not be in the DB Tapped and lootable flags --- sql/updates/world/2014_09_06_00_world_creature_template.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2014_09_06_00_world_creature_template.sql diff --git a/sql/updates/world/2014_09_06_00_world_creature_template.sql b/sql/updates/world/2014_09_06_00_world_creature_template.sql new file mode 100644 index 00000000000..36bed391dd4 --- /dev/null +++ b/sql/updates/world/2014_09_06_00_world_creature_template.sql @@ -0,0 +1,4 @@ +UPDATE `creature_template` SET `dynamicflags`=`dynamicflags` &~ 1; -- lootable +UPDATE `creature_template` SET `dynamicflags`=`dynamicflags` &~ 4; -- tapped +UPDATE `creature_template` SET `dynamicflags`=`dynamicflags` &~ 8; -- tapped by player +UPDATE `creature_template` SET `dynamicflags`=`dynamicflags` &~ 128; -- tapped by threat list From 7f93e1e56e205c974b7644c6efa80fec11a6a78b Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 6 Sep 2014 01:51:53 +0200 Subject: [PATCH 12/12] DB/Creature: Fix hover for "Maiden of Drak'Mar" in 7a04d5ee8276a81156af9fb7ac13521441cb3f36 --- sql/updates/world/2014_09_06_01_world_creature_template.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2014_09_06_01_world_creature_template.sql diff --git a/sql/updates/world/2014_09_06_01_world_creature_template.sql b/sql/updates/world/2014_09_06_01_world_creature_template.sql new file mode 100644 index 00000000000..a78145a174f --- /dev/null +++ b/sql/updates/world/2014_09_06_01_world_creature_template.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `HoverHeight`=1 WHERE `entry`=33273; -- Maiden of Drak'Mar