From 7968d553fc5b4ea577cb480c7650f2fad6256f5b Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 22 Oct 2023 10:19:10 +0800 Subject: [PATCH 01/65] Ashbringer event timers and coordinates use sniffing data --- .../instance_scarlet_monastery.cpp | 380 ++++++++++++------ 1 file changed, 249 insertions(+), 131 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index edfa3fb6e7ed3c..8e6cde4805b98c 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -23,20 +23,25 @@ enum AshbringerEventMisc { - AURA_OF_ASHBRINGER = 28282, - NPC_SCARLET_MYRIDON = 4295, - NPC_SCARLET_DEFENDER = 4298, - NPC_SCARLET_CENTURION = 4301, - NPC_SCARLET_SORCERER = 4294, - NPC_SCARLET_WIZARD = 4300, - NPC_SCARLET_ABBOT = 4303, - NPC_SCARLET_MONK = 4540, - NPC_SCARLET_CHAMPION = 4302, - NPC_SCARLET_CHAPLAIN = 4299, - NPC_FAIRBANKS = 4542, - NPC_COMMANDER_MOGRAINE = 3976, - NPC_INQUISITOR_WHITEMANE = 3977, - DOOR_HIGH_INQUISITOR_ID = 104600, + ABE_ffect_000 = 28441, + AURA_OF_ASHBRINGER = 28282, + + NPC_SCARLET_MYRIDON = 4295, + NPC_SCARLET_DEFENDER = 4298, + NPC_SCARLET_CENTURION = 4301, + NPC_SCARLET_SORCERER = 4294, + NPC_SCARLET_WIZARD = 4300, + NPC_SCARLET_ABBOT = 4303, + NPC_SCARLET_MONK = 4540, + NPC_SCARLET_CHAMPION = 4302, + NPC_SCARLET_CHAPLAIN = 4299, + NPC_FAIRBANKS = 4542, + + NPC_COMMANDER_MOGRAINE = 3976, + NPC_INQUISITOR_WHITEMANE = 3977, + DOOR_CHAPEL = 104591, + DOOR_HIGH_INQUISITOR_ID = 104600, + TALK_MOGRAINE_ASHBRBINGER_INTRO = 6, }; enum DataTypes @@ -71,48 +76,6 @@ class instance_scarlet_monastery : public InstanceMapScript SetHeaders(DataHeader); } - void OnPlayerEnter(Player* player) override - { - if (player->HasAura(AURA_OF_ASHBRINGER)) - { - std::list ScarletList; - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_MYRIDON, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_DEFENDER, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CENTURION, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_SORCERER, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_WIZARD, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_ABBOT, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_MONK, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CHAMPION, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CHAPLAIN, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_COMMANDER_MOGRAINE, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_FAIRBANKS, 4000.0f); - if (!ScarletList.empty()) - for (std::list::iterator itr = ScarletList.begin(); itr != ScarletList.end(); itr++) (*itr)->SetFaction(FACTION_FRIENDLY); - } - } - - void OnPlayerAreaUpdate(Player* player, uint32 /*oldArea*/, uint32 /*newArea*/) override - { - if (player->HasAura(AURA_OF_ASHBRINGER)) - { - std::list ScarletList; - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_MYRIDON, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_DEFENDER, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CENTURION, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_SORCERER, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_WIZARD, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_ABBOT, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_MONK, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CHAMPION, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CHAPLAIN, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_COMMANDER_MOGRAINE, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_FAIRBANKS, 4000.0f); - if (!ScarletList.empty()) - for (std::list::iterator itr = ScarletList.begin(); itr != ScarletList.end(); itr++) (*itr)->SetFaction(FACTION_FRIENDLY); - } - } - void OnGameObjectCreate(GameObject* go) override { switch (go->GetEntry()) @@ -121,6 +84,8 @@ class instance_scarlet_monastery : public InstanceMapScript case DOOR_HIGH_INQUISITOR_ID: DoorHighInquisitorGUID = go->GetGUID(); break; + default: + break; } } @@ -134,6 +99,8 @@ class instance_scarlet_monastery : public InstanceMapScript case NPC_INQUISITOR_WHITEMANE: WhitemaneGUID = creature->GetGUID(); break; + default: + break; } } @@ -158,6 +125,8 @@ class instance_scarlet_monastery : public InstanceMapScript case DATA_HORSEMAN_EVENT: encounter = data; break; + default: + break; } } @@ -171,9 +140,10 @@ class instance_scarlet_monastery : public InstanceMapScript return WhitemaneGUID; case DATA_DOOR_WHITEMANE: return DoorHighInquisitorGUID; + default: + return ObjectGuid::Empty; + break; } - - return ObjectGuid::Empty; } uint32 GetData(uint32 type) const override @@ -192,17 +162,97 @@ class instance_scarlet_monastery : public InstanceMapScript }; }; + + + +class at_scarlet_monastery_cathedral_entrance : public OnlyOnceAreaTriggerScript +{ +public: + at_scarlet_monastery_cathedral_entrance() : OnlyOnceAreaTriggerScript("at_scarlet_monastery_cathedral_entrance") {} + + bool _OnTrigger(Player* player, AreaTrigger const* /*trigger*/) override + { + if (InstanceScript* instance = player->GetInstanceScript()) + { + if (player->HasAura(AURA_OF_ASHBRINGER)) + { + Creature* commanderMograine = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_MOGRAINE)); + if (commanderMograine) + { + std::list ScarletList; + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_MYRIDON, 4000.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_DEFENDER, 4000.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CENTURION, 4000.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_SORCERER, 4000.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_WIZARD, 4000.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_ABBOT, 4000.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_MONK, 4000.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CHAMPION, 4000.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CHAPLAIN, 4000.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_FAIRBANKS, 4000.0f); + + + ScarletList.push_back(commanderMograine); + + if (!ScarletList.empty()) + { + for (Creature* itr : ScarletList) + { + itr->SetFaction(FACTION_FRIENDLY); + } + } + if (commanderMograine->IsAlive()) + commanderMograine->AI()->Talk(TALK_MOGRAINE_ASHBRBINGER_INTRO); + + if (GameObject* chapelDoor = player->FindNearestGameObject(DOOR_CHAPEL, 4000.0f)) + { + + //instance->DoUseDoorOrButton(chapelDoor->GetGUID());//Received //https://github.com/azerothcore/azerothcore-wotlk/commit/2779833768bbe9967006d6d16888dace05b4bcb6 Impact The door cannot be opened + chapelDoor->SetGoState(GO_STATE_ACTIVE); + chapelDoor->SetLootState(GO_ACTIVATED); + chapelDoor->SetGameObjectFlag(GO_FLAG_IN_USE); + } + return true; + } + } + } + return false; + } +}; + enum ScarletMonasteryTrashMisc { SAY_WELCOME = 0, AURA_ASHBRINGER = 28282, - //FACTION_FRIENDLY_TO_ALL = 35, - NPC_HIGHLORD_MOGRAINE = 16440, + NPC_HIGHLORD_MOGRAINE = 16062, + NPC_HIGHLORD_MOGRAINE_MOD = 16180, SPELL_COSMETIC_CHAIN = 45537, SPELL_COSMETIC_EXPLODE = 45935, SPELL_FORGIVENESS = 28697, }; +enum AshbringerEvent +{ + EVENT_MOGRAINE_FACING_PLAYER = 1, + EVENT_MOGRAINE_KNEEL, + EVENT_MOGRAINE_EMOTE_TALK3, + EVENT_SUMMONED_HIGHLORD_MOGRAINE, + EVENT_HIGHLORD_MOGRAINE_MOVE_STOP, + EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE, + EVENT_MOGRAINE_UNIT_STAND_STATE_STAND, + EVENT_MOGRAINE_EMOTE_TALK4, + EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK, + EVENT_HIGHLORD_MOGRAINE_EMOTE1, + EVENT_HIGHLORD_MOGRAINE_EMOTE2, + EVENT_HIGHLORD_MOGRAINE_EMOTE3, + EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2, + EVENT_MOGRAINE_EMOTE_TALK5, + EVENT_HIGHLORD_MOGRAINE_CASTSPELL, + EVENT_MOGRAINE_CASTSPELL, + EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, + EVENT_ASHBRINGER_OVER +}; + enum MograineEvents { EVENT_SPELL_CRUSADER_STRIKE = 1, @@ -232,7 +282,13 @@ enum Spells SPELL_DOMINATE_MIND = 14515, SPELL_HOLY_SMITE = 9481, SPELL_HEAL = 12039, - SPELL_POWER_WORD_SHIELD = 22187 + SPELL_POWER_WORD_SHIELD = 22187, + + // Highlord Mograine Spells + SPELL_MOGRAINE_COMETH_DND = 28688, + + // SPELL_TRANSFORM_GHOST + SPELL_TRANSFORM_GHOST = 28443 }; enum Says @@ -262,63 +318,108 @@ class npc_mograine : public CreatureScript instance = creature->GetInstanceScript(); } - uint32 AshbringerEvent(uint32 uiSteps) + void AshbringerEvent(uint32 eventId) { - Creature* mograine = me->FindNearestCreature(NPC_HIGHLORD_MOGRAINE, 200.0f); + Creature* summonedMograine = me->FindNearestCreature(NPC_HIGHLORD_MOGRAINE, 100.0f); - switch (uiSteps) + switch (eventId) { - case 1: - me->GetMotionMaster()->MovePoint(0, 1152.039795f, 1398.405518f, 32.527878f); - return 2 * IN_MILLISECONDS; - case 2: + case EVENT_MOGRAINE_FACING_PLAYER: + me->SetFacingToObject(playerWhoStartedAshbringer); + events.ScheduleEvent(EVENT_MOGRAINE_KNEEL, 1s, 3s); + break; + case EVENT_MOGRAINE_KNEEL: me->SetSheath(SHEATH_STATE_UNARMED); me->SetStandState(UNIT_STAND_STATE_KNEEL); - return 2 * IN_MILLISECONDS; - case 3: - Talk(3); - return 10 * IN_MILLISECONDS; - case 4: - me->SummonCreature(NPC_HIGHLORD_MOGRAINE, 1065.130737f, 1399.350586f, 30.763723f, 6.282961f, TEMPSUMMON_TIMED_DESPAWN, 400000)->SetName("Highlord Mograine"); - me->FindNearestCreature(NPC_HIGHLORD_MOGRAINE, 200.0f)->SetFaction(FACTION_FRIENDLY); - return 30 * IN_MILLISECONDS; - case 5: - mograine->StopMovingOnCurrentPos(); - mograine->AI()->Talk(0); - mograine->HandleEmoteCommand(EMOTE_ONESHOT_POINT); - return 4 * IN_MILLISECONDS; - case 6: + events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK3, 1s, 2s); + break; + case EVENT_MOGRAINE_EMOTE_TALK3: + Talk(3, playerWhoStartedAshbringer); + break; + case EVENT_SUMMONED_HIGHLORD_MOGRAINE: + // 03/29/2023 00:13:49.658 Number: 6862 + if (Creature* summonedMograine = me->SummonCreature(NPC_HIGHLORD_MOGRAINE, 1033.4642f, 1399.1022f, 27.337427f, 6.257956981658935546f, TEMPSUMMON_TIMED_DESPAWN, 120000)) + { + // 03/29/2023 00:13:49.658 + summonedMograine->SetFaction(FACTION_FRIENDLY); + summonedMograine->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, EQUIP_UNEQUIP); + summonedMograine->SetSpeed(MOVE_WALK, 1.0f); + summonedMograine->SetDisplayId(NPC_HIGHLORD_MOGRAINE_MOD);// + summonedMograine->setActive(true); + summonedMograine->CastSpell(summonedMograine, SPELL_MOGRAINE_COMETH_DND, false); // Sniffing data shows the use of this spell transformation, but the dispersion effect of this spell is not seen in the video + } + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_MOVE_STOP, 48546ms); + break; + case EVENT_HIGHLORD_MOGRAINE_MOVE_STOP: + summonedMograine->StopMovingOnCurrentPos(); + // 03/29/2023 00:14:38.204 + // 25 OneShotPoint + summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_POINT); + // 03/29/2023 00:14:38.418 + summonedMograine->AI()->Talk(0, 214ms); + events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE, 3024ms); + break; + case EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE: + // 03/29/2023 00:14:41.442 + me->SetFacingToObject(summonedMograine); + events.ScheduleEvent(EVENT_MOGRAINE_UNIT_STAND_STATE_STAND, 403ms); + break; + case EVENT_MOGRAINE_UNIT_STAND_STATE_STAND: me->SetStandState(UNIT_STAND_STATE_STAND); - return 2 * IN_MILLISECONDS; - case 7: - Talk(4); - return 4 * IN_MILLISECONDS; - case 8: - mograine->AI()->Talk(1); - return 11 * IN_MILLISECONDS; - case 9: - mograine->HandleEmoteCommand(EMOTE_ONESHOT_BATTLE_ROAR); - return 4 * IN_MILLISECONDS; - case 10: + me->SetSheath(SHEATH_STATE_MELEE); + events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK4, 809ms); + break; + case EVENT_MOGRAINE_EMOTE_TALK4: + me->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); + me->AI()->Talk(4, 209ms); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK, 4636ms); + break; + case EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK: + summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); + summonedMograine->AI()->Talk(1, me, 10ms); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE1, 3429ms); + break; + case EVENT_HIGHLORD_MOGRAINE_EMOTE1: + summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE2, 3236ms); + break; + case EVENT_HIGHLORD_MOGRAINE_EMOTE2: + summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_POINT); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE3, 3243ms); + break; + case EVENT_HIGHLORD_MOGRAINE_EMOTE3: + summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2, 3232ms); + break; + case EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2: + me->SetFacingToObject(summonedMograine); + events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK5, 1210ms); + break; + case EVENT_MOGRAINE_EMOTE_TALK5: me->SetSheath(SHEATH_STATE_UNARMED); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - Talk(5); - return 2 * IN_MILLISECONDS; - case 11: - mograine->CastSpell(me, SPELL_FORGIVENESS, false); - return 1 * IN_MILLISECONDS; - case 12: - mograine->CastSpell(me, SPELL_COSMETIC_CHAIN, true); - return 0.5 * IN_MILLISECONDS; - case 13: - mograine->AI()->Talk(2); - mograine->DespawnOrUnsummon(3 * IN_MILLISECONDS); - mograine->Kill(me, me, true); - return 0; + me->HandleEmoteCommand(EMOTE_ONESHOT_BEG); + me->AI()->Talk(5, 214ms); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_CASTSPELL, 3022ms); + break; + case EVENT_HIGHLORD_MOGRAINE_CASTSPELL: + summonedMograine->CastSpell(me, SPELL_FORGIVENESS, false); + //events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 1010ms); + events.ScheduleEvent(EVENT_MOGRAINE_CASTSPELL, 1000ms); // case 14 hack fix time + break; + case EVENT_MOGRAINE_CASTSPELL: + // Hack fix The lightning effect of mograine being hit by a spell + me->CastSpell(me, SPELL_COSMETIC_EXPLODE, false); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 100ms); + break; + case EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE: + Unit::Kill(me, me, true); + summonedMograine->AI()->Talk(2, 2764ms); + instance->SetData(DATA_MOGRAINE, DONE); + summonedMograine->DespawnOrUnsummon(6190); + me->setActive(false); + break; default: - if(mograine) - mograine->DespawnOrUnsummon(0); - return 0; + break; } } @@ -350,6 +451,12 @@ class npc_mograine : public CreatureScript hasDied = false; heal = false; fakeDeath = false; + me->setActive(false); + if (Creature* summonedMograine = me->FindNearestCreature(NPC_HIGHLORD_MOGRAINE, 100.0f)) + { + summonedMograine->setActive(false); + summonedMograine->DespawnOrUnsummon(); + } events.Reset(); } @@ -412,7 +519,7 @@ class npc_mograine : public CreatureScript Talk(SAY_MO_KILL); } - void SpellHit(Unit* /*who*/, SpellInfo const* spell) override + void SpellHit(Unit* who, SpellInfo const* spell) override { //When hit with resurrection say text if (spell->Id == SPELL_SCARLET_RESURRECTION) @@ -421,21 +528,32 @@ class npc_mograine : public CreatureScript fakeDeath = false; instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); } + + if (who && spell->Id == ABE_ffect_000 && !SayAshbringer) + { + me->SetFaction(FACTION_FRIENDLY); + me->GetMotionMaster()->MoveIdle(); + playerWhoStartedAshbringer = who->ToPlayer(); + // Standing delay inside the cathedral + SayAshbringer = true; + me->setActive(true); + events.ScheduleEvent(EVENT_MOGRAINE_FACING_PLAYER, 0ms); + events.ScheduleEvent(EVENT_SUMMONED_HIGHLORD_MOGRAINE, 20ms); + } } void UpdateAI(uint32 diff) override { - timer = timer - diff; - if (SayAshbringer && step < 15) + if (SayAshbringer) { - if (timer <= 0) + events.Update(diff); + while (uint32 eventId = events.ExecuteEvent()) { - timer = AshbringerEvent(step); - step++; + AshbringerEvent(eventId); } } - if (!UpdateVictim()) + if (!UpdateVictim() || SayAshbringer) return; if (hasDied && !heal && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) @@ -489,9 +607,10 @@ class npc_mograine : public CreatureScript bool SayAshbringer = false; int timer = 0; int step = 1; - bool hasDied; - bool heal; - bool fakeDeath; + bool hasDied=false; + bool heal=false; + bool fakeDeath=false; + Player* playerWhoStartedAshbringer = nullptr; EventMap events; InstanceScript* instance; }; @@ -658,21 +777,20 @@ class npc_fairbanks : public CreatureScript SayAshbringer = false; } - void MoveInLineOfSight(Unit* who) override + void SpellHit(Unit* who, SpellInfo const* spell) override { - if (who && who->GetDistance2d(me) < 2.0f) - if (Player* player = who->ToPlayer()) - if (player->HasAura(AURA_ASHBRINGER) && !SayAshbringer) - { + if (who && spell->Id == ABE_ffect_000 && !SayAshbringer) { + me->SetFaction(FACTION_FRIENDLY); - me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); - me->CastSpell(me, 57767, true); + me->SetFacingToObject(who); + //There is a delay in sniffing 1615ms + me->CastSpell(me, SPELL_TRANSFORM_GHOST); //The sniffer uses this spell, but without the visual effect of the spell, using spell 57767 as a visual effect instead + me->CastSpell(me, 57767, true);// + //delay 10ms me->SetDisplayId(16179); - me->SetFacingToObject(player); + me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); SayAshbringer = true; - } - - SmartAI::MoveInLineOfSight(who); + } } private: bool SayAshbringer = false; From 094d85b9579eb61d6cc82f0084a8745ec1d34780 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 22 Oct 2023 10:27:36 +0800 Subject: [PATCH 02/65] Add data in SQL --- .../rev_1697941424465768700.sql | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1697941424465768700.sql diff --git a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql new file mode 100644 index 00000000000000..2f529dc817cf3c --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql @@ -0,0 +1,57 @@ +-- 28282 is buff +DELETE +FROM `spell_custom_attr` +WHERE `spell_id` = 28282; +INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES (28282, 67108864); + +-- It takes time to open the door with a key in Blizzard servers +UPDATE `gameobject_template_addon` SET `flags` = 34 +WHERE (`entry` = 104591); + +-- Scarlet Commander Mograine say-- +DELETE +FROM `creature_text` +WHERE `CreatureID`=3976; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES + (3976, 0, 0, 'Infidels! They must be purified!', 14, 0, 100, 0, 0, 5835, 2847, 0, 'mograine SAY_MO_AGGRO'), + (3976, 1, 0, 'Unworthy.', 14, 0, 100, 0, 0, 5836, 6197, 0, 'mograine SAY_MO_KILL'), + (3976, 2, 0, 'At your side, milady!', 14, 0, 100, 0, 0, 5837, 18026, 0, 'mograine SAY_MO_RESSURECTED'), + (3976, 3, 0, 'You hold my father\'s blade, $n. My soldiers are yours TO control, my $g Lord:Lady;. Take them... LEAD them... The impure must be purged. They must be cleansed of their taint.', 12, 0, 100, 1, 0, 0, 12390, 0, 'mograine SAY_ASHBRINGER_ONE'), + (3976, 4, 0, 'Father... But... How?', 12, 0, 100, 6, 0, 0, 12470, 0, 'mograine SAY_ASHBRINGER_TWO'), + (3976, 5, 0, 'Forgive me, father! Please...', 12, 0, 100, 20, 0, 0, 12472, 0, 'mograine SAY_ASHBRINGER_THREE'), + (3976, 6, 0, 'Bow down! Kneel BEFORE the Ashbringer! A NEW dawn approaches, brothers AND sisters! Our message will be delivered TO the filth of this world through the chosen one!', 14, 0, 100, 0, 0, 0, 12389, 3, 'Ashbringer EVENT intro yell'); + +-- Highlord Mograine --- +-- Highlord Mograine say +DELETE FROM `creature_text` WHERE `CreatureID`=16062; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `Type`, `BroadcastTextId`, `TextRange`, `comment`) VALUES + (16062, 0, 0, 'Renault...', 0, 100, 0, 0, 0, 12, 12469, 0, 'mograine MOGRAINE_ONE'), + (16062, 1, 0, 'Did you think that your betrayal would be forgotten? Lost in the carefully planned cover up of my death? Blood of my blood, the blade felt your cruelty long after my heart had stopped beating. And in death, I knew what you had done. But now, the chains of Kel\'thuzad hold me NO more. I come TO serve justice. I AM ASHBRINGER.', 0, 100, 0, 0, 0, 12, 12471, 0, 'mograine MOGRAINE_TWO'), + (16062, 2, 0, 'You are forgiven...', 0, 100, 0, 0, 0, 12, 12473, 0, 'mograine MOGRAINE_THREE'); + +-- Highlord Mograine smart_scripts--- +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 16062; +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 16062); +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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(16062, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 0, 0, 53, 0, 16062, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine Transform - Just_Summoned - Start Waypoint (No Repeat)'), +(16062, 0, 1, 0, 40, 0, 100, 0, 12, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 3976, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine Transform - On Waypoint 5 Reached - Set Rooted On'); + + + +-- The coordinates of the movement sniffed +DELETE +FROM `waypoints` +WHERE `entry`=16062; +INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `point_comment`) VALUES +(16062, 1, 1033.4642, 1399.1022, 27.337427, NULL, 0, 'Ashbringer Event Move Points'), +(16062, 2, 1034.9252, 1399.0653, 27.393204, NULL, 0, 'Ashbringer Event Move Points'), +(16062, 3, 1036.3861, 1399.0284, 27.44898, NULL, 0, 'Ashbringer Event Move Points'), +(16062, 4, 1045.484, 1398.7991, 27.448977, NULL, 0, 'Ashbringer Event Move Points'), +(16062, 5, 1059.524, 1399.0273, 28.271557, NULL, 0, 'Ashbringer Event Move Points'), +(16062, 6, 1068.8096, 1399.2064, 30.7867, NULL, 0, 'Ashbringer Event Move Points'), +(16062, 7, 1086.6564, 1399.2048, 30.44898, NULL, 0, 'Ashbringer Event Move Points'), +(16062, 8, 1101.5681, 1399.3694, 30.485447, NULL, 0, 'Ashbringer Event Move Points'), +(16062, 9, 1116.6019, 1399.4752, 30.485447, NULL, 0, 'Ashbringer Event Move Points'), +(16062, 10, 1129.5881, 1399.2926, 30.524086, NULL, 0, 'Ashbringer Event Move Points'), +(16062, 11, 1149.4045, 1399.0231, 32.528877, NULL, 0, 'Ashbringer Event Move Points'), +(16062, 12, 1150.3911, 1398.723, 32.54613, NULL, 0, 'Ashbringer Event Move Points'); \ No newline at end of file From a18d496d6d1373dc8f8baebfeca00a2836e25189 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 22 Oct 2023 10:30:56 +0800 Subject: [PATCH 03/65] The time to remove the sniff --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 8e6cde4805b98c..9fc7bd924f0b68 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -352,15 +352,11 @@ class npc_mograine : public CreatureScript break; case EVENT_HIGHLORD_MOGRAINE_MOVE_STOP: summonedMograine->StopMovingOnCurrentPos(); - // 03/29/2023 00:14:38.204 - // 25 OneShotPoint summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_POINT); - // 03/29/2023 00:14:38.418 summonedMograine->AI()->Talk(0, 214ms); events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE, 3024ms); break; case EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE: - // 03/29/2023 00:14:41.442 me->SetFacingToObject(summonedMograine); events.ScheduleEvent(EVENT_MOGRAINE_UNIT_STAND_STATE_STAND, 403ms); break; From 15f88090b5acb5d16fc94bac1000793a1cebdcff Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 22 Oct 2023 10:36:13 +0800 Subject: [PATCH 04/65] Add a trigger --- .../pending_db_world/rev_1697941424465768700.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql index 2f529dc817cf3c..3c8a21ad2f0b06 100644 --- a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql +++ b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql @@ -8,6 +8,20 @@ INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES (28282, 671088 UPDATE `gameobject_template_addon` SET `flags` = 34 WHERE (`entry` = 104591); + +-- Add a trigger for Ashbringer events Fire once after approaching +DELETE +FROM `areatrigger_scripts` +WHERE `entry` = 4089; +INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES + (4089, 'at_scarlet_monastery_cathedral_entrance'); +DELETE +FROM `areatrigger` +WHERE `entry`=4089; +INSERT INTO `areatrigger` (`entry`, `map`, `x`, `y`, `z`, `radius`, `length`, `width`, `height`, `orientation`) VALUES + (4089, 189, 864.623, 1321.6, 18.0683, 5, 0, 0, 0, 0); + + -- Scarlet Commander Mograine say-- DELETE FROM `creature_text` From e2160cf5a6488d2eaea6f00a80d43c59c3ea85b0 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 22 Oct 2023 10:53:59 +0800 Subject: [PATCH 05/65] Just trigger the event with ABE_ffect_000 spell --- .../instance_scarlet_monastery.cpp | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 9fc7bd924f0b68..6e01c218c2b964 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -454,24 +454,7 @@ class npc_mograine : public CreatureScript summonedMograine->DespawnOrUnsummon(); } events.Reset(); - } - - void MoveInLineOfSight(Unit* who) override - { - if (who && who->GetDistance2d(me) < 15.0f) - if (Player* player = who->ToPlayer()) - if (player->HasAura(AURA_ASHBRINGER) && !SayAshbringer) - { - me->SetFaction(FACTION_FRIENDLY); - me->SetSheath(SHEATH_STATE_UNARMED); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->SetFacingToObject(player); - // me->Yell(12389, LANG_UNIVERSAL, player); // Doesn't exist - SayAshbringer = true; - } - - ScriptedAI::MoveInLineOfSight(who); - } + } void JustEngagedWith(Unit* /*who*/) override { @@ -804,4 +787,5 @@ void AddSC_instance_scarlet_monastery() new npc_fairbanks(); new npc_mograine(); new boss_high_inquisitor_whitemane(); + new at_scarlet_monastery_cathedral_entrance(); } From e6de517b17982c1aeeb4a65610fec9cf29a5c22e Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 22 Oct 2023 10:58:47 +0800 Subject: [PATCH 06/65] Add comments --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 6e01c218c2b964..c3f3fa07746971 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -756,6 +756,8 @@ class npc_fairbanks : public CreatureScript SayAshbringer = false; } + + //Ready to move to SmartAI void SpellHit(Unit* who, SpellInfo const* spell) override { if (who && spell->Id == ABE_ffect_000 && !SayAshbringer) { From 97de19aed4ce5b58f77d0761155f09f781021a12 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 22 Oct 2023 11:30:53 +0800 Subject: [PATCH 07/65] Remove extra spaces --- .../instance_scarlet_monastery.cpp | 404 +++++++++--------- 1 file changed, 202 insertions(+), 202 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index c3f3fa07746971..3ff9cc34bf7d8a 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -46,17 +46,17 @@ enum AshbringerEventMisc enum DataTypes { - TYPE_MOGRAINE_AND_WHITE_EVENT = 1, + TYPE_MOGRAINE_AND_WHITE_EVENT = 1, - DATA_MOGRAINE = 2, - DATA_WHITEMANE = 3, - DATA_DOOR_WHITEMANE = 4, + DATA_MOGRAINE = 2, + DATA_WHITEMANE = 3, + DATA_DOOR_WHITEMANE = 4, - DATA_HORSEMAN_EVENT = 5, - GAMEOBJECT_PUMPKIN_SHRINE = 6, + DATA_HORSEMAN_EVENT = 5, + GAMEOBJECT_PUMPKIN_SHRINE = 6, - DATA_VORREL = 7, - DATA_ARCANIST_DOAN = 8 + DATA_VORREL = 7, + DATA_ARCANIST_DOAN = 8 }; class instance_scarlet_monastery : public InstanceMapScript @@ -81,11 +81,11 @@ class instance_scarlet_monastery : public InstanceMapScript switch (go->GetEntry()) { //case ENTRY_PUMPKIN_SHRINE: PumpkinShrineGUID = go->GetGUID(); break; - case DOOR_HIGH_INQUISITOR_ID: - DoorHighInquisitorGUID = go->GetGUID(); - break; - default: - break; + case DOOR_HIGH_INQUISITOR_ID: + DoorHighInquisitorGUID = go->GetGUID(); + break; + default: + break; } } @@ -93,40 +93,40 @@ class instance_scarlet_monastery : public InstanceMapScript { switch (creature->GetEntry()) { - case NPC_COMMANDER_MOGRAINE: - MograineGUID = creature->GetGUID(); - break; - case NPC_INQUISITOR_WHITEMANE: - WhitemaneGUID = creature->GetGUID(); - break; - default: - break; + case NPC_COMMANDER_MOGRAINE: + MograineGUID = creature->GetGUID(); + break; + case NPC_INQUISITOR_WHITEMANE: + WhitemaneGUID = creature->GetGUID(); + break; + default: + break; } } void SetData(uint32 type, uint32 data) override { - switch(type) + switch (type) { - case TYPE_MOGRAINE_AND_WHITE_EVENT: - if (data == IN_PROGRESS) - { - DoUseDoorOrButton(DoorHighInquisitorGUID); - encounter = IN_PROGRESS; - } - if (data == FAIL) - { - DoUseDoorOrButton(DoorHighInquisitorGUID); - encounter = FAIL; - } - if (data == SPECIAL) - encounter = SPECIAL; - break; - case DATA_HORSEMAN_EVENT: - encounter = data; - break; - default: - break; + case TYPE_MOGRAINE_AND_WHITE_EVENT: + if (data == IN_PROGRESS) + { + DoUseDoorOrButton(DoorHighInquisitorGUID); + encounter = IN_PROGRESS; + } + if (data == FAIL) + { + DoUseDoorOrButton(DoorHighInquisitorGUID); + encounter = FAIL; + } + if (data == SPECIAL) + encounter = SPECIAL; + break; + case DATA_HORSEMAN_EVENT: + encounter = data; + break; + default: + break; } } @@ -134,15 +134,15 @@ class instance_scarlet_monastery : public InstanceMapScript { switch (type) { - case DATA_MOGRAINE: - return MograineGUID; - case DATA_WHITEMANE: - return WhitemaneGUID; - case DATA_DOOR_WHITEMANE: - return DoorHighInquisitorGUID; - default: - return ObjectGuid::Empty; - break; + case DATA_MOGRAINE: + return MograineGUID; + case DATA_WHITEMANE: + return WhitemaneGUID; + case DATA_DOOR_WHITEMANE: + return DoorHighInquisitorGUID; + default: + return ObjectGuid::Empty; + break; } } @@ -206,7 +206,7 @@ class at_scarlet_monastery_cathedral_entrance : public OnlyOnceAreaTriggerScript if (GameObject* chapelDoor = player->FindNearestGameObject(DOOR_CHAPEL, 4000.0f)) { - + //instance->DoUseDoorOrButton(chapelDoor->GetGUID());//Received //https://github.com/azerothcore/azerothcore-wotlk/commit/2779833768bbe9967006d6d16888dace05b4bcb6 Impact The door cannot be opened chapelDoor->SetGoState(GO_STATE_ACTIVE); chapelDoor->SetLootState(GO_ACTIVATED); @@ -255,34 +255,34 @@ enum AshbringerEvent enum MograineEvents { - EVENT_SPELL_CRUSADER_STRIKE = 1, - EVENT_SPELL_HAMMER_OF_JUSTICE = 2, - EVENT_PULL_CATHEDRAL = 3 + EVENT_SPELL_CRUSADER_STRIKE = 1, + EVENT_SPELL_HAMMER_OF_JUSTICE = 2, + EVENT_PULL_CATHEDRAL = 3 }; enum WhitemaneEvents { - EVENT_SPELL_HOLY_SMITE = 1, - EVENT_SPELL_POWER_WORLD_SHIELD = 2, - EVENT_SPELL_HEAL = 3 + EVENT_SPELL_HOLY_SMITE = 1, + EVENT_SPELL_POWER_WORLD_SHIELD = 2, + EVENT_SPELL_HEAL = 3 }; enum Spells { //Mograine Spells - SPELL_CRUSADER_STRIKE = 14518, - SPELL_HAMMER_OF_JUSTICE = 5589, - SPELL_LAY_ON_HANDS = 9257, - SPELL_RETRIBUTION_AURA = 8990, - SPELL_PERMANENT_FEIGN_DEATH = 29266, + SPELL_CRUSADER_STRIKE = 14518, + SPELL_HAMMER_OF_JUSTICE = 5589, + SPELL_LAY_ON_HANDS = 9257, + SPELL_RETRIBUTION_AURA = 8990, + SPELL_PERMANENT_FEIGN_DEATH = 29266, //Whitemanes Spells - SPELL_SCARLET_RESURRECTION = 9232, - SPELL_DEEP_SLEEP = 9256, - SPELL_DOMINATE_MIND = 14515, - SPELL_HOLY_SMITE = 9481, - SPELL_HEAL = 12039, - SPELL_POWER_WORD_SHIELD = 22187, + SPELL_SCARLET_RESURRECTION = 9232, + SPELL_DEEP_SLEEP = 9256, + SPELL_DOMINATE_MIND = 14515, + SPELL_HOLY_SMITE = 9481, + SPELL_HEAL = 12039, + SPELL_POWER_WORD_SHIELD = 22187, // Highlord Mograine Spells SPELL_MOGRAINE_COMETH_DND = 28688, @@ -294,17 +294,17 @@ enum Spells enum Says { //Mograine says - SAY_MO_AGGRO = 0, - SAY_MO_KILL = 1, - SAY_MO_RESURRECTED = 2, + SAY_MO_AGGRO = 0, + SAY_MO_KILL = 1, + SAY_MO_RESURRECTED = 2, //Whitemane says - SAY_WH_INTRO = 0, - SAY_WH_KILL = 1, - SAY_WH_RESURRECT = 2, + SAY_WH_INTRO = 0, + SAY_WH_KILL = 1, + SAY_WH_RESURRECT = 2, }; -float const CATHEDRAL_PULL_RANGE = 80.0f; // Distance from the Cathedral doors to where Mograine is standing +float const CATHEDRAL_PULL_RANGE = 80.0f; // Distance from the Cathedral doors to where Mograine is standing class npc_mograine : public CreatureScript { @@ -324,98 +324,98 @@ class npc_mograine : public CreatureScript switch (eventId) { - case EVENT_MOGRAINE_FACING_PLAYER: + case EVENT_MOGRAINE_FACING_PLAYER: me->SetFacingToObject(playerWhoStartedAshbringer); events.ScheduleEvent(EVENT_MOGRAINE_KNEEL, 1s, 3s); break; - case EVENT_MOGRAINE_KNEEL: - me->SetSheath(SHEATH_STATE_UNARMED); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK3, 1s, 2s); - break; - case EVENT_MOGRAINE_EMOTE_TALK3: - Talk(3, playerWhoStartedAshbringer); - break; - case EVENT_SUMMONED_HIGHLORD_MOGRAINE: - // 03/29/2023 00:13:49.658 Number: 6862 - if (Creature* summonedMograine = me->SummonCreature(NPC_HIGHLORD_MOGRAINE, 1033.4642f, 1399.1022f, 27.337427f, 6.257956981658935546f, TEMPSUMMON_TIMED_DESPAWN, 120000)) - { - // 03/29/2023 00:13:49.658 - summonedMograine->SetFaction(FACTION_FRIENDLY); - summonedMograine->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, EQUIP_UNEQUIP); - summonedMograine->SetSpeed(MOVE_WALK, 1.0f); - summonedMograine->SetDisplayId(NPC_HIGHLORD_MOGRAINE_MOD);// - summonedMograine->setActive(true); - summonedMograine->CastSpell(summonedMograine, SPELL_MOGRAINE_COMETH_DND, false); // Sniffing data shows the use of this spell transformation, but the dispersion effect of this spell is not seen in the video - } - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_MOVE_STOP, 48546ms); - break; - case EVENT_HIGHLORD_MOGRAINE_MOVE_STOP: - summonedMograine->StopMovingOnCurrentPos(); - summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_POINT); - summonedMograine->AI()->Talk(0, 214ms); - events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE, 3024ms); - break; - case EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE: - me->SetFacingToObject(summonedMograine); - events.ScheduleEvent(EVENT_MOGRAINE_UNIT_STAND_STATE_STAND, 403ms); - break; - case EVENT_MOGRAINE_UNIT_STAND_STATE_STAND: - me->SetStandState(UNIT_STAND_STATE_STAND); - me->SetSheath(SHEATH_STATE_MELEE); - events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK4, 809ms); - break; - case EVENT_MOGRAINE_EMOTE_TALK4: - me->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); - me->AI()->Talk(4, 209ms); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK, 4636ms); - break; - case EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK: - summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); - summonedMograine->AI()->Talk(1, me, 10ms); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE1, 3429ms); - break; - case EVENT_HIGHLORD_MOGRAINE_EMOTE1: - summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE2, 3236ms); - break; - case EVENT_HIGHLORD_MOGRAINE_EMOTE2: - summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_POINT); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE3, 3243ms); - break; - case EVENT_HIGHLORD_MOGRAINE_EMOTE3: - summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2, 3232ms); - break; - case EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2: - me->SetFacingToObject(summonedMograine); - events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK5, 1210ms); - break; - case EVENT_MOGRAINE_EMOTE_TALK5: - me->SetSheath(SHEATH_STATE_UNARMED); - me->HandleEmoteCommand(EMOTE_ONESHOT_BEG); - me->AI()->Talk(5, 214ms); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_CASTSPELL, 3022ms); - break; - case EVENT_HIGHLORD_MOGRAINE_CASTSPELL: - summonedMograine->CastSpell(me, SPELL_FORGIVENESS, false); - //events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 1010ms); - events.ScheduleEvent(EVENT_MOGRAINE_CASTSPELL, 1000ms); // case 14 hack fix time - break; - case EVENT_MOGRAINE_CASTSPELL: - // Hack fix The lightning effect of mograine being hit by a spell - me->CastSpell(me, SPELL_COSMETIC_EXPLODE, false); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 100ms); - break; - case EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE: - Unit::Kill(me, me, true); - summonedMograine->AI()->Talk(2, 2764ms); - instance->SetData(DATA_MOGRAINE, DONE); - summonedMograine->DespawnOrUnsummon(6190); - me->setActive(false); - break; - default: - break; + case EVENT_MOGRAINE_KNEEL: + me->SetSheath(SHEATH_STATE_UNARMED); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK3, 1s, 2s); + break; + case EVENT_MOGRAINE_EMOTE_TALK3: + Talk(3, playerWhoStartedAshbringer); + break; + case EVENT_SUMMONED_HIGHLORD_MOGRAINE: + // 03/29/2023 00:13:49.658 Number: 6862 + if (Creature* summonedMograine = me->SummonCreature(NPC_HIGHLORD_MOGRAINE, 1033.4642f, 1399.1022f, 27.337427f, 6.257956981658935546f, TEMPSUMMON_TIMED_DESPAWN, 120000)) + { + // 03/29/2023 00:13:49.658 + summonedMograine->SetFaction(FACTION_FRIENDLY); + summonedMograine->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, EQUIP_UNEQUIP); + summonedMograine->SetSpeed(MOVE_WALK, 1.0f); + summonedMograine->SetDisplayId(NPC_HIGHLORD_MOGRAINE_MOD);// + summonedMograine->setActive(true); + summonedMograine->CastSpell(summonedMograine, SPELL_MOGRAINE_COMETH_DND, false); // Sniffing data shows the use of this spell transformation, but the dispersion effect of this spell is not seen in the video + } + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_MOVE_STOP, 48546ms); + break; + case EVENT_HIGHLORD_MOGRAINE_MOVE_STOP: + summonedMograine->StopMovingOnCurrentPos(); + summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_POINT); + summonedMograine->AI()->Talk(0, 214ms); + events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE, 3024ms); + break; + case EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE: + me->SetFacingToObject(summonedMograine); + events.ScheduleEvent(EVENT_MOGRAINE_UNIT_STAND_STATE_STAND, 403ms); + break; + case EVENT_MOGRAINE_UNIT_STAND_STATE_STAND: + me->SetStandState(UNIT_STAND_STATE_STAND); + me->SetSheath(SHEATH_STATE_MELEE); + events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK4, 809ms); + break; + case EVENT_MOGRAINE_EMOTE_TALK4: + me->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); + me->AI()->Talk(4, 209ms); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK, 4636ms); + break; + case EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK: + summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); + summonedMograine->AI()->Talk(1, me, 10ms); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE1, 3429ms); + break; + case EVENT_HIGHLORD_MOGRAINE_EMOTE1: + summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE2, 3236ms); + break; + case EVENT_HIGHLORD_MOGRAINE_EMOTE2: + summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_POINT); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE3, 3243ms); + break; + case EVENT_HIGHLORD_MOGRAINE_EMOTE3: + summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2, 3232ms); + break; + case EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2: + me->SetFacingToObject(summonedMograine); + events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK5, 1210ms); + break; + case EVENT_MOGRAINE_EMOTE_TALK5: + me->SetSheath(SHEATH_STATE_UNARMED); + me->HandleEmoteCommand(EMOTE_ONESHOT_BEG); + me->AI()->Talk(5, 214ms); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_CASTSPELL, 3022ms); + break; + case EVENT_HIGHLORD_MOGRAINE_CASTSPELL: + summonedMograine->CastSpell(me, SPELL_FORGIVENESS, false); + //events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 1010ms); + events.ScheduleEvent(EVENT_MOGRAINE_CASTSPELL, 1000ms); // case 14 hack fix time + break; + case EVENT_MOGRAINE_CASTSPELL: + // Hack fix The lightning effect of mograine being hit by a spell + me->CastSpell(me, SPELL_COSMETIC_EXPLODE, false); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 100ms); + break; + case EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE: + Unit::Kill(me, me, true); + summonedMograine->AI()->Talk(2, 2764ms); + instance->SetData(DATA_MOGRAINE, DONE); + summonedMograine->DespawnOrUnsummon(6190); + me->setActive(false); + break; + default: + break; } } @@ -454,7 +454,7 @@ class npc_mograine : public CreatureScript summonedMograine->DespawnOrUnsummon(); } events.Reset(); - } + } void JustEngagedWith(Unit* /*who*/) override { @@ -564,19 +564,19 @@ class npc_mograine : public CreatureScript while (uint32 eventId = events.ExecuteEvent()) { - switch(eventId) + switch (eventId) { - case EVENT_SPELL_CRUSADER_STRIKE: - me->CastSpell(me->GetVictim(), SPELL_CRUSADER_STRIKE, true); - events.ScheduleEvent(EVENT_SPELL_CRUSADER_STRIKE, 10s); - break; - case EVENT_SPELL_HAMMER_OF_JUSTICE: - me->CastSpell(me->GetVictim(), SPELL_HAMMER_OF_JUSTICE, true); - events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 60s); - break; - case EVENT_PULL_CATHEDRAL: - PullCathedral(); - break; + case EVENT_SPELL_CRUSADER_STRIKE: + me->CastSpell(me->GetVictim(), SPELL_CRUSADER_STRIKE, true); + events.ScheduleEvent(EVENT_SPELL_CRUSADER_STRIKE, 10s); + break; + case EVENT_SPELL_HAMMER_OF_JUSTICE: + me->CastSpell(me->GetVictim(), SPELL_HAMMER_OF_JUSTICE, true); + events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 60s); + break; + case EVENT_PULL_CATHEDRAL: + PullCathedral(); + break; } } DoMeleeAttackIfReady(); @@ -586,9 +586,9 @@ class npc_mograine : public CreatureScript bool SayAshbringer = false; int timer = 0; int step = 1; - bool hasDied=false; - bool heal=false; - bool fakeDeath=false; + bool hasDied = false; + bool heal = false; + bool fakeDeath = false; Player* playerWhoStartedAshbringer = nullptr; EventMap events; InstanceScript* instance; @@ -710,17 +710,17 @@ class boss_high_inquisitor_whitemane : public CreatureScript { switch (eventId) { - case EVENT_SPELL_POWER_WORLD_SHIELD: - me->CastSpell(me, SPELL_POWER_WORD_SHIELD, false); - events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 15s); - break; - case EVENT_SPELL_HOLY_SMITE: - me->CastSpell(me->GetVictim(), SPELL_HOLY_SMITE, false); - events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 6s); - break; - case EVENT_SPELL_HEAL: - me->CastSpell(me, SPELL_HEAL, false); - break; + case EVENT_SPELL_POWER_WORLD_SHIELD: + me->CastSpell(me, SPELL_POWER_WORD_SHIELD, false); + events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 15s); + break; + case EVENT_SPELL_HOLY_SMITE: + me->CastSpell(me->GetVictim(), SPELL_HOLY_SMITE, false); + events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 6s); + break; + case EVENT_SPELL_HEAL: + me->CastSpell(me, SPELL_HEAL, false); + break; } } @@ -760,17 +760,17 @@ class npc_fairbanks : public CreatureScript //Ready to move to SmartAI void SpellHit(Unit* who, SpellInfo const* spell) override { - if (who && spell->Id == ABE_ffect_000 && !SayAshbringer) { - - me->SetFaction(FACTION_FRIENDLY); - me->SetFacingToObject(who); - //There is a delay in sniffing 1615ms - me->CastSpell(me, SPELL_TRANSFORM_GHOST); //The sniffer uses this spell, but without the visual effect of the spell, using spell 57767 as a visual effect instead - me->CastSpell(me, 57767, true);// - //delay 10ms - me->SetDisplayId(16179); - me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); - SayAshbringer = true; + if (who && spell->Id == ABE_ffect_000 && !SayAshbringer) + { + me->SetFaction(FACTION_FRIENDLY); + me->SetFacingToObject(who); + //There is a delay in sniffing 1615ms + me->CastSpell(me, SPELL_TRANSFORM_GHOST); //The sniffer uses this spell, but without the visual effect of the spell, using spell 57767 as a visual effect instead + me->CastSpell(me, 57767, true);// + //delay 10ms + me->SetDisplayId(16179); + me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); + SayAshbringer = true; } } private: From bd18df4655a7479dc896dbb49ffa714ef3132675 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 22 Oct 2023 11:34:36 +0800 Subject: [PATCH 08/65] Data already existing in world db is not re-added --- .../updates/pending_db_world/rev_1697941424465768700.sql | 6 ------ 1 file changed, 6 deletions(-) diff --git a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql index 3c8a21ad2f0b06..99a4dc34e20b41 100644 --- a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql +++ b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql @@ -15,12 +15,6 @@ FROM `areatrigger_scripts` WHERE `entry` = 4089; INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES (4089, 'at_scarlet_monastery_cathedral_entrance'); -DELETE -FROM `areatrigger` -WHERE `entry`=4089; -INSERT INTO `areatrigger` (`entry`, `map`, `x`, `y`, `z`, `radius`, `length`, `width`, `height`, `orientation`) VALUES - (4089, 189, 864.623, 1321.6, 18.0683, 5, 0, 0, 0, 0); - -- Scarlet Commander Mograine say-- DELETE From b173f477804b40b7f3dcad27e05b14a3f1c5fdf3 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 22 Oct 2023 11:45:04 +0800 Subject: [PATCH 09/65] Remove spaces --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 3ff9cc34bf7d8a..003a0995047310 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -207,7 +207,8 @@ class at_scarlet_monastery_cathedral_entrance : public OnlyOnceAreaTriggerScript if (GameObject* chapelDoor = player->FindNearestGameObject(DOOR_CHAPEL, 4000.0f)) { - //instance->DoUseDoorOrButton(chapelDoor->GetGUID());//Received //https://github.com/azerothcore/azerothcore-wotlk/commit/2779833768bbe9967006d6d16888dace05b4bcb6 Impact The door cannot be opened + //instance->DoUseDoorOrButton(chapelDoor->GetGUID());//Received + //https://github.com/azerothcore/azerothcore-wotlk/commit/2779833768bbe9967006d6d16888dace05b4bcb6 Impact The door cannot be opened chapelDoor->SetGoState(GO_STATE_ACTIVE); chapelDoor->SetLootState(GO_ACTIVATED); chapelDoor->SetGameObjectFlag(GO_FLAG_IN_USE); From 560926e85ab87136a49688c738c8be217f85fe70 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 22 Oct 2023 11:57:32 +0800 Subject: [PATCH 10/65] emove spaces --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 003a0995047310..64d8c839e4c658 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -338,16 +338,14 @@ class npc_mograine : public CreatureScript Talk(3, playerWhoStartedAshbringer); break; case EVENT_SUMMONED_HIGHLORD_MOGRAINE: - // 03/29/2023 00:13:49.658 Number: 6862 if (Creature* summonedMograine = me->SummonCreature(NPC_HIGHLORD_MOGRAINE, 1033.4642f, 1399.1022f, 27.337427f, 6.257956981658935546f, TEMPSUMMON_TIMED_DESPAWN, 120000)) { - // 03/29/2023 00:13:49.658 summonedMograine->SetFaction(FACTION_FRIENDLY); summonedMograine->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, EQUIP_UNEQUIP); summonedMograine->SetSpeed(MOVE_WALK, 1.0f); - summonedMograine->SetDisplayId(NPC_HIGHLORD_MOGRAINE_MOD);// + summonedMograine->SetDisplayId(NPC_HIGHLORD_MOGRAINE_MOD); summonedMograine->setActive(true); - summonedMograine->CastSpell(summonedMograine, SPELL_MOGRAINE_COMETH_DND, false); // Sniffing data shows the use of this spell transformation, but the dispersion effect of this spell is not seen in the video + summonedMograine->CastSpell(summonedMograine, SPELL_MOGRAINE_COMETH_DND, false);//Sniffing data shows the use of this spell transformation, but the dispersion effect of this spell is not seen in the video } events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_MOVE_STOP, 48546ms); break; @@ -757,7 +755,6 @@ class npc_fairbanks : public CreatureScript SayAshbringer = false; } - //Ready to move to SmartAI void SpellHit(Unit* who, SpellInfo const* spell) override { @@ -766,8 +763,8 @@ class npc_fairbanks : public CreatureScript me->SetFaction(FACTION_FRIENDLY); me->SetFacingToObject(who); //There is a delay in sniffing 1615ms - me->CastSpell(me, SPELL_TRANSFORM_GHOST); //The sniffer uses this spell, but without the visual effect of the spell, using spell 57767 as a visual effect instead - me->CastSpell(me, 57767, true);// + me->CastSpell(me, SPELL_TRANSFORM_GHOST);//The sniffer uses this spell, but without the visual effect of the spell, using spell 57767 as a visual effect instead + me->CastSpell(me, 57767, true); //delay 10ms me->SetDisplayId(16179); me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); From 753a3e8e71822e80ccd399422f2e5510a278670b Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 22 Oct 2023 16:22:28 +0800 Subject: [PATCH 11/65] Delete empty rows --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 64d8c839e4c658..7af001b4766a85 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -162,9 +162,6 @@ class instance_scarlet_monastery : public InstanceMapScript }; }; - - - class at_scarlet_monastery_cathedral_entrance : public OnlyOnceAreaTriggerScript { public: @@ -191,7 +188,6 @@ class at_scarlet_monastery_cathedral_entrance : public OnlyOnceAreaTriggerScript player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CHAPLAIN, 4000.0f); player->GetCreatureListWithEntryInGrid(ScarletList, NPC_FAIRBANKS, 4000.0f); - ScarletList.push_back(commanderMograine); if (!ScarletList.empty()) @@ -285,10 +281,10 @@ enum Spells SPELL_HEAL = 12039, SPELL_POWER_WORD_SHIELD = 22187, - // Highlord Mograine Spells + //Highlord Mograine Spells SPELL_MOGRAINE_COMETH_DND = 28688, - // SPELL_TRANSFORM_GHOST + //SPELL_TRANSFORM_GHOST SPELL_TRANSFORM_GHOST = 28443 }; From 3690ab3d3388d03720e96376309e5917c022db28 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sat, 28 Oct 2023 07:41:05 +0800 Subject: [PATCH 12/65] Narrow down the bio search, because even 4,000 yards doesn't make the library's creatures friendly --- .../instance_scarlet_monastery.cpp | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 7af001b4766a85..0b14d695507c2f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -177,16 +177,16 @@ class at_scarlet_monastery_cathedral_entrance : public OnlyOnceAreaTriggerScript if (commanderMograine) { std::list ScarletList; - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_MYRIDON, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_DEFENDER, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CENTURION, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_SORCERER, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_WIZARD, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_ABBOT, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_MONK, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CHAMPION, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CHAPLAIN, 4000.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_FAIRBANKS, 4000.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_MYRIDON, 400.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_DEFENDER, 400.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CENTURION, 400.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_SORCERER, 400.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_WIZARD, 400.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_ABBOT, 400.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_MONK, 400.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CHAMPION, 400.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CHAPLAIN, 400.0f); + player->GetCreatureListWithEntryInGrid(ScarletList, NPC_FAIRBANKS, 400.0f); ScarletList.push_back(commanderMograine); @@ -200,11 +200,9 @@ class at_scarlet_monastery_cathedral_entrance : public OnlyOnceAreaTriggerScript if (commanderMograine->IsAlive()) commanderMograine->AI()->Talk(TALK_MOGRAINE_ASHBRBINGER_INTRO); - if (GameObject* chapelDoor = player->FindNearestGameObject(DOOR_CHAPEL, 4000.0f)) + if (GameObject* chapelDoor = player->FindNearestGameObject(DOOR_CHAPEL, 250.0f)) { - //instance->DoUseDoorOrButton(chapelDoor->GetGUID());//Received - //https://github.com/azerothcore/azerothcore-wotlk/commit/2779833768bbe9967006d6d16888dace05b4bcb6 Impact The door cannot be opened chapelDoor->SetGoState(GO_STATE_ACTIVE); chapelDoor->SetLootState(GO_ACTIVATED); chapelDoor->SetGameObjectFlag(GO_FLAG_IN_USE); @@ -395,7 +393,7 @@ class npc_mograine : public CreatureScript case EVENT_HIGHLORD_MOGRAINE_CASTSPELL: summonedMograine->CastSpell(me, SPELL_FORGIVENESS, false); //events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 1010ms); - events.ScheduleEvent(EVENT_MOGRAINE_CASTSPELL, 1000ms); // case 14 hack fix time + events.ScheduleEvent(EVENT_MOGRAINE_CASTSPELL, 1000ms); // case 16 hack fix time break; case EVENT_MOGRAINE_CASTSPELL: // Hack fix The lightning effect of mograine being hit by a spell @@ -488,9 +486,10 @@ class npc_mograine : public CreatureScript } } - void KilledUnit(Unit* /*victim*/) override + void KilledUnit(Unit* victim) override { - Talk(SAY_MO_KILL); + if (victim->GetTypeId() == TYPEID_PLAYER && !SayAshbringer) + Talk(SAY_MO_KILL); } void SpellHit(Unit* who, SpellInfo const* spell) override @@ -634,9 +633,10 @@ class boss_high_inquisitor_whitemane : public CreatureScript damage = me->GetHealth() - 1; } - void KilledUnit(Unit* /*victim*/) override + void KilledUnit(Unit* victim) override { - Talk(SAY_WH_KILL); + if (victim->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_WH_KILL); } void UpdateAI(uint32 diff) override From 5d6eb2ef1f1f63fa67fc7e8dcb0ac7f9e5bbe93c Mon Sep 17 00:00:00 2001 From: fangshun Date: Sat, 4 Nov 2023 20:46:20 +0800 Subject: [PATCH 13/65] Instead, use OnTrigger to contact the event Do not use range search to change factions --- .../instance_scarlet_monastery.cpp | 108 +++++++++++------- 1 file changed, 65 insertions(+), 43 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 0b14d695507c2f..dd307e685d5f9a 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -56,7 +56,9 @@ enum DataTypes GAMEOBJECT_PUMPKIN_SHRINE = 6, DATA_VORREL = 7, - DATA_ARCANIST_DOAN = 8 + DATA_ARCANIST_DOAN = 8, + TYPE_ASHBRINGER_EVENT, + DATA_DOOR_CHAPEL, }; class instance_scarlet_monastery : public InstanceMapScript @@ -84,6 +86,9 @@ class instance_scarlet_monastery : public InstanceMapScript case DOOR_HIGH_INQUISITOR_ID: DoorHighInquisitorGUID = go->GetGUID(); break; + case DOOR_CHAPEL: + DoorChapelGUID = go->GetGUID(); + break; default: break; } @@ -93,8 +98,21 @@ class instance_scarlet_monastery : public InstanceMapScript { switch (creature->GetEntry()) { + case NPC_SCARLET_MYRIDON: + case NPC_SCARLET_DEFENDER: + case NPC_SCARLET_CENTURION: + case NPC_SCARLET_SORCERER: + case NPC_SCARLET_WIZARD: + case NPC_SCARLET_ABBOT: + case NPC_SCARLET_MONK: + case NPC_SCARLET_CHAMPION: + case NPC_SCARLET_CHAPLAIN: + case NPC_FAIRBANKS: + AshbringerNpcGUID.emplace(creature->GetGUID()); + break; case NPC_COMMANDER_MOGRAINE: MograineGUID = creature->GetGUID(); + AshbringerNpcGUID.emplace(creature->GetGUID()); break; case NPC_INQUISITOR_WHITEMANE: WhitemaneGUID = creature->GetGUID(); @@ -125,6 +143,22 @@ class instance_scarlet_monastery : public InstanceMapScript case DATA_HORSEMAN_EVENT: encounter = data; break; + case TYPE_ASHBRINGER_EVENT: + if (data == IN_PROGRESS) + { + if (GameObject* go = instance->GetGameObject(DoorChapelGUID)) + { + go->SetGoState(GO_STATE_ACTIVE); + go->SetLootState(GO_ACTIVATED); + go->SetGameObjectFlag(GO_FLAG_IN_USE); + } + for (const auto& scarletCathedralNpcGuid : AshbringerNpcGUID) + if (Creature* scarletNpc = instance->GetCreature(scarletCathedralNpcGuid)) + if (scarletNpc->IsAlive() && !scarletNpc->IsInCombat()) + scarletNpc->SetFaction(FACTION_FRIENDLY); + } + ashencounter = data; + break; default: break; } @@ -140,6 +174,8 @@ class instance_scarlet_monastery : public InstanceMapScript return WhitemaneGUID; case DATA_DOOR_WHITEMANE: return DoorHighInquisitorGUID; + case DATA_DOOR_CHAPEL: + return DoorChapelGUID; default: return ObjectGuid::Empty; break; @@ -148,65 +184,50 @@ class instance_scarlet_monastery : public InstanceMapScript uint32 GetData(uint32 type) const override { - if (type == TYPE_MOGRAINE_AND_WHITE_EVENT) + switch (type) + { + case TYPE_MOGRAINE_AND_WHITE_EVENT: return encounter; - else if (type == DATA_HORSEMAN_EVENT) + break; + case DATA_HORSEMAN_EVENT: return encounter; - return 0; + break; + case TYPE_ASHBRINGER_EVENT: + return ashencounter; + break; + default: + return 0; + break; + } } private: ObjectGuid DoorHighInquisitorGUID; + ObjectGuid DoorChapelGUID; ObjectGuid MograineGUID; ObjectGuid WhitemaneGUID; - uint32 encounter; + uint32 encounter{}; + uint32 ashencounter{}; + std::set AshbringerNpcGUID; }; }; -class at_scarlet_monastery_cathedral_entrance : public OnlyOnceAreaTriggerScript +class at_scarlet_monastery_cathedral_entrance : public AreaTriggerScript { public: - at_scarlet_monastery_cathedral_entrance() : OnlyOnceAreaTriggerScript("at_scarlet_monastery_cathedral_entrance") {} + at_scarlet_monastery_cathedral_entrance() : AreaTriggerScript("at_scarlet_monastery_cathedral_entrance") {} - bool _OnTrigger(Player* player, AreaTrigger const* /*trigger*/) override + bool OnTrigger(Player* player, AreaTrigger const* /*trigger*/) override { - if (InstanceScript* instance = player->GetInstanceScript()) + if (player->HasAura(AURA_OF_ASHBRINGER)) { - if (player->HasAura(AURA_OF_ASHBRINGER)) + if (InstanceScript* instance = player->GetInstanceScript()) { - Creature* commanderMograine = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_MOGRAINE)); - if (commanderMograine) + if (instance->GetData(TYPE_ASHBRINGER_EVENT) == NOT_STARTED) { - std::list ScarletList; - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_MYRIDON, 400.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_DEFENDER, 400.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CENTURION, 400.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_SORCERER, 400.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_WIZARD, 400.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_ABBOT, 400.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_MONK, 400.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CHAMPION, 400.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_SCARLET_CHAPLAIN, 400.0f); - player->GetCreatureListWithEntryInGrid(ScarletList, NPC_FAIRBANKS, 400.0f); - - ScarletList.push_back(commanderMograine); - - if (!ScarletList.empty()) - { - for (Creature* itr : ScarletList) - { - itr->SetFaction(FACTION_FRIENDLY); - } - } + Creature* commanderMograine = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_MOGRAINE)); if (commanderMograine->IsAlive()) commanderMograine->AI()->Talk(TALK_MOGRAINE_ASHBRBINGER_INTRO); - - if (GameObject* chapelDoor = player->FindNearestGameObject(DOOR_CHAPEL, 250.0f)) - { - - chapelDoor->SetGoState(GO_STATE_ACTIVE); - chapelDoor->SetLootState(GO_ACTIVATED); - chapelDoor->SetGameObjectFlag(GO_FLAG_IN_USE); - } + instance->SetData(TYPE_ASHBRINGER_EVENT, IN_PROGRESS); return true; } } @@ -220,7 +241,7 @@ enum ScarletMonasteryTrashMisc SAY_WELCOME = 0, AURA_ASHBRINGER = 28282, NPC_HIGHLORD_MOGRAINE = 16062, - NPC_HIGHLORD_MOGRAINE_MOD = 16180, + MODEL_HIGHLORD_MOGRAINE = 16180, SPELL_COSMETIC_CHAIN = 45537, SPELL_COSMETIC_EXPLODE = 45935, SPELL_FORGIVENESS = 28697, @@ -337,7 +358,7 @@ class npc_mograine : public CreatureScript summonedMograine->SetFaction(FACTION_FRIENDLY); summonedMograine->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, EQUIP_UNEQUIP); summonedMograine->SetSpeed(MOVE_WALK, 1.0f); - summonedMograine->SetDisplayId(NPC_HIGHLORD_MOGRAINE_MOD); + summonedMograine->SetDisplayId(MODEL_HIGHLORD_MOGRAINE); summonedMograine->setActive(true); summonedMograine->CastSpell(summonedMograine, SPELL_MOGRAINE_COMETH_DND, false);//Sniffing data shows the use of this spell transformation, but the dispersion effect of this spell is not seen in the video } @@ -698,6 +719,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript else Heal_Timer -= diff; events.Update(diff); + if (me->HasUnitState(UNIT_STATE_CASTING)) return; From e302dd3c14108db949c63391b6063764848b33ec Mon Sep 17 00:00:00 2001 From: fangshun Date: Wed, 8 Nov 2023 18:51:01 +0800 Subject: [PATCH 14/65] Change the code as required by the audit --- .../instance_scarlet_monastery.cpp | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index dd307e685d5f9a..447f89fb5a2fac 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -207,7 +207,7 @@ class instance_scarlet_monastery : public InstanceMapScript ObjectGuid WhitemaneGUID; uint32 encounter{}; uint32 ashencounter{}; - std::set AshbringerNpcGUID; + GuidSet AshbringerNpcGUID; }; }; @@ -314,6 +314,17 @@ enum Says SAY_MO_KILL = 1, SAY_MO_RESURRECTED = 2, + //Mograine Ashbringer Event says + SAY_MO_AB_TALK3, + SAY_MO_AB_TALK4, + SAY_MO_AB_TALK5, + SAY_MO_AB_TALK6, + + //Highlord Mograine Ashbringer Event Says + SAY_HM_AB_TALK0 = 0, + SAY_HM_AB_TALK1, + SAY_HM_AB_TALK2, + //Whitemane says SAY_WH_INTRO = 0, SAY_WH_KILL = 1, @@ -340,7 +351,7 @@ class npc_mograine : public CreatureScript switch (eventId) { - case EVENT_MOGRAINE_FACING_PLAYER: + case EVENT_MOGRAINE_FACING_PLAYER: me->SetFacingToObject(playerWhoStartedAshbringer); events.ScheduleEvent(EVENT_MOGRAINE_KNEEL, 1s, 3s); break; @@ -350,7 +361,7 @@ class npc_mograine : public CreatureScript events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK3, 1s, 2s); break; case EVENT_MOGRAINE_EMOTE_TALK3: - Talk(3, playerWhoStartedAshbringer); + me->AI()->Talk(SAY_MO_AB_TALK3, playerWhoStartedAshbringer); break; case EVENT_SUMMONED_HIGHLORD_MOGRAINE: if (Creature* summonedMograine = me->SummonCreature(NPC_HIGHLORD_MOGRAINE, 1033.4642f, 1399.1022f, 27.337427f, 6.257956981658935546f, TEMPSUMMON_TIMED_DESPAWN, 120000)) @@ -367,7 +378,7 @@ class npc_mograine : public CreatureScript case EVENT_HIGHLORD_MOGRAINE_MOVE_STOP: summonedMograine->StopMovingOnCurrentPos(); summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_POINT); - summonedMograine->AI()->Talk(0, 214ms); + summonedMograine->AI()->Talk(SAY_HM_AB_TALK0, 214ms); events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE, 3024ms); break; case EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE: @@ -381,12 +392,12 @@ class npc_mograine : public CreatureScript break; case EVENT_MOGRAINE_EMOTE_TALK4: me->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); - me->AI()->Talk(4, 209ms); + me->AI()->Talk(SAY_MO_AB_TALK4, 209ms); events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK, 4636ms); break; case EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK: summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); - summonedMograine->AI()->Talk(1, me, 10ms); + summonedMograine->AI()->Talk(SAY_HM_AB_TALK1, me, 10ms); events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE1, 3429ms); break; case EVENT_HIGHLORD_MOGRAINE_EMOTE1: @@ -408,7 +419,7 @@ class npc_mograine : public CreatureScript case EVENT_MOGRAINE_EMOTE_TALK5: me->SetSheath(SHEATH_STATE_UNARMED); me->HandleEmoteCommand(EMOTE_ONESHOT_BEG); - me->AI()->Talk(5, 214ms); + me->AI()->Talk(SAY_MO_AB_TALK5, 214ms); events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_CASTSPELL, 3022ms); break; case EVENT_HIGHLORD_MOGRAINE_CASTSPELL: @@ -422,8 +433,8 @@ class npc_mograine : public CreatureScript events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 100ms); break; case EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE: - Unit::Kill(me, me, true); - summonedMograine->AI()->Talk(2, 2764ms); + me->KillSelf(); + summonedMograine->AI()->Talk(SAY_HM_AB_TALK2, 2764ms); instance->SetData(DATA_MOGRAINE, DONE); summonedMograine->DespawnOrUnsummon(6190); me->setActive(false); @@ -582,11 +593,11 @@ class npc_mograine : public CreatureScript switch (eventId) { case EVENT_SPELL_CRUSADER_STRIKE: - me->CastSpell(me->GetVictim(), SPELL_CRUSADER_STRIKE, true); + DoCastVictim(SPELL_CRUSADER_STRIKE, true); events.ScheduleEvent(EVENT_SPELL_CRUSADER_STRIKE, 10s); break; case EVENT_SPELL_HAMMER_OF_JUSTICE: - me->CastSpell(me->GetVictim(), SPELL_HAMMER_OF_JUSTICE, true); + DoCastVictim(SPELL_HAMMER_OF_JUSTICE, true); events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 60s); break; case EVENT_PULL_CATHEDRAL: From a25aa075929625cbc2bd43bfbd71f412ccb60ce7 Mon Sep 17 00:00:00 2001 From: fangshun Date: Wed, 8 Nov 2023 18:57:17 +0800 Subject: [PATCH 15/65] Add a judgment --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 447f89fb5a2fac..8ea2bb21809a20 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -225,7 +225,7 @@ class at_scarlet_monastery_cathedral_entrance : public AreaTriggerScript if (instance->GetData(TYPE_ASHBRINGER_EVENT) == NOT_STARTED) { Creature* commanderMograine = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_MOGRAINE)); - if (commanderMograine->IsAlive()) + if (commanderMograine && commanderMograine->IsAlive()) commanderMograine->AI()->Talk(TALK_MOGRAINE_ASHBRBINGER_INTRO); instance->SetData(TYPE_ASHBRINGER_EVENT, IN_PROGRESS); return true; From db91d7432fa9b737c07555ea4e19cd559edd7572 Mon Sep 17 00:00:00 2001 From: fangshun Date: Wed, 8 Nov 2023 19:15:32 +0800 Subject: [PATCH 16/65] Delete unused enums --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 8ea2bb21809a20..871278cdd10d3d 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -318,7 +318,6 @@ enum Says SAY_MO_AB_TALK3, SAY_MO_AB_TALK4, SAY_MO_AB_TALK5, - SAY_MO_AB_TALK6, //Highlord Mograine Ashbringer Event Says SAY_HM_AB_TALK0 = 0, From de74d6a69718830ef0237fd28e55a4d0e006153d Mon Sep 17 00:00:00 2001 From: fangshun Date: Wed, 8 Nov 2023 19:21:38 +0800 Subject: [PATCH 17/65] Remove emoticons in sql, use emoticons in cpp and sniff time --- .../updates/pending_db_world/rev_1697941424465768700.sql | 6 +++--- .../ScarletMonastery/instance_scarlet_monastery.cpp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql index 99a4dc34e20b41..ba3579901addcf 100644 --- a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql +++ b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql @@ -24,9 +24,9 @@ INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Lan (3976, 0, 0, 'Infidels! They must be purified!', 14, 0, 100, 0, 0, 5835, 2847, 0, 'mograine SAY_MO_AGGRO'), (3976, 1, 0, 'Unworthy.', 14, 0, 100, 0, 0, 5836, 6197, 0, 'mograine SAY_MO_KILL'), (3976, 2, 0, 'At your side, milady!', 14, 0, 100, 0, 0, 5837, 18026, 0, 'mograine SAY_MO_RESSURECTED'), - (3976, 3, 0, 'You hold my father\'s blade, $n. My soldiers are yours TO control, my $g Lord:Lady;. Take them... LEAD them... The impure must be purged. They must be cleansed of their taint.', 12, 0, 100, 1, 0, 0, 12390, 0, 'mograine SAY_ASHBRINGER_ONE'), - (3976, 4, 0, 'Father... But... How?', 12, 0, 100, 6, 0, 0, 12470, 0, 'mograine SAY_ASHBRINGER_TWO'), - (3976, 5, 0, 'Forgive me, father! Please...', 12, 0, 100, 20, 0, 0, 12472, 0, 'mograine SAY_ASHBRINGER_THREE'), + (3976, 3, 0, 'You hold my father\'s blade, $n. My soldiers are yours TO control, my $g Lord:Lady;. Take them... LEAD them... The impure must be purged. They must be cleansed of their taint.', 12, 0, 100, 0, 0, 0, 12390, 0, 'mograine SAY_ASHBRINGER_ONE'), + (3976, 4, 0, 'Father... But... How?', 12, 0, 100, 0, 0, 0, 12470, 0, 'mograine SAY_ASHBRINGER_TWO'), + (3976, 5, 0, 'Forgive me, father! Please...', 12, 0, 100, 0, 0, 0, 12472, 0, 'mograine SAY_ASHBRINGER_THREE'), (3976, 6, 0, 'Bow down! Kneel BEFORE the Ashbringer! A NEW dawn approaches, brothers AND sisters! Our message will be delivered TO the filth of this world through the chosen one!', 14, 0, 100, 0, 0, 0, 12389, 3, 'Ashbringer EVENT intro yell'); -- Highlord Mograine --- diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 871278cdd10d3d..aae870a951337b 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -360,7 +360,8 @@ class npc_mograine : public CreatureScript events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK3, 1s, 2s); break; case EVENT_MOGRAINE_EMOTE_TALK3: - me->AI()->Talk(SAY_MO_AB_TALK3, playerWhoStartedAshbringer); + me->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); + me->AI()->Talk(SAY_MO_AB_TALK3, playerWhoStartedAshbringer,43ms); break; case EVENT_SUMMONED_HIGHLORD_MOGRAINE: if (Creature* summonedMograine = me->SummonCreature(NPC_HIGHLORD_MOGRAINE, 1033.4642f, 1399.1022f, 27.337427f, 6.257956981658935546f, TEMPSUMMON_TIMED_DESPAWN, 120000)) From 700f1fb9ec0d36a14272eb95bf75f759ac134c71 Mon Sep 17 00:00:00 2001 From: fangshun Date: Wed, 8 Nov 2023 19:30:43 +0800 Subject: [PATCH 18/65] Fixed the wrong use of emotes --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index aae870a951337b..ac0e11e48e9d86 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -360,7 +360,7 @@ class npc_mograine : public CreatureScript events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK3, 1s, 2s); break; case EVENT_MOGRAINE_EMOTE_TALK3: - me->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); + me->HandleEmoteCommand(EMOTE_ONESHOT_TALK); me->AI()->Talk(SAY_MO_AB_TALK3, playerWhoStartedAshbringer,43ms); break; case EVENT_SUMMONED_HIGHLORD_MOGRAINE: From 7053b7877236513f8bf720adedae9a28a971359e Mon Sep 17 00:00:00 2001 From: fangshun Date: Thu, 9 Nov 2023 18:47:08 +0800 Subject: [PATCH 19/65] Adjust the time of sniffing The modification may be the time of the server's delay --- .../instance_scarlet_monastery.cpp | 51 +++++++++---------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index ac0e11e48e9d86..b6736865676fc7 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -361,7 +361,7 @@ class npc_mograine : public CreatureScript break; case EVENT_MOGRAINE_EMOTE_TALK3: me->HandleEmoteCommand(EMOTE_ONESHOT_TALK); - me->AI()->Talk(SAY_MO_AB_TALK3, playerWhoStartedAshbringer,43ms); + me->AI()->Talk(SAY_MO_AB_TALK3, playerWhoStartedAshbringer); break; case EVENT_SUMMONED_HIGHLORD_MOGRAINE: if (Creature* summonedMograine = me->SummonCreature(NPC_HIGHLORD_MOGRAINE, 1033.4642f, 1399.1022f, 27.337427f, 6.257956981658935546f, TEMPSUMMON_TIMED_DESPAWN, 120000)) @@ -373,70 +373,64 @@ class npc_mograine : public CreatureScript summonedMograine->setActive(true); summonedMograine->CastSpell(summonedMograine, SPELL_MOGRAINE_COMETH_DND, false);//Sniffing data shows the use of this spell transformation, but the dispersion effect of this spell is not seen in the video } - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_MOVE_STOP, 48546ms); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_MOVE_STOP, 48500ms); break; case EVENT_HIGHLORD_MOGRAINE_MOVE_STOP: summonedMograine->StopMovingOnCurrentPos(); summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_POINT); - summonedMograine->AI()->Talk(SAY_HM_AB_TALK0, 214ms); - events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE, 3024ms); + summonedMograine->AI()->Talk(SAY_HM_AB_TALK0, 200ms); + events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE, 3000ms); break; case EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE: me->SetFacingToObject(summonedMograine); - events.ScheduleEvent(EVENT_MOGRAINE_UNIT_STAND_STATE_STAND, 403ms); + events.ScheduleEvent(EVENT_MOGRAINE_UNIT_STAND_STATE_STAND, 400ms); break; case EVENT_MOGRAINE_UNIT_STAND_STATE_STAND: me->SetStandState(UNIT_STAND_STATE_STAND); me->SetSheath(SHEATH_STATE_MELEE); - events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK4, 809ms); + events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK4, 800ms); break; case EVENT_MOGRAINE_EMOTE_TALK4: me->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); - me->AI()->Talk(SAY_MO_AB_TALK4, 209ms); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK, 4636ms); + me->AI()->Talk(SAY_MO_AB_TALK4, 200ms); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK, 4600ms); break; case EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK: summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); - summonedMograine->AI()->Talk(SAY_HM_AB_TALK1, me, 10ms); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE1, 3429ms); + summonedMograine->AI()->Talk(SAY_HM_AB_TALK1, me); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE1, 3400ms); break; case EVENT_HIGHLORD_MOGRAINE_EMOTE1: summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE2, 3236ms); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE2, 3200ms); break; case EVENT_HIGHLORD_MOGRAINE_EMOTE2: summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_POINT); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE3, 3243ms); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE3, 3200ms); break; case EVENT_HIGHLORD_MOGRAINE_EMOTE3: summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2, 3232ms); + events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2, 3200ms); break; case EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2: me->SetFacingToObject(summonedMograine); - events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK5, 1210ms); + events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK5, 1200ms); break; case EVENT_MOGRAINE_EMOTE_TALK5: me->SetSheath(SHEATH_STATE_UNARMED); me->HandleEmoteCommand(EMOTE_ONESHOT_BEG); - me->AI()->Talk(SAY_MO_AB_TALK5, 214ms); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_CASTSPELL, 3022ms); + me->AI()->Talk(SAY_MO_AB_TALK5, 200ms); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_CASTSPELL, 3000ms); break; case EVENT_HIGHLORD_MOGRAINE_CASTSPELL: + //In Blizzard's servers, after "HIGHLORD_MOGRAINE" uses this spell, "MOGRAINE" will have a visual effect of lightning hits, and the visual effect after the hit is missing here and needs to be fixed summonedMograine->CastSpell(me, SPELL_FORGIVENESS, false); - //events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 1010ms); - events.ScheduleEvent(EVENT_MOGRAINE_CASTSPELL, 1000ms); // case 16 hack fix time - break; - case EVENT_MOGRAINE_CASTSPELL: - // Hack fix The lightning effect of mograine being hit by a spell - me->CastSpell(me, SPELL_COSMETIC_EXPLODE, false); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 100ms); - break; + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 1000ms); + break; case EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE: me->KillSelf(); - summonedMograine->AI()->Talk(SAY_HM_AB_TALK2, 2764ms); - instance->SetData(DATA_MOGRAINE, DONE); - summonedMograine->DespawnOrUnsummon(6190); + summonedMograine->AI()->Talk(SAY_HM_AB_TALK2, 2700ms); + summonedMograine->DespawnOrUnsummon(6100); me->setActive(false); break; default: @@ -792,7 +786,8 @@ class npc_fairbanks : public CreatureScript me->SetFaction(FACTION_FRIENDLY); me->SetFacingToObject(who); //There is a delay in sniffing 1615ms - me->CastSpell(me, SPELL_TRANSFORM_GHOST);//The sniffer uses this spell, but without the visual effect of the spell, using spell 57767 as a visual effect instead + //The sniffer uses this spell, but without the visual effect of the spell, using spell 57767 as a visual effect instead + me->CastSpell(me, SPELL_TRANSFORM_GHOST); me->CastSpell(me, 57767, true); //delay 10ms me->SetDisplayId(16179); From 7a763a735b5f0890e06557c7fc7e5df477dd0a41 Mon Sep 17 00:00:00 2001 From: fangshun Date: Thu, 9 Nov 2023 19:04:54 +0800 Subject: [PATCH 20/65] Remove spaces --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index b6736865676fc7..bad6756c26bc63 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -426,7 +426,7 @@ class npc_mograine : public CreatureScript //In Blizzard's servers, after "HIGHLORD_MOGRAINE" uses this spell, "MOGRAINE" will have a visual effect of lightning hits, and the visual effect after the hit is missing here and needs to be fixed summonedMograine->CastSpell(me, SPELL_FORGIVENESS, false); events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 1000ms); - break; + break; case EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE: me->KillSelf(); summonedMograine->AI()->Talk(SAY_HM_AB_TALK2, 2700ms); From a565a1071bdc48aaf3a6621e42fea1870931d54e Mon Sep 17 00:00:00 2001 From: fangshun Date: Mon, 13 Nov 2023 19:48:22 +0800 Subject: [PATCH 21/65] Modify as required --- .../rev_1697941424465768700.sql | 14 +- .../instance_scarlet_monastery.cpp | 505 +++++++++--------- 2 files changed, 256 insertions(+), 263 deletions(-) diff --git a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql index ba3579901addcf..4e70a7810c1acd 100644 --- a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql +++ b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql @@ -24,17 +24,17 @@ INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Lan (3976, 0, 0, 'Infidels! They must be purified!', 14, 0, 100, 0, 0, 5835, 2847, 0, 'mograine SAY_MO_AGGRO'), (3976, 1, 0, 'Unworthy.', 14, 0, 100, 0, 0, 5836, 6197, 0, 'mograine SAY_MO_KILL'), (3976, 2, 0, 'At your side, milady!', 14, 0, 100, 0, 0, 5837, 18026, 0, 'mograine SAY_MO_RESSURECTED'), - (3976, 3, 0, 'You hold my father\'s blade, $n. My soldiers are yours TO control, my $g Lord:Lady;. Take them... LEAD them... The impure must be purged. They must be cleansed of their taint.', 12, 0, 100, 0, 0, 0, 12390, 0, 'mograine SAY_ASHBRINGER_ONE'), - (3976, 4, 0, 'Father... But... How?', 12, 0, 100, 0, 0, 0, 12470, 0, 'mograine SAY_ASHBRINGER_TWO'), - (3976, 5, 0, 'Forgive me, father! Please...', 12, 0, 100, 0, 0, 0, 12472, 0, 'mograine SAY_ASHBRINGER_THREE'), + (3976, 3, 0, 'You hold my father\'s blade, $n. My soldiers are yours TO control, my $g Lord:Lady;. Take them... LEAD them... The impure must be purged. They must be cleansed of their taint.', 12, 0, 100, 1, 0, 0, 12390, 0, 'mograine SAY_ASHBRINGER_ONE'), + (3976, 4, 0, 'Father... But... How?', 12, 0, 100, 6, 0, 0, 12470, 0, 'mograine SAY_ASHBRINGER_TWO'), + (3976, 5, 0, 'Forgive me, father! Please...', 12, 0, 100, 20, 0, 0, 12472, 0, 'mograine SAY_ASHBRINGER_THREE'), (3976, 6, 0, 'Bow down! Kneel BEFORE the Ashbringer! A NEW dawn approaches, brothers AND sisters! Our message will be delivered TO the filth of this world through the chosen one!', 14, 0, 100, 0, 0, 0, 12389, 3, 'Ashbringer EVENT intro yell'); -- Highlord Mograine --- -- Highlord Mograine say DELETE FROM `creature_text` WHERE `CreatureID`=16062; INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `Type`, `BroadcastTextId`, `TextRange`, `comment`) VALUES - (16062, 0, 0, 'Renault...', 0, 100, 0, 0, 0, 12, 12469, 0, 'mograine MOGRAINE_ONE'), - (16062, 1, 0, 'Did you think that your betrayal would be forgotten? Lost in the carefully planned cover up of my death? Blood of my blood, the blade felt your cruelty long after my heart had stopped beating. And in death, I knew what you had done. But now, the chains of Kel\'thuzad hold me NO more. I come TO serve justice. I AM ASHBRINGER.', 0, 100, 0, 0, 0, 12, 12471, 0, 'mograine MOGRAINE_TWO'), + (16062, 0, 0, 'Renault...', 0, 100, 25, 0, 0, 12, 12469, 0, 'mograine MOGRAINE_ONE'), + (16062, 1, 0, 'Did you think that your betrayal would be forgotten? Lost in the carefully planned cover up of my death? Blood of my blood, the blade felt your cruelty long after my heart had stopped beating. And in death, I knew what you had done. But now, the chains of Kel\'thuzad hold me NO more. I come TO serve justice. I AM ASHBRINGER.', 0, 100, 6, 0, 0, 12, 12471, 0, 'mograine MOGRAINE_TWO'), (16062, 2, 0, 'You are forgiven...', 0, 100, 0, 0, 0, 12, 12473, 0, 'mograine MOGRAINE_THREE'); -- Highlord Mograine smart_scripts--- @@ -42,7 +42,7 @@ UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 16062; DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 16062); 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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES (16062, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 0, 0, 53, 0, 16062, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine Transform - Just_Summoned - Start Waypoint (No Repeat)'), -(16062, 0, 1, 0, 40, 0, 100, 0, 12, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 3976, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine Transform - On Waypoint 5 Reached - Set Rooted On'); +(16062, 0, 1, 0, 40, 0, 100, 0, 12, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 3976, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine Transform - On Waypoint 12 Reached - Set Rooted On'); @@ -62,4 +62,4 @@ INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `positi (16062, 9, 1116.6019, 1399.4752, 30.485447, NULL, 0, 'Ashbringer Event Move Points'), (16062, 10, 1129.5881, 1399.2926, 30.524086, NULL, 0, 'Ashbringer Event Move Points'), (16062, 11, 1149.4045, 1399.0231, 32.528877, NULL, 0, 'Ashbringer Event Move Points'), -(16062, 12, 1150.3911, 1398.723, 32.54613, NULL, 0, 'Ashbringer Event Move Points'); \ No newline at end of file +(16062, 12, 1150.3911, 1398.723, 32.54613, NULL, 0, 'Ashbringer Event Move Points'); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index bad6756c26bc63..ba7e77b4803f94 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -57,8 +57,8 @@ enum DataTypes DATA_VORREL = 7, DATA_ARCANIST_DOAN = 8, - TYPE_ASHBRINGER_EVENT, - DATA_DOOR_CHAPEL, + TYPE_ASHBRINGER_EVENT = 9, + DATA_DOOR_CHAPEL = 10, }; class instance_scarlet_monastery : public InstanceMapScript @@ -83,14 +83,14 @@ class instance_scarlet_monastery : public InstanceMapScript switch (go->GetEntry()) { //case ENTRY_PUMPKIN_SHRINE: PumpkinShrineGUID = go->GetGUID(); break; - case DOOR_HIGH_INQUISITOR_ID: - DoorHighInquisitorGUID = go->GetGUID(); - break; - case DOOR_CHAPEL: - DoorChapelGUID = go->GetGUID(); - break; - default: - break; + case DOOR_HIGH_INQUISITOR_ID: + DoorHighInquisitorGUID = go->GetGUID(); + break; + case DOOR_CHAPEL: + DoorChapelGUID = go->GetGUID(); + break; + default: + break; } } @@ -98,27 +98,27 @@ class instance_scarlet_monastery : public InstanceMapScript { switch (creature->GetEntry()) { - case NPC_SCARLET_MYRIDON: - case NPC_SCARLET_DEFENDER: - case NPC_SCARLET_CENTURION: - case NPC_SCARLET_SORCERER: - case NPC_SCARLET_WIZARD: - case NPC_SCARLET_ABBOT: - case NPC_SCARLET_MONK: - case NPC_SCARLET_CHAMPION: - case NPC_SCARLET_CHAPLAIN: - case NPC_FAIRBANKS: - AshbringerNpcGUID.emplace(creature->GetGUID()); - break; - case NPC_COMMANDER_MOGRAINE: - MograineGUID = creature->GetGUID(); - AshbringerNpcGUID.emplace(creature->GetGUID()); - break; - case NPC_INQUISITOR_WHITEMANE: - WhitemaneGUID = creature->GetGUID(); - break; - default: - break; + case NPC_SCARLET_MYRIDON: + case NPC_SCARLET_DEFENDER: + case NPC_SCARLET_CENTURION: + case NPC_SCARLET_SORCERER: + case NPC_SCARLET_WIZARD: + case NPC_SCARLET_ABBOT: + case NPC_SCARLET_MONK: + case NPC_SCARLET_CHAMPION: + case NPC_SCARLET_CHAPLAIN: + case NPC_FAIRBANKS: + AshbringerNpcGUID.emplace(creature->GetGUID()); + break; + case NPC_COMMANDER_MOGRAINE: + MograineGUID = creature->GetGUID(); + AshbringerNpcGUID.emplace(creature->GetGUID()); + break; + case NPC_INQUISITOR_WHITEMANE: + WhitemaneGUID = creature->GetGUID(); + break; + default: + break; } } @@ -126,41 +126,41 @@ class instance_scarlet_monastery : public InstanceMapScript { switch (type) { - case TYPE_MOGRAINE_AND_WHITE_EVENT: - if (data == IN_PROGRESS) - { - DoUseDoorOrButton(DoorHighInquisitorGUID); - encounter = IN_PROGRESS; - } - if (data == FAIL) - { - DoUseDoorOrButton(DoorHighInquisitorGUID); - encounter = FAIL; - } - if (data == SPECIAL) - encounter = SPECIAL; - break; - case DATA_HORSEMAN_EVENT: - encounter = data; - break; - case TYPE_ASHBRINGER_EVENT: - if (data == IN_PROGRESS) - { - if (GameObject* go = instance->GetGameObject(DoorChapelGUID)) + case TYPE_MOGRAINE_AND_WHITE_EVENT: + if (data == IN_PROGRESS) { - go->SetGoState(GO_STATE_ACTIVE); - go->SetLootState(GO_ACTIVATED); - go->SetGameObjectFlag(GO_FLAG_IN_USE); + DoUseDoorOrButton(DoorHighInquisitorGUID); + encounter = IN_PROGRESS; } - for (const auto& scarletCathedralNpcGuid : AshbringerNpcGUID) - if (Creature* scarletNpc = instance->GetCreature(scarletCathedralNpcGuid)) - if (scarletNpc->IsAlive() && !scarletNpc->IsInCombat()) - scarletNpc->SetFaction(FACTION_FRIENDLY); - } - ashencounter = data; - break; - default: - break; + if (data == FAIL) + { + DoUseDoorOrButton(DoorHighInquisitorGUID); + encounter = FAIL; + } + if (data == SPECIAL) + encounter = SPECIAL; + break; + case DATA_HORSEMAN_EVENT: + encounter = data; + break; + case TYPE_ASHBRINGER_EVENT: + if (data == IN_PROGRESS) + { + if (GameObject* go = instance->GetGameObject(DoorChapelGUID)) + { + go->SetGoState(GO_STATE_ACTIVE); + go->SetLootState(GO_ACTIVATED); + go->SetGameObjectFlag(GO_FLAG_IN_USE); + } + for (const auto& scarletCathedralNpcGuid : AshbringerNpcGUID) + if (Creature* scarletNpc = instance->GetCreature(scarletCathedralNpcGuid)) + if (scarletNpc->IsAlive() && !scarletNpc->IsInCombat()) + scarletNpc->SetFaction(FACTION_FRIENDLY); + } + ashencounter = data; + break; + default: + break; } } @@ -168,17 +168,17 @@ class instance_scarlet_monastery : public InstanceMapScript { switch (type) { - case DATA_MOGRAINE: - return MograineGUID; - case DATA_WHITEMANE: - return WhitemaneGUID; - case DATA_DOOR_WHITEMANE: - return DoorHighInquisitorGUID; - case DATA_DOOR_CHAPEL: - return DoorChapelGUID; - default: - return ObjectGuid::Empty; - break; + case DATA_MOGRAINE: + return MograineGUID; + case DATA_WHITEMANE: + return WhitemaneGUID; + case DATA_DOOR_WHITEMANE: + return DoorHighInquisitorGUID; + case DATA_DOOR_CHAPEL: + return DoorChapelGUID; + default: + return ObjectGuid::Empty; + break; } } @@ -186,18 +186,18 @@ class instance_scarlet_monastery : public InstanceMapScript { switch (type) { - case TYPE_MOGRAINE_AND_WHITE_EVENT: - return encounter; - break; - case DATA_HORSEMAN_EVENT: - return encounter; - break; - case TYPE_ASHBRINGER_EVENT: - return ashencounter; - break; - default: - return 0; - break; + case TYPE_MOGRAINE_AND_WHITE_EVENT: + return encounter; + break; + case DATA_HORSEMAN_EVENT: + return encounter; + break; + case TYPE_ASHBRINGER_EVENT: + return ashencounter; + break; + default: + return 0; + break; } } private: @@ -250,23 +250,23 @@ enum ScarletMonasteryTrashMisc enum AshbringerEvent { EVENT_MOGRAINE_FACING_PLAYER = 1, - EVENT_MOGRAINE_KNEEL, - EVENT_MOGRAINE_EMOTE_TALK3, - EVENT_SUMMONED_HIGHLORD_MOGRAINE, - EVENT_HIGHLORD_MOGRAINE_MOVE_STOP, - EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE, - EVENT_MOGRAINE_UNIT_STAND_STATE_STAND, - EVENT_MOGRAINE_EMOTE_TALK4, - EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK, - EVENT_HIGHLORD_MOGRAINE_EMOTE1, - EVENT_HIGHLORD_MOGRAINE_EMOTE2, - EVENT_HIGHLORD_MOGRAINE_EMOTE3, - EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2, - EVENT_MOGRAINE_EMOTE_TALK5, - EVENT_HIGHLORD_MOGRAINE_CASTSPELL, - EVENT_MOGRAINE_CASTSPELL, - EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, - EVENT_ASHBRINGER_OVER + EVENT_MOGRAINE_KNEEL = 2, + EVENT_MOGRAINE_EMOTE_TALK3 = 3, + EVENT_SUMMONED_HIGHLORD_MOGRAINE = 4, + EVENT_HIGHLORD_MOGRAINE_MOVE_STOP = 5, + EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE = 6, + EVENT_MOGRAINE_UNIT_STAND_STATE_STAND = 7, + EVENT_MOGRAINE_EMOTE_TALK4 = 8, + EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK = 9, + EVENT_HIGHLORD_MOGRAINE_EMOTE1 = 10, + EVENT_HIGHLORD_MOGRAINE_EMOTE2 = 11, + EVENT_HIGHLORD_MOGRAINE_EMOTE3 = 12, + EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2 = 13, + EVENT_MOGRAINE_EMOTE_TALK5 = 14, + EVENT_HIGHLORD_MOGRAINE_CASTSPELL = 15, + EVENT_MOGRAINE_CASTSPELL = 16, + EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE = 17, + EVENT_ASHBRINGER_OVER = 18 }; enum MograineEvents @@ -315,14 +315,14 @@ enum Says SAY_MO_RESURRECTED = 2, //Mograine Ashbringer Event says - SAY_MO_AB_TALK3, - SAY_MO_AB_TALK4, - SAY_MO_AB_TALK5, + SAY_MO_AB_TALK3 = 3, + SAY_MO_AB_TALK4 = 4, + SAY_MO_AB_TALK5 = 5, //Highlord Mograine Ashbringer Event Says SAY_HM_AB_TALK0 = 0, - SAY_HM_AB_TALK1, - SAY_HM_AB_TALK2, + SAY_HM_AB_TALK1 = 1, + SAY_HM_AB_TALK2 = 2, //Whitemane says SAY_WH_INTRO = 0, @@ -350,91 +350,86 @@ class npc_mograine : public CreatureScript switch (eventId) { - case EVENT_MOGRAINE_FACING_PLAYER: - me->SetFacingToObject(playerWhoStartedAshbringer); - events.ScheduleEvent(EVENT_MOGRAINE_KNEEL, 1s, 3s); - break; - case EVENT_MOGRAINE_KNEEL: - me->SetSheath(SHEATH_STATE_UNARMED); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK3, 1s, 2s); - break; - case EVENT_MOGRAINE_EMOTE_TALK3: - me->HandleEmoteCommand(EMOTE_ONESHOT_TALK); - me->AI()->Talk(SAY_MO_AB_TALK3, playerWhoStartedAshbringer); - break; - case EVENT_SUMMONED_HIGHLORD_MOGRAINE: - if (Creature* summonedMograine = me->SummonCreature(NPC_HIGHLORD_MOGRAINE, 1033.4642f, 1399.1022f, 27.337427f, 6.257956981658935546f, TEMPSUMMON_TIMED_DESPAWN, 120000)) - { - summonedMograine->SetFaction(FACTION_FRIENDLY); - summonedMograine->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, EQUIP_UNEQUIP); - summonedMograine->SetSpeed(MOVE_WALK, 1.0f); - summonedMograine->SetDisplayId(MODEL_HIGHLORD_MOGRAINE); - summonedMograine->setActive(true); - summonedMograine->CastSpell(summonedMograine, SPELL_MOGRAINE_COMETH_DND, false);//Sniffing data shows the use of this spell transformation, but the dispersion effect of this spell is not seen in the video - } - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_MOVE_STOP, 48500ms); - break; - case EVENT_HIGHLORD_MOGRAINE_MOVE_STOP: - summonedMograine->StopMovingOnCurrentPos(); - summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_POINT); - summonedMograine->AI()->Talk(SAY_HM_AB_TALK0, 200ms); - events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE, 3000ms); - break; - case EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE: - me->SetFacingToObject(summonedMograine); - events.ScheduleEvent(EVENT_MOGRAINE_UNIT_STAND_STATE_STAND, 400ms); - break; - case EVENT_MOGRAINE_UNIT_STAND_STATE_STAND: - me->SetStandState(UNIT_STAND_STATE_STAND); - me->SetSheath(SHEATH_STATE_MELEE); - events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK4, 800ms); - break; - case EVENT_MOGRAINE_EMOTE_TALK4: - me->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); - me->AI()->Talk(SAY_MO_AB_TALK4, 200ms); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK, 4600ms); - break; - case EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK: - summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); - summonedMograine->AI()->Talk(SAY_HM_AB_TALK1, me); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE1, 3400ms); - break; - case EVENT_HIGHLORD_MOGRAINE_EMOTE1: - summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE2, 3200ms); - break; - case EVENT_HIGHLORD_MOGRAINE_EMOTE2: - summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_POINT); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE3, 3200ms); - break; - case EVENT_HIGHLORD_MOGRAINE_EMOTE3: - summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2, 3200ms); - break; - case EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2: - me->SetFacingToObject(summonedMograine); - events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK5, 1200ms); - break; - case EVENT_MOGRAINE_EMOTE_TALK5: - me->SetSheath(SHEATH_STATE_UNARMED); - me->HandleEmoteCommand(EMOTE_ONESHOT_BEG); - me->AI()->Talk(SAY_MO_AB_TALK5, 200ms); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_CASTSPELL, 3000ms); - break; - case EVENT_HIGHLORD_MOGRAINE_CASTSPELL: - //In Blizzard's servers, after "HIGHLORD_MOGRAINE" uses this spell, "MOGRAINE" will have a visual effect of lightning hits, and the visual effect after the hit is missing here and needs to be fixed - summonedMograine->CastSpell(me, SPELL_FORGIVENESS, false); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 1000ms); - break; - case EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE: - me->KillSelf(); - summonedMograine->AI()->Talk(SAY_HM_AB_TALK2, 2700ms); - summonedMograine->DespawnOrUnsummon(6100); - me->setActive(false); - break; - default: - break; + case EVENT_MOGRAINE_FACING_PLAYER: + me->SetFacingToObject(_playerWhoStartedAshbringer); + events.ScheduleEvent(EVENT_MOGRAINE_KNEEL, 1s, 3s); + break; + case EVENT_MOGRAINE_KNEEL: + me->SetSheath(SHEATH_STATE_UNARMED); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK3, 1s, 2s); + break; + case EVENT_MOGRAINE_EMOTE_TALK3: + me->AI()->Talk(SAY_MO_AB_TALK3, _playerWhoStartedAshbringer); + break; + case EVENT_SUMMONED_HIGHLORD_MOGRAINE: + if (Creature* summonedMograine = me->SummonCreature(NPC_HIGHLORD_MOGRAINE, 1033.4642f, 1399.1022f, 27.337427f, 6.257956981658935546f, TEMPSUMMON_TIMED_DESPAWN, 120000)) + { + summonedMograine->SetFaction(FACTION_FRIENDLY); + summonedMograine->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, EQUIP_UNEQUIP); + summonedMograine->SetSpeed(MOVE_WALK, 1.0f); + summonedMograine->SetDisplayId(MODEL_HIGHLORD_MOGRAINE); + summonedMograine->setActive(true); + summonedMograine->CastSpell(summonedMograine, SPELL_MOGRAINE_COMETH_DND, false);//Sniffing data shows the use of this spell transformation, but the dispersion effect of this spell is not seen in the video + } + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_MOVE_STOP, 48500ms); + break; + case EVENT_HIGHLORD_MOGRAINE_MOVE_STOP: + summonedMograine->StopMovingOnCurrentPos(); + summonedMograine->AI()->Talk(SAY_HM_AB_TALK0, 200ms); + events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE, 3000ms); + break; + case EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE: + me->SetFacingToObject(summonedMograine); + events.ScheduleEvent(EVENT_MOGRAINE_UNIT_STAND_STATE_STAND, 400ms); + break; + case EVENT_MOGRAINE_UNIT_STAND_STATE_STAND: + me->SetStandState(UNIT_STAND_STATE_STAND); + me->SetSheath(SHEATH_STATE_MELEE); + events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK4, 800ms); + break; + case EVENT_MOGRAINE_EMOTE_TALK4: + me->AI()->Talk(SAY_MO_AB_TALK4, 200ms); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK, 4600ms); + break; + case EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK: + summonedMograine->AI()->Talk(SAY_HM_AB_TALK1, me); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE1, 3400ms); + break; + case EVENT_HIGHLORD_MOGRAINE_EMOTE1: + summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE2, 3200ms); + break; + case EVENT_HIGHLORD_MOGRAINE_EMOTE2: + summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_POINT); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE3, 3200ms); + break; + case EVENT_HIGHLORD_MOGRAINE_EMOTE3: + summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2, 3200ms); + break; + case EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2: + me->SetFacingToObject(summonedMograine); + events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK5, 1200ms); + break; + case EVENT_MOGRAINE_EMOTE_TALK5: + me->SetSheath(SHEATH_STATE_UNARMED); + me->AI()->Talk(SAY_MO_AB_TALK5, 200ms); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_CASTSPELL, 3000ms); + break; + case EVENT_HIGHLORD_MOGRAINE_CASTSPELL: + //In Blizzard's servers, after "HIGHLORD_MOGRAINE" uses this spell, "MOGRAINE" will have a visual effect of lightning hits, and the visual effect after the hit is missing here and needs to be fixed + summonedMograine->CastSpell(me, SPELL_FORGIVENESS, false); + events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 1000ms); + break; + case EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE: + me->KillSelf(); + summonedMograine->AI()->Talk(SAY_HM_AB_TALK2, 2700ms); + summonedMograine->DespawnOrUnsummon(6100); + me->setActive(false); + break; + default: + break; } } @@ -461,11 +456,10 @@ class npc_mograine : public CreatureScript me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH); SayAshbringer = false; - timer = 0; - step = 1; - hasDied = false; - heal = false; - fakeDeath = false; + _timer = 0; + _hasDied = false; + _heal = false; + _fakeDeath = false; me->setActive(false); if (Creature* summonedMograine = me->FindNearestCreature(NPC_HIGHLORD_MOGRAINE, 100.0f)) { @@ -486,7 +480,7 @@ class npc_mograine : public CreatureScript void DamageTaken(Unit* /*doneBy*/, uint32& damage, DamageEffectType, SpellSchoolMask) override { - if (damage < me->GetHealth() || hasDied || fakeDeath) + if (damage < me->GetHealth() || _hasDied || _fakeDeath) return; //On first death, fake death and open door, as well as initiate whitemane if exist @@ -505,8 +499,8 @@ class npc_mograine : public CreatureScript me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->CastSpell(me, SPELL_PERMANENT_FEIGN_DEATH, true); - hasDied = true; - fakeDeath = true; + _hasDied = true; + _fakeDeath = true; damage = 0; ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_WHITEMANE))->SetInCombatWithZone(); } @@ -524,7 +518,7 @@ class npc_mograine : public CreatureScript if (spell->Id == SPELL_SCARLET_RESURRECTION) { Talk(SAY_MO_RESURRECTED); - fakeDeath = false; + _fakeDeath = false; instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); } @@ -532,7 +526,7 @@ class npc_mograine : public CreatureScript { me->SetFaction(FACTION_FRIENDLY); me->GetMotionMaster()->MoveIdle(); - playerWhoStartedAshbringer = who->ToPlayer(); + _playerWhoStartedAshbringer = who->ToPlayer(); // Standing delay inside the cathedral SayAshbringer = true; me->setActive(true); @@ -555,7 +549,7 @@ class npc_mograine : public CreatureScript if (!UpdateVictim() || SayAshbringer) return; - if (hasDied && !heal && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) + if (_hasDied && !_heal && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) { //On resurrection, stop fake death and heal whitemane and resume fight if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_WHITEMANE))) @@ -570,12 +564,12 @@ class npc_mograine : public CreatureScript events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 6s, 11s); if (me->GetVictim()) me->GetMotionMaster()->MoveChase(me->GetVictim()); - heal = true; + _heal = true; } } //This if-check to make sure mograine does not attack while fake death - if (fakeDeath) + if (_fakeDeath) return; events.Update(diff); @@ -586,17 +580,17 @@ class npc_mograine : public CreatureScript { switch (eventId) { - case EVENT_SPELL_CRUSADER_STRIKE: - DoCastVictim(SPELL_CRUSADER_STRIKE, true); - events.ScheduleEvent(EVENT_SPELL_CRUSADER_STRIKE, 10s); - break; - case EVENT_SPELL_HAMMER_OF_JUSTICE: - DoCastVictim(SPELL_HAMMER_OF_JUSTICE, true); - events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 60s); - break; - case EVENT_PULL_CATHEDRAL: - PullCathedral(); - break; + case EVENT_SPELL_CRUSADER_STRIKE: + DoCastVictim(SPELL_CRUSADER_STRIKE, true); + events.ScheduleEvent(EVENT_SPELL_CRUSADER_STRIKE, 10s); + break; + case EVENT_SPELL_HAMMER_OF_JUSTICE: + DoCastVictim(SPELL_HAMMER_OF_JUSTICE, true); + events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 60s); + break; + case EVENT_PULL_CATHEDRAL: + PullCathedral(); + break; } } DoMeleeAttackIfReady(); @@ -604,12 +598,11 @@ class npc_mograine : public CreatureScript private: bool SayAshbringer = false; - int timer = 0; - int step = 1; - bool hasDied = false; - bool heal = false; - bool fakeDeath = false; - Player* playerWhoStartedAshbringer = nullptr; + int _timer = 0; + bool _hasDied = false; + bool _heal = false; + bool _fakeDeath = false; + Player* _playerWhoStartedAshbringer = nullptr; EventMap events; InstanceScript* instance; }; @@ -634,10 +627,10 @@ class boss_high_inquisitor_whitemane : public CreatureScript void Reset() override { - canResurrectCheck = false; - canResurrect = false; - Wait_Timer = 7000; - Heal_Timer = 10000; + _canResurrectCheck = false; + _canResurrect = false; + _Wait_Timer = 7000; + _Heal_Timer = 10000; } void JustReachedHome() override @@ -655,7 +648,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript void DamageTaken(Unit* /*doneBy*/, uint32& damage, DamageEffectType, SpellSchoolMask) override { - if (!canResurrectCheck && damage >= me->GetHealth()) + if (!_canResurrectCheck && damage >= me->GetHealth()) damage = me->GetHealth() - 1; } @@ -670,39 +663,39 @@ class boss_high_inquisitor_whitemane : public CreatureScript if (!UpdateVictim()) return; - if (canResurrect) + if (_canResurrect) { //When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out - if (Wait_Timer <= diff) + if (_Wait_Timer <= diff) { if (ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MOGRAINE))) { DoCast(SPELL_SCARLET_RESURRECTION); Talk(SAY_WH_RESURRECT); - canResurrect = false; + _canResurrect = false; } } - else Wait_Timer -= diff; + else _Wait_Timer -= diff; } //Cast Deep sleep when health is less than 50% - if (!canResurrectCheck && !HealthAbovePct(50)) + if (!_canResurrectCheck && !HealthAbovePct(50)) { if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(false); me->CastSpell(me->GetVictim(), SPELL_DEEP_SLEEP, true); - canResurrectCheck = true; - canResurrect = true; + _canResurrectCheck = true; + _canResurrect = true; return; } //while in "resurrect-mode", don't do anything - if (canResurrect) + if (_canResurrect) return; //If we are <75% hp cast healing spells at self or Mograine - if (Heal_Timer <= diff) + if (_Heal_Timer <= diff) { Creature* target = nullptr; @@ -712,16 +705,16 @@ class boss_high_inquisitor_whitemane : public CreatureScript if (Creature* mograine = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MOGRAINE))) { // checking canResurrectCheck prevents her healing Mograine while he is "faking death" - if (canResurrectCheck && mograine->IsAlive() && !mograine->HealthAbovePct(75)) + if (_canResurrectCheck && mograine->IsAlive() && !mograine->HealthAbovePct(75)) target = mograine; } if (target) me->CastSpell(target, SPELL_HEAL, false); - Heal_Timer = 13000; + _Heal_Timer = 13000; } - else Heal_Timer -= diff; + else _Heal_Timer -= diff; events.Update(diff); @@ -732,17 +725,17 @@ class boss_high_inquisitor_whitemane : public CreatureScript { switch (eventId) { - case EVENT_SPELL_POWER_WORLD_SHIELD: - me->CastSpell(me, SPELL_POWER_WORD_SHIELD, false); - events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 15s); - break; - case EVENT_SPELL_HOLY_SMITE: - me->CastSpell(me->GetVictim(), SPELL_HOLY_SMITE, false); - events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 6s); - break; - case EVENT_SPELL_HEAL: - me->CastSpell(me, SPELL_HEAL, false); - break; + case EVENT_SPELL_POWER_WORLD_SHIELD: + me->CastSpell(me, SPELL_POWER_WORD_SHIELD, false); + events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 15s); + break; + case EVENT_SPELL_HOLY_SMITE: + me->CastSpell(me->GetVictim(), SPELL_HOLY_SMITE, false); + events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 6s); + break; + case EVENT_SPELL_HEAL: + me->CastSpell(me, SPELL_HEAL, false); + break; } } @@ -751,10 +744,10 @@ class boss_high_inquisitor_whitemane : public CreatureScript private: InstanceScript* instance; - uint32 Heal_Timer; - uint32 Wait_Timer; - bool canResurrectCheck; - bool canResurrect; + uint32 _Heal_Timer; + uint32 _Wait_Timer; + bool _canResurrectCheck; + bool _canResurrect; EventMap events; }; From b996ea15747deb170746ab42086948c2d08e144a Mon Sep 17 00:00:00 2001 From: fangshun Date: Tue, 2 Jan 2024 22:23:46 +0800 Subject: [PATCH 22/65] Reworked the battle between Mograine and Whitemane --- .../instance_scarlet_monastery.cpp | 584 ++++++++++++------ 1 file changed, 398 insertions(+), 186 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 32e160515a4f0a..15bdaa2e52da4f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -17,14 +17,14 @@ #include "CreatureScript.h" #include "InstanceMapScript.h" +#include "scarletmonastery.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" #include "SmartAI.h" -#include "scarletmonastery.h" enum AshbringerEventMisc { - ABE_ffect_000 = 28441, + AB_Effect_000 = 28441, AURA_OF_ASHBRINGER = 28282, NPC_SCARLET_MYRIDON = 4295, @@ -42,7 +42,7 @@ enum AshbringerEventMisc NPC_INQUISITOR_WHITEMANE = 3977, DOOR_CHAPEL = 104591, DOOR_HIGH_INQUISITOR_ID = 104600, - TALK_MOGRAINE_ASHBRBINGER_INTRO = 6, + SAY_MOGRAINE_ASHBRBINGER_INTRO = 6, }; enum DataTypes @@ -135,15 +135,40 @@ class instance_scarlet_monastery : public InstanceMapScript } if (data == FAIL) { - DoUseDoorOrButton(DoorHighInquisitorGUID); - encounter = FAIL; + Creature* Whitemane = instance->GetCreature(WhitemaneGUID); + Creature* Mograine = instance->GetCreature(MograineGUID); + if (!Mograine||!Whitemane) + return; + + if (Whitemane->IsAlive() && Mograine->IsAlive()) + { + //When Whitemane emerges from the main gate, Whitemane will stand next to Mograine's corpse and will not reset Whitemane + if (Whitemane->IsInCombat()) + Whitemane->DespawnOnEvade(30s); + + Mograine->DespawnOnEvade(30s); + encounter = NOT_STARTED; + return; + } + //Whitemane will not be able to fight Mograine again when he dies + if (!Whitemane->IsAlive()) + { + Mograine->DespawnOrUnsummon(); + encounter = data; + return; + } + + if (Whitemane->IsAlive() && !Mograine->IsAlive()) + { + Whitemane->DespawnOnEvade(30s); + encounter = data; + return; + } + encounter = data; } if (data == SPECIAL) encounter = SPECIAL; break; - case DATA_HORSEMAN_EVENT: - encounter = data; - break; case TYPE_ASHBRINGER_EVENT: if (data == IN_PROGRESS) { @@ -153,13 +178,22 @@ class instance_scarlet_monastery : public InstanceMapScript go->SetLootState(GO_ACTIVATED); go->SetGameObjectFlag(GO_FLAG_IN_USE); } - for (const auto& scarletCathedralNpcGuid : AshbringerNpcGUID) + + // the ashbringer incident did not sniff out any data from whitemane + Creature* whitemane = instance->GetCreature(WhitemaneGUID); + if (whitemane && whitemane->IsAlive() && !whitemane->IsInCombat()) + whitemane->DespawnOrUnsummon(); + + for (auto const& scarletCathedralNpcGuid : AshbringerNpcGUID) if (Creature* scarletNpc = instance->GetCreature(scarletCathedralNpcGuid)) if (scarletNpc->IsAlive() && !scarletNpc->IsInCombat()) scarletNpc->SetFaction(FACTION_FRIENDLY); } ashencounter = data; break; + case DATA_HORSEMAN_EVENT: + encounter = data; + break; default: break; } @@ -227,7 +261,7 @@ class at_scarlet_monastery_cathedral_entrance : public AreaTriggerScript { Creature* commanderMograine = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_MOGRAINE)); if (commanderMograine && commanderMograine->IsAlive()) - commanderMograine->AI()->Talk(TALK_MOGRAINE_ASHBRBINGER_INTRO); + commanderMograine->AI()->Talk(SAY_MOGRAINE_ASHBRBINGER_INTRO); instance->SetData(TYPE_ASHBRINGER_EVENT, IN_PROGRESS); return true; } @@ -243,9 +277,10 @@ enum ScarletMonasteryTrashMisc AURA_ASHBRINGER = 28282, NPC_HIGHLORD_MOGRAINE = 16062, MODEL_HIGHLORD_MOGRAINE = 16180, + MODEL_FAIRBANKS = 16179, SPELL_COSMETIC_CHAIN = 45537, SPELL_COSMETIC_EXPLODE = 45935, - SPELL_FORGIVENESS = 28697, + SPELL_FORGIVENESS = 28697 }; enum AshbringerEvent @@ -272,16 +307,23 @@ enum AshbringerEvent enum MograineEvents { - EVENT_SPELL_CRUSADER_STRIKE = 1, - EVENT_SPELL_HAMMER_OF_JUSTICE = 2, - EVENT_PULL_CATHEDRAL = 3 + EVENT_RESURRECTED = 1, + EVENT_SPELL_LAY_ON_HANDS = 2, + EVENT_MOGRAINE_EMOTE = 3, + EVENT_MOVE = 4 }; enum WhitemaneEvents { EVENT_SPELL_HOLY_SMITE = 1, EVENT_SPELL_POWER_WORLD_SHIELD = 2, - EVENT_SPELL_HEAL = 3 + EVENT_SPELL_HEAL = 3, + EVENT_SPELL_DOMINATE_MIND = 4, + EVENT_SLEEP = 5, + EVENT_RESURRECT = 6, + EVENT_SAY = 7, + EVENT_WHITEMANE_EMOTE = 8, + EVENT_DEALY_ATTACK = 9 }; enum Spells @@ -291,7 +333,6 @@ enum Spells SPELL_HAMMER_OF_JUSTICE = 5589, SPELL_LAY_ON_HANDS = 9257, SPELL_RETRIBUTION_AURA = 8990, - SPELL_PERMANENT_FEIGN_DEATH = 29266, //Whitemanes Spells SPELL_SCARLET_RESURRECTION = 9232, @@ -368,10 +409,8 @@ class npc_mograine : public CreatureScript { summonedMograine->SetFaction(FACTION_FRIENDLY); summonedMograine->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, EQUIP_UNEQUIP); - summonedMograine->SetSpeed(MOVE_WALK, 1.0f); summonedMograine->SetDisplayId(MODEL_HIGHLORD_MOGRAINE); - summonedMograine->setActive(true); - summonedMograine->CastSpell(summonedMograine, SPELL_MOGRAINE_COMETH_DND, false);//Sniffing data shows the use of this spell transformation, but the dispersion effect of this spell is not seen in the video + summonedMograine->CastSpell(summonedMograine, SPELL_MOGRAINE_COMETH_DND);//Sniffing data shows the use of this spell transformation, but the dispersion effect of this spell is not seen in the video } events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_MOVE_STOP, 48500ms); break; @@ -420,14 +459,13 @@ class npc_mograine : public CreatureScript break; case EVENT_HIGHLORD_MOGRAINE_CASTSPELL: //In Blizzard's servers, after "HIGHLORD_MOGRAINE" uses this spell, "MOGRAINE" will have a visual effect of lightning hits, and the visual effect after the hit is missing here and needs to be fixed - summonedMograine->CastSpell(me, SPELL_FORGIVENESS, false); + summonedMograine->CastSpell(me, SPELL_FORGIVENESS); events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 1000ms); break; case EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE: me->KillSelf(); summonedMograine->AI()->Talk(SAY_HM_AB_TALK2, 2700ms); summonedMograine->DespawnOrUnsummon(6100); - me->setActive(false); break; default: break; @@ -450,60 +488,141 @@ class npc_mograine : public CreatureScript } } + void ScheduleGround() + { + _scheduler.Schedule(1s, 5s, [this](TaskContext context) + { + DoCastVictim(SPELL_CRUSADER_STRIKE); + context.Repeat(10s); + }) + .Schedule(6s, 11s, [this](TaskContext context) + { + DoCastVictim(SPELL_HAMMER_OF_JUSTICE); + context.Repeat(60s); + }); + } + void Reset() override { - //Incase wipe during phase that mograine fake death - me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); + // Incase wipe during phase that mograine fake death + me->SetReactState(REACT_AGGRESSIVE); + me->SetStandState(UNIT_STAND_STATE_STAND); + me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH); - SayAshbringer = false; - _timer = 0; - _hasDied = false; - _heal = false; + events.Reset(); _fakeDeath = false; - me->setActive(false); + _scheduler.CancelAll(); if (Creature* summonedMograine = me->FindNearestCreature(NPC_HIGHLORD_MOGRAINE, 100.0f)) { - summonedMograine->setActive(false); summonedMograine->DespawnOrUnsummon(); } - events.Reset(); + SayAshbringer = false; + } + + void EnterEvadeMode(EvadeReason why) override + { + if (instance) + { + instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); + } + } + + void MovementInform(uint32 type, uint32 id) override + { + if (type != POINT_MOTION_TYPE) + return; + + if (id == 1) + { + me->SetReactState(REACT_AGGRESSIVE); + DoCastSelf(SPELL_RETRIBUTION_AURA); + ScheduleGround(); + if (me->GetVictim()) + AttackStart(me->GetVictim()); + } } void JustEngagedWith(Unit* /*who*/) override { - Talk(SAY_MO_AGGRO); - me->CastSpell(me, SPELL_RETRIBUTION_AURA, true); - events.ScheduleEvent(EVENT_PULL_CATHEDRAL, 1s); // Has to be done via event, otherwise mob aggroing Mograine DOES NOT aggro the room - events.ScheduleEvent(EVENT_SPELL_CRUSADER_STRIKE, 1s, 5s); - events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 6s, 11s); + Talk(SAY_MO_AGGRO); + DoCastSelf(SPELL_RETRIBUTION_AURA); + _scheduler.Schedule(1s, [this](TaskContext) + { + PullCathedral(); + }); + ScheduleGround(); } void DamageTaken(Unit* /*doneBy*/, uint32& damage, DamageEffectType, SpellSchoolMask) override { - if (damage < me->GetHealth() || _hasDied || _fakeDeath) - return; + if (damage > me->GetHealth() && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) != SPECIAL && _fakeDeath) + damage = 0; //On first death, fake death and open door, as well as initiate whitemane if exist - if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_WHITEMANE))) + if (damage > me->GetHealth() && !_fakeDeath) { - instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); - Whitemane->GetMotionMaster()->MovePoint(1, 1163.113370f, 1398.856812f, 32.527786f); + // On first death, fake death and open door, as well as initiate whitemane if exist + if (Creature* Whitemane = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_WHITEMANE))) + { + instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); + Whitemane->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + //ServerToClient: SMSG_CHAT (0x2BAD) Length: 187 ConnIdx: 0 Time: 06/24/2023 06:02:03.366 Number: 9026 + Whitemane->AI()->Talk(SAY_WH_INTRO, me); + float fx, fy, fz; + me->GetContactPoint(Whitemane, fx, fy, fz, 5.0f); + Whitemane->GetMotionMaster()->MovePoint(1, fx, fy, fz); + Whitemane->SetReactState(REACT_AGGRESSIVE); + // Whitemane->GetMotionMaster()->MovePoint(1, 1163.113370f, 1398.856812f, 32.527786f); + } me->GetMotionMaster()->MovementExpired(); me->GetMotionMaster()->MoveIdle(); me->SetHealth(0); - if (me->IsNonMeleeSpellCast(false)) - me->InterruptNonMeleeSpells(false); - me->ClearComboPointHolders(); - me->RemoveAllAuras(); - me->ClearAllReactives(); + /*ServerToClient: SMSG_PLAY_OBJECT_SOUND(0x276E) Length : 48 ConnIdx : 1 Time : 11 / 25 / 2023 11 : 17 : 10.928 Number : 1490 + SoundId : 1326 (1326) + SourceObjectGUID : Full : 0x204CB017A003E2000001BA00006163B7 Creature / 0 R4908 / S442 Map : 189 Entry : 3976 Low : 6382519 + TargetObjectGUID : Full : 0x204CB017A003E2000001BA00006163B7 Creature / 0 R4908 / S442 Map : 189 Entry : 3976 Low : 6382519 + Position : X : 1138.4968 Y : 1400.8589 Z : 30.745066 + BroadcastTextID : 0*/ + me->PlayDirectSound(1326); + /* ServerToClient: SMSG_AURA_UPDATE(0x2C1F) Length : 18 ConnIdx : 1 Time : 11 / 25 / 2023 11 : 17 : 10.928 Number : 1491 + UpdateAll : False + AurasCount : 1 + [0] Slot : 0 + [0] HasAura : False + UnitGUID : Full: 0x204CB017A003E2000001BA00006163B7 Creature / 0 R4908 / S442 Map : 189 Entry : 3976 Low : 6382519*/ + me->RemoveAura(SPELL_RETRIBUTION_AURA); + /* ServerToClient: SMSG_ATTACK_STOP(0x293E) Length : 23 ConnIdx : 1 Time : 11 / 25 / 2023 11 : 17 : 10.928 Number : 1492 + Attacker Guid : Full: 0x204CB017A003E2000001BA00006163B7 Creature / 0 R4908 / S442 Map : 189 Entry : 3976 Low : 6382519 + Victim Guid : Full: 0x084CA000000000000000000000ABA68A Player / 0 R4904 / S0 Map : 0 Low : 11249290 + NowDead : False*/ + me->AttackStop(); + /*ServerToClient: SMSG_UPDATE_OBJECT(0x27CB) Length : 132 ConnIdx : 1 Time : 11 / 25 / 2023 11 : 17 : 10.928 Number : 1494 + NumObjUpdates : 2 + MapID : 189 (189) + HasRemovedObjects : True + DestroyedObjCount : 0 + RemovedObjCount : 3 + (OutOfRange)[0] ObjectGUID : Full : 0x204CB017A00433000001BA0000E163B8 Creature / 0 R4908 / S442 Map : 189 Entry : 4300 Low : 14771128 + (OutOfRange)[1] ObjectGUID : Full : 0x204CB017A00432800001BA00016163B8 Creature / 0 R4908 / S442 Map : 189 Entry : 4298 Low : 23159736 + (OutOfRange)[2] ObjectGUID : Full : 0x204CB017A00433400001BA0005E163B8 Creature / 0 R4908 / S442 Map : 189 Entry : 4301 Low : 98657208 + Data size : 69 + [0] UpdateType : Values + [0] Object Guid : Full: 0x084CA000000000000000000000ABA68A Player / 0 R4904 / S0 Map : 0 Low : 11249290 + [0] Flags : 524296 + [1] UpdateType : Values + [1] Object Guid : Full: 0x204CB017A003E2000001BA00006163B7 Creature / 0 R4908 / S442 Map : 189 Entry : 3976 Low : 6382519 + [1] Target : Full : 0x0 + [1] Flags : 34081344 + [1] StandState : 7*/ + me->SetStandState(UNIT_STAND_STATE_DEAD); + /*ClientToServer: CMSG_SET_SELECTION(0x3528) Length : 2 ConnIdx : 1 Time : 11 / 25 / 2023 11 : 17 : 10.932 Number : 1496 + Guid : Full : 0x0*/ me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->CastSpell(me, SPELL_PERMANENT_FEIGN_DEATH, true); - - _hasDied = true; + me->ClearAllReactives(); + me->SetReactState(REACT_PASSIVE); + _scheduler.CancelAll(); _fakeDeath = true; - damage = 0; - ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_WHITEMANE))->SetInCombatWithZone(); + /* ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_WHITEMANE))->AI()->DoZoneInCombat(nullptr, 15.0f);*/ } } @@ -515,24 +634,26 @@ class npc_mograine : public CreatureScript void SpellHit(Unit* who, SpellInfo const* spell) override { - //When hit with resurrection say text - if (spell->Id == SPELL_SCARLET_RESURRECTION) + if (instance) { - Talk(SAY_MO_RESURRECTED); - _fakeDeath = false; - instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); - } + //ServerToClient: SMSG_SPELL_GO (0x2C36) Length: 125 ConnIdx: 1 Time: 11/25/2023 11:17:38.916 Number: 1884 + //When hit with resurrection say text + if (spell->Id == SPELL_SCARLET_RESURRECTION) + { + instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); + events.ScheduleEvent(EVENT_RESURRECTED, 3500ms); + } - if (who && spell->Id == ABE_ffect_000 && !SayAshbringer) - { - me->SetFaction(FACTION_FRIENDLY); - me->GetMotionMaster()->MoveIdle(); - _playerWhoStartedAshbringer = who->ToPlayer(); - // Standing delay inside the cathedral - SayAshbringer = true; - me->setActive(true); - events.ScheduleEvent(EVENT_MOGRAINE_FACING_PLAYER, 0ms); - events.ScheduleEvent(EVENT_SUMMONED_HIGHLORD_MOGRAINE, 20ms); + if (who && spell->Id == AB_Effect_000 && !SayAshbringer) + { + me->SetFaction(FACTION_FRIENDLY); + me->GetMotionMaster()->MoveIdle(); + _playerWhoStartedAshbringer = who->ToPlayer(); + // Standing delay inside the cathedral + SayAshbringer = true; + events.ScheduleEvent(EVENT_MOGRAINE_FACING_PLAYER, 0ms); + events.ScheduleEvent(EVENT_SUMMONED_HIGHLORD_MOGRAINE, 20ms); + } } } @@ -549,63 +670,69 @@ class npc_mograine : public CreatureScript if (!UpdateVictim() || SayAshbringer) return; - - if (_hasDied && !_heal && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) - { - //On resurrection, stop fake death and heal whitemane and resume fight - if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_WHITEMANE))) - { - //Incase wipe during phase that mograine fake death - me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); - me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH); - me->CastSpell(me, SPELL_RETRIBUTION_AURA, true); - me->CastSpell(Whitemane, SPELL_LAY_ON_HANDS, true); - events.ScheduleEvent(EVENT_SPELL_CRUSADER_STRIKE, 1s, 5s); - events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 6s, 11s); - if (me->GetVictim()) - me->GetMotionMaster()->MoveChase(me->GetVictim()); - _heal = true; - } - } - - //This if-check to make sure mograine does not attack while fake death - if (_fakeDeath) - return; - - events.Update(diff); - if (me->HasUnitState(UNIT_STATE_CASTING)) + _scheduler.Update(diff); + events.Update(diff); + if (me->HasUnitState(UNIT_STATE_CASTING)) return; - - while (uint32 eventId = events.ExecuteEvent()) + while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { - case EVENT_SPELL_CRUSADER_STRIKE: - DoCastVictim(SPELL_CRUSADER_STRIKE, true); - events.ScheduleEvent(EVENT_SPELL_CRUSADER_STRIKE, 10s); + case EVENT_RESURRECTED: + //me->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH); + me->SetReactState(REACT_PASSIVE); + //Removed the debuff that took a long time + me->AttackStop(); + me->InterruptNonMeleeSpells(false); + //How do I get rid of the animation from UNIT_STAND_STATE_DEAD to UNIT_STAND_STATE_STAND? + me->SetStandState(UNIT_STAND_STATE_STAND); + events.ScheduleEvent(EVENT_SPELL_LAY_ON_HANDS, 0s); break; - case EVENT_SPELL_HAMMER_OF_JUSTICE: - DoCastVictim(SPELL_HAMMER_OF_JUSTICE, true); - events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 60s); + case EVENT_SPELL_LAY_ON_HANDS: + //ServerToClient: SMSG_PLAY_OBJECT_SOUND (0x276E) Length: 48 ConnIdx: 1 Time: 11/25/2023 11:17:43.409 Number: 1928 + //SoundId: 5837 (5837) + //ServerToClient: SMSG_SPELL_START (0x2C37) Length: 108 ConnIdx: 1 Time: 11/25/2023 11:17:43.409 Number: 1929 + if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_WHITEMANE))) + { + if (Whitemane->IsAlive()) + me->CastSpell(Whitemane, SPELL_LAY_ON_HANDS); + Talk(SAY_MO_RESURRECTED, Whitemane); + events.ScheduleEvent(EVENT_MOGRAINE_EMOTE, 500ms); + } break; - case EVENT_PULL_CATHEDRAL: - PullCathedral(); + //ServerToClient: SMSG_CHAT (0x2BAD) Length: 159 ConnIdx: 0 Time: 11/25/2023 11:17:43.597 Number: 1936 + case EVENT_MOGRAINE_EMOTE: + //ServerToClient: SMSG_CHAT (0x2BAD) Length: 159 ConnIdx: 0 Time: 11/25/2023 11:17:43.597 Number: 1936 + me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + events.ScheduleEvent(EVENT_MOVE, 3044ms); + break; + //ServerToClient: SMSG_ON_MONSTER_MOVE (0x2DD4) Length: 80 ConnIdx: 1 Time: 11/25/2023 11:17:46.641 Number: 1956 + case EVENT_MOVE: + if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_WHITEMANE))) + { + + float fx, fy, fz; + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + Whitemane->GetContactPoint(me, fx, fy, fz, 0.0f); + me->GetMotionMaster()->MovePoint(1, fx, fy, fz); + } + break; + //SMSG_ATTACKER_STATE_UPDATE (0x2952) Length: 80 ConnIdx: 1 Time: 11/25/2023 11:17:49.891 Number: 1990 + //8990 + default: break; } } DoMeleeAttackIfReady(); } - private: + private: bool SayAshbringer = false; - int _timer = 0; - bool _hasDied = false; - bool _heal = false; bool _fakeDeath = false; - Player* _playerWhoStartedAshbringer = nullptr; EventMap events; InstanceScript* instance; + TaskScheduler _scheduler; + Player* _playerWhoStartedAshbringer = nullptr; }; CreatureAI* GetAI(Creature* creature) const override @@ -628,29 +755,60 @@ class boss_high_inquisitor_whitemane : public CreatureScript void Reset() override { - _canResurrectCheck = false; - _canResurrect = false; - _Wait_Timer = 7000; - _Heal_Timer = 10000; + me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);//this heck fix + me->SetReactState(REACT_AGGRESSIVE); + _victimbuff = nullptr; + events.Reset(); + _Phase = 0; } - void JustReachedHome() override + void JustRespawned() override { - instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); + if (instance) + instance->DoUseDoorOrButton(instance->GetGuidData(DATA_DOOR_WHITEMANE)); + ScriptedAI::JustRespawned(); + } + + void EnterEvadeMode(EvadeReason why) override + { + if (instance) + { + instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); + } } void JustEngagedWith(Unit* /*who*/) override { - Talk(SAY_WH_INTRO); - events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 1s, 3s); - events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 6s); - events.ScheduleEvent(EVENT_SPELL_HEAL, 9s); + events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 10ms); + events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 22s, 45s); + events.ScheduleEvent(EVENT_SPELL_DOMINATE_MIND, 5s, 10s); } void DamageTaken(Unit* /*doneBy*/, uint32& damage, DamageEffectType, SpellSchoolMask) override { - if ((!_canResurrectCheck || _canResurrect) && damage >= me->GetHealth()) - damage = me->GetHealth() - 1; + //Until Mowglini is resurrected, players cannot kill her + if (_Phase != 2 && damage >= me->GetHealth()) + { + damage = 0; + me->SetHealth(1); + } + } + + void MovementInform(uint32 type, uint32 id) override + { + if (type != POINT_MOTION_TYPE) + return; + + if (id == 2) + { + //This determines whether the target buff exists + //Use don't know why use me->GetVictim() Unable to get the target + if (_victimbuff && _victimbuff->HasAura(SPELL_DEEP_SLEEP)) + //Wait 5 seconds to revive while the debuff is still present on the player + events.ScheduleEvent(EVENT_RESURRECT, 5s); + else + events.ScheduleEvent(EVENT_RESURRECT, 1s); + } } void KilledUnit(Unit* victim) override @@ -664,78 +822,134 @@ class boss_high_inquisitor_whitemane : public CreatureScript if (!UpdateVictim()) return; - if (_canResurrect) - { - //When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out - if (_Wait_Timer <= diff) - { - if (ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MOGRAINE))) - { - DoCast(SPELL_SCARLET_RESURRECTION); - Talk(SAY_WH_RESURRECT); - _canResurrect = false; - } - } - else _Wait_Timer -= diff; - } - - //Cast Deep sleep when health is less than 50% - if (!_canResurrectCheck && !HealthAbovePct(50)) - { - if (me->IsNonMeleeSpellCast(false)) - me->InterruptNonMeleeSpells(false); - - me->CastSpell(me->GetVictim(), SPELL_DEEP_SLEEP, true); - _canResurrectCheck = true; - _canResurrect = true; - return; - } + events.Update(diff); - //while in "resurrect-mode", don't do anything - if (_canResurrect) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; - //If we are <75% hp cast healing spells at self or Mograine - if (_Heal_Timer <= diff) + if (_Phase==0 && me->HealthBelowPct(50)) { - Creature* target = nullptr; - - if (!HealthAbovePct(75)) - target = me; - - if (Creature* mograine = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MOGRAINE))) - { - // checking canResurrectCheck prevents her healing Mograine while he is "faking death" - if (_canResurrectCheck && mograine->IsAlive() && !mograine->HealthAbovePct(75)) - target = mograine; - } - - if (target) - me->CastSpell(target, SPELL_HEAL, false); - - _Heal_Timer = 13000; + events.Reset(); + _Phase = 1; + events.ScheduleEvent(EVENT_SLEEP, 0ms); } - else _Heal_Timer -= diff; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { - case EVENT_SPELL_POWER_WORLD_SHIELD: - me->CastSpell(me, SPELL_POWER_WORD_SHIELD, false); - events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 15s); - break; case EVENT_SPELL_HOLY_SMITE: - me->CastSpell(me->GetVictim(), SPELL_HOLY_SMITE, false); - events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 6s); + if (Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 0, 0.0f, false)) + { + me->GetMotionMaster()->MoveChase(target, 30.0f); + + if (DoCast(target, SPELL_HOLY_SMITE) != SPELL_CAST_OK) + { + me->GetMotionMaster()->MoveChase(target, 0); + events.Repeat(1200ms,1500ms); + break; + } + } + events.Repeat(4000ms,7s); + break; + case EVENT_SPELL_POWER_WORLD_SHIELD: + //Since mograine has 0 HP, the DoSelectLowestHpFriendly function will always try to use it on him, not on himself + if (_Phase!=2) + { + DoCast(me, SPELL_POWER_WORD_SHIELD); + events.Repeat(22s, 35s); + break; + } + + if (Unit* target = DoSelectLowestHpFriendly(40.0f)) + { + if (DoCast(target, SPELL_POWER_WORD_SHIELD) == SPELL_CAST_OK) + { + events.Repeat(22s, 35s); + break; + } + } + events.Repeat(1s); break; case EVENT_SPELL_HEAL: - me->CastSpell(me, SPELL_HEAL, false); + if (Unit* target = DoSelectLowestHpFriendly(40.0f)) + { + if (target->HealthBelowPct(75)) + { + if (me->IsNonMeleeSpellCast(true)) + me->InterruptNonMeleeSpells(false); + DoCast(target, SPELL_HEAL); + events.Repeat(17500ms, 20s); + break; + } + } + events.Repeat(1s); + break; + /* case EVENT_SPELL_DOMINATE_MIND: + if (me->GetThreatMgr().GetThreatList().size() > 1) + { + if (urand(0, 50)) + { + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true)) + { + DoCast(target, SPELL_DOMINATE_MIND); + events.Repeat(20s, 30s); + break; + } + } + } + events.Repeat(5s); + break;*/ + case EVENT_SLEEP: + //This saves the target's "SLEEP" buff after the move is complete + _victimbuff = me->GetVictim(); + me->SetReactState(REACT_PASSIVE); + DoCast(me,SPELL_DEEP_SLEEP); + + me->AttackStop(); + if (Creature* mograine = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MOGRAINE))) + { + if (me->GetDistance(mograine) > 0.5f) + { + float fx, fy, fz; + mograine->GetContactPoint(me, fx, fy, fz, 0.5f); + me->GetMotionMaster()->MovePoint(2, fx, fy, fz); + break; + } + } + events.ScheduleEvent(EVENT_RESURRECT, 5s); + break; + case EVENT_RESURRECT: + if (Creature* mograine = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MOGRAINE))) + { + //ServerToClient: SMSG_SPELL_START (0x2C37) Length: 110 ConnIdx: 1 Time: 06/24/2023 06:03:22.400 Number: 13497 + DoCast(mograine, SPELL_SCARLET_RESURRECTION); + me->SetSheath(SHEATH_STATE_UNARMED); + //ServerToClient: SMSG_SPELL_GO (0x2C36) Length: 125 ConnIdx: 1 Time: 06/24/2023 06:03:24.397 Number: 13596 + events.ScheduleEvent(EVENT_SAY, 3429ms); + } + break; + case EVENT_SAY://3429ms + //ServerToClient: SMSG_CHAT (0x2BAD) Length: 107 ConnIdx: 0 Time: 06/24/2023 06:03:25.829 Number: 13659 + Talk(SAY_WH_RESURRECT); + events.ScheduleEvent(EVENT_WHITEMANE_EMOTE, 1413ms); + break; + case EVENT_WHITEMANE_EMOTE://1230ms + //ServerToClient: SMSG_EMOTE (0x27CF) Length: 27 ConnIdx: 1 Time: 06/24/2023 06:03:27.242 Number: 13726 + me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); + _Phase = 2; + events.ScheduleEvent(EVENT_DEALY_ATTACK, 3227ms); + break; + case EVENT_DEALY_ATTACK://3227ms + _Phase = 2; + me->SetReactState(REACT_AGGRESSIVE); + //ServerToClient: SMSG_SPELL_START (0x2C37) Length: 123 ConnIdx: 1 Time: 06/24/2023 06:03:30.469 Number: 13916 + events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 0ms); + events.ScheduleEvent(EVENT_SPELL_HEAL, 15s); + events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 10s); + //events.ScheduleEvent(EVENT_SPELL_DOMINATE_MIND, 10s); + break; + default: break; } } @@ -745,11 +959,9 @@ class boss_high_inquisitor_whitemane : public CreatureScript private: InstanceScript* instance; - uint32 _Heal_Timer; - uint32 _Wait_Timer; - bool _canResurrectCheck; - bool _canResurrect; + Unit* _victimbuff = nullptr; EventMap events; + int _Phase{}; }; CreatureAI* GetAI(Creature* creature) const override @@ -775,20 +987,20 @@ class npc_fairbanks : public CreatureScript //Ready to move to SmartAI void SpellHit(Unit* who, SpellInfo const* spell) override { - if (who && spell->Id == ABE_ffect_000 && !SayAshbringer) + if (who && spell->Id == AB_Effect_000 && !SayAshbringer) { me->SetFaction(FACTION_FRIENDLY); me->SetFacingToObject(who); //There is a delay in sniffing 1615ms //The sniffer uses this spell, but without the visual effect of the spell, using spell 57767 as a visual effect instead me->CastSpell(me, SPELL_TRANSFORM_GHOST); - me->CastSpell(me, 57767, true); //delay 10ms - me->SetDisplayId(16179); + me->SetDisplayId(MODEL_FAIRBANKS); me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); SayAshbringer = true; } } + private: bool SayAshbringer = false; }; From 5fc8085510f892cdeca687341e0b20e9afb497f9 Mon Sep 17 00:00:00 2001 From: fangshun Date: Tue, 2 Jan 2024 23:04:07 +0800 Subject: [PATCH 23/65] Remove some comments --- .../instance_scarlet_monastery.cpp | 271 +++++++----------- 1 file changed, 106 insertions(+), 165 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 15bdaa2e52da4f..8676abc1801c51 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -24,42 +24,38 @@ enum AshbringerEventMisc { - AB_Effect_000 = 28441, - AURA_OF_ASHBRINGER = 28282, - - NPC_SCARLET_MYRIDON = 4295, - NPC_SCARLET_DEFENDER = 4298, - NPC_SCARLET_CENTURION = 4301, - NPC_SCARLET_SORCERER = 4294, - NPC_SCARLET_WIZARD = 4300, - NPC_SCARLET_ABBOT = 4303, - NPC_SCARLET_MONK = 4540, - NPC_SCARLET_CHAMPION = 4302, - NPC_SCARLET_CHAPLAIN = 4299, - NPC_FAIRBANKS = 4542, - - NPC_COMMANDER_MOGRAINE = 3976, - NPC_INQUISITOR_WHITEMANE = 3977, - DOOR_CHAPEL = 104591, - DOOR_HIGH_INQUISITOR_ID = 104600, + AB_Effect_000 = 28441, + AURA_OF_ASHBRINGER = 28282, + NPC_SCARLET_MYRIDON = 4295, + NPC_SCARLET_DEFENDER = 4298, + NPC_SCARLET_CENTURION = 4301, + NPC_SCARLET_SORCERER = 4294, + NPC_SCARLET_WIZARD = 4300, + NPC_SCARLET_ABBOT = 4303, + NPC_SCARLET_MONK = 4540, + NPC_SCARLET_CHAMPION = 4302, + NPC_SCARLET_CHAPLAIN = 4299, + NPC_FAIRBANKS = 4542, + + NPC_COMMANDER_MOGRAINE = 3976, + NPC_INQUISITOR_WHITEMANE = 3977, + DOOR_CHAPEL = 104591, + DOOR_HIGH_INQUISITOR_ID = 104600, SAY_MOGRAINE_ASHBRBINGER_INTRO = 6, }; enum DataTypes { TYPE_MOGRAINE_AND_WHITE_EVENT = 1, - - DATA_MOGRAINE = 2, - DATA_WHITEMANE = 3, - DATA_DOOR_WHITEMANE = 4, - - DATA_HORSEMAN_EVENT = 5, - GAMEOBJECT_PUMPKIN_SHRINE = 6, - - DATA_VORREL = 7, - DATA_ARCANIST_DOAN = 8, - TYPE_ASHBRINGER_EVENT = 9, - DATA_DOOR_CHAPEL = 10, + TYPE_ASHBRINGER_EVENT = 2, + DATA_MOGRAINE = 3, + DATA_WHITEMANE = 4, + DATA_DOOR_WHITEMANE = 5, + DATA_HORSEMAN_EVENT = 6, + DATA_VORREL = 7, + DATA_ARCANIST_DOAN = 8, + DATA_DOOR_CHAPEL = 9, + GAMEOBJECT_PUMPKIN_SHRINE = 10, }; class instance_scarlet_monastery : public InstanceMapScript @@ -273,106 +269,108 @@ class at_scarlet_monastery_cathedral_entrance : public AreaTriggerScript enum ScarletMonasteryTrashMisc { - SAY_WELCOME = 0, - AURA_ASHBRINGER = 28282, - NPC_HIGHLORD_MOGRAINE = 16062, - MODEL_HIGHLORD_MOGRAINE = 16180, - MODEL_FAIRBANKS = 16179, - SPELL_COSMETIC_CHAIN = 45537, - SPELL_COSMETIC_EXPLODE = 45935, - SPELL_FORGIVENESS = 28697 + SAY_WELCOME = 0, + DEAD_SOUND = 1326, + AURA_ASHBRINGER = 28282, + NPC_HIGHLORD_MOGRAINE = 16062, + MODEL_HIGHLORD_MOGRAINE = 16180, + MODEL_FAIRBANKS = 16179, + SPELL_COSMETIC_CHAIN = 45537, + SPELL_COSMETIC_EXPLODE = 45935 }; enum AshbringerEvent { - EVENT_MOGRAINE_FACING_PLAYER = 1, - EVENT_MOGRAINE_KNEEL = 2, - EVENT_MOGRAINE_EMOTE_TALK3 = 3, - EVENT_SUMMONED_HIGHLORD_MOGRAINE = 4, - EVENT_HIGHLORD_MOGRAINE_MOVE_STOP = 5, - EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE = 6, - EVENT_MOGRAINE_UNIT_STAND_STATE_STAND = 7, - EVENT_MOGRAINE_EMOTE_TALK4 = 8, - EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK = 9, - EVENT_HIGHLORD_MOGRAINE_EMOTE1 = 10, - EVENT_HIGHLORD_MOGRAINE_EMOTE2 = 11, - EVENT_HIGHLORD_MOGRAINE_EMOTE3 = 12, + EVENT_MOGRAINE_FACING_PLAYER = 1, + EVENT_MOGRAINE_KNEEL = 2, + EVENT_MOGRAINE_EMOTE_TALK3 = 3, + EVENT_SUMMONED_HIGHLORD_MOGRAINE = 4, + EVENT_HIGHLORD_MOGRAINE_MOVE_STOP = 5, + EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE = 6, + EVENT_MOGRAINE_UNIT_STAND_STATE_STAND = 7, + EVENT_MOGRAINE_EMOTE_TALK4 = 8, + EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK = 9, + EVENT_HIGHLORD_MOGRAINE_EMOTE1 = 10, + EVENT_HIGHLORD_MOGRAINE_EMOTE2 = 11, + EVENT_HIGHLORD_MOGRAINE_EMOTE3 = 12, EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2 = 13, - EVENT_MOGRAINE_EMOTE_TALK5 = 14, - EVENT_HIGHLORD_MOGRAINE_CASTSPELL = 15, - EVENT_MOGRAINE_CASTSPELL = 16, - EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE = 17, - EVENT_ASHBRINGER_OVER = 18 + EVENT_MOGRAINE_EMOTE_TALK5 = 14, + EVENT_HIGHLORD_MOGRAINE_CASTSPELL = 15, + EVENT_MOGRAINE_CASTSPELL = 16, + EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE = 17, + EVENT_ASHBRINGER_OVER = 18 }; enum MograineEvents { - EVENT_RESURRECTED = 1, + EVENT_RESURRECTED = 1, EVENT_SPELL_LAY_ON_HANDS = 2, - EVENT_MOGRAINE_EMOTE = 3, - EVENT_MOVE = 4 + EVENT_MOGRAINE_EMOTE = 3, + EVENT_MOVE = 4 }; enum WhitemaneEvents { - EVENT_SPELL_HOLY_SMITE = 1, + EVENT_SPELL_HOLY_SMITE = 1, EVENT_SPELL_POWER_WORLD_SHIELD = 2, - EVENT_SPELL_HEAL = 3, - EVENT_SPELL_DOMINATE_MIND = 4, - EVENT_SLEEP = 5, - EVENT_RESURRECT = 6, - EVENT_SAY = 7, - EVENT_WHITEMANE_EMOTE = 8, - EVENT_DEALY_ATTACK = 9 + EVENT_SPELL_HEAL = 3, + EVENT_SPELL_DOMINATE_MIND = 4, + EVENT_SLEEP = 5, + EVENT_RESURRECT = 6, + EVENT_SAY = 7, + EVENT_WHITEMANE_EMOTE = 8, + EVENT_DEALY_ATTACK = 9 }; enum Spells { //Mograine Spells - SPELL_CRUSADER_STRIKE = 14518, - SPELL_HAMMER_OF_JUSTICE = 5589, - SPELL_LAY_ON_HANDS = 9257, - SPELL_RETRIBUTION_AURA = 8990, + SPELL_CRUSADER_STRIKE = 14518, + SPELL_HAMMER_OF_JUSTICE = 5589, + SPELL_LAY_ON_HANDS = 9257, + SPELL_RETRIBUTION_AURA = 8990, //Whitemanes Spells - SPELL_SCARLET_RESURRECTION = 9232, - SPELL_DEEP_SLEEP = 9256, - SPELL_DOMINATE_MIND = 14515, - SPELL_HOLY_SMITE = 9481, - SPELL_HEAL = 12039, - SPELL_POWER_WORD_SHIELD = 22187, + SPELL_SCARLET_RESURRECTION = 9232, + SPELL_DEEP_SLEEP = 9256, + SPELL_DOMINATE_MIND = 14515, + SPELL_HOLY_SMITE = 9481, + SPELL_HEAL = 12039, + SPELL_POWER_WORD_SHIELD = 22187, //Highlord Mograine Spells - SPELL_MOGRAINE_COMETH_DND = 28688, + SPELL_MOGRAINE_COMETH_DND = 28688, + SPELL_FORGIVENESS = 28697, - //SPELL_TRANSFORM_GHOST - SPELL_TRANSFORM_GHOST = 28443 + //SPELL_TRANSFORM_GHOST + SPELL_TRANSFORM_GHOST = 28443 }; enum Says { //Mograine says - SAY_MO_AGGRO = 0, - SAY_MO_KILL = 1, - SAY_MO_RESURRECTED = 2, + SAY_MO_AGGRO = 0, + SAY_MO_KILL = 1, + SAY_MO_RESURRECTED = 2, //Mograine Ashbringer Event says - SAY_MO_AB_TALK3 = 3, - SAY_MO_AB_TALK4 = 4, - SAY_MO_AB_TALK5 = 5, + SAY_MO_AB_TALK3 = 3, + SAY_MO_AB_TALK4 = 4, + SAY_MO_AB_TALK5 = 5, //Highlord Mograine Ashbringer Event Says - SAY_HM_AB_TALK0 = 0, - SAY_HM_AB_TALK1 = 1, - SAY_HM_AB_TALK2 = 2, + SAY_HM_AB_TALK0 = 0, + SAY_HM_AB_TALK1 = 1, + SAY_HM_AB_TALK2 = 2, //Whitemane says - SAY_WH_INTRO = 0, - SAY_WH_KILL = 1, - SAY_WH_RESURRECT = 2, + SAY_WH_INTRO = 0, + SAY_WH_KILL = 1, + SAY_WH_RESURRECT = 2 }; float const CATHEDRAL_PULL_RANGE = 80.0f; // Distance from the Cathedral doors to where Mograine is standing +Position const summonedMograinePos = { 1033.4642f, 1399.1022f, 27.337427f, 6.257956981658935546f }; class npc_mograine : public CreatureScript { @@ -405,7 +403,7 @@ class npc_mograine : public CreatureScript me->AI()->Talk(SAY_MO_AB_TALK3, _playerWhoStartedAshbringer); break; case EVENT_SUMMONED_HIGHLORD_MOGRAINE: - if (Creature* summonedMograine = me->SummonCreature(NPC_HIGHLORD_MOGRAINE, 1033.4642f, 1399.1022f, 27.337427f, 6.257956981658935546f, TEMPSUMMON_TIMED_DESPAWN, 120000)) + if (Creature* summonedMograine = me->SummonCreature(NPC_HIGHLORD_MOGRAINE, summonedMograinePos, TEMPSUMMON_TIMED_DESPAWN, 120000)) { summonedMograine->SetFaction(FACTION_FRIENDLY); summonedMograine->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, EQUIP_UNEQUIP); @@ -504,7 +502,6 @@ class npc_mograine : public CreatureScript void Reset() override { - // Incase wipe during phase that mograine fake death me->SetReactState(REACT_AGGRESSIVE); me->SetStandState(UNIT_STAND_STATE_STAND); me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); @@ -559,70 +556,32 @@ class npc_mograine : public CreatureScript damage = 0; //On first death, fake death and open door, as well as initiate whitemane if exist - if (damage > me->GetHealth() && !_fakeDeath) + if (damage > me->GetHealth() && !_fakeDeath) { // On first death, fake death and open door, as well as initiate whitemane if exist if (Creature* Whitemane = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_WHITEMANE))) { instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); Whitemane->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - //ServerToClient: SMSG_CHAT (0x2BAD) Length: 187 ConnIdx: 0 Time: 06/24/2023 06:02:03.366 Number: 9026 Whitemane->AI()->Talk(SAY_WH_INTRO, me); float fx, fy, fz; me->GetContactPoint(Whitemane, fx, fy, fz, 5.0f); Whitemane->GetMotionMaster()->MovePoint(1, fx, fy, fz); Whitemane->SetReactState(REACT_AGGRESSIVE); - // Whitemane->GetMotionMaster()->MovePoint(1, 1163.113370f, 1398.856812f, 32.527786f); } me->GetMotionMaster()->MovementExpired(); me->GetMotionMaster()->MoveIdle(); me->SetHealth(0); - /*ServerToClient: SMSG_PLAY_OBJECT_SOUND(0x276E) Length : 48 ConnIdx : 1 Time : 11 / 25 / 2023 11 : 17 : 10.928 Number : 1490 - SoundId : 1326 (1326) - SourceObjectGUID : Full : 0x204CB017A003E2000001BA00006163B7 Creature / 0 R4908 / S442 Map : 189 Entry : 3976 Low : 6382519 - TargetObjectGUID : Full : 0x204CB017A003E2000001BA00006163B7 Creature / 0 R4908 / S442 Map : 189 Entry : 3976 Low : 6382519 - Position : X : 1138.4968 Y : 1400.8589 Z : 30.745066 - BroadcastTextID : 0*/ - me->PlayDirectSound(1326); - /* ServerToClient: SMSG_AURA_UPDATE(0x2C1F) Length : 18 ConnIdx : 1 Time : 11 / 25 / 2023 11 : 17 : 10.928 Number : 1491 - UpdateAll : False - AurasCount : 1 - [0] Slot : 0 - [0] HasAura : False - UnitGUID : Full: 0x204CB017A003E2000001BA00006163B7 Creature / 0 R4908 / S442 Map : 189 Entry : 3976 Low : 6382519*/ + me->PlayDirectSound(DEAD_SOUND); + //Remove all beneficial auras me->RemoveAura(SPELL_RETRIBUTION_AURA); - /* ServerToClient: SMSG_ATTACK_STOP(0x293E) Length : 23 ConnIdx : 1 Time : 11 / 25 / 2023 11 : 17 : 10.928 Number : 1492 - Attacker Guid : Full: 0x204CB017A003E2000001BA00006163B7 Creature / 0 R4908 / S442 Map : 189 Entry : 3976 Low : 6382519 - Victim Guid : Full: 0x084CA000000000000000000000ABA68A Player / 0 R4904 / S0 Map : 0 Low : 11249290 - NowDead : False*/ me->AttackStop(); - /*ServerToClient: SMSG_UPDATE_OBJECT(0x27CB) Length : 132 ConnIdx : 1 Time : 11 / 25 / 2023 11 : 17 : 10.928 Number : 1494 - NumObjUpdates : 2 - MapID : 189 (189) - HasRemovedObjects : True - DestroyedObjCount : 0 - RemovedObjCount : 3 - (OutOfRange)[0] ObjectGUID : Full : 0x204CB017A00433000001BA0000E163B8 Creature / 0 R4908 / S442 Map : 189 Entry : 4300 Low : 14771128 - (OutOfRange)[1] ObjectGUID : Full : 0x204CB017A00432800001BA00016163B8 Creature / 0 R4908 / S442 Map : 189 Entry : 4298 Low : 23159736 - (OutOfRange)[2] ObjectGUID : Full : 0x204CB017A00433400001BA0005E163B8 Creature / 0 R4908 / S442 Map : 189 Entry : 4301 Low : 98657208 - Data size : 69 - [0] UpdateType : Values - [0] Object Guid : Full: 0x084CA000000000000000000000ABA68A Player / 0 R4904 / S0 Map : 0 Low : 11249290 - [0] Flags : 524296 - [1] UpdateType : Values - [1] Object Guid : Full: 0x204CB017A003E2000001BA00006163B7 Creature / 0 R4908 / S442 Map : 189 Entry : 3976 Low : 6382519 - [1] Target : Full : 0x0 - [1] Flags : 34081344 - [1] StandState : 7*/ me->SetStandState(UNIT_STAND_STATE_DEAD); - /*ClientToServer: CMSG_SET_SELECTION(0x3528) Length : 2 ConnIdx : 1 Time : 11 / 25 / 2023 11 : 17 : 10.932 Number : 1496 - Guid : Full : 0x0*/ me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->ClearAllReactives(); me->SetReactState(REACT_PASSIVE); _scheduler.CancelAll(); _fakeDeath = true; - /* ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_WHITEMANE))->AI()->DoZoneInCombat(nullptr, 15.0f);*/ } } @@ -636,7 +595,6 @@ class npc_mograine : public CreatureScript { if (instance) { - //ServerToClient: SMSG_SPELL_GO (0x2C36) Length: 125 ConnIdx: 1 Time: 11/25/2023 11:17:38.916 Number: 1884 //When hit with resurrection say text if (spell->Id == SPELL_SCARLET_RESURRECTION) { @@ -670,18 +628,16 @@ class npc_mograine : public CreatureScript if (!UpdateVictim() || SayAshbringer) return; - _scheduler.Update(diff); - events.Update(diff); - if (me->HasUnitState(UNIT_STATE_CASTING)) + _scheduler.Update(diff); + events.Update(diff); + if (me->HasUnitState(UNIT_STATE_CASTING)) return; - while (uint32 eventId = events.ExecuteEvent()) + while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_RESURRECTED: - //me->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH); me->SetReactState(REACT_PASSIVE); - //Removed the debuff that took a long time me->AttackStop(); me->InterruptNonMeleeSpells(false); //How do I get rid of the animation from UNIT_STAND_STATE_DEAD to UNIT_STAND_STATE_STAND? @@ -689,9 +645,6 @@ class npc_mograine : public CreatureScript events.ScheduleEvent(EVENT_SPELL_LAY_ON_HANDS, 0s); break; case EVENT_SPELL_LAY_ON_HANDS: - //ServerToClient: SMSG_PLAY_OBJECT_SOUND (0x276E) Length: 48 ConnIdx: 1 Time: 11/25/2023 11:17:43.409 Number: 1928 - //SoundId: 5837 (5837) - //ServerToClient: SMSG_SPELL_START (0x2C37) Length: 108 ConnIdx: 1 Time: 11/25/2023 11:17:43.409 Number: 1929 if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_WHITEMANE))) { if (Whitemane->IsAlive()) @@ -700,13 +653,10 @@ class npc_mograine : public CreatureScript events.ScheduleEvent(EVENT_MOGRAINE_EMOTE, 500ms); } break; - //ServerToClient: SMSG_CHAT (0x2BAD) Length: 159 ConnIdx: 0 Time: 11/25/2023 11:17:43.597 Number: 1936 case EVENT_MOGRAINE_EMOTE: - //ServerToClient: SMSG_CHAT (0x2BAD) Length: 159 ConnIdx: 0 Time: 11/25/2023 11:17:43.597 Number: 1936 me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); events.ScheduleEvent(EVENT_MOVE, 3044ms); break; - //ServerToClient: SMSG_ON_MONSTER_MOVE (0x2DD4) Length: 80 ConnIdx: 1 Time: 11/25/2023 11:17:46.641 Number: 1956 case EVENT_MOVE: if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_WHITEMANE))) { @@ -717,12 +667,11 @@ class npc_mograine : public CreatureScript me->GetMotionMaster()->MovePoint(1, fx, fy, fz); } break; - //SMSG_ATTACKER_STATE_UPDATE (0x2952) Length: 80 ConnIdx: 1 Time: 11/25/2023 11:17:49.891 Number: 1990 - //8990 default: break; } } + DoMeleeAttackIfReady(); } @@ -755,7 +704,6 @@ class boss_high_inquisitor_whitemane : public CreatureScript void Reset() override { - me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);//this heck fix me->SetReactState(REACT_AGGRESSIVE); _victimbuff = nullptr; events.Reset(); @@ -876,8 +824,6 @@ class boss_high_inquisitor_whitemane : public CreatureScript { if (target->HealthBelowPct(75)) { - if (me->IsNonMeleeSpellCast(true)) - me->InterruptNonMeleeSpells(false); DoCast(target, SPELL_HEAL); events.Repeat(17500ms, 20s); break; @@ -885,10 +831,11 @@ class boss_high_inquisitor_whitemane : public CreatureScript } events.Repeat(1s); break; + /* case EVENT_SPELL_DOMINATE_MIND: if (me->GetThreatMgr().GetThreatList().size() > 1) { - if (urand(0, 50)) + if (urand(0, 2)) { if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true)) { @@ -904,7 +851,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript //This saves the target's "SLEEP" buff after the move is complete _victimbuff = me->GetVictim(); me->SetReactState(REACT_PASSIVE); - DoCast(me,SPELL_DEEP_SLEEP); + DoCast(SPELL_DEEP_SLEEP); me->AttackStop(); if (Creature* mograine = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MOGRAINE))) @@ -922,32 +869,26 @@ class boss_high_inquisitor_whitemane : public CreatureScript case EVENT_RESURRECT: if (Creature* mograine = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MOGRAINE))) { - //ServerToClient: SMSG_SPELL_START (0x2C37) Length: 110 ConnIdx: 1 Time: 06/24/2023 06:03:22.400 Number: 13497 DoCast(mograine, SPELL_SCARLET_RESURRECTION); me->SetSheath(SHEATH_STATE_UNARMED); - //ServerToClient: SMSG_SPELL_GO (0x2C36) Length: 125 ConnIdx: 1 Time: 06/24/2023 06:03:24.397 Number: 13596 events.ScheduleEvent(EVENT_SAY, 3429ms); } break; - case EVENT_SAY://3429ms - //ServerToClient: SMSG_CHAT (0x2BAD) Length: 107 ConnIdx: 0 Time: 06/24/2023 06:03:25.829 Number: 13659 + case EVENT_SAY: Talk(SAY_WH_RESURRECT); events.ScheduleEvent(EVENT_WHITEMANE_EMOTE, 1413ms); break; - case EVENT_WHITEMANE_EMOTE://1230ms - //ServerToClient: SMSG_EMOTE (0x27CF) Length: 27 ConnIdx: 1 Time: 06/24/2023 06:03:27.242 Number: 13726 + case EVENT_WHITEMANE_EMOTE: me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); _Phase = 2; events.ScheduleEvent(EVENT_DEALY_ATTACK, 3227ms); break; - case EVENT_DEALY_ATTACK://3227ms + case EVENT_DEALY_ATTACK: _Phase = 2; - me->SetReactState(REACT_AGGRESSIVE); - //ServerToClient: SMSG_SPELL_START (0x2C37) Length: 123 ConnIdx: 1 Time: 06/24/2023 06:03:30.469 Number: 13916 + me->SetReactState(REACT_AGGRESSIVE); events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 0ms); events.ScheduleEvent(EVENT_SPELL_HEAL, 15s); events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 10s); - //events.ScheduleEvent(EVENT_SPELL_DOMINATE_MIND, 10s); break; default: break; @@ -992,7 +933,7 @@ class npc_fairbanks : public CreatureScript me->SetFaction(FACTION_FRIENDLY); me->SetFacingToObject(who); //There is a delay in sniffing 1615ms - //The sniffer uses this spell, but without the visual effect of the spell, using spell 57767 as a visual effect instead + //The sniffer uses this spell, but without the visual effect of the spell. me->CastSpell(me, SPELL_TRANSFORM_GHOST); //delay 10ms me->SetDisplayId(MODEL_FAIRBANKS); From 1824ac57c7404fe2841cd212a9a506a09081f81b Mon Sep 17 00:00:00 2001 From: fangshun Date: Wed, 3 Jan 2024 18:28:29 +0800 Subject: [PATCH 24/65] Delete blank lines --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 8676abc1801c51..e0acc5e0b7fd9b 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -845,7 +845,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript } } } - events.Repeat(5s); + events.Repeat(10s); break;*/ case EVENT_SLEEP: //This saves the target's "SLEEP" buff after the move is complete @@ -874,18 +874,18 @@ class boss_high_inquisitor_whitemane : public CreatureScript events.ScheduleEvent(EVENT_SAY, 3429ms); } break; - case EVENT_SAY: + case EVENT_SAY: Talk(SAY_WH_RESURRECT); events.ScheduleEvent(EVENT_WHITEMANE_EMOTE, 1413ms); break; - case EVENT_WHITEMANE_EMOTE: + case EVENT_WHITEMANE_EMOTE: me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); _Phase = 2; events.ScheduleEvent(EVENT_DEALY_ATTACK, 3227ms); break; case EVENT_DEALY_ATTACK: _Phase = 2; - me->SetReactState(REACT_AGGRESSIVE); + me->SetReactState(REACT_AGGRESSIVE); events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 0ms); events.ScheduleEvent(EVENT_SPELL_HEAL, 15s); events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 10s); From db61caad849e5e2715b8d859cfb7274aaa5959f2 Mon Sep 17 00:00:00 2001 From: fangshun Date: Wed, 3 Jan 2024 18:40:12 +0800 Subject: [PATCH 25/65] Remove spaces --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index e0acc5e0b7fd9b..2df1d359bac867 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -53,9 +53,9 @@ enum DataTypes DATA_DOOR_WHITEMANE = 5, DATA_HORSEMAN_EVENT = 6, DATA_VORREL = 7, - DATA_ARCANIST_DOAN = 8, + DATA_ARCANIST_DOAN = 8, DATA_DOOR_CHAPEL = 9, - GAMEOBJECT_PUMPKIN_SHRINE = 10, + GAMEOBJECT_PUMPKIN_SHRINE = 10 }; class instance_scarlet_monastery : public InstanceMapScript @@ -342,7 +342,7 @@ enum Spells SPELL_MOGRAINE_COMETH_DND = 28688, SPELL_FORGIVENESS = 28697, - //SPELL_TRANSFORM_GHOST + //SPELL_TRANSFORM_GHOST SPELL_TRANSFORM_GHOST = 28443 }; From d4b14d97f6d0129fbd802991bb0fb8ccec171180 Mon Sep 17 00:00:00 2001 From: fangshun Date: Wed, 3 Jan 2024 19:04:00 +0800 Subject: [PATCH 26/65] Add header files --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 2df1d359bac867..266d94c61eeedd 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -15,6 +15,7 @@ * with this program. If not, see . */ +#include "AreaTriggerScript.h" #include "CreatureScript.h" #include "InstanceMapScript.h" #include "scarletmonastery.h" From be45787927b4bb8de9bf50896db4425714177355 Mon Sep 17 00:00:00 2001 From: fangshun Date: Wed, 3 Jan 2024 19:20:10 +0800 Subject: [PATCH 27/65] Comment out unused parameters --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 266d94c61eeedd..2b551b46feaf1d 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -517,7 +517,7 @@ class npc_mograine : public CreatureScript SayAshbringer = false; } - void EnterEvadeMode(EvadeReason why) override + void EnterEvadeMode(EvadeReason /*why*/) override { if (instance) { @@ -718,7 +718,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript ScriptedAI::JustRespawned(); } - void EnterEvadeMode(EvadeReason why) override + void EnterEvadeMode(EvadeReason /*why*/) override { if (instance) { From ca5537d9fe4ffb07a4e7392e31d3ef76aa859021 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sat, 6 Jan 2024 09:20:42 +0800 Subject: [PATCH 28/65] Add spaces --- .../instance_scarlet_monastery.cpp | 116 ++++++++++-------- 1 file changed, 67 insertions(+), 49 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 2b551b46feaf1d..5c56f427c24288 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -25,30 +25,37 @@ enum AshbringerEventMisc { - AB_Effect_000 = 28441, + AB_EFFECT_000 = 28441, AURA_OF_ASHBRINGER = 28282, + + NPC_COMMANDER_MOGRAINE = 3976, + NPC_INQUISITOR_WHITEMANE = 3977, NPC_SCARLET_MYRIDON = 4295, - NPC_SCARLET_DEFENDER = 4298, - NPC_SCARLET_CENTURION = 4301, NPC_SCARLET_SORCERER = 4294, + NPC_SCARLET_DEFENDER = 4298, + NPC_SCARLET_CHAPLAIN = 4299, NPC_SCARLET_WIZARD = 4300, + NPC_SCARLET_CENTURION = 4301, + NPC_SCARLET_CHAMPION = 4302, NPC_SCARLET_ABBOT = 4303, NPC_SCARLET_MONK = 4540, - NPC_SCARLET_CHAMPION = 4302, - NPC_SCARLET_CHAPLAIN = 4299, - NPC_FAIRBANKS = 4542, + NPC_FAIRBANKS = 4542, + NPC_HIGHLORD_MOGRAINE = 16062, - NPC_COMMANDER_MOGRAINE = 3976, - NPC_INQUISITOR_WHITEMANE = 3977, DOOR_CHAPEL = 104591, DOOR_HIGH_INQUISITOR_ID = 104600, - SAY_MOGRAINE_ASHBRBINGER_INTRO = 6, + + MODEL_HIGHLORD_MOGRAINE = 16180, + MODEL_FAIRBANKS = 16179, + + SAY_MOGRAINE_ASHBRBINGER_INTRO = 6 }; enum DataTypes { TYPE_MOGRAINE_AND_WHITE_EVENT = 1, TYPE_ASHBRINGER_EVENT = 2, + DATA_MOGRAINE = 3, DATA_WHITEMANE = 4, DATA_DOOR_WHITEMANE = 5, @@ -56,6 +63,7 @@ enum DataTypes DATA_VORREL = 7, DATA_ARCANIST_DOAN = 8, DATA_DOOR_CHAPEL = 9, + GAMEOBJECT_PUMPKIN_SHRINE = 10 }; @@ -147,6 +155,7 @@ class instance_scarlet_monastery : public InstanceMapScript encounter = NOT_STARTED; return; } + //Whitemane will not be able to fight Mograine again when he dies if (!Whitemane->IsAlive()) { @@ -161,6 +170,7 @@ class instance_scarlet_monastery : public InstanceMapScript encounter = data; return; } + encounter = data; } if (data == SPECIAL) @@ -177,9 +187,9 @@ class instance_scarlet_monastery : public InstanceMapScript } // the ashbringer incident did not sniff out any data from whitemane - Creature* whitemane = instance->GetCreature(WhitemaneGUID); - if (whitemane && whitemane->IsAlive() && !whitemane->IsInCombat()) - whitemane->DespawnOrUnsummon(); + if (Creature* whitemane = instance->GetCreature(WhitemaneGUID)) + if (whitemane->IsAlive() && !whitemane->IsInCombat()) + whitemane->DespawnOrUnsummon(); for (auto const& scarletCathedralNpcGuid : AshbringerNpcGUID) if (Creature* scarletNpc = instance->GetCreature(scarletCathedralNpcGuid)) @@ -259,6 +269,7 @@ class at_scarlet_monastery_cathedral_entrance : public AreaTriggerScript Creature* commanderMograine = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_MOGRAINE)); if (commanderMograine && commanderMograine->IsAlive()) commanderMograine->AI()->Talk(SAY_MOGRAINE_ASHBRBINGER_INTRO); + instance->SetData(TYPE_ASHBRINGER_EVENT, IN_PROGRESS); return true; } @@ -268,16 +279,11 @@ class at_scarlet_monastery_cathedral_entrance : public AreaTriggerScript } }; -enum ScarletMonasteryTrashMisc +enum Misc { - SAY_WELCOME = 0, - DEAD_SOUND = 1326, - AURA_ASHBRINGER = 28282, - NPC_HIGHLORD_MOGRAINE = 16062, - MODEL_HIGHLORD_MOGRAINE = 16180, - MODEL_FAIRBANKS = 16179, - SPELL_COSMETIC_CHAIN = 45537, - SPELL_COSMETIC_EXPLODE = 45935 + POINT_MOGRAINE_TO_WHITEMANE = 0, + POINT_WHITEMANE_TO_MOGRAINE = 0, + POINT_WHITEMANE_RESURRECTED = 1 }; enum AshbringerEvent @@ -353,6 +359,7 @@ enum Says SAY_MO_AGGRO = 0, SAY_MO_KILL = 1, SAY_MO_RESURRECTED = 2, + SOUND_DEAD = 1326, //Mograine Ashbringer Event says SAY_MO_AB_TALK3 = 3, @@ -505,7 +512,6 @@ class npc_mograine : public CreatureScript { me->SetReactState(REACT_AGGRESSIVE); me->SetStandState(UNIT_STAND_STATE_STAND); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); events.Reset(); _fakeDeath = false; @@ -530,7 +536,7 @@ class npc_mograine : public CreatureScript if (type != POINT_MOTION_TYPE) return; - if (id == 1) + if (id == POINT_MOGRAINE_TO_WHITEMANE) { me->SetReactState(REACT_AGGRESSIVE); DoCastSelf(SPELL_RETRIBUTION_AURA); @@ -542,7 +548,7 @@ class npc_mograine : public CreatureScript void JustEngagedWith(Unit* /*who*/) override { - Talk(SAY_MO_AGGRO); + Talk(SAY_MO_AGGRO); DoCastSelf(SPELL_RETRIBUTION_AURA); _scheduler.Schedule(1s, [this](TaskContext) { @@ -563,17 +569,16 @@ class npc_mograine : public CreatureScript if (Creature* Whitemane = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_WHITEMANE))) { instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); - Whitemane->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); Whitemane->AI()->Talk(SAY_WH_INTRO, me); float fx, fy, fz; me->GetContactPoint(Whitemane, fx, fy, fz, 5.0f); - Whitemane->GetMotionMaster()->MovePoint(1, fx, fy, fz); + Whitemane->GetMotionMaster()->MovePoint(POINT_WHITEMANE_TO_MOGRAINE, fx, fy,fz); Whitemane->SetReactState(REACT_AGGRESSIVE); } me->GetMotionMaster()->MovementExpired(); me->GetMotionMaster()->MoveIdle(); me->SetHealth(0); - me->PlayDirectSound(DEAD_SOUND); + me->PlayDirectSound(SOUND_DEAD); //Remove all beneficial auras me->RemoveAura(SPELL_RETRIBUTION_AURA); me->AttackStop(); @@ -603,7 +608,7 @@ class npc_mograine : public CreatureScript events.ScheduleEvent(EVENT_RESURRECTED, 3500ms); } - if (who && spell->Id == AB_Effect_000 && !SayAshbringer) + if (who && spell->Id == AB_EFFECT_000 && !SayAshbringer) { me->SetFaction(FACTION_FRIENDLY); me->GetMotionMaster()->MoveIdle(); @@ -629,10 +634,14 @@ class npc_mograine : public CreatureScript if (!UpdateVictim() || SayAshbringer) return; + _scheduler.Update(diff); + events.Update(diff); + if (me->HasUnitState(UNIT_STATE_CASTING)) return; + while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) @@ -650,6 +659,7 @@ class npc_mograine : public CreatureScript { if (Whitemane->IsAlive()) me->CastSpell(Whitemane, SPELL_LAY_ON_HANDS); + Talk(SAY_MO_RESURRECTED, Whitemane); events.ScheduleEvent(EVENT_MOGRAINE_EMOTE, 500ms); } @@ -661,11 +671,10 @@ class npc_mograine : public CreatureScript case EVENT_MOVE: if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_WHITEMANE))) { - - float fx, fy, fz; me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + float fx{}, fy{}, fz{}; Whitemane->GetContactPoint(me, fx, fy, fz, 0.0f); - me->GetMotionMaster()->MovePoint(1, fx, fy, fz); + me->GetMotionMaster()->MovePoint(POINT_MOGRAINE_TO_WHITEMANE, fx, fy, fz); } break; default: @@ -715,6 +724,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript { if (instance) instance->DoUseDoorOrButton(instance->GetGuidData(DATA_DOOR_WHITEMANE)); + ScriptedAI::JustRespawned(); } @@ -730,6 +740,8 @@ class boss_high_inquisitor_whitemane : public CreatureScript { events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 10ms); events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 22s, 45s); + //This spell was not used during the single-player test on the Blizzard server, + // it should take 2 people, and the chance of using it should be low events.ScheduleEvent(EVENT_SPELL_DOMINATE_MIND, 5s, 10s); } @@ -748,7 +760,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript if (type != POINT_MOTION_TYPE) return; - if (id == 2) + if (id == POINT_WHITEMANE_RESURRECTED) { //This determines whether the target buff exists //Use don't know why use me->GetVictim() Unable to get the target @@ -788,22 +800,29 @@ class boss_high_inquisitor_whitemane : public CreatureScript switch (eventId) { case EVENT_SPELL_HOLY_SMITE: - if (Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 0, 0.0f, false)) + + if (Unit* target = me->GetVictim()) { me->GetMotionMaster()->MoveChase(target, 30.0f); if (DoCast(target, SPELL_HOLY_SMITE) != SPELL_CAST_OK) { - me->GetMotionMaster()->MoveChase(target, 0); - events.Repeat(1200ms,1500ms); + me->GetMotionMaster()->MoveChase(target); + events.Repeat(1200ms); + break; + } + + if (me->GetExactDist2d(target) < 5.0f) + { + events.Repeat(4500ms, 5s); break; } } - events.Repeat(4000ms,7s); + events.Repeat(2600ms, 3000ms); break; case EVENT_SPELL_POWER_WORLD_SHIELD: //Since mograine has 0 HP, the DoSelectLowestHpFriendly function will always try to use it on him, not on himself - if (_Phase!=2) + if (_Phase != 2) { DoCast(me, SPELL_POWER_WORD_SHIELD); events.Repeat(22s, 35s); @@ -830,13 +849,13 @@ class boss_high_inquisitor_whitemane : public CreatureScript break; } } - events.Repeat(1s); + events.Repeat(5s); break; - - /* case EVENT_SPELL_DOMINATE_MIND: + case EVENT_SPELL_DOMINATE_MIND: + // The list of hates is greater than 1 if (me->GetThreatMgr().GetThreatList().size() > 1) { - if (urand(0, 2)) + if (urand(0, 20))//Used for testing !urand(0, 20) { if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true)) { @@ -847,21 +866,21 @@ class boss_high_inquisitor_whitemane : public CreatureScript } } events.Repeat(10s); - break;*/ + break; case EVENT_SLEEP: //This saves the target's "SLEEP" buff after the move is complete _victimbuff = me->GetVictim(); me->SetReactState(REACT_PASSIVE); DoCast(SPELL_DEEP_SLEEP); - me->AttackStop(); + if (Creature* mograine = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MOGRAINE))) { if (me->GetDistance(mograine) > 0.5f) { float fx, fy, fz; mograine->GetContactPoint(me, fx, fy, fz, 0.5f); - me->GetMotionMaster()->MovePoint(2, fx, fy, fz); + me->GetMotionMaster()->MovePoint(POINT_WHITEMANE_RESURRECTED, fx, fy, fz); break; } } @@ -885,9 +904,8 @@ class boss_high_inquisitor_whitemane : public CreatureScript events.ScheduleEvent(EVENT_DEALY_ATTACK, 3227ms); break; case EVENT_DEALY_ATTACK: - _Phase = 2; me->SetReactState(REACT_AGGRESSIVE); - events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 0ms); + events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 10ms); events.ScheduleEvent(EVENT_SPELL_HEAL, 15s); events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 10s); break; @@ -903,7 +921,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript InstanceScript* instance; Unit* _victimbuff = nullptr; EventMap events; - int _Phase{}; + uint8 _Phase{}; }; CreatureAI* GetAI(Creature* creature) const override @@ -919,7 +937,7 @@ class npc_fairbanks : public CreatureScript struct npc_fairbanksAI : public SmartAI { - npc_fairbanksAI(Creature* creature) : SmartAI(creature) { } + npc_fairbanksAI(Creature* creature) : SmartAI(creature) {} void Reset() override { @@ -929,7 +947,7 @@ class npc_fairbanks : public CreatureScript //Ready to move to SmartAI void SpellHit(Unit* who, SpellInfo const* spell) override { - if (who && spell->Id == AB_Effect_000 && !SayAshbringer) + if (who && spell->Id == AB_EFFECT_000 && !SayAshbringer) { me->SetFaction(FACTION_FRIENDLY); me->SetFacingToObject(who); From c8cc0aafa7212ba5520d7973ded96008e52c9fa2 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sat, 6 Jan 2024 11:57:00 +0800 Subject: [PATCH 29/65] Remove spaces --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 5c56f427c24288..7d45174c553189 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -39,7 +39,7 @@ enum AshbringerEventMisc NPC_SCARLET_CHAMPION = 4302, NPC_SCARLET_ABBOT = 4303, NPC_SCARLET_MONK = 4540, - NPC_FAIRBANKS = 4542, + NPC_FAIRBANKS = 4542, NPC_HIGHLORD_MOGRAINE = 16062, DOOR_CHAPEL = 104591, @@ -672,7 +672,7 @@ class npc_mograine : public CreatureScript if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_WHITEMANE))) { me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - float fx{}, fy{}, fz{}; + float fx, fy, fz; Whitemane->GetContactPoint(me, fx, fy, fz, 0.0f); me->GetMotionMaster()->MovePoint(POINT_MOGRAINE_TO_WHITEMANE, fx, fy, fz); } @@ -799,8 +799,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript { switch (eventId) { - case EVENT_SPELL_HOLY_SMITE: - + case EVENT_SPELL_HOLY_SMITE: if (Unit* target = me->GetVictim()) { me->GetMotionMaster()->MoveChase(target, 30.0f); From 016f0e13de1726420a8c81328b3dcca4285b8282 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sat, 6 Jan 2024 11:59:06 +0800 Subject: [PATCH 30/65] Remove spaces --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 7d45174c553189..06d5d764125ab8 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -799,7 +799,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript { switch (eventId) { - case EVENT_SPELL_HOLY_SMITE: + case EVENT_SPELL_HOLY_SMITE: if (Unit* target = me->GetVictim()) { me->GetMotionMaster()->MoveChase(target, 30.0f); From 3f8997b966b1127117806b8a5aa470de8583050d Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 7 Jan 2024 06:57:17 +0800 Subject: [PATCH 31/65] Code modifications --- .../instance_scarlet_monastery.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 06d5d764125ab8..ea1b0475d3573d 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -45,8 +45,8 @@ enum AshbringerEventMisc DOOR_CHAPEL = 104591, DOOR_HIGH_INQUISITOR_ID = 104600, - MODEL_HIGHLORD_MOGRAINE = 16180, - MODEL_FAIRBANKS = 16179, + MODEL_HIGHLORD_MOGRAINE = 16180, + MODEL_FAIRBANKS = 16179, SAY_MOGRAINE_ASHBRBINGER_INTRO = 6 }; @@ -266,9 +266,13 @@ class at_scarlet_monastery_cathedral_entrance : public AreaTriggerScript { if (instance->GetData(TYPE_ASHBRINGER_EVENT) == NOT_STARTED) { - Creature* commanderMograine = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_MOGRAINE)); - if (commanderMograine && commanderMograine->IsAlive()) - commanderMograine->AI()->Talk(SAY_MOGRAINE_ASHBRBINGER_INTRO); + if (Creature* commanderMograine = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_MOGRAINE))) + { + if (commanderMograine->IsAlive()) + { + commanderMograine->AI()->Talk(SAY_MOGRAINE_ASHBRBINGER_INTRO); + } + } instance->SetData(TYPE_ASHBRINGER_EVENT, IN_PROGRESS); return true; From a0b90fde3fef9a33940de10575df67a1c644656d Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 7 Jan 2024 07:07:27 +0800 Subject: [PATCH 32/65] Modify time --- .../instance_scarlet_monastery.cpp | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index ea1b0475d3573d..2bf5df0c3198a0 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -314,23 +314,23 @@ enum AshbringerEvent enum MograineEvents { - EVENT_RESURRECTED = 1, - EVENT_SPELL_LAY_ON_HANDS = 2, - EVENT_MOGRAINE_EMOTE = 3, - EVENT_MOVE = 4 + EVENT_RESURRECTED = 1, + EVENT_SPELL_LAY_ON_HANDS = 2, + EVENT_MOGRAINE_EMOTE = 3, + EVENT_MOVE = 4 }; enum WhitemaneEvents { - EVENT_SPELL_HOLY_SMITE = 1, - EVENT_SPELL_POWER_WORLD_SHIELD = 2, - EVENT_SPELL_HEAL = 3, - EVENT_SPELL_DOMINATE_MIND = 4, - EVENT_SLEEP = 5, - EVENT_RESURRECT = 6, - EVENT_SAY = 7, - EVENT_WHITEMANE_EMOTE = 8, - EVENT_DEALY_ATTACK = 9 + EVENT_SPELL_HOLY_SMITE = 1, + EVENT_SPELL_POWER_WORLD_SHIELD = 2, + EVENT_SPELL_HEAL = 3, + EVENT_SPELL_DOMINATE_MIND = 4, + EVENT_SLEEP = 5, + EVENT_RESURRECT = 6, + EVENT_SAY = 7, + EVENT_WHITEMANE_EMOTE = 8, + EVENT_DEALY_ATTACK = 9 }; enum Spells @@ -663,14 +663,13 @@ class npc_mograine : public CreatureScript { if (Whitemane->IsAlive()) me->CastSpell(Whitemane, SPELL_LAY_ON_HANDS); - Talk(SAY_MO_RESURRECTED, Whitemane); - events.ScheduleEvent(EVENT_MOGRAINE_EMOTE, 500ms); } + events.ScheduleEvent(EVENT_MOGRAINE_EMOTE, 500ms); break; case EVENT_MOGRAINE_EMOTE: me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - events.ScheduleEvent(EVENT_MOVE, 3044ms); + events.ScheduleEvent(EVENT_MOVE, 3000ms); break; case EVENT_MOVE: if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_WHITEMANE))) @@ -751,7 +750,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript void DamageTaken(Unit* /*doneBy*/, uint32& damage, DamageEffectType, SpellSchoolMask) override { - //Until Mowglini is resurrected, players cannot kill her + //The player cannot kill her until she is releashed. Retain at least 1 life if (_Phase != 2 && damage >= me->GetHealth()) { damage = 0; @@ -894,17 +893,17 @@ class boss_high_inquisitor_whitemane : public CreatureScript { DoCast(mograine, SPELL_SCARLET_RESURRECTION); me->SetSheath(SHEATH_STATE_UNARMED); - events.ScheduleEvent(EVENT_SAY, 3429ms); + events.ScheduleEvent(EVENT_SAY, 3400ms); } break; case EVENT_SAY: Talk(SAY_WH_RESURRECT); - events.ScheduleEvent(EVENT_WHITEMANE_EMOTE, 1413ms); + events.ScheduleEvent(EVENT_WHITEMANE_EMOTE, 1400ms); break; case EVENT_WHITEMANE_EMOTE: me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); _Phase = 2; - events.ScheduleEvent(EVENT_DEALY_ATTACK, 3227ms); + events.ScheduleEvent(EVENT_DEALY_ATTACK, 3200ms); break; case EVENT_DEALY_ATTACK: me->SetReactState(REACT_AGGRESSIVE); From be9d5cb63d89d97d1f88e00b58142e782be51f48 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 7 Jan 2024 07:18:10 +0800 Subject: [PATCH 33/65] Modify DOMINATE_MIND chances --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 2bf5df0c3198a0..d33fbe693d5400 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -857,7 +857,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript // The list of hates is greater than 1 if (me->GetThreatMgr().GetThreatList().size() > 1) { - if (urand(0, 20))//Used for testing !urand(0, 20) + if (!urand(0, 20))// 1/20 Used for testing urand(0, 20) { if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true)) { From 45e13601dac83c1ce9bb9a5710ee807bbda3e172 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 7 Jan 2024 07:22:37 +0800 Subject: [PATCH 34/65] Modify the code location --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index d33fbe693d5400..c989a039f51b89 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -892,9 +892,9 @@ class boss_high_inquisitor_whitemane : public CreatureScript if (Creature* mograine = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MOGRAINE))) { DoCast(mograine, SPELL_SCARLET_RESURRECTION); - me->SetSheath(SHEATH_STATE_UNARMED); - events.ScheduleEvent(EVENT_SAY, 3400ms); } + me->SetSheath(SHEATH_STATE_UNARMED); + events.ScheduleEvent(EVENT_SAY, 3400ms); break; case EVENT_SAY: Talk(SAY_WH_RESURRECT); From d1144375e21e0cd8a963734fb43aea53d087c9bc Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 7 Jan 2024 07:27:22 +0800 Subject: [PATCH 35/65] Modify the comment --- .../instance_scarlet_monastery.cpp | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index c989a039f51b89..8e741945eb317b 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -88,7 +88,7 @@ class instance_scarlet_monastery : public InstanceMapScript { switch (go->GetEntry()) { - //case ENTRY_PUMPKIN_SHRINE: PumpkinShrineGUID = go->GetGUID(); break; + // case ENTRY_PUMPKIN_SHRINE: PumpkinShrineGUID = go->GetGUID(); break; case DOOR_HIGH_INQUISITOR_ID: DoorHighInquisitorGUID = go->GetGUID(); break; @@ -147,7 +147,7 @@ class instance_scarlet_monastery : public InstanceMapScript if (Whitemane->IsAlive() && Mograine->IsAlive()) { - //When Whitemane emerges from the main gate, Whitemane will stand next to Mograine's corpse and will not reset Whitemane + // When Whitemane emerges from the main gate, Whitemane will stand next to Mograine's corpse and will not reset Whitemane if (Whitemane->IsInCombat()) Whitemane->DespawnOnEvade(30s); @@ -156,7 +156,7 @@ class instance_scarlet_monastery : public InstanceMapScript return; } - //Whitemane will not be able to fight Mograine again when he dies + // Whitemane will not be able to fight Mograine again when he dies if (!Whitemane->IsAlive()) { Mograine->DespawnOrUnsummon(); @@ -420,7 +420,8 @@ class npc_mograine : public CreatureScript summonedMograine->SetFaction(FACTION_FRIENDLY); summonedMograine->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, EQUIP_UNEQUIP); summonedMograine->SetDisplayId(MODEL_HIGHLORD_MOGRAINE); - summonedMograine->CastSpell(summonedMograine, SPELL_MOGRAINE_COMETH_DND);//Sniffing data shows the use of this spell transformation, but the dispersion effect of this spell is not seen in the video + // Sniffing data shows the use of this spell transformation, but the dispersion effect of this spell is not seen in the video + summonedMograine->CastSpell(summonedMograine, SPELL_MOGRAINE_COMETH_DND); } events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_MOVE_STOP, 48500ms); break; @@ -468,7 +469,7 @@ class npc_mograine : public CreatureScript events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_CASTSPELL, 3000ms); break; case EVENT_HIGHLORD_MOGRAINE_CASTSPELL: - //In Blizzard's servers, after "HIGHLORD_MOGRAINE" uses this spell, "MOGRAINE" will have a visual effect of lightning hits, and the visual effect after the hit is missing here and needs to be fixed + // In Blizzard's servers, after "HIGHLORD_MOGRAINE" uses this spell, "MOGRAINE" will have a visual effect of lightning hits, and the visual effect after the hit is missing here and needs to be fixed summonedMograine->CastSpell(me, SPELL_FORGIVENESS); events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 1000ms); break; @@ -566,7 +567,7 @@ class npc_mograine : public CreatureScript if (damage > me->GetHealth() && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) != SPECIAL && _fakeDeath) damage = 0; - //On first death, fake death and open door, as well as initiate whitemane if exist + // On first death, fake death and open door, as well as initiate whitemane if exist if (damage > me->GetHealth() && !_fakeDeath) { // On first death, fake death and open door, as well as initiate whitemane if exist @@ -583,7 +584,7 @@ class npc_mograine : public CreatureScript me->GetMotionMaster()->MoveIdle(); me->SetHealth(0); me->PlayDirectSound(SOUND_DEAD); - //Remove all beneficial auras + // Remove all beneficial auras me->RemoveAura(SPELL_RETRIBUTION_AURA); me->AttackStop(); me->SetStandState(UNIT_STAND_STATE_DEAD); @@ -605,13 +606,14 @@ class npc_mograine : public CreatureScript { if (instance) { - //When hit with resurrection say text + // When hit with resurrection say text if (spell->Id == SPELL_SCARLET_RESURRECTION) { instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); events.ScheduleEvent(EVENT_RESURRECTED, 3500ms); } + // Ashbringer Event if (who && spell->Id == AB_EFFECT_000 && !SayAshbringer) { me->SetFaction(FACTION_FRIENDLY); @@ -654,7 +656,7 @@ class npc_mograine : public CreatureScript me->SetReactState(REACT_PASSIVE); me->AttackStop(); me->InterruptNonMeleeSpells(false); - //How do I get rid of the animation from UNIT_STAND_STATE_DEAD to UNIT_STAND_STATE_STAND? + // How do I get rid of the animation from UNIT_STAND_STATE_DEAD to UNIT_STAND_STATE_STAND? me->SetStandState(UNIT_STAND_STATE_STAND); events.ScheduleEvent(EVENT_SPELL_LAY_ON_HANDS, 0s); break; @@ -743,14 +745,14 @@ class boss_high_inquisitor_whitemane : public CreatureScript { events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 10ms); events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 22s, 45s); - //This spell was not used during the single-player test on the Blizzard server, + // This spell was not used during the single-player test on the Blizzard server, // it should take 2 people, and the chance of using it should be low events.ScheduleEvent(EVENT_SPELL_DOMINATE_MIND, 5s, 10s); } void DamageTaken(Unit* /*doneBy*/, uint32& damage, DamageEffectType, SpellSchoolMask) override { - //The player cannot kill her until she is releashed. Retain at least 1 life + // The player cannot kill her until she is releashed. Retain at least 1 life if (_Phase != 2 && damage >= me->GetHealth()) { damage = 0; @@ -765,10 +767,10 @@ class boss_high_inquisitor_whitemane : public CreatureScript if (id == POINT_WHITEMANE_RESURRECTED) { - //This determines whether the target buff exists - //Use don't know why use me->GetVictim() Unable to get the target + // This determines whether the target buff exists + // Use don't know why use me->GetVictim() Unable to get the target if (_victimbuff && _victimbuff->HasAura(SPELL_DEEP_SLEEP)) - //Wait 5 seconds to revive while the debuff is still present on the player + // Wait 5 seconds to revive while the debuff is still present on the player events.ScheduleEvent(EVENT_RESURRECT, 5s); else events.ScheduleEvent(EVENT_RESURRECT, 1s); @@ -823,7 +825,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript events.Repeat(2600ms, 3000ms); break; case EVENT_SPELL_POWER_WORLD_SHIELD: - //Since mograine has 0 HP, the DoSelectLowestHpFriendly function will always try to use it on him, not on himself + // Since mograine has 0 HP, the DoSelectLowestHpFriendly function will always try to use it on him, not on himself if (_Phase != 2) { DoCast(me, SPELL_POWER_WORD_SHIELD); @@ -870,7 +872,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript events.Repeat(10s); break; case EVENT_SLEEP: - //This saves the target's "SLEEP" buff after the move is complete + // This saves the target's "SLEEP" buff after the move is complete _victimbuff = me->GetVictim(); me->SetReactState(REACT_PASSIVE); DoCast(SPELL_DEEP_SLEEP); @@ -946,17 +948,17 @@ class npc_fairbanks : public CreatureScript SayAshbringer = false; } - //Ready to move to SmartAI + // Ready to move to SmartAI void SpellHit(Unit* who, SpellInfo const* spell) override { if (who && spell->Id == AB_EFFECT_000 && !SayAshbringer) { me->SetFaction(FACTION_FRIENDLY); me->SetFacingToObject(who); - //There is a delay in sniffing 1615ms - //The sniffer uses this spell, but without the visual effect of the spell. + // There is a delay in sniffing 1615ms + // The sniffer uses this spell, but without the visual effect of the spell. me->CastSpell(me, SPELL_TRANSFORM_GHOST); - //delay 10ms + // delay 10ms me->SetDisplayId(MODEL_FAIRBANKS); me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); SayAshbringer = true; From 50bb1062e85730322ef965c7dad48799c129a212 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 7 Jan 2024 10:09:53 +0800 Subject: [PATCH 36/65] Code formatting --- .../instance_scarlet_monastery.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 8e741945eb317b..2fcdbd62ccce0f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -70,7 +70,7 @@ enum DataTypes class instance_scarlet_monastery : public InstanceMapScript { public: - instance_scarlet_monastery() : InstanceMapScript("instance_scarlet_monastery", 189) { } + instance_scarlet_monastery() : InstanceMapScript("instance_scarlet_monastery", 189) {} InstanceScript* GetInstanceScript(InstanceMap* map) const override { @@ -142,7 +142,7 @@ class instance_scarlet_monastery : public InstanceMapScript { Creature* Whitemane = instance->GetCreature(WhitemaneGUID); Creature* Mograine = instance->GetCreature(MograineGUID); - if (!Mograine||!Whitemane) + if (!Mograine || !Whitemane) return; if (Whitemane->IsAlive() && Mograine->IsAlive()) @@ -387,7 +387,7 @@ Position const summonedMograinePos = { 1033.4642f, 1399.1022f, 27.337427f, 6.257 class npc_mograine : public CreatureScript { public: - npc_mograine() : CreatureScript("npc_scarlet_commander_mograine") { } + npc_mograine() : CreatureScript("npc_scarlet_commander_mograine") {} struct npc_mograineAI : public ScriptedAI { @@ -577,7 +577,7 @@ class npc_mograine : public CreatureScript Whitemane->AI()->Talk(SAY_WH_INTRO, me); float fx, fy, fz; me->GetContactPoint(Whitemane, fx, fy, fz, 5.0f); - Whitemane->GetMotionMaster()->MovePoint(POINT_WHITEMANE_TO_MOGRAINE, fx, fy,fz); + Whitemane->GetMotionMaster()->MovePoint(POINT_WHITEMANE_TO_MOGRAINE, fx, fy, fz); Whitemane->SetReactState(REACT_AGGRESSIVE); } me->GetMotionMaster()->MovementExpired(); @@ -690,7 +690,7 @@ class npc_mograine : public CreatureScript DoMeleeAttackIfReady(); } - private: + private: bool SayAshbringer = false; bool _fakeDeath = false; EventMap events; @@ -708,7 +708,7 @@ class npc_mograine : public CreatureScript class boss_high_inquisitor_whitemane : public CreatureScript { public: - boss_high_inquisitor_whitemane() : CreatureScript("boss_high_inquisitor_whitemane") { } + boss_high_inquisitor_whitemane() : CreatureScript("boss_high_inquisitor_whitemane") {} struct boss_high_inquisitor_whitemaneAI : public ScriptedAI { @@ -793,7 +793,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript if (me->HasUnitState(UNIT_STATE_CASTING)) return; - if (_Phase==0 && me->HealthBelowPct(50)) + if (_Phase == 0 && me->HealthBelowPct(50)) { events.Reset(); _Phase = 1; @@ -937,7 +937,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript class npc_fairbanks : public CreatureScript { public: - npc_fairbanks() : CreatureScript("npc_fairbanks") { } + npc_fairbanks() : CreatureScript("npc_fairbanks") {} struct npc_fairbanksAI : public SmartAI { From 27788517fdbea7c80be08a3084127ea34b9c65c2 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 7 Jan 2024 22:47:11 +0800 Subject: [PATCH 37/65] Modify the code --- .../instance_scarlet_monastery.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 2fcdbd62ccce0f..725a51fc77d490 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -261,24 +261,16 @@ class at_scarlet_monastery_cathedral_entrance : public AreaTriggerScript bool OnTrigger(Player* player, AreaTrigger const* /*trigger*/) override { if (player->HasAura(AURA_OF_ASHBRINGER)) - { if (InstanceScript* instance = player->GetInstanceScript()) - { if (instance->GetData(TYPE_ASHBRINGER_EVENT) == NOT_STARTED) { - if (Creature* commanderMograine = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_MOGRAINE))) - { - if (commanderMograine->IsAlive()) - { - commanderMograine->AI()->Talk(SAY_MOGRAINE_ASHBRBINGER_INTRO); - } - } + Creature* commanderMograine = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_MOGRAINE)); + if (commanderMograine && commanderMograine->IsAlive()) + commanderMograine->AI()->Talk(SAY_MOGRAINE_ASHBRBINGER_INTRO); instance->SetData(TYPE_ASHBRINGER_EVENT, IN_PROGRESS); return true; } - } - } return false; } }; From 77bbd7298869605f9e65b06a6619995fc2f4e597 Mon Sep 17 00:00:00 2001 From: fangshun Date: Mon, 8 Jan 2024 00:16:35 +0800 Subject: [PATCH 38/65] Modify the code --- .../instance_scarlet_monastery.cpp | 82 ++++++++++--------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 725a51fc77d490..a79ace3bc0b3df 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -179,6 +179,15 @@ class instance_scarlet_monastery : public InstanceMapScript case TYPE_ASHBRINGER_EVENT: if (data == IN_PROGRESS) { + if (Creature* Mograine = instance->GetCreature(WhitemaneGUID)) + if (Mograine->IsAlive() && !Mograine->IsInCombat()) + Mograine->AI()->Talk(SAY_MOGRAINE_ASHBRBINGER_INTRO); + + // the ashbringer incident did not sniff out any data from whitemane + if (Creature* whitemane = instance->GetCreature(WhitemaneGUID)) + if (whitemane->IsAlive() && !whitemane->IsInCombat()) + whitemane->DespawnOrUnsummon(); + if (GameObject* go = instance->GetGameObject(DoorChapelGUID)) { go->SetGoState(GO_STATE_ACTIVE); @@ -186,11 +195,6 @@ class instance_scarlet_monastery : public InstanceMapScript go->SetGameObjectFlag(GO_FLAG_IN_USE); } - // the ashbringer incident did not sniff out any data from whitemane - if (Creature* whitemane = instance->GetCreature(WhitemaneGUID)) - if (whitemane->IsAlive() && !whitemane->IsInCombat()) - whitemane->DespawnOrUnsummon(); - for (auto const& scarletCathedralNpcGuid : AshbringerNpcGUID) if (Creature* scarletNpc = instance->GetCreature(scarletCathedralNpcGuid)) if (scarletNpc->IsAlive() && !scarletNpc->IsInCombat()) @@ -260,17 +264,16 @@ class at_scarlet_monastery_cathedral_entrance : public AreaTriggerScript bool OnTrigger(Player* player, AreaTrigger const* /*trigger*/) override { - if (player->HasAura(AURA_OF_ASHBRINGER)) - if (InstanceScript* instance = player->GetInstanceScript()) - if (instance->GetData(TYPE_ASHBRINGER_EVENT) == NOT_STARTED) - { - Creature* commanderMograine = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_MOGRAINE)); - if (commanderMograine && commanderMograine->IsAlive()) - commanderMograine->AI()->Talk(SAY_MOGRAINE_ASHBRBINGER_INTRO); + if (!player->HasAura(AURA_OF_ASHBRINGER)) + return false; + + InstanceScript* instance = player->GetInstanceScript(); + if (instance && instance->GetData(TYPE_ASHBRINGER_EVENT) == NOT_STARTED) + { + instance->SetData(TYPE_ASHBRINGER_EVENT, IN_PROGRESS); + return true; + } - instance->SetData(TYPE_ASHBRINGER_EVENT, IN_PROGRESS); - return true; - } return false; } }; @@ -604,18 +607,17 @@ class npc_mograine : public CreatureScript instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); events.ScheduleEvent(EVENT_RESURRECTED, 3500ms); } - - // Ashbringer Event - if (who && spell->Id == AB_EFFECT_000 && !SayAshbringer) - { - me->SetFaction(FACTION_FRIENDLY); - me->GetMotionMaster()->MoveIdle(); - _playerWhoStartedAshbringer = who->ToPlayer(); - // Standing delay inside the cathedral - SayAshbringer = true; - events.ScheduleEvent(EVENT_MOGRAINE_FACING_PLAYER, 0ms); - events.ScheduleEvent(EVENT_SUMMONED_HIGHLORD_MOGRAINE, 20ms); - } + else + if (who && spell->Id == AB_EFFECT_000 && !SayAshbringer)// Ashbringer Event + { + me->SetFaction(FACTION_FRIENDLY); + me->GetMotionMaster()->MoveIdle(); + _playerWhoStartedAshbringer = who->ToPlayer(); + // Standing delay inside the cathedral + SayAshbringer = true; + events.ScheduleEvent(EVENT_MOGRAINE_FACING_PLAYER, 0ms); + events.ScheduleEvent(EVENT_SUMMONED_HIGHLORD_MOGRAINE, 20ms); + } } } @@ -807,12 +809,12 @@ class boss_high_inquisitor_whitemane : public CreatureScript events.Repeat(1200ms); break; } - - if (me->GetExactDist2d(target) < 5.0f) - { - events.Repeat(4500ms, 5s); - break; - } + else + if (me->GetExactDist2d(target) < 5.0f) + { + events.Repeat(4500ms, 5s); + break; + } } events.Repeat(2600ms, 3000ms); break; @@ -824,15 +826,15 @@ class boss_high_inquisitor_whitemane : public CreatureScript events.Repeat(22s, 35s); break; } - - if (Unit* target = DoSelectLowestHpFriendly(40.0f)) - { - if (DoCast(target, SPELL_POWER_WORD_SHIELD) == SPELL_CAST_OK) + else + if (Unit* target = DoSelectLowestHpFriendly(40.0f)) { - events.Repeat(22s, 35s); - break; + if (DoCast(target, SPELL_POWER_WORD_SHIELD) == SPELL_CAST_OK) + { + events.Repeat(22s, 35s); + break; + } } - } events.Repeat(1s); break; case EVENT_SPELL_HEAL: From ffd693a9de7312353f1b84f284dc7a0ce9245309 Mon Sep 17 00:00:00 2001 From: fangshun Date: Mon, 8 Jan 2024 19:29:11 +0800 Subject: [PATCH 39/65] Code tweaks --- .../instance_scarlet_monastery.cpp | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index a79ace3bc0b3df..813a1cfbdf4826 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -497,15 +497,15 @@ class npc_mograine : public CreatureScript void ScheduleGround() { _scheduler.Schedule(1s, 5s, [this](TaskContext context) - { - DoCastVictim(SPELL_CRUSADER_STRIKE); - context.Repeat(10s); - }) + { + DoCastVictim(SPELL_CRUSADER_STRIKE); + context.Repeat(10s); + }) .Schedule(6s, 11s, [this](TaskContext context) - { - DoCastVictim(SPELL_HAMMER_OF_JUSTICE); - context.Repeat(60s); - }); + { + DoCastVictim(SPELL_HAMMER_OF_JUSTICE); + context.Repeat(60s); + }); } void Reset() override @@ -551,9 +551,9 @@ class npc_mograine : public CreatureScript Talk(SAY_MO_AGGRO); DoCastSelf(SPELL_RETRIBUTION_AURA); _scheduler.Schedule(1s, [this](TaskContext) - { - PullCathedral(); - }); + { + PullCathedral(); + }); ScheduleGround(); } @@ -599,25 +599,25 @@ class npc_mograine : public CreatureScript void SpellHit(Unit* who, SpellInfo const* spell) override { - if (instance) - { + if (!instance) + return; + // When hit with resurrection say text - if (spell->Id == SPELL_SCARLET_RESURRECTION) - { - instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); - events.ScheduleEvent(EVENT_RESURRECTED, 3500ms); - } - else - if (who && spell->Id == AB_EFFECT_000 && !SayAshbringer)// Ashbringer Event - { - me->SetFaction(FACTION_FRIENDLY); - me->GetMotionMaster()->MoveIdle(); - _playerWhoStartedAshbringer = who->ToPlayer(); - // Standing delay inside the cathedral - SayAshbringer = true; - events.ScheduleEvent(EVENT_MOGRAINE_FACING_PLAYER, 0ms); - events.ScheduleEvent(EVENT_SUMMONED_HIGHLORD_MOGRAINE, 20ms); - } + if (spell->Id == SPELL_SCARLET_RESURRECTION) + { + instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); + events.ScheduleEvent(EVENT_RESURRECTED, 3500ms); + } + + if (who && spell->Id == AB_EFFECT_000 && !SayAshbringer)// Ashbringer Event + { + me->SetFaction(FACTION_FRIENDLY); + me->GetMotionMaster()->MoveIdle(); + _playerWhoStartedAshbringer = who->ToPlayer(); + // Standing delay inside the cathedral + SayAshbringer = true; + events.ScheduleEvent(EVENT_MOGRAINE_FACING_PLAYER, 0ms); + events.ScheduleEvent(EVENT_SUMMONED_HIGHLORD_MOGRAINE, 20ms); } } @@ -809,12 +809,12 @@ class boss_high_inquisitor_whitemane : public CreatureScript events.Repeat(1200ms); break; } - else - if (me->GetExactDist2d(target) < 5.0f) - { - events.Repeat(4500ms, 5s); - break; - } + + if (me->GetExactDist2d(target) < 5.0f) + { + events.Repeat(4500ms, 5s); + break; + } } events.Repeat(2600ms, 3000ms); break; @@ -826,15 +826,15 @@ class boss_high_inquisitor_whitemane : public CreatureScript events.Repeat(22s, 35s); break; } - else - if (Unit* target = DoSelectLowestHpFriendly(40.0f)) + + if (Unit* target = DoSelectLowestHpFriendly(40.0f)) + { + if (DoCast(target, SPELL_POWER_WORD_SHIELD) == SPELL_CAST_OK) { - if (DoCast(target, SPELL_POWER_WORD_SHIELD) == SPELL_CAST_OK) - { - events.Repeat(22s, 35s); - break; - } + events.Repeat(22s, 35s); + break; } + } events.Repeat(1s); break; case EVENT_SPELL_HEAL: From fc2c7f7fdf3691bd17309d75a79509d58c330964 Mon Sep 17 00:00:00 2001 From: fangshun Date: Tue, 9 Jan 2024 19:56:08 +0800 Subject: [PATCH 40/65] Change the name of a private member variable --- .../instance_scarlet_monastery.cpp | 227 +++++++++--------- 1 file changed, 113 insertions(+), 114 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 813a1cfbdf4826..c71e2b9a655f0f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -90,10 +90,10 @@ class instance_scarlet_monastery : public InstanceMapScript { // case ENTRY_PUMPKIN_SHRINE: PumpkinShrineGUID = go->GetGUID(); break; case DOOR_HIGH_INQUISITOR_ID: - DoorHighInquisitorGUID = go->GetGUID(); + _doorHighInquisitorGUID = go->GetGUID(); break; case DOOR_CHAPEL: - DoorChapelGUID = go->GetGUID(); + _doorChapelGUID = go->GetGUID(); break; default: break; @@ -114,14 +114,14 @@ class instance_scarlet_monastery : public InstanceMapScript case NPC_SCARLET_CHAMPION: case NPC_SCARLET_CHAPLAIN: case NPC_FAIRBANKS: - AshbringerNpcGUID.emplace(creature->GetGUID()); + _ashbringerNpcGUID.emplace(creature->GetGUID()); break; case NPC_COMMANDER_MOGRAINE: - MograineGUID = creature->GetGUID(); - AshbringerNpcGUID.emplace(creature->GetGUID()); + _mograineGUID = creature->GetGUID(); + _ashbringerNpcGUID.emplace(creature->GetGUID()); break; case NPC_INQUISITOR_WHITEMANE: - WhitemaneGUID = creature->GetGUID(); + _whitemaneGUID = creature->GetGUID(); break; default: break; @@ -135,14 +135,17 @@ class instance_scarlet_monastery : public InstanceMapScript case TYPE_MOGRAINE_AND_WHITE_EVENT: if (data == IN_PROGRESS) { - DoUseDoorOrButton(DoorHighInquisitorGUID); - encounter = IN_PROGRESS; + DoUseDoorOrButton(_doorHighInquisitorGUID); + _encounter = IN_PROGRESS; } if (data == FAIL) { - Creature* Whitemane = instance->GetCreature(WhitemaneGUID); - Creature* Mograine = instance->GetCreature(MograineGUID); - if (!Mograine || !Whitemane) + Creature* Whitemane = instance->GetCreature(_whitemaneGUID); + if (!Whitemane) + return; + + Creature* Mograine = instance->GetCreature(_mograineGUID); + if (!Mograine) return; if (Whitemane->IsAlive() && Mograine->IsAlive()) @@ -152,7 +155,7 @@ class instance_scarlet_monastery : public InstanceMapScript Whitemane->DespawnOnEvade(30s); Mograine->DespawnOnEvade(30s); - encounter = NOT_STARTED; + _encounter = NOT_STARTED; return; } @@ -160,50 +163,50 @@ class instance_scarlet_monastery : public InstanceMapScript if (!Whitemane->IsAlive()) { Mograine->DespawnOrUnsummon(); - encounter = data; + _encounter = data; return; } if (Whitemane->IsAlive() && !Mograine->IsAlive()) { Whitemane->DespawnOnEvade(30s); - encounter = data; + _encounter = data; return; } - encounter = data; + _encounter = data; } if (data == SPECIAL) - encounter = SPECIAL; + _encounter = SPECIAL; break; case TYPE_ASHBRINGER_EVENT: if (data == IN_PROGRESS) { - if (Creature* Mograine = instance->GetCreature(WhitemaneGUID)) + if (Creature* Mograine = instance->GetCreature(_whitemaneGUID)) if (Mograine->IsAlive() && !Mograine->IsInCombat()) Mograine->AI()->Talk(SAY_MOGRAINE_ASHBRBINGER_INTRO); // the ashbringer incident did not sniff out any data from whitemane - if (Creature* whitemane = instance->GetCreature(WhitemaneGUID)) + if (Creature* whitemane = instance->GetCreature(_whitemaneGUID)) if (whitemane->IsAlive() && !whitemane->IsInCombat()) whitemane->DespawnOrUnsummon(); - if (GameObject* go = instance->GetGameObject(DoorChapelGUID)) + if (GameObject* go = instance->GetGameObject(_doorChapelGUID)) { go->SetGoState(GO_STATE_ACTIVE); go->SetLootState(GO_ACTIVATED); go->SetGameObjectFlag(GO_FLAG_IN_USE); } - for (auto const& scarletCathedralNpcGuid : AshbringerNpcGUID) + for (auto const& scarletCathedralNpcGuid : _ashbringerNpcGUID) if (Creature* scarletNpc = instance->GetCreature(scarletCathedralNpcGuid)) if (scarletNpc->IsAlive() && !scarletNpc->IsInCombat()) scarletNpc->SetFaction(FACTION_FRIENDLY); } - ashencounter = data; + _ashencounter = data; break; case DATA_HORSEMAN_EVENT: - encounter = data; + _encounter = data; break; default: break; @@ -215,13 +218,13 @@ class instance_scarlet_monastery : public InstanceMapScript switch (type) { case DATA_MOGRAINE: - return MograineGUID; + return _mograineGUID; case DATA_WHITEMANE: - return WhitemaneGUID; + return _whitemaneGUID; case DATA_DOOR_WHITEMANE: - return DoorHighInquisitorGUID; + return _doorHighInquisitorGUID; case DATA_DOOR_CHAPEL: - return DoorChapelGUID; + return _doorChapelGUID; default: return ObjectGuid::Empty; break; @@ -233,13 +236,13 @@ class instance_scarlet_monastery : public InstanceMapScript switch (type) { case TYPE_MOGRAINE_AND_WHITE_EVENT: - return encounter; + return _encounter; break; case DATA_HORSEMAN_EVENT: - return encounter; + return _encounter; break; case TYPE_ASHBRINGER_EVENT: - return ashencounter; + return _ashencounter; break; default: return 0; @@ -247,13 +250,13 @@ class instance_scarlet_monastery : public InstanceMapScript } } private: - ObjectGuid DoorHighInquisitorGUID; - ObjectGuid DoorChapelGUID; - ObjectGuid MograineGUID; - ObjectGuid WhitemaneGUID; - uint32 encounter{}; - uint32 ashencounter{}; - GuidSet AshbringerNpcGUID; + ObjectGuid _doorHighInquisitorGUID; + ObjectGuid _doorChapelGUID; + ObjectGuid _mograineGUID; + ObjectGuid _whitemaneGUID; + uint32 _encounter{}; + uint32 _ashencounter{}; + GuidSet _ashbringerNpcGUID; }; }; @@ -377,7 +380,7 @@ enum Says }; float const CATHEDRAL_PULL_RANGE = 80.0f; // Distance from the Cathedral doors to where Mograine is standing -Position const summonedMograinePos = { 1033.4642f, 1399.1022f, 27.337427f, 6.257956981658935546f }; +Position const SummonedMograinePos = { 1033.4642f, 1399.1022f, 27.337427f, 6.257956981658935546f }; class npc_mograine : public CreatureScript { @@ -388,7 +391,7 @@ class npc_mograine : public CreatureScript { npc_mograineAI(Creature* creature) : ScriptedAI(creature) { - instance = creature->GetInstanceScript(); + _instance = creature->GetInstanceScript(); } void AshbringerEvent(uint32 eventId) @@ -410,7 +413,7 @@ class npc_mograine : public CreatureScript me->AI()->Talk(SAY_MO_AB_TALK3, _playerWhoStartedAshbringer); break; case EVENT_SUMMONED_HIGHLORD_MOGRAINE: - if (Creature* summonedMograine = me->SummonCreature(NPC_HIGHLORD_MOGRAINE, summonedMograinePos, TEMPSUMMON_TIMED_DESPAWN, 120000)) + if (Creature* summonedMograine = me->SummonCreature(NPC_HIGHLORD_MOGRAINE, SummonedMograinePos, TEMPSUMMON_TIMED_DESPAWN, 120000)) { summonedMograine->SetFaction(FACTION_FRIENDLY); summonedMograine->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, EQUIP_UNEQUIP); @@ -520,15 +523,13 @@ class npc_mograine : public CreatureScript { summonedMograine->DespawnOrUnsummon(); } - SayAshbringer = false; + _sayAshbringer = false; } void EnterEvadeMode(EvadeReason /*why*/) override { - if (instance) - { - instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); - } + if (_instance) + _instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); } void MovementInform(uint32 type, uint32 id) override @@ -559,16 +560,16 @@ class npc_mograine : public CreatureScript void DamageTaken(Unit* /*doneBy*/, uint32& damage, DamageEffectType, SpellSchoolMask) override { - if (damage > me->GetHealth() && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) != SPECIAL && _fakeDeath) + if (damage > me->GetHealth() && _instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) != SPECIAL && _fakeDeath) damage = 0; // On first death, fake death and open door, as well as initiate whitemane if exist if (damage > me->GetHealth() && !_fakeDeath) { // On first death, fake death and open door, as well as initiate whitemane if exist - if (Creature* Whitemane = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_WHITEMANE))) + if (Creature* Whitemane = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_WHITEMANE))) { - instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); + _instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); Whitemane->AI()->Talk(SAY_WH_INTRO, me); float fx, fy, fz; me->GetContactPoint(Whitemane, fx, fy, fz, 5.0f); @@ -593,56 +594,56 @@ class npc_mograine : public CreatureScript void KilledUnit(Unit* victim) override { - if (victim->GetTypeId() == TYPEID_PLAYER && !SayAshbringer) + if (victim->GetTypeId() == TYPEID_PLAYER && !_sayAshbringer) Talk(SAY_MO_KILL); } void SpellHit(Unit* who, SpellInfo const* spell) override { - if (!instance) + if (!_instance) return; // When hit with resurrection say text if (spell->Id == SPELL_SCARLET_RESURRECTION) { - instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); - events.ScheduleEvent(EVENT_RESURRECTED, 3500ms); + _instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); + _events.ScheduleEvent(EVENT_RESURRECTED, 3500ms); } - if (who && spell->Id == AB_EFFECT_000 && !SayAshbringer)// Ashbringer Event + if (who && spell->Id == AB_EFFECT_000 && !_sayAshbringer)// Ashbringer Event { me->SetFaction(FACTION_FRIENDLY); me->GetMotionMaster()->MoveIdle(); _playerWhoStartedAshbringer = who->ToPlayer(); // Standing delay inside the cathedral - SayAshbringer = true; - events.ScheduleEvent(EVENT_MOGRAINE_FACING_PLAYER, 0ms); - events.ScheduleEvent(EVENT_SUMMONED_HIGHLORD_MOGRAINE, 20ms); + _sayAshbringer = true; + _events.ScheduleEvent(EVENT_MOGRAINE_FACING_PLAYER, 0ms); + _events.ScheduleEvent(EVENT_SUMMONED_HIGHLORD_MOGRAINE, 20ms); } } void UpdateAI(uint32 diff) override { - if (SayAshbringer) + if (_sayAshbringer) { - events.Update(diff); - while (uint32 eventId = events.ExecuteEvent()) + _events.Update(diff); + while (uint32 eventId = _events.ExecuteEvent()) { AshbringerEvent(eventId); } } - if (!UpdateVictim() || SayAshbringer) + if (!UpdateVictim() || _sayAshbringer) return; _scheduler.Update(diff); - events.Update(diff); + _events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; - while (uint32 eventId = events.ExecuteEvent()) + while (uint32 eventId = _events.ExecuteEvent()) { switch (eventId) { @@ -652,23 +653,23 @@ class npc_mograine : public CreatureScript me->InterruptNonMeleeSpells(false); // How do I get rid of the animation from UNIT_STAND_STATE_DEAD to UNIT_STAND_STATE_STAND? me->SetStandState(UNIT_STAND_STATE_STAND); - events.ScheduleEvent(EVENT_SPELL_LAY_ON_HANDS, 0s); + _events.ScheduleEvent(EVENT_SPELL_LAY_ON_HANDS, 0s); break; case EVENT_SPELL_LAY_ON_HANDS: - if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_WHITEMANE))) + if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, _instance->GetGuidData(DATA_WHITEMANE))) { if (Whitemane->IsAlive()) me->CastSpell(Whitemane, SPELL_LAY_ON_HANDS); Talk(SAY_MO_RESURRECTED, Whitemane); } - events.ScheduleEvent(EVENT_MOGRAINE_EMOTE, 500ms); + _events.ScheduleEvent(EVENT_MOGRAINE_EMOTE, 500ms); break; case EVENT_MOGRAINE_EMOTE: me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - events.ScheduleEvent(EVENT_MOVE, 3000ms); + _events.ScheduleEvent(EVENT_MOVE, 3000ms); break; case EVENT_MOVE: - if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_WHITEMANE))) + if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, _instance->GetGuidData(DATA_WHITEMANE))) { me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); float fx, fy, fz; @@ -685,10 +686,10 @@ class npc_mograine : public CreatureScript } private: - bool SayAshbringer = false; + bool _sayAshbringer = false; bool _fakeDeath = false; - EventMap events; - InstanceScript* instance; + EventMap _events; + InstanceScript* _instance; TaskScheduler _scheduler; Player* _playerWhoStartedAshbringer = nullptr; }; @@ -708,7 +709,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript { boss_high_inquisitor_whitemaneAI(Creature* creature) : ScriptedAI(creature) { - instance = creature->GetInstanceScript(); + _instance = creature->GetInstanceScript(); } void Reset() override @@ -716,23 +717,21 @@ class boss_high_inquisitor_whitemane : public CreatureScript me->SetReactState(REACT_AGGRESSIVE); _victimbuff = nullptr; events.Reset(); - _Phase = 0; + _phase = 0; } void JustRespawned() override { - if (instance) - instance->DoUseDoorOrButton(instance->GetGuidData(DATA_DOOR_WHITEMANE)); + if (_instance) + _instance->DoUseDoorOrButton(_instance->GetGuidData(DATA_DOOR_WHITEMANE)); ScriptedAI::JustRespawned(); } void EnterEvadeMode(EvadeReason /*why*/) override { - if (instance) - { - instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); - } + if (_instance) + _instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); } void JustEngagedWith(Unit* /*who*/) override @@ -747,7 +746,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript void DamageTaken(Unit* /*doneBy*/, uint32& damage, DamageEffectType, SpellSchoolMask) override { // The player cannot kill her until she is releashed. Retain at least 1 life - if (_Phase != 2 && damage >= me->GetHealth()) + if (_phase != 2 && damage >= me->GetHealth()) { damage = 0; me->SetHealth(1); @@ -765,9 +764,9 @@ class boss_high_inquisitor_whitemane : public CreatureScript // Use don't know why use me->GetVictim() Unable to get the target if (_victimbuff && _victimbuff->HasAura(SPELL_DEEP_SLEEP)) // Wait 5 seconds to revive while the debuff is still present on the player - events.ScheduleEvent(EVENT_RESURRECT, 5s); + _events.ScheduleEvent(EVENT_RESURRECT, 5s); else - events.ScheduleEvent(EVENT_RESURRECT, 1s); + _events.ScheduleEvent(EVENT_RESURRECT, 1s); } } @@ -782,19 +781,19 @@ class boss_high_inquisitor_whitemane : public CreatureScript if (!UpdateVictim()) return; - events.Update(diff); + _events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; - if (_Phase == 0 && me->HealthBelowPct(50)) + if (_phase == 0 && me->HealthBelowPct(50)) { - events.Reset(); - _Phase = 1; - events.ScheduleEvent(EVENT_SLEEP, 0ms); + _events.Reset(); + _phase = 1; + _events.ScheduleEvent(EVENT_SLEEP, 0ms); } - while (uint32 eventId = events.ExecuteEvent()) + while (uint32 eventId = _events.ExecuteEvent()) { switch (eventId) { @@ -806,24 +805,24 @@ class boss_high_inquisitor_whitemane : public CreatureScript if (DoCast(target, SPELL_HOLY_SMITE) != SPELL_CAST_OK) { me->GetMotionMaster()->MoveChase(target); - events.Repeat(1200ms); + _events.Repeat(1200ms); break; } if (me->GetExactDist2d(target) < 5.0f) { - events.Repeat(4500ms, 5s); + _events.Repeat(4500ms, 5s); break; } } - events.Repeat(2600ms, 3000ms); + _events.Repeat(2600ms, 3000ms); break; case EVENT_SPELL_POWER_WORLD_SHIELD: // Since mograine has 0 HP, the DoSelectLowestHpFriendly function will always try to use it on him, not on himself - if (_Phase != 2) + if (_phase != 2) { DoCast(me, SPELL_POWER_WORD_SHIELD); - events.Repeat(22s, 35s); + _events.Repeat(22s, 35s); break; } @@ -831,11 +830,11 @@ class boss_high_inquisitor_whitemane : public CreatureScript { if (DoCast(target, SPELL_POWER_WORD_SHIELD) == SPELL_CAST_OK) { - events.Repeat(22s, 35s); + _events.Repeat(22s, 35s); break; } } - events.Repeat(1s); + _events.Repeat(1s); break; case EVENT_SPELL_HEAL: if (Unit* target = DoSelectLowestHpFriendly(40.0f)) @@ -843,11 +842,11 @@ class boss_high_inquisitor_whitemane : public CreatureScript if (target->HealthBelowPct(75)) { DoCast(target, SPELL_HEAL); - events.Repeat(17500ms, 20s); + _events.Repeat(17500ms, 20s); break; } } - events.Repeat(5s); + _events.Repeat(5s); break; case EVENT_SPELL_DOMINATE_MIND: // The list of hates is greater than 1 @@ -858,12 +857,12 @@ class boss_high_inquisitor_whitemane : public CreatureScript if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true)) { DoCast(target, SPELL_DOMINATE_MIND); - events.Repeat(20s, 30s); + _events.Repeat(20s, 30s); break; } } } - events.Repeat(10s); + _events.Repeat(10s); break; case EVENT_SLEEP: // This saves the target's "SLEEP" buff after the move is complete @@ -872,7 +871,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript DoCast(SPELL_DEEP_SLEEP); me->AttackStop(); - if (Creature* mograine = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MOGRAINE))) + if (Creature* mograine = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_MOGRAINE))) { if (me->GetDistance(mograine) > 0.5f) { @@ -882,30 +881,30 @@ class boss_high_inquisitor_whitemane : public CreatureScript break; } } - events.ScheduleEvent(EVENT_RESURRECT, 5s); + _events.ScheduleEvent(EVENT_RESURRECT, 5s); break; case EVENT_RESURRECT: - if (Creature* mograine = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MOGRAINE))) + if (Creature* mograine = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_MOGRAINE))) { DoCast(mograine, SPELL_SCARLET_RESURRECTION); } me->SetSheath(SHEATH_STATE_UNARMED); - events.ScheduleEvent(EVENT_SAY, 3400ms); + _events.ScheduleEvent(EVENT_SAY, 3400ms); break; case EVENT_SAY: Talk(SAY_WH_RESURRECT); - events.ScheduleEvent(EVENT_WHITEMANE_EMOTE, 1400ms); + _events.ScheduleEvent(EVENT_WHITEMANE_EMOTE, 1400ms); break; case EVENT_WHITEMANE_EMOTE: me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); - _Phase = 2; - events.ScheduleEvent(EVENT_DEALY_ATTACK, 3200ms); + _phase = 2; + _events.ScheduleEvent(EVENT_DEALY_ATTACK, 3200ms); break; case EVENT_DEALY_ATTACK: me->SetReactState(REACT_AGGRESSIVE); - events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 10ms); - events.ScheduleEvent(EVENT_SPELL_HEAL, 15s); - events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 10s); + _events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 10ms); + _events.ScheduleEvent(EVENT_SPELL_HEAL, 15s); + _events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 10s); break; default: break; @@ -916,10 +915,10 @@ class boss_high_inquisitor_whitemane : public CreatureScript } private: - InstanceScript* instance; + InstanceScript* _instance; Unit* _victimbuff = nullptr; - EventMap events; - uint8 _Phase{}; + EventMap _events; + uint8 _phase{}; }; CreatureAI* GetAI(Creature* creature) const override @@ -939,13 +938,13 @@ class npc_fairbanks : public CreatureScript void Reset() override { - SayAshbringer = false; + _SayAshbringer = false; } // Ready to move to SmartAI void SpellHit(Unit* who, SpellInfo const* spell) override { - if (who && spell->Id == AB_EFFECT_000 && !SayAshbringer) + if (who && spell->Id == AB_EFFECT_000 && !_SayAshbringer) { me->SetFaction(FACTION_FRIENDLY); me->SetFacingToObject(who); @@ -955,12 +954,12 @@ class npc_fairbanks : public CreatureScript // delay 10ms me->SetDisplayId(MODEL_FAIRBANKS); me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); - SayAshbringer = true; + _SayAshbringer = true; } } private: - bool SayAshbringer = false; + bool _SayAshbringer = false; }; CreatureAI* GetAI(Creature* creature) const override From d124b195ea392cd09ff2e1802c2f003c18aabb17 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sat, 13 Jan 2024 09:06:46 +0800 Subject: [PATCH 41/65] Code style adjustments --- .../instance_scarlet_monastery.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index c71e2b9a655f0f..82869dfa9eb3d2 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -182,10 +182,6 @@ class instance_scarlet_monastery : public InstanceMapScript case TYPE_ASHBRINGER_EVENT: if (data == IN_PROGRESS) { - if (Creature* Mograine = instance->GetCreature(_whitemaneGUID)) - if (Mograine->IsAlive() && !Mograine->IsInCombat()) - Mograine->AI()->Talk(SAY_MOGRAINE_ASHBRBINGER_INTRO); - // the ashbringer incident did not sniff out any data from whitemane if (Creature* whitemane = instance->GetCreature(_whitemaneGUID)) if (whitemane->IsAlive() && !whitemane->IsInCombat()) @@ -271,13 +267,15 @@ class at_scarlet_monastery_cathedral_entrance : public AreaTriggerScript return false; InstanceScript* instance = player->GetInstanceScript(); - if (instance && instance->GetData(TYPE_ASHBRINGER_EVENT) == NOT_STARTED) - { - instance->SetData(TYPE_ASHBRINGER_EVENT, IN_PROGRESS); - return true; - } + if (!instance || instance->GetData(TYPE_ASHBRINGER_EVENT) != NOT_STARTED) + return false; + + if (Creature* Mograine = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_MOGRAINE))) + if (Mograine->IsAlive() && !Mograine->IsInCombat()) + Mograine->AI()->Talk(SAY_MOGRAINE_ASHBRBINGER_INTRO, player); - return false; + instance->SetData(TYPE_ASHBRINGER_EVENT, IN_PROGRESS); + return true; } }; From 9ce72898e655599309334fa1891e6abedf963575 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sat, 13 Jan 2024 09:11:35 +0800 Subject: [PATCH 42/65] Delete unused header files --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 82869dfa9eb3d2..25e5ab0fe94f52 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -20,7 +20,6 @@ #include "InstanceMapScript.h" #include "scarletmonastery.h" #include "ScriptedCreature.h" -#include "ScriptedGossip.h" #include "SmartAI.h" enum AshbringerEventMisc From 9216f225864c09d56ddcde20c8300f69e9c29f88 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sat, 13 Jan 2024 14:42:35 +0800 Subject: [PATCH 43/65] Fixed an issue where some events would not run. --- .../instance_scarlet_monastery.cpp | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 25e5ab0fe94f52..ee37e077d532ee 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -399,12 +399,12 @@ class npc_mograine : public CreatureScript { case EVENT_MOGRAINE_FACING_PLAYER: me->SetFacingToObject(_playerWhoStartedAshbringer); - events.ScheduleEvent(EVENT_MOGRAINE_KNEEL, 1s, 3s); + _events.ScheduleEvent(EVENT_MOGRAINE_KNEEL, 1s, 3s); break; case EVENT_MOGRAINE_KNEEL: me->SetSheath(SHEATH_STATE_UNARMED); me->SetStandState(UNIT_STAND_STATE_KNEEL); - events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK3, 1s, 2s); + _events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK3, 1s, 2s); break; case EVENT_MOGRAINE_EMOTE_TALK3: me->AI()->Talk(SAY_MO_AB_TALK3, _playerWhoStartedAshbringer); @@ -418,55 +418,55 @@ class npc_mograine : public CreatureScript // Sniffing data shows the use of this spell transformation, but the dispersion effect of this spell is not seen in the video summonedMograine->CastSpell(summonedMograine, SPELL_MOGRAINE_COMETH_DND); } - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_MOVE_STOP, 48500ms); + _events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_MOVE_STOP, 48500ms); break; case EVENT_HIGHLORD_MOGRAINE_MOVE_STOP: summonedMograine->StopMovingOnCurrentPos(); summonedMograine->AI()->Talk(SAY_HM_AB_TALK0, 200ms); - events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE, 3000ms); + _events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE, 3000ms); break; case EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE: me->SetFacingToObject(summonedMograine); - events.ScheduleEvent(EVENT_MOGRAINE_UNIT_STAND_STATE_STAND, 400ms); + _events.ScheduleEvent(EVENT_MOGRAINE_UNIT_STAND_STATE_STAND, 400ms); break; case EVENT_MOGRAINE_UNIT_STAND_STATE_STAND: me->SetStandState(UNIT_STAND_STATE_STAND); me->SetSheath(SHEATH_STATE_MELEE); - events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK4, 800ms); + _events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK4, 800ms); break; case EVENT_MOGRAINE_EMOTE_TALK4: me->AI()->Talk(SAY_MO_AB_TALK4, 200ms); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK, 4600ms); + _events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK, 4600ms); break; case EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK: summonedMograine->AI()->Talk(SAY_HM_AB_TALK1, me); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE1, 3400ms); + _events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE1, 3400ms); break; case EVENT_HIGHLORD_MOGRAINE_EMOTE1: summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE2, 3200ms); + _events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE2, 3200ms); break; case EVENT_HIGHLORD_MOGRAINE_EMOTE2: summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_POINT); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE3, 3200ms); + _events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE3, 3200ms); break; case EVENT_HIGHLORD_MOGRAINE_EMOTE3: summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2, 3200ms); + _events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2, 3200ms); break; case EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2: me->SetFacingToObject(summonedMograine); - events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK5, 1200ms); + _events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK5, 1200ms); break; case EVENT_MOGRAINE_EMOTE_TALK5: me->SetSheath(SHEATH_STATE_UNARMED); me->AI()->Talk(SAY_MO_AB_TALK5, 200ms); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_CASTSPELL, 3000ms); + _events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_CASTSPELL, 3000ms); break; case EVENT_HIGHLORD_MOGRAINE_CASTSPELL: // In Blizzard's servers, after "HIGHLORD_MOGRAINE" uses this spell, "MOGRAINE" will have a visual effect of lightning hits, and the visual effect after the hit is missing here and needs to be fixed summonedMograine->CastSpell(me, SPELL_FORGIVENESS); - events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 1000ms); + _events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 1000ms); break; case EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE: me->KillSelf(); @@ -513,7 +513,7 @@ class npc_mograine : public CreatureScript me->SetReactState(REACT_AGGRESSIVE); me->SetStandState(UNIT_STAND_STATE_STAND); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - events.Reset(); + _events.Reset(); _fakeDeath = false; _scheduler.CancelAll(); if (Creature* summonedMograine = me->FindNearestCreature(NPC_HIGHLORD_MOGRAINE, 100.0f)) @@ -713,7 +713,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript { me->SetReactState(REACT_AGGRESSIVE); _victimbuff = nullptr; - events.Reset(); + _events.Reset(); _phase = 0; } @@ -733,11 +733,11 @@ class boss_high_inquisitor_whitemane : public CreatureScript void JustEngagedWith(Unit* /*who*/) override { - events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 10ms); - events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 22s, 45s); + _events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 10ms); + _events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 22s, 45s); // This spell was not used during the single-player test on the Blizzard server, // it should take 2 people, and the chance of using it should be low - events.ScheduleEvent(EVENT_SPELL_DOMINATE_MIND, 5s, 10s); + _events.ScheduleEvent(EVENT_SPELL_DOMINATE_MIND, 5s, 10s); } void DamageTaken(Unit* /*doneBy*/, uint32& damage, DamageEffectType, SpellSchoolMask) override From 37c6a4be40c457d1b0360a6e24b616bd7c13992f Mon Sep 17 00:00:00 2001 From: fangshun Date: Thu, 1 Feb 2024 21:13:38 +0800 Subject: [PATCH 44/65] 1.Moves the expression to the database 2.Use the "WoWDatabaseEditor" to calculate the time of sniffing --- .../rev_1697941424465768700.sql | 2 +- .../instance_scarlet_monastery.cpp | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql index 4e70a7810c1acd..690716f749be7a 100644 --- a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql +++ b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql @@ -23,7 +23,7 @@ WHERE `CreatureID`=3976; INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES (3976, 0, 0, 'Infidels! They must be purified!', 14, 0, 100, 0, 0, 5835, 2847, 0, 'mograine SAY_MO_AGGRO'), (3976, 1, 0, 'Unworthy.', 14, 0, 100, 0, 0, 5836, 6197, 0, 'mograine SAY_MO_KILL'), - (3976, 2, 0, 'At your side, milady!', 14, 0, 100, 0, 0, 5837, 18026, 0, 'mograine SAY_MO_RESSURECTED'), + (3976, 2, 0, 'At your side, milady!', 14, 0, 100, 15, 0, 5837, 18026, 0, 'mograine SAY_MO_RESSURECTED'), (3976, 3, 0, 'You hold my father\'s blade, $n. My soldiers are yours TO control, my $g Lord:Lady;. Take them... LEAD them... The impure must be purged. They must be cleansed of their taint.', 12, 0, 100, 1, 0, 0, 12390, 0, 'mograine SAY_ASHBRINGER_ONE'), (3976, 4, 0, 'Father... But... How?', 12, 0, 100, 6, 0, 0, 12470, 0, 'mograine SAY_ASHBRINGER_TWO'), (3976, 5, 0, 'Forgive me, father! Please...', 12, 0, 100, 20, 0, 0, 12472, 0, 'mograine SAY_ASHBRINGER_THREE'), diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index ee37e077d532ee..37edbcb862d1e6 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -311,7 +311,7 @@ enum MograineEvents { EVENT_RESURRECTED = 1, EVENT_SPELL_LAY_ON_HANDS = 2, - EVENT_MOGRAINE_EMOTE = 3, + EVENT_MOGRAINE_SAY = 3, EVENT_MOVE = 4 }; @@ -656,18 +656,20 @@ class npc_mograine : public CreatureScript if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, _instance->GetGuidData(DATA_WHITEMANE))) { if (Whitemane->IsAlive()) - me->CastSpell(Whitemane, SPELL_LAY_ON_HANDS); - Talk(SAY_MO_RESURRECTED, Whitemane); + me->CastSpell(Whitemane, SPELL_LAY_ON_HANDS); } - _events.ScheduleEvent(EVENT_MOGRAINE_EMOTE, 500ms); + _events.ScheduleEvent(EVENT_MOGRAINE_SAY, 200ms); break; - case EVENT_MOGRAINE_EMOTE: - me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + case EVENT_MOGRAINE_SAY: + if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, _instance->GetGuidData(DATA_WHITEMANE))) + { + Talk(SAY_MO_RESURRECTED, Whitemane); + } _events.ScheduleEvent(EVENT_MOVE, 3000ms); break; case EVENT_MOVE: if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, _instance->GetGuidData(DATA_WHITEMANE))) - { + { me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); float fx, fy, fz; Whitemane->GetContactPoint(me, fx, fy, fz, 0.0f); @@ -895,7 +897,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript case EVENT_WHITEMANE_EMOTE: me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); _phase = 2; - _events.ScheduleEvent(EVENT_DEALY_ATTACK, 3200ms); + _events.ScheduleEvent(EVENT_DEALY_ATTACK, 1400ms); break; case EVENT_DEALY_ATTACK: me->SetReactState(REACT_AGGRESSIVE); From 7aa8049cb559a304fa092d39a6efbfe2aecf7abc Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 4 Feb 2024 08:24:13 +0800 Subject: [PATCH 45/65] Modify the sniffing time --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 37edbcb862d1e6..6319a35cb3c104 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -28,9 +28,9 @@ enum AshbringerEventMisc AURA_OF_ASHBRINGER = 28282, NPC_COMMANDER_MOGRAINE = 3976, - NPC_INQUISITOR_WHITEMANE = 3977, - NPC_SCARLET_MYRIDON = 4295, + NPC_INQUISITOR_WHITEMANE = 3977, NPC_SCARLET_SORCERER = 4294, + NPC_SCARLET_MYRIDON = 4295, NPC_SCARLET_DEFENDER = 4298, NPC_SCARLET_CHAPLAIN = 4299, NPC_SCARLET_WIZARD = 4300, @@ -880,15 +880,14 @@ class boss_high_inquisitor_whitemane : public CreatureScript break; } } - _events.ScheduleEvent(EVENT_RESURRECT, 5s); + _events.ScheduleEvent(EVENT_RESURRECT, 3200ms); break; case EVENT_RESURRECT: if (Creature* mograine = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_MOGRAINE))) { DoCast(mograine, SPELL_SCARLET_RESURRECTION); } - me->SetSheath(SHEATH_STATE_UNARMED); - _events.ScheduleEvent(EVENT_SAY, 3400ms); + _events.ScheduleEvent(EVENT_SAY,1900ms); break; case EVENT_SAY: Talk(SAY_WH_RESURRECT); From e4a93207e2fcb8d1f71ad4b6e680e5c09d0dde38 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 4 Feb 2024 15:41:46 +0800 Subject: [PATCH 46/65] Delete data that is not in the sniff data --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 6319a35cb3c104..ce9537da658ff8 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -402,7 +402,6 @@ class npc_mograine : public CreatureScript _events.ScheduleEvent(EVENT_MOGRAINE_KNEEL, 1s, 3s); break; case EVENT_MOGRAINE_KNEEL: - me->SetSheath(SHEATH_STATE_UNARMED); me->SetStandState(UNIT_STAND_STATE_KNEEL); _events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK3, 1s, 2s); break; @@ -431,15 +430,14 @@ class npc_mograine : public CreatureScript break; case EVENT_MOGRAINE_UNIT_STAND_STATE_STAND: me->SetStandState(UNIT_STAND_STATE_STAND); - me->SetSheath(SHEATH_STATE_MELEE); - _events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK4, 800ms); + _events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK4, 1200ms); break; case EVENT_MOGRAINE_EMOTE_TALK4: - me->AI()->Talk(SAY_MO_AB_TALK4, 200ms); + me->AI()->Talk(SAY_MO_AB_TALK4); _events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK, 4600ms); break; case EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK: - summonedMograine->AI()->Talk(SAY_HM_AB_TALK1, me); + summonedMograine->AI()->Talk(SAY_HM_AB_TALK1); _events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE1, 3400ms); break; case EVENT_HIGHLORD_MOGRAINE_EMOTE1: @@ -459,8 +457,7 @@ class npc_mograine : public CreatureScript _events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK5, 1200ms); break; case EVENT_MOGRAINE_EMOTE_TALK5: - me->SetSheath(SHEATH_STATE_UNARMED); - me->AI()->Talk(SAY_MO_AB_TALK5, 200ms); + me->AI()->Talk(SAY_MO_AB_TALK5); _events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_CASTSPELL, 3000ms); break; case EVENT_HIGHLORD_MOGRAINE_CASTSPELL: From 03007ff1cefd03080226e52a2c32b16b7a0243bb Mon Sep 17 00:00:00 2001 From: fangshun Date: Fri, 9 Feb 2024 07:55:59 +0800 Subject: [PATCH 47/65] Fixed the buff of the "Ember Bringer" item causing NPCs to enter battle --- src/server/game/Spells/SpellInfo.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 0fc3038c80f274..7324db78cae507 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -2630,8 +2630,6 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const // some explicitly required dummy effect sets switch (Id) { - case 28441: - return false; // AB Effect 000 default: break; } From b02a664a8918ac7b3b469313a1aa5ca716b096a8 Mon Sep 17 00:00:00 2001 From: fangshun Date: Wed, 14 Feb 2024 12:27:25 +0800 Subject: [PATCH 48/65] Modify the TextRange --- data/sql/updates/pending_db_world/rev_1697941424465768700.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql index 690716f749be7a..79fa2abb6410aa 100644 --- a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql +++ b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql @@ -27,7 +27,7 @@ INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Lan (3976, 3, 0, 'You hold my father\'s blade, $n. My soldiers are yours TO control, my $g Lord:Lady;. Take them... LEAD them... The impure must be purged. They must be cleansed of their taint.', 12, 0, 100, 1, 0, 0, 12390, 0, 'mograine SAY_ASHBRINGER_ONE'), (3976, 4, 0, 'Father... But... How?', 12, 0, 100, 6, 0, 0, 12470, 0, 'mograine SAY_ASHBRINGER_TWO'), (3976, 5, 0, 'Forgive me, father! Please...', 12, 0, 100, 20, 0, 0, 12472, 0, 'mograine SAY_ASHBRINGER_THREE'), - (3976, 6, 0, 'Bow down! Kneel BEFORE the Ashbringer! A NEW dawn approaches, brothers AND sisters! Our message will be delivered TO the filth of this world through the chosen one!', 14, 0, 100, 0, 0, 0, 12389, 3, 'Ashbringer EVENT intro yell'); + (3976, 6, 0, 'Bow down! Kneel BEFORE the Ashbringer! A NEW dawn approaches, brothers AND sisters! Our message will be delivered TO the filth of this world through the chosen one!', 14, 0, 100, 0, 0, 0, 12389, 0, 'Ashbringer EVENT intro yell'); -- Highlord Mograine --- -- Highlord Mograine say From ab871e2cb27da4782a653e12cf7be3bea9dc0c56 Mon Sep 17 00:00:00 2001 From: fangshun Date: Mon, 25 Mar 2024 05:59:17 +0800 Subject: [PATCH 49/65] Delete spaces --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index ce9537da658ff8..b834db2fab6c0e 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -28,7 +28,7 @@ enum AshbringerEventMisc AURA_OF_ASHBRINGER = 28282, NPC_COMMANDER_MOGRAINE = 3976, - NPC_INQUISITOR_WHITEMANE = 3977, + NPC_INQUISITOR_WHITEMANE = 3977, NPC_SCARLET_SORCERER = 4294, NPC_SCARLET_MYRIDON = 4295, NPC_SCARLET_DEFENDER = 4298, @@ -653,7 +653,7 @@ class npc_mograine : public CreatureScript if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, _instance->GetGuidData(DATA_WHITEMANE))) { if (Whitemane->IsAlive()) - me->CastSpell(Whitemane, SPELL_LAY_ON_HANDS); + me->CastSpell(Whitemane, SPELL_LAY_ON_HANDS); } _events.ScheduleEvent(EVENT_MOGRAINE_SAY, 200ms); break; @@ -661,12 +661,12 @@ class npc_mograine : public CreatureScript if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, _instance->GetGuidData(DATA_WHITEMANE))) { Talk(SAY_MO_RESURRECTED, Whitemane); - } + } _events.ScheduleEvent(EVENT_MOVE, 3000ms); break; case EVENT_MOVE: if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, _instance->GetGuidData(DATA_WHITEMANE))) - { + { me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); float fx, fy, fz; Whitemane->GetContactPoint(me, fx, fy, fz, 0.0f); From 6f584631e56312090706818c8296e6af8d0d14a6 Mon Sep 17 00:00:00 2001 From: fangshun Date: Mon, 2 Sep 2024 18:57:16 +0800 Subject: [PATCH 50/65] Code style --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index b834db2fab6c0e..afbc9eba828311 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -588,7 +588,7 @@ class npc_mograine : public CreatureScript void KilledUnit(Unit* victim) override { - if (victim->GetTypeId() == TYPEID_PLAYER && !_sayAshbringer) + if (victim->IsPlayer() && !_sayAshbringer) Talk(SAY_MO_KILL); } @@ -768,7 +768,7 @@ class boss_high_inquisitor_whitemane : public CreatureScript void KilledUnit(Unit* victim) override { - if (victim->GetTypeId() == TYPEID_PLAYER) + if (victim->IsPlayer()) Talk(SAY_WH_KILL); } From 9230bdd5a61aa185ea1c2e8d6c5a0b51e6f01497 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 24 Nov 2024 12:30:21 +0800 Subject: [PATCH 51/65] Delete the C++ script code. --- .../instance_scarlet_monastery.cpp | 733 +----------------- 1 file changed, 25 insertions(+), 708 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index afbc9eba828311..69f30e6ef846ca 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -66,6 +66,8 @@ enum DataTypes GAMEOBJECT_PUMPKIN_SHRINE = 10 }; +float const CATHEDRAL_PULL_RANGE = 80.0f; // Distance from the Cathedral doors to where Mograine is standing + class instance_scarlet_monastery : public InstanceMapScript { public: @@ -134,7 +136,22 @@ class instance_scarlet_monastery : public InstanceMapScript case TYPE_MOGRAINE_AND_WHITE_EVENT: if (data == IN_PROGRESS) { - DoUseDoorOrButton(_doorHighInquisitorGUID); + Creature* Mograine = instance->GetCreature(_mograineGUID); + if (Mograine) + { + std::list creatureList; + GetCreatureListWithEntryInGrid(creatureList, Mograine, NPC_SCARLET_MONK, CATHEDRAL_PULL_RANGE); + GetCreatureListWithEntryInGrid(creatureList, Mograine, NPC_SCARLET_ABBOT, CATHEDRAL_PULL_RANGE); + GetCreatureListWithEntryInGrid(creatureList, Mograine, NPC_SCARLET_CHAMPION, CATHEDRAL_PULL_RANGE); + GetCreatureListWithEntryInGrid(creatureList, Mograine, NPC_SCARLET_CENTURION, CATHEDRAL_PULL_RANGE); + GetCreatureListWithEntryInGrid(creatureList, Mograine, NPC_SCARLET_WIZARD, CATHEDRAL_PULL_RANGE); + GetCreatureListWithEntryInGrid(creatureList, Mograine, NPC_SCARLET_CHAPLAIN, CATHEDRAL_PULL_RANGE); + for (std::list::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr) + { + if (Creature* creature = *itr) + creature->AI()->AttackStart(Mograine->GetVictim()); + } + } _encounter = IN_PROGRESS; } if (data == FAIL) @@ -150,7 +167,7 @@ class instance_scarlet_monastery : public InstanceMapScript if (Whitemane->IsAlive() && Mograine->IsAlive()) { // When Whitemane emerges from the main gate, Whitemane will stand next to Mograine's corpse and will not reset Whitemane - if (Whitemane->IsInCombat()) + if (Whitemane->IsInCombat()||Whitemane->IsInEvadeMode()) Whitemane->DespawnOnEvade(30s); Mograine->DespawnOnEvade(30s); @@ -175,8 +192,8 @@ class instance_scarlet_monastery : public InstanceMapScript _encounter = data; } - if (data == SPECIAL) - _encounter = SPECIAL; + if (data == DONE) + _encounter = DONE; break; case TYPE_ASHBRINGER_EVENT: if (data == IN_PROGRESS) @@ -255,719 +272,19 @@ class instance_scarlet_monastery : public InstanceMapScript }; }; -class at_scarlet_monastery_cathedral_entrance : public AreaTriggerScript -{ -public: - at_scarlet_monastery_cathedral_entrance() : AreaTriggerScript("at_scarlet_monastery_cathedral_entrance") {} - - bool OnTrigger(Player* player, AreaTrigger const* /*trigger*/) override - { - if (!player->HasAura(AURA_OF_ASHBRINGER)) - return false; - - InstanceScript* instance = player->GetInstanceScript(); - if (!instance || instance->GetData(TYPE_ASHBRINGER_EVENT) != NOT_STARTED) - return false; - - if (Creature* Mograine = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_MOGRAINE))) - if (Mograine->IsAlive() && !Mograine->IsInCombat()) - Mograine->AI()->Talk(SAY_MOGRAINE_ASHBRBINGER_INTRO, player); - - instance->SetData(TYPE_ASHBRINGER_EVENT, IN_PROGRESS); - return true; - } -}; -enum Misc +enum Speel { - POINT_MOGRAINE_TO_WHITEMANE = 0, - POINT_WHITEMANE_TO_MOGRAINE = 0, - POINT_WHITEMANE_RESURRECTED = 1 -}; - -enum AshbringerEvent -{ - EVENT_MOGRAINE_FACING_PLAYER = 1, - EVENT_MOGRAINE_KNEEL = 2, - EVENT_MOGRAINE_EMOTE_TALK3 = 3, - EVENT_SUMMONED_HIGHLORD_MOGRAINE = 4, - EVENT_HIGHLORD_MOGRAINE_MOVE_STOP = 5, - EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE = 6, - EVENT_MOGRAINE_UNIT_STAND_STATE_STAND = 7, - EVENT_MOGRAINE_EMOTE_TALK4 = 8, - EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK = 9, - EVENT_HIGHLORD_MOGRAINE_EMOTE1 = 10, - EVENT_HIGHLORD_MOGRAINE_EMOTE2 = 11, - EVENT_HIGHLORD_MOGRAINE_EMOTE3 = 12, - EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2 = 13, - EVENT_MOGRAINE_EMOTE_TALK5 = 14, - EVENT_HIGHLORD_MOGRAINE_CASTSPELL = 15, - EVENT_MOGRAINE_CASTSPELL = 16, - EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE = 17, - EVENT_ASHBRINGER_OVER = 18 -}; - -enum MograineEvents -{ - EVENT_RESURRECTED = 1, - EVENT_SPELL_LAY_ON_HANDS = 2, - EVENT_MOGRAINE_SAY = 3, - EVENT_MOVE = 4 -}; - -enum WhitemaneEvents -{ - EVENT_SPELL_HOLY_SMITE = 1, - EVENT_SPELL_POWER_WORLD_SHIELD = 2, - EVENT_SPELL_HEAL = 3, - EVENT_SPELL_DOMINATE_MIND = 4, - EVENT_SLEEP = 5, - EVENT_RESURRECT = 6, - EVENT_SAY = 7, - EVENT_WHITEMANE_EMOTE = 8, - EVENT_DEALY_ATTACK = 9 -}; - -enum Spells -{ - //Mograine Spells - SPELL_CRUSADER_STRIKE = 14518, - SPELL_HAMMER_OF_JUSTICE = 5589, - SPELL_LAY_ON_HANDS = 9257, - SPELL_RETRIBUTION_AURA = 8990, - - //Whitemanes Spells - SPELL_SCARLET_RESURRECTION = 9232, - SPELL_DEEP_SLEEP = 9256, - SPELL_DOMINATE_MIND = 14515, - SPELL_HOLY_SMITE = 9481, - SPELL_HEAL = 12039, - SPELL_POWER_WORD_SHIELD = 22187, - //Highlord Mograine Spells - SPELL_MOGRAINE_COMETH_DND = 28688, + //This spell lacks the visual effect after hitting the target SPELL_FORGIVENESS = 28697, - //SPELL_TRANSFORM_GHOST + //High Inquisitor Fairbanks + //This spell lacks the visual effect after hitting the target SPELL_TRANSFORM_GHOST = 28443 }; -enum Says -{ - //Mograine says - SAY_MO_AGGRO = 0, - SAY_MO_KILL = 1, - SAY_MO_RESURRECTED = 2, - SOUND_DEAD = 1326, - - //Mograine Ashbringer Event says - SAY_MO_AB_TALK3 = 3, - SAY_MO_AB_TALK4 = 4, - SAY_MO_AB_TALK5 = 5, - - //Highlord Mograine Ashbringer Event Says - SAY_HM_AB_TALK0 = 0, - SAY_HM_AB_TALK1 = 1, - SAY_HM_AB_TALK2 = 2, - - //Whitemane says - SAY_WH_INTRO = 0, - SAY_WH_KILL = 1, - SAY_WH_RESURRECT = 2 -}; - -float const CATHEDRAL_PULL_RANGE = 80.0f; // Distance from the Cathedral doors to where Mograine is standing -Position const SummonedMograinePos = { 1033.4642f, 1399.1022f, 27.337427f, 6.257956981658935546f }; - -class npc_mograine : public CreatureScript -{ -public: - npc_mograine() : CreatureScript("npc_scarlet_commander_mograine") {} - - struct npc_mograineAI : public ScriptedAI - { - npc_mograineAI(Creature* creature) : ScriptedAI(creature) - { - _instance = creature->GetInstanceScript(); - } - - void AshbringerEvent(uint32 eventId) - { - Creature* summonedMograine = me->FindNearestCreature(NPC_HIGHLORD_MOGRAINE, 100.0f); - - switch (eventId) - { - case EVENT_MOGRAINE_FACING_PLAYER: - me->SetFacingToObject(_playerWhoStartedAshbringer); - _events.ScheduleEvent(EVENT_MOGRAINE_KNEEL, 1s, 3s); - break; - case EVENT_MOGRAINE_KNEEL: - me->SetStandState(UNIT_STAND_STATE_KNEEL); - _events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK3, 1s, 2s); - break; - case EVENT_MOGRAINE_EMOTE_TALK3: - me->AI()->Talk(SAY_MO_AB_TALK3, _playerWhoStartedAshbringer); - break; - case EVENT_SUMMONED_HIGHLORD_MOGRAINE: - if (Creature* summonedMograine = me->SummonCreature(NPC_HIGHLORD_MOGRAINE, SummonedMograinePos, TEMPSUMMON_TIMED_DESPAWN, 120000)) - { - summonedMograine->SetFaction(FACTION_FRIENDLY); - summonedMograine->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, EQUIP_UNEQUIP); - summonedMograine->SetDisplayId(MODEL_HIGHLORD_MOGRAINE); - // Sniffing data shows the use of this spell transformation, but the dispersion effect of this spell is not seen in the video - summonedMograine->CastSpell(summonedMograine, SPELL_MOGRAINE_COMETH_DND); - } - _events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_MOVE_STOP, 48500ms); - break; - case EVENT_HIGHLORD_MOGRAINE_MOVE_STOP: - summonedMograine->StopMovingOnCurrentPos(); - summonedMograine->AI()->Talk(SAY_HM_AB_TALK0, 200ms); - _events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE, 3000ms); - break; - case EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE: - me->SetFacingToObject(summonedMograine); - _events.ScheduleEvent(EVENT_MOGRAINE_UNIT_STAND_STATE_STAND, 400ms); - break; - case EVENT_MOGRAINE_UNIT_STAND_STATE_STAND: - me->SetStandState(UNIT_STAND_STATE_STAND); - _events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK4, 1200ms); - break; - case EVENT_MOGRAINE_EMOTE_TALK4: - me->AI()->Talk(SAY_MO_AB_TALK4); - _events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK, 4600ms); - break; - case EVENT_HIGHLORD_MOGRAINE_EMOTE_TALK: - summonedMograine->AI()->Talk(SAY_HM_AB_TALK1); - _events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE1, 3400ms); - break; - case EVENT_HIGHLORD_MOGRAINE_EMOTE1: - summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_QUESTION); - _events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE2, 3200ms); - break; - case EVENT_HIGHLORD_MOGRAINE_EMOTE2: - summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_POINT); - _events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_EMOTE3, 3200ms); - break; - case EVENT_HIGHLORD_MOGRAINE_EMOTE3: - summonedMograine->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - _events.ScheduleEvent(EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2, 3200ms); - break; - case EVENT_MOGRAINE_FACING_HIGHLORD_MOGRAINE2: - me->SetFacingToObject(summonedMograine); - _events.ScheduleEvent(EVENT_MOGRAINE_EMOTE_TALK5, 1200ms); - break; - case EVENT_MOGRAINE_EMOTE_TALK5: - me->AI()->Talk(SAY_MO_AB_TALK5); - _events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_CASTSPELL, 3000ms); - break; - case EVENT_HIGHLORD_MOGRAINE_CASTSPELL: - // In Blizzard's servers, after "HIGHLORD_MOGRAINE" uses this spell, "MOGRAINE" will have a visual effect of lightning hits, and the visual effect after the hit is missing here and needs to be fixed - summonedMograine->CastSpell(me, SPELL_FORGIVENESS); - _events.ScheduleEvent(EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE, 1000ms); - break; - case EVENT_HIGHLORD_MOGRAINE_KILL_MOGRAINE: - me->KillSelf(); - summonedMograine->AI()->Talk(SAY_HM_AB_TALK2, 2700ms); - summonedMograine->DespawnOrUnsummon(6100); - break; - default: - break; - } - } - - void PullCathedral() // CallForHelp will ignore any npcs without LOS - { - std::list creatureList; - GetCreatureListWithEntryInGrid(creatureList, me, NPC_SCARLET_MONK, CATHEDRAL_PULL_RANGE); - GetCreatureListWithEntryInGrid(creatureList, me, NPC_SCARLET_ABBOT, CATHEDRAL_PULL_RANGE); - GetCreatureListWithEntryInGrid(creatureList, me, NPC_SCARLET_CHAMPION, CATHEDRAL_PULL_RANGE); - GetCreatureListWithEntryInGrid(creatureList, me, NPC_SCARLET_CENTURION, CATHEDRAL_PULL_RANGE); - GetCreatureListWithEntryInGrid(creatureList, me, NPC_SCARLET_WIZARD, CATHEDRAL_PULL_RANGE); - GetCreatureListWithEntryInGrid(creatureList, me, NPC_SCARLET_CHAPLAIN, CATHEDRAL_PULL_RANGE); - for (std::list::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr) - { - if (Creature* creature = *itr) - creature->AI()->AttackStart(me->GetVictim()); - } - } - - void ScheduleGround() - { - _scheduler.Schedule(1s, 5s, [this](TaskContext context) - { - DoCastVictim(SPELL_CRUSADER_STRIKE); - context.Repeat(10s); - }) - .Schedule(6s, 11s, [this](TaskContext context) - { - DoCastVictim(SPELL_HAMMER_OF_JUSTICE); - context.Repeat(60s); - }); - } - - void Reset() override - { - me->SetReactState(REACT_AGGRESSIVE); - me->SetStandState(UNIT_STAND_STATE_STAND); - me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - _events.Reset(); - _fakeDeath = false; - _scheduler.CancelAll(); - if (Creature* summonedMograine = me->FindNearestCreature(NPC_HIGHLORD_MOGRAINE, 100.0f)) - { - summonedMograine->DespawnOrUnsummon(); - } - _sayAshbringer = false; - } - - void EnterEvadeMode(EvadeReason /*why*/) override - { - if (_instance) - _instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); - } - - void MovementInform(uint32 type, uint32 id) override - { - if (type != POINT_MOTION_TYPE) - return; - - if (id == POINT_MOGRAINE_TO_WHITEMANE) - { - me->SetReactState(REACT_AGGRESSIVE); - DoCastSelf(SPELL_RETRIBUTION_AURA); - ScheduleGround(); - if (me->GetVictim()) - AttackStart(me->GetVictim()); - } - } - - void JustEngagedWith(Unit* /*who*/) override - { - Talk(SAY_MO_AGGRO); - DoCastSelf(SPELL_RETRIBUTION_AURA); - _scheduler.Schedule(1s, [this](TaskContext) - { - PullCathedral(); - }); - ScheduleGround(); - } - - void DamageTaken(Unit* /*doneBy*/, uint32& damage, DamageEffectType, SpellSchoolMask) override - { - if (damage > me->GetHealth() && _instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) != SPECIAL && _fakeDeath) - damage = 0; - - // On first death, fake death and open door, as well as initiate whitemane if exist - if (damage > me->GetHealth() && !_fakeDeath) - { - // On first death, fake death and open door, as well as initiate whitemane if exist - if (Creature* Whitemane = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_WHITEMANE))) - { - _instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); - Whitemane->AI()->Talk(SAY_WH_INTRO, me); - float fx, fy, fz; - me->GetContactPoint(Whitemane, fx, fy, fz, 5.0f); - Whitemane->GetMotionMaster()->MovePoint(POINT_WHITEMANE_TO_MOGRAINE, fx, fy, fz); - Whitemane->SetReactState(REACT_AGGRESSIVE); - } - me->GetMotionMaster()->MovementExpired(); - me->GetMotionMaster()->MoveIdle(); - me->SetHealth(0); - me->PlayDirectSound(SOUND_DEAD); - // Remove all beneficial auras - me->RemoveAura(SPELL_RETRIBUTION_AURA); - me->AttackStop(); - me->SetStandState(UNIT_STAND_STATE_DEAD); - me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->ClearAllReactives(); - me->SetReactState(REACT_PASSIVE); - _scheduler.CancelAll(); - _fakeDeath = true; - } - } - - void KilledUnit(Unit* victim) override - { - if (victim->IsPlayer() && !_sayAshbringer) - Talk(SAY_MO_KILL); - } - - void SpellHit(Unit* who, SpellInfo const* spell) override - { - if (!_instance) - return; - - // When hit with resurrection say text - if (spell->Id == SPELL_SCARLET_RESURRECTION) - { - _instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); - _events.ScheduleEvent(EVENT_RESURRECTED, 3500ms); - } - - if (who && spell->Id == AB_EFFECT_000 && !_sayAshbringer)// Ashbringer Event - { - me->SetFaction(FACTION_FRIENDLY); - me->GetMotionMaster()->MoveIdle(); - _playerWhoStartedAshbringer = who->ToPlayer(); - // Standing delay inside the cathedral - _sayAshbringer = true; - _events.ScheduleEvent(EVENT_MOGRAINE_FACING_PLAYER, 0ms); - _events.ScheduleEvent(EVENT_SUMMONED_HIGHLORD_MOGRAINE, 20ms); - } - } - - void UpdateAI(uint32 diff) override - { - if (_sayAshbringer) - { - _events.Update(diff); - while (uint32 eventId = _events.ExecuteEvent()) - { - AshbringerEvent(eventId); - } - } - - if (!UpdateVictim() || _sayAshbringer) - return; - - _scheduler.Update(diff); - - _events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = _events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_RESURRECTED: - me->SetReactState(REACT_PASSIVE); - me->AttackStop(); - me->InterruptNonMeleeSpells(false); - // How do I get rid of the animation from UNIT_STAND_STATE_DEAD to UNIT_STAND_STATE_STAND? - me->SetStandState(UNIT_STAND_STATE_STAND); - _events.ScheduleEvent(EVENT_SPELL_LAY_ON_HANDS, 0s); - break; - case EVENT_SPELL_LAY_ON_HANDS: - if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, _instance->GetGuidData(DATA_WHITEMANE))) - { - if (Whitemane->IsAlive()) - me->CastSpell(Whitemane, SPELL_LAY_ON_HANDS); - } - _events.ScheduleEvent(EVENT_MOGRAINE_SAY, 200ms); - break; - case EVENT_MOGRAINE_SAY: - if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, _instance->GetGuidData(DATA_WHITEMANE))) - { - Talk(SAY_MO_RESURRECTED, Whitemane); - } - _events.ScheduleEvent(EVENT_MOVE, 3000ms); - break; - case EVENT_MOVE: - if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, _instance->GetGuidData(DATA_WHITEMANE))) - { - me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - float fx, fy, fz; - Whitemane->GetContactPoint(me, fx, fy, fz, 0.0f); - me->GetMotionMaster()->MovePoint(POINT_MOGRAINE_TO_WHITEMANE, fx, fy, fz); - } - break; - default: - break; - } - } - - DoMeleeAttackIfReady(); - } - - private: - bool _sayAshbringer = false; - bool _fakeDeath = false; - EventMap _events; - InstanceScript* _instance; - TaskScheduler _scheduler; - Player* _playerWhoStartedAshbringer = nullptr; - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return GetScarletMonasteryAI(creature); - } -}; - -class boss_high_inquisitor_whitemane : public CreatureScript -{ -public: - boss_high_inquisitor_whitemane() : CreatureScript("boss_high_inquisitor_whitemane") {} - - struct boss_high_inquisitor_whitemaneAI : public ScriptedAI - { - boss_high_inquisitor_whitemaneAI(Creature* creature) : ScriptedAI(creature) - { - _instance = creature->GetInstanceScript(); - } - - void Reset() override - { - me->SetReactState(REACT_AGGRESSIVE); - _victimbuff = nullptr; - _events.Reset(); - _phase = 0; - } - - void JustRespawned() override - { - if (_instance) - _instance->DoUseDoorOrButton(_instance->GetGuidData(DATA_DOOR_WHITEMANE)); - - ScriptedAI::JustRespawned(); - } - - void EnterEvadeMode(EvadeReason /*why*/) override - { - if (_instance) - _instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); - } - - void JustEngagedWith(Unit* /*who*/) override - { - _events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 10ms); - _events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 22s, 45s); - // This spell was not used during the single-player test on the Blizzard server, - // it should take 2 people, and the chance of using it should be low - _events.ScheduleEvent(EVENT_SPELL_DOMINATE_MIND, 5s, 10s); - } - - void DamageTaken(Unit* /*doneBy*/, uint32& damage, DamageEffectType, SpellSchoolMask) override - { - // The player cannot kill her until she is releashed. Retain at least 1 life - if (_phase != 2 && damage >= me->GetHealth()) - { - damage = 0; - me->SetHealth(1); - } - } - - void MovementInform(uint32 type, uint32 id) override - { - if (type != POINT_MOTION_TYPE) - return; - - if (id == POINT_WHITEMANE_RESURRECTED) - { - // This determines whether the target buff exists - // Use don't know why use me->GetVictim() Unable to get the target - if (_victimbuff && _victimbuff->HasAura(SPELL_DEEP_SLEEP)) - // Wait 5 seconds to revive while the debuff is still present on the player - _events.ScheduleEvent(EVENT_RESURRECT, 5s); - else - _events.ScheduleEvent(EVENT_RESURRECT, 1s); - } - } - - void KilledUnit(Unit* victim) override - { - if (victim->IsPlayer()) - Talk(SAY_WH_KILL); - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - _events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - if (_phase == 0 && me->HealthBelowPct(50)) - { - _events.Reset(); - _phase = 1; - _events.ScheduleEvent(EVENT_SLEEP, 0ms); - } - - while (uint32 eventId = _events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_SPELL_HOLY_SMITE: - if (Unit* target = me->GetVictim()) - { - me->GetMotionMaster()->MoveChase(target, 30.0f); - - if (DoCast(target, SPELL_HOLY_SMITE) != SPELL_CAST_OK) - { - me->GetMotionMaster()->MoveChase(target); - _events.Repeat(1200ms); - break; - } - - if (me->GetExactDist2d(target) < 5.0f) - { - _events.Repeat(4500ms, 5s); - break; - } - } - _events.Repeat(2600ms, 3000ms); - break; - case EVENT_SPELL_POWER_WORLD_SHIELD: - // Since mograine has 0 HP, the DoSelectLowestHpFriendly function will always try to use it on him, not on himself - if (_phase != 2) - { - DoCast(me, SPELL_POWER_WORD_SHIELD); - _events.Repeat(22s, 35s); - break; - } - - if (Unit* target = DoSelectLowestHpFriendly(40.0f)) - { - if (DoCast(target, SPELL_POWER_WORD_SHIELD) == SPELL_CAST_OK) - { - _events.Repeat(22s, 35s); - break; - } - } - _events.Repeat(1s); - break; - case EVENT_SPELL_HEAL: - if (Unit* target = DoSelectLowestHpFriendly(40.0f)) - { - if (target->HealthBelowPct(75)) - { - DoCast(target, SPELL_HEAL); - _events.Repeat(17500ms, 20s); - break; - } - } - _events.Repeat(5s); - break; - case EVENT_SPELL_DOMINATE_MIND: - // The list of hates is greater than 1 - if (me->GetThreatMgr().GetThreatList().size() > 1) - { - if (!urand(0, 20))// 1/20 Used for testing urand(0, 20) - { - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true)) - { - DoCast(target, SPELL_DOMINATE_MIND); - _events.Repeat(20s, 30s); - break; - } - } - } - _events.Repeat(10s); - break; - case EVENT_SLEEP: - // This saves the target's "SLEEP" buff after the move is complete - _victimbuff = me->GetVictim(); - me->SetReactState(REACT_PASSIVE); - DoCast(SPELL_DEEP_SLEEP); - me->AttackStop(); - - if (Creature* mograine = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_MOGRAINE))) - { - if (me->GetDistance(mograine) > 0.5f) - { - float fx, fy, fz; - mograine->GetContactPoint(me, fx, fy, fz, 0.5f); - me->GetMotionMaster()->MovePoint(POINT_WHITEMANE_RESURRECTED, fx, fy, fz); - break; - } - } - _events.ScheduleEvent(EVENT_RESURRECT, 3200ms); - break; - case EVENT_RESURRECT: - if (Creature* mograine = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_MOGRAINE))) - { - DoCast(mograine, SPELL_SCARLET_RESURRECTION); - } - _events.ScheduleEvent(EVENT_SAY,1900ms); - break; - case EVENT_SAY: - Talk(SAY_WH_RESURRECT); - _events.ScheduleEvent(EVENT_WHITEMANE_EMOTE, 1400ms); - break; - case EVENT_WHITEMANE_EMOTE: - me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); - _phase = 2; - _events.ScheduleEvent(EVENT_DEALY_ATTACK, 1400ms); - break; - case EVENT_DEALY_ATTACK: - me->SetReactState(REACT_AGGRESSIVE); - _events.ScheduleEvent(EVENT_SPELL_HOLY_SMITE, 10ms); - _events.ScheduleEvent(EVENT_SPELL_HEAL, 15s); - _events.ScheduleEvent(EVENT_SPELL_POWER_WORLD_SHIELD, 10s); - break; - default: - break; - } - } - - DoMeleeAttackIfReady(); - } - - private: - InstanceScript* _instance; - Unit* _victimbuff = nullptr; - EventMap _events; - uint8 _phase{}; - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return GetScarletMonasteryAI(creature); - } -}; - -class npc_fairbanks : public CreatureScript -{ -public: - npc_fairbanks() : CreatureScript("npc_fairbanks") {} - - struct npc_fairbanksAI : public SmartAI - { - npc_fairbanksAI(Creature* creature) : SmartAI(creature) {} - - void Reset() override - { - _SayAshbringer = false; - } - - // Ready to move to SmartAI - void SpellHit(Unit* who, SpellInfo const* spell) override - { - if (who && spell->Id == AB_EFFECT_000 && !_SayAshbringer) - { - me->SetFaction(FACTION_FRIENDLY); - me->SetFacingToObject(who); - // There is a delay in sniffing 1615ms - // The sniffer uses this spell, but without the visual effect of the spell. - me->CastSpell(me, SPELL_TRANSFORM_GHOST); - // delay 10ms - me->SetDisplayId(MODEL_FAIRBANKS); - me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP); - _SayAshbringer = true; - } - } - - private: - bool _SayAshbringer = false; - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return GetScarletMonasteryAI(creature); - } -}; - void AddSC_instance_scarlet_monastery() { new instance_scarlet_monastery(); - new npc_fairbanks(); - new npc_mograine(); - new boss_high_inquisitor_whitemane(); - new at_scarlet_monastery_cathedral_entrance(); } From 3b936ab368ff2c5230be884e6c4b10180a04cf8b Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 24 Nov 2024 12:36:16 +0800 Subject: [PATCH 52/65] Mograine, Whitemane, Fairbanks, and Ashbringer Conversation Events moved to SmartAi --- .../rev_1697941424465768700.sql | 250 ++++++++++++++++-- 1 file changed, 221 insertions(+), 29 deletions(-) diff --git a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql index 79fa2abb6410aa..32dbebb349c648 100644 --- a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql +++ b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql @@ -1,4 +1,4 @@ --- 28282 is buff +-- Ashbringer is buff DELETE FROM `spell_custom_attr` WHERE `spell_id` = 28282; @@ -8,45 +8,154 @@ INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES (28282, 671088 UPDATE `gameobject_template_addon` SET `flags` = 34 WHERE (`entry` = 104591); + -- Clientside area trigger 4089 smart ai +SET @ENTRY := 4089; +DELETE FROM `areatrigger_scripts` WHERE `entry` = @ENTRY; +INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES (@ENTRY, 'SmartTrigger'); +DELETE FROM `smart_scripts` WHERE `source_type` = 2 AND `entryOrGuid` = @ENTRY; +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`, `event_param5`, `event_param6`, `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 +(@ENTRY, 2, 0, 1, 46, 0, 100, 1, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'On trigger - Self: storedTarget[0] = Triggering player'), +(@ENTRY, 2, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 34, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'On trigger - Set instance data #2 to 1'), +(@ENTRY, 2, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 10, 40029, 3976, 0, 0, 0, 0, 0, 'On trigger - Send stored target storedTarget[0] to Creature Scarlet Commander Mograine (3976) with guid 40029 (fetching)'), +(@ENTRY, 2, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 45, 0, 1, 0, 0, 0, 0, 10, 40029, 3976, 0, 0, 0, 0, 0, 'On trigger - Creature Scarlet Commander Mograine (3976) with guid 40029 (fetching): Set creature data #0 to 1'); +-- +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 4089 AND `SourceId` = 2; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES +(22, 1, 4089, 2, 0, 1, 0, 28282, 0, 0, 0, 'Action invoker has aura of spell Ashbringer (28282), effect EFFECT_0'), +(22, 1, 4089, 2, 0, 13, 0, 2, 0, 0, 0, 'instance data 2 equals 0'); --- Add a trigger for Ashbringer events Fire once after approaching -DELETE -FROM `areatrigger_scripts` -WHERE `entry` = 4089; -INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES - (4089, 'at_scarlet_monastery_cathedral_entrance'); +-- Scarlet Commander Mograine smart ai + +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 3976; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 3976); +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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(3976, 0, 0, 0, 38, 0, 100, 0, 0, 1, 0, 0, 0, 0, 1, 6, 0, 1, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Data Set 0 1 - Say Line 6'), +(3976, 0, 1, 0, 0, 0, 100, 1, 0, 0, 0, 0, 0, 0, 11, 8990, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - In Combat - Cast \'Retribution Aura\' (No Repeat)'), +(3976, 0, 2, 0, 0, 0, 100, 1, 1000, 1000, 0, 0, 0, 0, 34, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - In Combat - Set Instance Data 1 to 1 (No Repeat)'), +(3976, 0, 3, 0, 0, 0, 100, 0, 1000, 5000, 10000, 10000, 0, 0, 11, 14518, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - In Combat - Cast \'Crusader Strike\''), +(3976, 0, 4, 0, 0, 0, 100, 0, 6000, 11000, 60000, 60000, 0, 0, 11, 5589, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - In Combat - Cast \'Hammer of Justice\''), +(3976, 0, 5, 6, 11, 0, 100, 0, 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Respawn - Set Active Off'), +(3976, 0, 6, 7, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 19, 33554432, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Respawn - Remove Flags Not Selectable'), +(3976, 0, 7, 8, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Respawn - Set Reactstate Aggressive'), +(3976, 0, 8, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 91, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Respawn - Remove FlagStandstate Dead'), +(3976, 0, 9, 10, 4, 0, 100, 0, 0, 0, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Aggro - Set Invincibility Hp 1'), +(3976, 0, 10, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Aggro - Say Line 0'), +(3976, 0, 11, 12, 7, 0, 100, 0, 0, 0, 0, 0, 0, 0, 212, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Evade - Stop motion (StopMoving: 0, MovementExpired: 0)'), +(3976, 0, 12, 13, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 96, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Evade - Remove Dynamic Flags Dead'), +(3976, 0, 13, 14, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 34, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Evade - Set Instance Data 1 to 2'), +(3976, 0, 14, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 19, 33554432, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Evade - Remove Flags Not Selectable'), +(3976, 0, 15, 0, 5, 0, 100, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Killed Unit - Say Line 1'), +(3976, 0, 16, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 34, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Just Died - Set Instance Data 1 to 3'), +(3976, 0, 17, 0, 2, 0, 100, 1, 0, 1, 0, 0, 0, 0, 80, 397600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Between 0-1% Health - Run Script (No Repeat)'), +(3976, 0, 18, 0, 8, 1, 100, 512, 9232, 0, 0, 0, 0, 0, 80, 397601, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Spellhit \'Scarlet Resurrection\' - Run Script (Phase 1)'), +(3976, 0, 19, 20, 34, 0, 100, 0, 8, 1, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Reached Point 1 - Reset Invincibility Hp'), +(3976, 0, 20, 21, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 19, 33554432, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Reached Point 1 - Remove Flags Not Selectable'), +(3976, 0, 21, 22, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Reached Point 1 - Set Reactstate Aggressive'), +(3976, 0, 22, 23, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 8990, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Reached Point 1 - Cast \'Retribution Aura\''), +(3976, 0, 23, 24, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Reached Point 1 - Start Attacking'), +(3976, 0, 24, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Reached Point 1 - Start Attacking'), +(3976, 0, 25, 0, 8, 0, 100, 1, 28441, 0, 0, 0, 0, 0, 80, 397602, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Spellhit \'AB Effect 000\' - Run Script (No Repeat)'), +(3976, 0, 26, 0, 8, 0, 100, 1, 28441, 0, 0, 0, 0, 0, 67, 1, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Spellhit \'AB Effect 000\' - Create Timed Event (No Repeat)'), +(3976, 0, 27, 0, 59, 0, 100, 0, 1, 0, 0, 0, 0, 0, 12, 16062, 8, 0, 0, 0, 0, 8, 0, 0, 0, 0, 1033.46, 1399.1, 27.3374, 6.25796, 'Scarlet Commander Mograine - On Timed Event 1 Triggered - Summon Creature \'Highlord Mograine\''), +(3976, 0, 28, 0, 8, 0, 100, 0, 28697, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - On Spellhit \'Forgiveness\' - Kill Self'); + +-- Scarlet Commander Mograine suspended animation +DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 397600); +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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(397600, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 224, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Stop Attack'), +(397600, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 45, 0, 1, 0, 0, 0, 0, 10, 39946, 3977, 0, 0, 0, 0, 0, 0, 'Creature High Inquisitor Whitemane (3977) with guid 39946 (fetching): Set creature data #0 to 1'), +(397600, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 212, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Stop motion (StopMoving: 0, MovementExpired: 1)'), +(397600, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Start Random Movement'), +(397600, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 4, 1326, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Play Sound 1326'), +(397600, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 28, 8990, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Remove Aura \'Retribution Aura\''), +(397600, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 90, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Set Flag Standstate Dead'), +(397600, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 18, 33554432, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Set Flags Not Selectable'), +(397600, 9, 8, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Set Reactstate Passive'), +(397600, 9, 9, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Set Event Phase 1'); + +DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 397601); +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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(397601, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Set Reactstate Passive'), +(397601, 9, 1, 0, 0, 0, 100, 0, 1500, 1500, 0, 0, 0, 0, 91, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Remove FlagStandstate Dead'), +(397601, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 9257, 0, 0, 0, 0, 0, 10, 39946, 3977, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Cast \'Lay on Hands\''), +(397601, 9, 3, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 0, 1, 2, 0, 1, 0, 0, 0, 10, 39946, 3977, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Say Line 2'), +(397601, 9, 4, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 0, 10, 39946, 3977, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Move To Closest Creature \'High Inquisitor Whitemane\''); + +-- Scarlet Commander Mograine Ashbringer_Event +DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 397602); +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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(397602, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Set Active On'), +(397602, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 2, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Set Faction 35'), +(397602, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Start Random Movement'), +(397602, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Set Orientation Invoker'), +(397602, 9, 4, 0, 0, 0, 100, 0, 1000, 3000, 0, 0, 0, 0, 90, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Set Flag Standstate Kneel'), +(397602, 9, 5, 0, 0, 0, 100, 0, 1000, 2000, 0, 0, 0, 0, 1, 3, 0, 1, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Say Line 3'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 3976 AND `SourceId` = 0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES +(22, 1, 3976, 0, 0, 21, 1, 16384, 0, 0, 1, 'Object doesn\'t have unit state UNIT_STATE_ATTACK_PLAYER'), +(22, 1, 3976, 0, 0, 36, 1, 0, 0, 0, 0, 'Object is alive'), +(22, 3, 3976, 0, 0, 4, 1, 796, 0, 0, 0, 'Object in zone (796)'), +(22, 18, 3976, 0, 0, 4, 1, 796, 0, 0, 0, 'Object in zone (796)'), +(22, 19, 3976, 0, 0, 4, 1, 796, 0, 0, 0, 'Object in zone (796)'), +(22, 26, 3976, 0, 0, 4, 1, 796, 0, 0, 0, 'Object in zone (796)'), +(22, 26, 3976, 0, 0, 36, 1, 0, 0, 0, 0, 'Object is alive'), +(22, 27, 3976, 0, 0, 4, 1, 796, 0, 0, 0, 'Object in zone (796)'), +(22, 27, 3976, 0, 0, 36, 1, 0, 0, 0, 0, 'Object is alive'); -- Scarlet Commander Mograine say-- -DELETE -FROM `creature_text` -WHERE `CreatureID`=3976; +DELETE FROM `creature_text` WHERE `CreatureID` = 3976; INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES - (3976, 0, 0, 'Infidels! They must be purified!', 14, 0, 100, 0, 0, 5835, 2847, 0, 'mograine SAY_MO_AGGRO'), - (3976, 1, 0, 'Unworthy.', 14, 0, 100, 0, 0, 5836, 6197, 0, 'mograine SAY_MO_KILL'), - (3976, 2, 0, 'At your side, milady!', 14, 0, 100, 15, 0, 5837, 18026, 0, 'mograine SAY_MO_RESSURECTED'), - (3976, 3, 0, 'You hold my father\'s blade, $n. My soldiers are yours TO control, my $g Lord:Lady;. Take them... LEAD them... The impure must be purged. They must be cleansed of their taint.', 12, 0, 100, 1, 0, 0, 12390, 0, 'mograine SAY_ASHBRINGER_ONE'), - (3976, 4, 0, 'Father... But... How?', 12, 0, 100, 6, 0, 0, 12470, 0, 'mograine SAY_ASHBRINGER_TWO'), - (3976, 5, 0, 'Forgive me, father! Please...', 12, 0, 100, 20, 0, 0, 12472, 0, 'mograine SAY_ASHBRINGER_THREE'), - (3976, 6, 0, 'Bow down! Kneel BEFORE the Ashbringer! A NEW dawn approaches, brothers AND sisters! Our message will be delivered TO the filth of this world through the chosen one!', 14, 0, 100, 0, 0, 0, 12389, 0, 'Ashbringer EVENT intro yell'); - --- Highlord Mograine --- --- Highlord Mograine say -DELETE FROM `creature_text` WHERE `CreatureID`=16062; -INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `Type`, `BroadcastTextId`, `TextRange`, `comment`) VALUES - (16062, 0, 0, 'Renault...', 0, 100, 25, 0, 0, 12, 12469, 0, 'mograine MOGRAINE_ONE'), - (16062, 1, 0, 'Did you think that your betrayal would be forgotten? Lost in the carefully planned cover up of my death? Blood of my blood, the blade felt your cruelty long after my heart had stopped beating. And in death, I knew what you had done. But now, the chains of Kel\'thuzad hold me NO more. I come TO serve justice. I AM ASHBRINGER.', 0, 100, 6, 0, 0, 12, 12471, 0, 'mograine MOGRAINE_TWO'), - (16062, 2, 0, 'You are forgiven...', 0, 100, 0, 0, 0, 12, 12473, 0, 'mograine MOGRAINE_THREE'); +(3976, 0, 0, 'Infidels! They must be purified!', 14, 0, 100, 0, 0, 5835, 2847, 0, 'Scarlet Commander Mograine // mograine SAY_MO_AGGRO'), +(3976, 1, 0, 'Unworthy.', 14, 0, 100, 0, 0, 5836, 6197, 0, 'Scarlet Commander Mograine // mograine SAY_MO_KILL'), +(3976, 2, 0, 'At your side, milady!', 14, 0, 100, 15, 0, 5837, 18026, 0, 'Scarlet Commander Mograine // mograine SAY_MO_RESSURECTED'), +(3976, 3, 0, 'You hold my father\'s blade, $n. My soldiers are yours TO control, my $g Lord:Lady;. Take them... LEAD them... The impure must be purged. They must be cleansed of their taint.', 12, 0, 100, 1, 0, 0, 12390, 0, 'Scarlet Commander Mograine // mograine SAY_ASHBRINGER_ONE'), +(3976, 4, 0, 'Father... But... How?', 12, 0, 100, 6, 0, 0, 12470, 0, 'Scarlet Commander Mograine // mograine SAY_ASHBRINGER_TWO'), +(3976, 5, 0, 'Forgive me, father! Please...', 12, 0, 100, 20, 0, 0, 12472, 0, 'Scarlet Commander Mograine // mograine SAY_ASHBRINGER_THREE'), +(3976, 6, 0, 'Bow down! Kneel BEFORE the Ashbringer! A NEW dawn approaches, brothers AND sisters! Our message will be delivered TO the filth of this world through the chosen one!', 14, 0, 100, 0, 0, 0, 12389, 3, 'Scarlet Commander Mograine // Ashbringer EVENT intro yell'); + -- Highlord Mograine smart_scripts--- -UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 16062; + +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 16062; + DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 16062); 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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES -(16062, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 0, 0, 53, 0, 16062, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine Transform - Just_Summoned - Start Waypoint (No Repeat)'), -(16062, 0, 1, 0, 40, 0, 100, 0, 12, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 3976, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine Transform - On Waypoint 12 Reached - Set Rooted On'); +(16062, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - On Just Summoned - Set Active On'), +(16062, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 2, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - On Just Summoned - Set Faction 35'), +(16062, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 71, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - On Just Summoned - Change Equipment'), +(16062, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 3, 0, 16180, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - On Just Summoned - Morph To Model 16180'), +(16062, 0, 4, 5, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 28688, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - On Just Summoned - Cast \'Mograine Cometh DND\''), +(16062, 0, 5, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 53, 0, 16062, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - On Just Summoned - Start Waypoint Path 16062'), +(16062, 0, 6, 7, 40, 0, 100, 0, 12, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 3976, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - On Point 12 of Path Any Reached - Set Orientation Closest Creature \'Scarlet Commander Mograine\''), +(16062, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 1606200, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - On Point 12 of Path Any Reached - Run Script'); +-- Highlord Mograine Ashbringer_Event +DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 1606200); +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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(1606200, 9, 0, 0, 0, 0, 100, 0, 200, 200, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - Actionlist - Say Line 0'), +(1606200, 9, 1, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 0, 0, 231, 2, 0, 0, 0, 0, 0, 19, 3976, 5, 0, 0, 0, 0, 0, 0, 'Closest alive creature Scarlet Commander Mograine (3976) in 5 yards: - Actionlist - Set Target Orientation'), +(1606200, 9, 2, 0, 0, 0, 100, 0, 400, 400, 0, 0, 0, 0, 91, 8, 0, 0, 0, 0, 0, 19, 3976, 5, 0, 0, 0, 0, 0, 0, 'Closest alive creature Scarlet Commander Mograine (3976) in 5 yards: - Actionlist - Remove FlagStandstate Kneel'), +(1606200, 9, 3, 0, 0, 0, 100, 0, 1200, 1200, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 19, 3976, 5, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - Actionlist - Say Line 4'), +(1606200, 9, 4, 0, 0, 0, 100, 0, 4600, 4600, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - Actionlist - Say Line 1'), +(1606200, 9, 5, 0, 0, 0, 100, 0, 3400, 3400, 0, 0, 0, 0, 5, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - Actionlist - Play Emote 6'), +(1606200, 9, 6, 0, 0, 0, 100, 0, 3200, 3200, 0, 0, 0, 0, 5, 25, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - Actionlist - Play Emote 25'), +(1606200, 9, 7, 0, 0, 0, 100, 0, 3200, 3200, 0, 0, 0, 0, 5, 15, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - Actionlist - Play Emote 15'), +(1606200, 9, 8, 0, 0, 0, 100, 0, 3200, 3200, 0, 0, 0, 0, 231, 2, 0, 0, 0, 0, 0, 19, 3976, 5, 0, 0, 0, 0, 0, 0, 'Closest alive creature Scarlet Commander Mograine (3976) in 5 yards: - Actionlist - Set Target Orientation'), +(1606200, 9, 9, 0, 0, 0, 100, 0, 1200, 1200, 0, 0, 0, 0, 1, 5, 0, 0, 0, 0, 0, 19, 3976, 5, 0, 0, 0, 0, 0, 0, 'Closest alive creature Scarlet Commander Mograine (3976) in 5 yards: - Actionlist - Say Line 5'), +(1606200, 9, 10, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 0, 0, 11, 28697, 0, 0, 0, 0, 0, 19, 3976, 10, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - Actionlist - Cast \'Forgiveness\''), +(1606200, 9, 11, 0, 0, 0, 100, 0, 3700, 3700, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - Actionlist - Say Line 2'), +(1606200, 9, 12, 0, 0, 0, 100, 0, 3400, 3400, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - Actionlist - Despawn Instant'); + +-- Highlord Mograine Say +DELETE FROM `creature_text` WHERE `CreatureID`=16062; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `Type`, `BroadcastTextId`, `TextRange`, `comment`) VALUES + (16062, 0, 0, 'Renault...', 0, 100, 25, 0, 0, 12, 12469, 0, 'mograine MOGRAINE_ONE'), + (16062, 1, 0, 'Did you think that your betrayal would be forgotten? Lost in the carefully planned cover up of my death? Blood of my blood, the blade felt your cruelty long after my heart had stopped beating. And in death, I knew what you had done. But now, the chains of Kel\'thuzad hold me NO more. I come TO serve justice. I AM ASHBRINGER.', 0, 100, 6, 0, 0, 12, 12471, 0, 'mograine MOGRAINE_TWO'), + (16062, 2, 0, 'You are forgiven...', 0, 100, 0, 0, 0, 12, 12473, 0, 'mograine MOGRAINE_THREE'); --- The coordinates of the movement sniffed DELETE FROM `waypoints` WHERE `entry`=16062; @@ -63,3 +172,86 @@ INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `positi (16062, 10, 1129.5881, 1399.2926, 30.524086, NULL, 0, 'Ashbringer Event Move Points'), (16062, 11, 1149.4045, 1399.0231, 32.528877, NULL, 0, 'Ashbringer Event Move Points'), (16062, 12, 1150.3911, 1398.723, 32.54613, NULL, 0, 'Ashbringer Event Move Points'); + +-- +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceEntry` IN (8990)); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES +(13, 1, 8990, 0, 0, 31, 0, 3, 16062, 0, 1, 'Potential target of the spell is not creature, entry is 16062'); + +-- High Inquisitor Whitemane Smart ai +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 3977; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 3977); +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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(3977, 0, 0, 1, 38, 0, 100, 0, 0, 1, 0, 0, 0, 0, 118, 2, 0, 0, 0, 0, 0, 14, 11877, 104600, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Data Set 0 1 - Set GO State To 2'), +(3977, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Data Set 0 1 - Say Line 0'), +(3977, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 0, 10, 40029, 3976, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Data Set 0 1 - Move To Closest Creature \'Scarlet Commander Mograine\''), +(3977, 0, 3, 4, 4, 0, 100, 0, 0, 0, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Aggro - Set Invincibility Hp 1'), +(3977, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Aggro - Set Event Phase 1'), +(3977, 0, 5, 0, 0, 0, 100, 0, 1000, 1000, 2600, 4000, 0, 0, 11, 9481, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - In Combat - Cast \'Holy Smite\''), +(3977, 0, 6, 0, 0, 1, 100, 0, 1000, 1000, 5000, 10000, 0, 0, 11, 22187, 32, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - In Combat - Cast \'Power Word: Shield\' (Phase 1)'), +(3977, 0, 7, 0, 14, 0, 100, 0, 1, 40, 5000, 10000, 0, 0, 11, 22187, 32, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Friendly At 1 Health - Cast \'Power Word: Shield\''), +(3977, 0, 8, 0, 0, 2, 100, 0, 45000, 45000, 20000, 30000, 0, 0, 11, 14515, 64, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - In Combat - Cast \'Dominate Mind\' (Phase 2)'), +(3977, 0, 9, 0, 14, 2, 100, 0, 590, 40, 5000, 15000, 0, 0, 11, 12039, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Friendly At 590 Health - Cast \'Heal\' (Phase 2)'), +(3977, 0, 10, 0, 5, 0, 100, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Killed Unit - Say Line 1'), +(3977, 0, 11, 0, 21, 0, 100, 0, 0, 0, 0, 0, 0, 0, 118, 1, 0, 0, 0, 0, 0, 14, 11877, 104600, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Reached Home - Set GO State To 1'), +(3977, 0, 12, 0, 11, 0, 100, 0, 0, 0, 0, 0, 0, 0, 118, 1, 0, 0, 0, 0, 0, 14, 11877, 104600, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Respawn - Set GO State To 1'), +(3977, 0, 13, 14, 7, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Evade - Set Reactstate Aggressive'), +(3977, 0, 14, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 34, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Evade - Set Instance Data 1 to 2'), +(3977, 0, 15, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 34, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Just Died - Set Instance Data 1 to 3'), +(3977, 0, 16, 0, 2, 0, 100, 513, 0, 50, 0, 0, 0, 0, 80, 397700, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Between 0-50% Health - Run Script (No Repeat)'), +(3977, 0, 17, 0, 38, 0, 100, 0, 1, 1, 0, 0, 0, 0, 67, 1, 200, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Data Set 1 1 - Create Timed Event'), +(3977, 0, 18, 0, 59, 0, 100, 0, 1, 0, 0, 0, 0, 0, 80, 397701, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Timed Event 1 Triggered - Run Script'), +(3977, 0, 19, 0, 38, 0, 100, 0, 1, 1, 0, 0, 0, 0, 69, 2, 0, 0, 2, 0, 0, 10, 40029, 3976, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Data Set 1 1 - Move To Closest Creature \'Scarlet Commander Mograine\''), +(3977, 0, 20, 0, 34, 0, 100, 512, 8, 2, 0, 0, 0, 0, 80, 397701, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Reached Point 2 - Run Script'); + +-- Health less than 50% Hypnotize the player +DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 397700); +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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(397700, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 224, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Actionlist - Stop Attack'), +(397700, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Actionlist - Set Event Phase 0'), +(397700, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Actionlist - Set Reactstate Passive'), +(397700, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 9256, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Actionlist - Cast \'Deep Sleep\''), +(397700, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'After 0 seconds - Self: Set data[1] to 1'); + +-- Resurrect Mograini + +DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 397701); +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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(397701, 9, 0, 0, 0, 0, 100, 0, 4500, 4500, 0, 0, 0, 0, 11, 9232, 0, 0, 0, 0, 0, 19, 3976, 50, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Actionlist - Cast \'Scarlet Resurrection\''), +(397701, 9, 1, 0, 0, 0, 100, 0, 1900, 1900, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Actionlist - Say Line 2'), +(397701, 9, 2, 0, 0, 0, 100, 0, 1400, 1400, 0, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Actionlist - Set Sheath Unarmed'), +(397701, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 5, 66, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Actionlist - Play Emote 66'), +(397701, 9, 4, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Actionlist - Reset Invincibility Hp'), +(397701, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Actionlist - Set Reactstate Aggressive'), +(397701, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Actionlist - Set Event Phase 2'), +(397701, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Actionlist - Start Attacking'); + +-- High Inquisitor Whitemane say + +DELETE FROM `creature_text` WHERE `CreatureID` = 3977; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(3977, 0, 0, 'Mograine has fallen! You shall pay for this treachery! Arise, my champion! Arise!', 14, 0, 100, 0, 0, 5838, 18023, 0, 'High Inquisitor Whitemane // whitemane SAY_WH_INTRO'), +(3977, 1, 0, 'The Light has spoken!', 14, 0, 100, 0, 0, 5839, 6198, 0, 'High Inquisitor Whitemane // whitemane SAY_WH_KILL'), +(3977, 2, 0, 'Arise, my champion!', 14, 0, 100, 0, 0, 5840, 6532, 0, 'High Inquisitor Whitemane // whitemane SAY_WH_RESSURECT'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 3977 AND `SourceId` = 0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES +(22, 18, 3977, 0, 0, 29, 1, 3976, 5, 0, 0, 'There is creature Scarlet Commander Mograine (3976) within range 5 yards to Object'), +(22, 20, 3977, 0, 0, 29, 1, 3976, 5, 0, 1, 'There is no creature Scarlet Commander Mograine (3976) within range 5 yards to Object'); + +-- High Inquisitor Fairbanks smart ai + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 4542; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 4542) AND (`source_type` = 0) AND (`id` IN (11)); +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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(4542, 0, 11, 0, 8, 0, 100, 1, 28441, 0, 0, 0, 0, 0, 80, 454205, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Fairbanks - On Spellhit \'AB Effect 000\' - Run Script (No Repeat)'); + +DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 454205); +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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(454205, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 2, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Fairbanks - Actionlist - Set Faction 35'), +(454205, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Fairbanks - Actionlist - Set Orientation Invoker'), +(454205, 9, 2, 0, 0, 0, 100, 0, 500, 500, 0, 0, 0, 0, 11, 28443, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Fairbanks - Actionlist - Cast \'Transform Ghost\''), +(454205, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 3, 0, 16179, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Fairbanks - Actionlist - Morph To Model 16179'), +(454205, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Fairbanks - Actionlist - Add Npc Flags Gossip'); From d4855a536a441f35b847b1c32e573a223c489939 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sat, 7 Dec 2024 23:19:05 +0800 Subject: [PATCH 53/65] Move C++ scripts to Smart AI --- .../rev_1697941424465768700.sql | 46 +++++++++---------- .../instance_scarlet_monastery.cpp | 14 ++---- 2 files changed, 25 insertions(+), 35 deletions(-) diff --git a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql index 32dbebb349c648..0d5d5b3287f44c 100644 --- a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql +++ b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql @@ -82,7 +82,7 @@ INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_ (397601, 9, 3, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 0, 1, 2, 0, 1, 0, 0, 0, 10, 39946, 3977, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Say Line 2'), (397601, 9, 4, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 0, 10, 39946, 3977, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Move To Closest Creature \'High Inquisitor Whitemane\''); --- Scarlet Commander Mograine Ashbringer_Event +-- Scarlet Commander Mograine Ashbringer Event DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 397602); 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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES (397602, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Set Active On'), @@ -173,7 +173,7 @@ INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `positi (16062, 11, 1149.4045, 1399.0231, 32.528877, NULL, 0, 'Ashbringer Event Move Points'), (16062, 12, 1150.3911, 1398.723, 32.54613, NULL, 0, 'Ashbringer Event Move Points'); --- +-- Highlord Mograine Conditions DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceEntry` IN (8990)); INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES (13, 1, 8990, 0, 0, 31, 0, 3, 16062, 0, 1, 'Potential target of the spell is not creature, entry is 16062'); @@ -188,22 +188,21 @@ INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_ (3977, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 0, 10, 40029, 3976, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Data Set 0 1 - Move To Closest Creature \'Scarlet Commander Mograine\''), (3977, 0, 3, 4, 4, 0, 100, 0, 0, 0, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Aggro - Set Invincibility Hp 1'), (3977, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Aggro - Set Event Phase 1'), -(3977, 0, 5, 0, 0, 0, 100, 0, 1000, 1000, 2600, 4000, 0, 0, 11, 9481, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - In Combat - Cast \'Holy Smite\''), -(3977, 0, 6, 0, 0, 1, 100, 0, 1000, 1000, 5000, 10000, 0, 0, 11, 22187, 32, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - In Combat - Cast \'Power Word: Shield\' (Phase 1)'), -(3977, 0, 7, 0, 14, 0, 100, 0, 1, 40, 5000, 10000, 0, 0, 11, 22187, 32, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Friendly At 1 Health - Cast \'Power Word: Shield\''), -(3977, 0, 8, 0, 0, 2, 100, 0, 45000, 45000, 20000, 30000, 0, 0, 11, 14515, 64, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - In Combat - Cast \'Dominate Mind\' (Phase 2)'), -(3977, 0, 9, 0, 14, 2, 100, 0, 590, 40, 5000, 15000, 0, 0, 11, 12039, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Friendly At 590 Health - Cast \'Heal\' (Phase 2)'), -(3977, 0, 10, 0, 5, 0, 100, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Killed Unit - Say Line 1'), -(3977, 0, 11, 0, 21, 0, 100, 0, 0, 0, 0, 0, 0, 0, 118, 1, 0, 0, 0, 0, 0, 14, 11877, 104600, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Reached Home - Set GO State To 1'), -(3977, 0, 12, 0, 11, 0, 100, 0, 0, 0, 0, 0, 0, 0, 118, 1, 0, 0, 0, 0, 0, 14, 11877, 104600, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Respawn - Set GO State To 1'), -(3977, 0, 13, 14, 7, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Evade - Set Reactstate Aggressive'), -(3977, 0, 14, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 34, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Evade - Set Instance Data 1 to 2'), -(3977, 0, 15, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 34, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Just Died - Set Instance Data 1 to 3'), -(3977, 0, 16, 0, 2, 0, 100, 513, 0, 50, 0, 0, 0, 0, 80, 397700, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Between 0-50% Health - Run Script (No Repeat)'), -(3977, 0, 17, 0, 38, 0, 100, 0, 1, 1, 0, 0, 0, 0, 67, 1, 200, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Data Set 1 1 - Create Timed Event'), -(3977, 0, 18, 0, 59, 0, 100, 0, 1, 0, 0, 0, 0, 0, 80, 397701, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Timed Event 1 Triggered - Run Script'), -(3977, 0, 19, 0, 38, 0, 100, 0, 1, 1, 0, 0, 0, 0, 69, 2, 0, 0, 2, 0, 0, 10, 40029, 3976, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Data Set 1 1 - Move To Closest Creature \'Scarlet Commander Mograine\''), -(3977, 0, 20, 0, 34, 0, 100, 512, 8, 2, 0, 0, 0, 0, 80, 397701, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Reached Point 2 - Run Script'); +(3977, 0, 5, 0, 0, 3, 100, 0, 1000, 1000, 2600, 4000, 0, 0, 11, 9481, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - In Combat - Cast \'Holy Smite\' (Phases 1 & 2)'), +(3977, 0, 6, 0, 16, 3, 100, 0, 22187, 40, 5000, 10000, 1, 0, 11, 22187, 32, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Friendly Unit Missing Buff \'Power Word: Shield\' - Cast \'Power Word: Shield\' (Phases 1 & 2)'), +(3977, 0, 7, 0, 0, 2, 100, 0, 45000, 45000, 20000, 30000, 0, 0, 11, 14515, 64, 0, 0, 0, 0, 6, 20, 1, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - In Combat - Cast \'Dominate Mind\' (Phase 2)'), +(3977, 0, 8, 0, 74, 2, 100, 0, 5000, 15000, 5000, 15000, 75, 40, 11, 12039, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Friendly Below 75% Health - Cast \'Heal\' (Phase 2)'), +(3977, 0, 9, 0, 5, 0, 100, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Killed Unit - Say Line 1'), +(3977, 0, 10, 0, 11, 0, 100, 0, 0, 0, 0, 0, 0, 0, 118, 1, 0, 0, 0, 0, 0, 14, 11877, 104600, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Respawn - Set GO State To 1'), +(3977, 0, 11, 12, 7, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Evade - Set Reactstate Aggressive'), +(3977, 0, 12, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 34, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Evade - Set Instance Data 1 to 2'), +(3977, 0, 13, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 34, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Just Died - Set Instance Data 1 to 3'), +(3977, 0, 14, 15, 2, 0, 100, 513, 0, 50, 0, 0, 0, 0, 80, 397700, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Between 0-50% Health - Run Script (No Repeat)'), +(3977, 0, 15, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Between 0-50% Health - Set Event Phase 1 (No Repeat)'), +(3977, 0, 16, 0, 38, 0, 100, 0, 1, 1, 0, 0, 0, 0, 67, 1, 200, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Data Set 1 1 - Create Timed Event'), +(3977, 0, 17, 0, 59, 0, 100, 0, 1, 0, 0, 0, 0, 0, 80, 397701, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Timed Event 1 Triggered - Run Script'), +(3977, 0, 18, 0, 38, 0, 100, 0, 1, 1, 0, 0, 0, 0, 69, 2, 0, 0, 2, 0, 0, 10, 40029, 3976, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Data Set 1 1 - Move To Closest Creature \'Scarlet Commander Mograine\''), +(3977, 0, 19, 0, 34, 0, 100, 512, 8, 2, 0, 0, 0, 0, 80, 397701, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - On Reached Point 2 - Run Script'); -- Health less than 50% Hypnotize the player DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 397700); @@ -215,7 +214,6 @@ INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_ (397700, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'After 0 seconds - Self: Set data[1] to 1'); -- Resurrect Mograini - DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 397701); 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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES (397701, 9, 0, 0, 0, 0, 100, 0, 4500, 4500, 0, 0, 0, 0, 11, 9232, 0, 0, 0, 0, 0, 19, 3976, 50, 0, 0, 0, 0, 0, 0, 'High Inquisitor Whitemane - Actionlist - Cast \'Scarlet Resurrection\''), @@ -235,15 +233,15 @@ INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Lan (3977, 1, 0, 'The Light has spoken!', 14, 0, 100, 0, 0, 5839, 6198, 0, 'High Inquisitor Whitemane // whitemane SAY_WH_KILL'), (3977, 2, 0, 'Arise, my champion!', 14, 0, 100, 0, 0, 5840, 6532, 0, 'High Inquisitor Whitemane // whitemane SAY_WH_RESSURECT'); +-- High Inquisitor Whitemane Conditions DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 3977 AND `SourceId` = 0; INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES -(22, 18, 3977, 0, 0, 29, 1, 3976, 5, 0, 0, 'There is creature Scarlet Commander Mograine (3976) within range 5 yards to Object'), -(22, 20, 3977, 0, 0, 29, 1, 3976, 5, 0, 1, 'There is no creature Scarlet Commander Mograine (3976) within range 5 yards to Object'); +(22, 17, 3977, 0, 0, 29, 1, 3976, 5, 0, 0, 'There is creature Scarlet Commander Mograine (3976) within range 5 yards to Object'), +(22, 19, 3977, 0, 0, 29, 1, 3976, 5, 0, 1, 'There is no creature Scarlet Commander Mograine (3976) within range 5 yards to Object'); -- High Inquisitor Fairbanks smart ai -UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 4542; - +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 4542; DELETE FROM `smart_scripts` WHERE (`entryorguid` = 4542) AND (`source_type` = 0) AND (`id` IN (11)); 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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES (4542, 0, 11, 0, 8, 0, 100, 1, 28441, 0, 0, 0, 0, 0, 80, 454205, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Fairbanks - On Spellhit \'AB Effect 000\' - Run Script (No Repeat)'); @@ -254,4 +252,4 @@ INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_ (454205, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Fairbanks - Actionlist - Set Orientation Invoker'), (454205, 9, 2, 0, 0, 0, 100, 0, 500, 500, 0, 0, 0, 0, 11, 28443, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Fairbanks - Actionlist - Cast \'Transform Ghost\''), (454205, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 3, 0, 16179, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Fairbanks - Actionlist - Morph To Model 16179'), -(454205, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Fairbanks - Actionlist - Add Npc Flags Gossip'); +(454205, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Fairbanks - Actionlist - Add Npc Flags Gossip'); \ No newline at end of file diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 69f30e6ef846ca..3f867827be5b12 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -24,9 +24,6 @@ enum AshbringerEventMisc { - AB_EFFECT_000 = 28441, - AURA_OF_ASHBRINGER = 28282, - NPC_COMMANDER_MOGRAINE = 3976, NPC_INQUISITOR_WHITEMANE = 3977, NPC_SCARLET_SORCERER = 4294, @@ -43,11 +40,6 @@ enum AshbringerEventMisc DOOR_CHAPEL = 104591, DOOR_HIGH_INQUISITOR_ID = 104600, - - MODEL_HIGHLORD_MOGRAINE = 16180, - MODEL_FAIRBANKS = 16179, - - SAY_MOGRAINE_ASHBRBINGER_INTRO = 6 }; enum DataTypes @@ -136,8 +128,8 @@ class instance_scarlet_monastery : public InstanceMapScript case TYPE_MOGRAINE_AND_WHITE_EVENT: if (data == IN_PROGRESS) { - Creature* Mograine = instance->GetCreature(_mograineGUID); - if (Mograine) + + if (Creature* Mograine = instance->GetCreature(_mograineGUID)) { std::list creatureList; GetCreatureListWithEntryInGrid(creatureList, Mograine, NPC_SCARLET_MONK, CATHEDRAL_PULL_RANGE); @@ -276,7 +268,7 @@ class instance_scarlet_monastery : public InstanceMapScript enum Speel { //Highlord Mograine Spells - //This spell lacks the visual effect after hitting the target + //This spell lacks the lightning visual effect after hitting the target SPELL_FORGIVENESS = 28697, //High Inquisitor Fairbanks From 7e8d0064b3744f32b8a2bd2bfec543b60d2af66b Mon Sep 17 00:00:00 2001 From: fangshun Date: Sat, 7 Dec 2024 23:35:53 +0800 Subject: [PATCH 54/65] Modify the code style --- .../rev_1697941424465768700.sql | 2 +- .../instance_scarlet_monastery.cpp | 26 +++++++++---------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql index 0d5d5b3287f44c..c477d50edf9532 100644 --- a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql +++ b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql @@ -252,4 +252,4 @@ INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_ (454205, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Fairbanks - Actionlist - Set Orientation Invoker'), (454205, 9, 2, 0, 0, 0, 100, 0, 500, 500, 0, 0, 0, 0, 11, 28443, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Fairbanks - Actionlist - Cast \'Transform Ghost\''), (454205, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 3, 0, 16179, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Fairbanks - Actionlist - Morph To Model 16179'), -(454205, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Fairbanks - Actionlist - Add Npc Flags Gossip'); \ No newline at end of file +(454205, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'High Inquisitor Fairbanks - Actionlist - Add Npc Flags Gossip'); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 3f867827be5b12..80819370b57732 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -42,6 +42,17 @@ enum AshbringerEventMisc DOOR_HIGH_INQUISITOR_ID = 104600, }; +enum AshbringerSpell +{ + //Highlord Mograine Spells + //This spell lacks the lightning visual effect after hitting the target + SPELL_FORGIVENESS = 28697, + + //High Inquisitor Fairbanks + //This spell lacks the visual effect after hitting the target + SPELL_TRANSFORM_GHOST = 28443 +}; + enum DataTypes { TYPE_MOGRAINE_AND_WHITE_EVENT = 1, @@ -127,8 +138,7 @@ class instance_scarlet_monastery : public InstanceMapScript { case TYPE_MOGRAINE_AND_WHITE_EVENT: if (data == IN_PROGRESS) - { - + { if (Creature* Mograine = instance->GetCreature(_mograineGUID)) { std::list creatureList; @@ -264,18 +274,6 @@ class instance_scarlet_monastery : public InstanceMapScript }; }; - -enum Speel -{ - //Highlord Mograine Spells - //This spell lacks the lightning visual effect after hitting the target - SPELL_FORGIVENESS = 28697, - - //High Inquisitor Fairbanks - //This spell lacks the visual effect after hitting the target - SPELL_TRANSFORM_GHOST = 28443 -}; - void AddSC_instance_scarlet_monastery() { new instance_scarlet_monastery(); From 44af5756c5cb4568edcbb604222151df2b5aefbf Mon Sep 17 00:00:00 2001 From: fangshun Date: Sat, 7 Dec 2024 23:41:13 +0800 Subject: [PATCH 55/65] Remove spaces --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 80819370b57732..4056000cb937d8 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -138,7 +138,7 @@ class instance_scarlet_monastery : public InstanceMapScript { case TYPE_MOGRAINE_AND_WHITE_EVENT: if (data == IN_PROGRESS) - { + { if (Creature* Mograine = instance->GetCreature(_mograineGUID)) { std::list creatureList; From f16f79e9b79ca62210cd22b15b0fc46242d92cc6 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 22 Dec 2024 20:05:30 +0800 Subject: [PATCH 56/65] Revised to Lowercase The name of the correspondence is IsInCombat changed to IsEngaged --- .../instance_scarlet_monastery.cpp | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 4056000cb937d8..a3ea9fd9162445 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -139,55 +139,55 @@ class instance_scarlet_monastery : public InstanceMapScript case TYPE_MOGRAINE_AND_WHITE_EVENT: if (data == IN_PROGRESS) { - if (Creature* Mograine = instance->GetCreature(_mograineGUID)) + if (Creature* mograine = instance->GetCreature(_mograineGUID)) { std::list creatureList; - GetCreatureListWithEntryInGrid(creatureList, Mograine, NPC_SCARLET_MONK, CATHEDRAL_PULL_RANGE); - GetCreatureListWithEntryInGrid(creatureList, Mograine, NPC_SCARLET_ABBOT, CATHEDRAL_PULL_RANGE); - GetCreatureListWithEntryInGrid(creatureList, Mograine, NPC_SCARLET_CHAMPION, CATHEDRAL_PULL_RANGE); - GetCreatureListWithEntryInGrid(creatureList, Mograine, NPC_SCARLET_CENTURION, CATHEDRAL_PULL_RANGE); - GetCreatureListWithEntryInGrid(creatureList, Mograine, NPC_SCARLET_WIZARD, CATHEDRAL_PULL_RANGE); - GetCreatureListWithEntryInGrid(creatureList, Mograine, NPC_SCARLET_CHAPLAIN, CATHEDRAL_PULL_RANGE); + GetCreatureListWithEntryInGrid(creatureList, mograine, NPC_SCARLET_MONK, CATHEDRAL_PULL_RANGE); + GetCreatureListWithEntryInGrid(creatureList, mograine, NPC_SCARLET_ABBOT, CATHEDRAL_PULL_RANGE); + GetCreatureListWithEntryInGrid(creatureList, mograine, NPC_SCARLET_CHAMPION, CATHEDRAL_PULL_RANGE); + GetCreatureListWithEntryInGrid(creatureList, mograine, NPC_SCARLET_CENTURION, CATHEDRAL_PULL_RANGE); + GetCreatureListWithEntryInGrid(creatureList, mograine, NPC_SCARLET_WIZARD, CATHEDRAL_PULL_RANGE); + GetCreatureListWithEntryInGrid(creatureList, mograine, NPC_SCARLET_CHAPLAIN, CATHEDRAL_PULL_RANGE); for (std::list::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr) { if (Creature* creature = *itr) - creature->AI()->AttackStart(Mograine->GetVictim()); + creature->AI()->AttackStart(mograine->GetVictim()); } } _encounter = IN_PROGRESS; } if (data == FAIL) { - Creature* Whitemane = instance->GetCreature(_whitemaneGUID); - if (!Whitemane) + Creature* whitemane = instance->GetCreature(_whitemaneGUID); + if (!whitemane) return; - Creature* Mograine = instance->GetCreature(_mograineGUID); - if (!Mograine) + Creature* mograine = instance->GetCreature(_mograineGUID); + if (!mograine) return; - if (Whitemane->IsAlive() && Mograine->IsAlive()) + if (whitemane->IsAlive() && mograine->IsAlive()) { // When Whitemane emerges from the main gate, Whitemane will stand next to Mograine's corpse and will not reset Whitemane - if (Whitemane->IsInCombat()||Whitemane->IsInEvadeMode()) - Whitemane->DespawnOnEvade(30s); + if (whitemane->IsEngaged()||whitemane->IsInEvadeMode()) + whitemane->DespawnOnEvade(20s); - Mograine->DespawnOnEvade(30s); + mograine->DespawnOnEvade(20s); _encounter = NOT_STARTED; return; } // Whitemane will not be able to fight Mograine again when he dies - if (!Whitemane->IsAlive()) + if (!whitemane->IsAlive()) { - Mograine->DespawnOrUnsummon(); + mograine->DespawnOrUnsummon(); _encounter = data; return; } - if (Whitemane->IsAlive() && !Mograine->IsAlive()) + if (whitemane->IsAlive() && !mograine->IsAlive()) { - Whitemane->DespawnOnEvade(30s); + whitemane->DespawnOnEvade(20s); _encounter = data; return; } @@ -202,7 +202,7 @@ class instance_scarlet_monastery : public InstanceMapScript { // the ashbringer incident did not sniff out any data from whitemane if (Creature* whitemane = instance->GetCreature(_whitemaneGUID)) - if (whitemane->IsAlive() && !whitemane->IsInCombat()) + if (whitemane->IsAlive() && !whitemane->IsEngaged()) whitemane->DespawnOrUnsummon(); if (GameObject* go = instance->GetGameObject(_doorChapelGUID)) @@ -214,7 +214,7 @@ class instance_scarlet_monastery : public InstanceMapScript for (auto const& scarletCathedralNpcGuid : _ashbringerNpcGUID) if (Creature* scarletNpc = instance->GetCreature(scarletCathedralNpcGuid)) - if (scarletNpc->IsAlive() && !scarletNpc->IsInCombat()) + if (scarletNpc->IsAlive() && !scarletNpc->IsEngaged()) scarletNpc->SetFaction(FACTION_FRIENDLY); } _ashencounter = data; From 11962e11b0dfd6030126a5061dad52ccaf459c23 Mon Sep 17 00:00:00 2001 From: fangshun Date: Sun, 22 Dec 2024 20:32:28 +0800 Subject: [PATCH 57/65] Delete some header files --- .../ScarletMonastery/instance_scarlet_monastery.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index a3ea9fd9162445..a0a6089700e988 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -15,12 +15,10 @@ * with this program. If not, see . */ -#include "AreaTriggerScript.h" #include "CreatureScript.h" #include "InstanceMapScript.h" #include "scarletmonastery.h" #include "ScriptedCreature.h" -#include "SmartAI.h" enum AshbringerEventMisc { @@ -45,11 +43,11 @@ enum AshbringerEventMisc enum AshbringerSpell { //Highlord Mograine Spells - //This spell lacks the lightning visual effect after hitting the target + //Needs Fix: Increased the visual effect of spells on hit SPELL_FORGIVENESS = 28697, //High Inquisitor Fairbanks - //This spell lacks the visual effect after hitting the target + //Needs Fix: Increased the visual effect of spells on hit SPELL_TRANSFORM_GHOST = 28443 }; From 0a9df0d51f2f0651b3c75ec422e77b2839710d94 Mon Sep 17 00:00:00 2001 From: fangshun Date: Tue, 24 Dec 2024 19:40:27 +0800 Subject: [PATCH 58/65] Delete some header files --- .../instance_scarlet_monastery.cpp | 51 ++++++++++++++++--- 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index a0a6089700e988..ead75330b34c1f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -15,7 +15,6 @@ * with this program. If not, see . */ -#include "CreatureScript.h" #include "InstanceMapScript.h" #include "scarletmonastery.h" #include "ScriptedCreature.h" @@ -37,7 +36,7 @@ enum AshbringerEventMisc NPC_HIGHLORD_MOGRAINE = 16062, DOOR_CHAPEL = 104591, - DOOR_HIGH_INQUISITOR_ID = 104600, + DOOR_HIGH_INQUISITOR_ID = 104600 }; enum AshbringerSpell @@ -198,18 +197,24 @@ class instance_scarlet_monastery : public InstanceMapScript case TYPE_ASHBRINGER_EVENT: if (data == IN_PROGRESS) { - // the ashbringer incident did not sniff out any data from whitemane - if (Creature* whitemane = instance->GetCreature(_whitemaneGUID)) - if (whitemane->IsAlive() && !whitemane->IsEngaged()) - whitemane->DespawnOrUnsummon(); - + instance->LoadGrid(1069.949951f, 1399.140015f); if (GameObject* go = instance->GetGameObject(_doorChapelGUID)) { go->SetGoState(GO_STATE_ACTIVE); go->SetLootState(GO_ACTIVATED); go->SetGameObjectFlag(GO_FLAG_IN_USE); + go->AllowSaveToDB(true); } + // the ashbringer incident did not sniff out any data from whitemane + if (Creature* whitemane = instance->GetCreature(_whitemaneGUID)) + if (whitemane->IsAlive() && !whitemane->IsEngaged()) + whitemane->DespawnOrUnsummon(); + + if (Creature* mograine = instance->GetCreature(_mograineGUID)) + if (!mograine->IsAlive()) + SetData(TYPE_ASHBRINGER_EVENT, DONE); + for (auto const& scarletCathedralNpcGuid : _ashbringerNpcGUID) if (Creature* scarletNpc = instance->GetCreature(scarletCathedralNpcGuid)) if (scarletNpc->IsAlive() && !scarletNpc->IsEngaged()) @@ -223,6 +228,8 @@ class instance_scarlet_monastery : public InstanceMapScript default: break; } + + SaveToDB(); } ObjectGuid GetGuidData(uint32 type) const override @@ -261,6 +268,36 @@ class instance_scarlet_monastery : public InstanceMapScript break; } } + + void OnPlayerEnter(Player* /*player*/) override + { + switch (_ashencounter) + { + case IN_PROGRESS: + SetData(TYPE_ASHBRINGER_EVENT, IN_PROGRESS); + break; + case DONE: + SetData(TYPE_ASHBRINGER_EVENT, IN_PROGRESS); + if (Creature* mograine = instance->GetCreature(_mograineGUID)) + mograine->DespawnOrUnsummon(); + break; + default: + break; + } + } + + void ReadSaveDataMore(std::istringstream& data) override + { + data >> _encounter; + data >> _ashencounter; + } + + void WriteSaveDataMore(std::ostringstream& data) override + { + data << _encounter << ' ' + << _ashencounter; + } + private: ObjectGuid _doorHighInquisitorGUID; ObjectGuid _doorChapelGUID; From 60e06275e1b9cc9d95acfecb94cebe72f5b3ebfc Mon Sep 17 00:00:00 2001 From: fangshun Date: Tue, 24 Dec 2024 20:50:23 +0800 Subject: [PATCH 59/65] quash --- .../instance_scarlet_monastery.cpp | 48 ++----------------- 1 file changed, 5 insertions(+), 43 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index ead75330b34c1f..c8ebf38cafd61f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -197,24 +197,18 @@ class instance_scarlet_monastery : public InstanceMapScript case TYPE_ASHBRINGER_EVENT: if (data == IN_PROGRESS) { - instance->LoadGrid(1069.949951f, 1399.140015f); + // the ashbringer incident did not sniff out any data from whitemane + if (Creature* whitemane = instance->GetCreature(_whitemaneGUID)) + if (whitemane->IsAlive() && !whitemane->IsEngaged()) + whitemane->DespawnOrUnsummon(); + if (GameObject* go = instance->GetGameObject(_doorChapelGUID)) { go->SetGoState(GO_STATE_ACTIVE); go->SetLootState(GO_ACTIVATED); go->SetGameObjectFlag(GO_FLAG_IN_USE); - go->AllowSaveToDB(true); } - // the ashbringer incident did not sniff out any data from whitemane - if (Creature* whitemane = instance->GetCreature(_whitemaneGUID)) - if (whitemane->IsAlive() && !whitemane->IsEngaged()) - whitemane->DespawnOrUnsummon(); - - if (Creature* mograine = instance->GetCreature(_mograineGUID)) - if (!mograine->IsAlive()) - SetData(TYPE_ASHBRINGER_EVENT, DONE); - for (auto const& scarletCathedralNpcGuid : _ashbringerNpcGUID) if (Creature* scarletNpc = instance->GetCreature(scarletCathedralNpcGuid)) if (scarletNpc->IsAlive() && !scarletNpc->IsEngaged()) @@ -228,8 +222,6 @@ class instance_scarlet_monastery : public InstanceMapScript default: break; } - - SaveToDB(); } ObjectGuid GetGuidData(uint32 type) const override @@ -268,36 +260,6 @@ class instance_scarlet_monastery : public InstanceMapScript break; } } - - void OnPlayerEnter(Player* /*player*/) override - { - switch (_ashencounter) - { - case IN_PROGRESS: - SetData(TYPE_ASHBRINGER_EVENT, IN_PROGRESS); - break; - case DONE: - SetData(TYPE_ASHBRINGER_EVENT, IN_PROGRESS); - if (Creature* mograine = instance->GetCreature(_mograineGUID)) - mograine->DespawnOrUnsummon(); - break; - default: - break; - } - } - - void ReadSaveDataMore(std::istringstream& data) override - { - data >> _encounter; - data >> _ashencounter; - } - - void WriteSaveDataMore(std::ostringstream& data) override - { - data << _encounter << ' ' - << _ashencounter; - } - private: ObjectGuid _doorHighInquisitorGUID; ObjectGuid _doorChapelGUID; From 39e698cc8ee07ae7d4e946e09e3314d8e9c1e756 Mon Sep 17 00:00:00 2001 From: fangshun Date: Tue, 24 Dec 2024 21:18:13 +0800 Subject: [PATCH 60/65] fix --- data/sql/updates/pending_db_world/rev_1697941424465768700.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql index c477d50edf9532..a6431a7a4636d7 100644 --- a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql +++ b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql @@ -8,7 +8,7 @@ INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES (28282, 671088 UPDATE `gameobject_template_addon` SET `flags` = 34 WHERE (`entry` = 104591); - -- Clientside area trigger 4089 smart ai +-- Clientside area trigger 4089 smart ai SET @ENTRY := 4089; DELETE FROM `areatrigger_scripts` WHERE `entry` = @ENTRY; INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES (@ENTRY, 'SmartTrigger'); From 4f59cf7f532b93825a162e83d24c90578eceec0d Mon Sep 17 00:00:00 2001 From: fangshun Date: Tue, 24 Dec 2024 21:20:25 +0800 Subject: [PATCH 61/65] fix error --- data/sql/updates/pending_db_world/rev_1697941424465768700.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql index a6431a7a4636d7..ce1c5e9587d414 100644 --- a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql +++ b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql @@ -18,7 +18,7 @@ INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_ (@ENTRY, 2, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 34, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'On trigger - Set instance data #2 to 1'), (@ENTRY, 2, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 10, 40029, 3976, 0, 0, 0, 0, 0, 'On trigger - Send stored target storedTarget[0] to Creature Scarlet Commander Mograine (3976) with guid 40029 (fetching)'), (@ENTRY, 2, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 45, 0, 1, 0, 0, 0, 0, 10, 40029, 3976, 0, 0, 0, 0, 0, 'On trigger - Creature Scarlet Commander Mograine (3976) with guid 40029 (fetching): Set creature data #0 to 1'); --- +-- smart conditions DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 4089 AND `SourceId` = 2; INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES (22, 1, 4089, 2, 0, 1, 0, 28282, 0, 0, 0, 'Action invoker has aura of spell Ashbringer (28282), effect EFFECT_0'), From b2f77d267efa2f7f4547c5805f0448fe2a8723a9 Mon Sep 17 00:00:00 2001 From: fangshun Date: Tue, 24 Dec 2024 21:30:45 +0800 Subject: [PATCH 62/65] code style --- .../updates/pending_db_world/rev_1697941424465768700.sql | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql index ce1c5e9587d414..e3b3aec2fc6f03 100644 --- a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql +++ b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql @@ -20,7 +20,7 @@ INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_ (@ENTRY, 2, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 45, 0, 1, 0, 0, 0, 0, 10, 40029, 3976, 0, 0, 0, 0, 0, 'On trigger - Creature Scarlet Commander Mograine (3976) with guid 40029 (fetching): Set creature data #0 to 1'); -- smart conditions DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 4089 AND `SourceId` = 2; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES (22, 1, 4089, 2, 0, 1, 0, 28282, 0, 0, 0, 'Action invoker has aura of spell Ashbringer (28282), effect EFFECT_0'), (22, 1, 4089, 2, 0, 13, 0, 2, 0, 0, 0, 'instance data 2 equals 0'); @@ -93,7 +93,7 @@ INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_ (397602, 9, 5, 0, 0, 0, 100, 0, 1000, 2000, 0, 0, 0, 0, 1, 3, 0, 1, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Commander Mograine - Actionlist - Say Line 3'); DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 3976 AND `SourceId` = 0; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES (22, 1, 3976, 0, 0, 21, 1, 16384, 0, 0, 1, 'Object doesn\'t have unit state UNIT_STATE_ATTACK_PLAYER'), (22, 1, 3976, 0, 0, 36, 1, 0, 0, 0, 0, 'Object is alive'), (22, 3, 3976, 0, 0, 4, 1, 796, 0, 0, 0, 'Object in zone (796)'), @@ -115,7 +115,6 @@ INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Lan (3976, 5, 0, 'Forgive me, father! Please...', 12, 0, 100, 20, 0, 0, 12472, 0, 'Scarlet Commander Mograine // mograine SAY_ASHBRINGER_THREE'), (3976, 6, 0, 'Bow down! Kneel BEFORE the Ashbringer! A NEW dawn approaches, brothers AND sisters! Our message will be delivered TO the filth of this world through the chosen one!', 14, 0, 100, 0, 0, 0, 12389, 3, 'Scarlet Commander Mograine // Ashbringer EVENT intro yell'); - -- Highlord Mograine smart_scripts--- UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 16062; @@ -175,7 +174,7 @@ INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `positi -- Highlord Mograine Conditions DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceEntry` IN (8990)); -INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES (13, 1, 8990, 0, 0, 31, 0, 3, 16062, 0, 1, 'Potential target of the spell is not creature, entry is 16062'); -- High Inquisitor Whitemane Smart ai @@ -235,7 +234,7 @@ INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Lan -- High Inquisitor Whitemane Conditions DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 3977 AND `SourceId` = 0; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES (22, 17, 3977, 0, 0, 29, 1, 3976, 5, 0, 0, 'There is creature Scarlet Commander Mograine (3976) within range 5 yards to Object'), (22, 19, 3977, 0, 0, 29, 1, 3976, 5, 0, 1, 'There is no creature Scarlet Commander Mograine (3976) within range 5 yards to Object'); From ad60ab5d6a797316618d5742958eefb078fcd83c Mon Sep 17 00:00:00 2001 From: fangshun Date: Wed, 1 Jan 2025 11:44:22 +0800 Subject: [PATCH 63/65] edit --- .../rev_1697941424465768700.sql | 44 ++++++++++--------- .../instance_scarlet_monastery.cpp | 8 ++-- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql index e3b3aec2fc6f03..5fdc665b7ae34b 100644 --- a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql +++ b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql @@ -2,10 +2,10 @@ DELETE FROM `spell_custom_attr` WHERE `spell_id` = 28282; -INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES (28282, 67108864); +INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES (28282, `attributes`|67108864); -- It takes time to open the door with a key in Blizzard servers -UPDATE `gameobject_template_addon` SET `flags` = 34 +UPDATE `gameobject_template_addon` SET `flags` = `flags|2|32 WHERE (`entry` = 104591); -- Clientside area trigger 4089 smart ai @@ -19,10 +19,10 @@ INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_ (@ENTRY, 2, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 10, 40029, 3976, 0, 0, 0, 0, 0, 'On trigger - Send stored target storedTarget[0] to Creature Scarlet Commander Mograine (3976) with guid 40029 (fetching)'), (@ENTRY, 2, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 45, 0, 1, 0, 0, 0, 0, 10, 40029, 3976, 0, 0, 0, 0, 0, 'On trigger - Creature Scarlet Commander Mograine (3976) with guid 40029 (fetching): Set creature data #0 to 1'); -- smart conditions -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 4089 AND `SourceId` = 2; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = @ENTRY AND `SourceId` = 2; INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES -(22, 1, 4089, 2, 0, 1, 0, 28282, 0, 0, 0, 'Action invoker has aura of spell Ashbringer (28282), effect EFFECT_0'), -(22, 1, 4089, 2, 0, 13, 0, 2, 0, 0, 0, 'instance data 2 equals 0'); +(22, 1, @ENTRY, 2, 0, 1, 0, 28282, 0, 0, 0, 'Action invoker has aura of spell Ashbringer (28282), effect EFFECT_0'), +(22, 1, @ENTRY, 2, 0, 13, 0, 2, 0, 0, 0, 'instance data 2 equals 0'); -- Scarlet Commander Mograine smart ai @@ -96,15 +96,15 @@ DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES (22, 1, 3976, 0, 0, 21, 1, 16384, 0, 0, 1, 'Object doesn\'t have unit state UNIT_STATE_ATTACK_PLAYER'), (22, 1, 3976, 0, 0, 36, 1, 0, 0, 0, 0, 'Object is alive'), -(22, 3, 3976, 0, 0, 4, 1, 796, 0, 0, 0, 'Object in zone (796)'), -(22, 18, 3976, 0, 0, 4, 1, 796, 0, 0, 0, 'Object in zone (796)'), -(22, 19, 3976, 0, 0, 4, 1, 796, 0, 0, 0, 'Object in zone (796)'), -(22, 26, 3976, 0, 0, 4, 1, 796, 0, 0, 0, 'Object in zone (796)'), +(22, 3, 3976, 0, 0, 4, 1, 796, 0, 0, 0, 'Object in zone (796)'), +(22, 18, 3976, 0, 0, 4, 1, 796, 0, 0, 0, 'Object in zone (796)'), +(22, 19, 3976, 0, 0, 4, 1, 796, 0, 0, 0, 'Object in zone (796)'), +(22, 26, 3976, 0, 0, 4, 1, 796, 0, 0, 0, 'Object in zone (796)'), (22, 26, 3976, 0, 0, 36, 1, 0, 0, 0, 0, 'Object is alive'), -(22, 27, 3976, 0, 0, 4, 1, 796, 0, 0, 0, 'Object in zone (796)'), +(22, 27, 3976, 0, 0, 4, 1, 796, 0, 0, 0, 'Object in zone (796)'), (22, 27, 3976, 0, 0, 36, 1, 0, 0, 0, 0, 'Object is alive'); --- Scarlet Commander Mograine say-- +-- Scarlet Commander Mograine say DELETE FROM `creature_text` WHERE `CreatureID` = 3976; INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES (3976, 0, 0, 'Infidels! They must be purified!', 14, 0, 100, 0, 0, 5835, 2847, 0, 'Scarlet Commander Mograine // mograine SAY_MO_AGGRO'), @@ -115,7 +115,7 @@ INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Lan (3976, 5, 0, 'Forgive me, father! Please...', 12, 0, 100, 20, 0, 0, 12472, 0, 'Scarlet Commander Mograine // mograine SAY_ASHBRINGER_THREE'), (3976, 6, 0, 'Bow down! Kneel BEFORE the Ashbringer! A NEW dawn approaches, brothers AND sisters! Our message will be delivered TO the filth of this world through the chosen one!', 14, 0, 100, 0, 0, 0, 12389, 3, 'Scarlet Commander Mograine // Ashbringer EVENT intro yell'); --- Highlord Mograine smart_scripts--- +-- Highlord Mograine smart_scripts UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 16062; @@ -130,7 +130,7 @@ INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_ (16062, 0, 6, 7, 40, 0, 100, 0, 12, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 3976, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - On Point 12 of Path Any Reached - Set Orientation Closest Creature \'Scarlet Commander Mograine\''), (16062, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 1606200, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Highlord Mograine - On Point 12 of Path Any Reached - Run Script'); --- Highlord Mograine Ashbringer_Event +-- Highlord Mograine Ashbringer Event DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 1606200); 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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES @@ -151,9 +151,9 @@ INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_ -- Highlord Mograine Say DELETE FROM `creature_text` WHERE `CreatureID`=16062; INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `Type`, `BroadcastTextId`, `TextRange`, `comment`) VALUES - (16062, 0, 0, 'Renault...', 0, 100, 25, 0, 0, 12, 12469, 0, 'mograine MOGRAINE_ONE'), - (16062, 1, 0, 'Did you think that your betrayal would be forgotten? Lost in the carefully planned cover up of my death? Blood of my blood, the blade felt your cruelty long after my heart had stopped beating. And in death, I knew what you had done. But now, the chains of Kel\'thuzad hold me NO more. I come TO serve justice. I AM ASHBRINGER.', 0, 100, 6, 0, 0, 12, 12471, 0, 'mograine MOGRAINE_TWO'), - (16062, 2, 0, 'You are forgiven...', 0, 100, 0, 0, 0, 12, 12473, 0, 'mograine MOGRAINE_THREE'); +(16062, 0, 0, 'Renault...', 0, 100, 25, 0, 0, 12, 12469, 0, 'mograine MOGRAINE_ONE'), +(16062, 1, 0, 'Did you think that your betrayal would be forgotten? Lost in the carefully planned cover up of my death? Blood of my blood, the blade felt your cruelty long after my heart had stopped beating. And in death, I knew what you had done. But now, the chains of Kel\'thuzad hold me NO more. I come TO serve justice. I AM ASHBRINGER.', 0, 100, 6, 0, 0, 12, 12471, 0, 'mograine MOGRAINE_TWO'), +(16062, 2, 0, 'You are forgiven...', 0, 100, 0, 0, 0, 12, 12473, 0, 'mograine MOGRAINE_THREE'); DELETE FROM `waypoints` @@ -172,10 +172,14 @@ INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `positi (16062, 11, 1149.4045, 1399.0231, 32.528877, NULL, 0, 'Ashbringer Event Move Points'), (16062, 12, 1150.3911, 1398.723, 32.54613, NULL, 0, 'Ashbringer Event Move Points'); --- Highlord Mograine Conditions -DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceEntry` IN (8990)); -INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `Comment`) VALUES -(13, 1, 8990, 0, 0, 31, 0, 3, 16062, 0, 1, 'Potential target of the spell is not creature, entry is 16062'); +-- Highlord Mograine Condition +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceGroup` = 1) AND (`SourceEntry` = 8990) AND (`SourceId` = 0) AND (`ElseGroup` = 0) AND (`ConditionTypeOrReference` = 31) AND (`ConditionTarget` = 0) AND (`ConditionValue1` = 3) AND (`ConditionValue2` = 16062) AND (`ConditionValue3` = 0); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 8990, 0, 0, 31, 0, 3, 16062, 0, 1, 0, 0, '', 'Potential target of the spell is not creature, entry is 16062'); + +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 22) AND (`SourceGroup` = 1) AND (`SourceEntry` = 16062) AND (`SourceId` = 0) AND (`ElseGroup` = 0) AND (`ConditionTypeOrReference` = 4) AND (`ConditionTarget` = 1) AND (`ConditionValue1` = 796) AND (`ConditionValue2` = 0) AND (`ConditionValue3` = 0); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(22, 1, 16062, 0, 0, 4, 1, 796, 0, 0, 0, 0, 0, '', 'Object in zone (796)'); -- High Inquisitor Whitemane Smart ai UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 3977; diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index c8ebf38cafd61f..69e4a94accd123 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -35,8 +35,8 @@ enum AshbringerEventMisc NPC_FAIRBANKS = 4542, NPC_HIGHLORD_MOGRAINE = 16062, - DOOR_CHAPEL = 104591, - DOOR_HIGH_INQUISITOR_ID = 104600 + GO_CHAPEL_DOOR = 104591, + GO_HIGH_INQUISITOR_DOOR = 104600 }; enum AshbringerSpell @@ -90,10 +90,10 @@ class instance_scarlet_monastery : public InstanceMapScript switch (go->GetEntry()) { // case ENTRY_PUMPKIN_SHRINE: PumpkinShrineGUID = go->GetGUID(); break; - case DOOR_HIGH_INQUISITOR_ID: + case GO_HIGH_INQUISITOR_DOOR: _doorHighInquisitorGUID = go->GetGUID(); break; - case DOOR_CHAPEL: + case GO_CHAPEL_DOOR: _doorChapelGUID = go->GetGUID(); break; default: From b2166606e299cc57c8a68399caae69b13f95394d Mon Sep 17 00:00:00 2001 From: fangshun Date: Wed, 1 Jan 2025 13:24:14 +0800 Subject: [PATCH 64/65] fix error --- data/sql/updates/pending_db_world/rev_1697941424465768700.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql index 5fdc665b7ae34b..8edc269e09a8fc 100644 --- a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql +++ b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql @@ -5,7 +5,7 @@ WHERE `spell_id` = 28282; INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES (28282, `attributes`|67108864); -- It takes time to open the door with a key in Blizzard servers -UPDATE `gameobject_template_addon` SET `flags` = `flags|2|32 +UPDATE `gameobject_template_addon` SET `flags` = `flags`|2|32 WHERE (`entry` = 104591); -- Clientside area trigger 4089 smart ai From 69b4f0e495849dc170a8f5443b40c7509611ce01 Mon Sep 17 00:00:00 2001 From: daobashun <49193927+fangshun2004@users.noreply.github.com> Date: Wed, 1 Jan 2025 21:43:55 +0800 Subject: [PATCH 65/65] Update rev_1697941424465768700.sql --- data/sql/updates/pending_db_world/rev_1697941424465768700.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql index 8edc269e09a8fc..433c12fcb96fee 100644 --- a/data/sql/updates/pending_db_world/rev_1697941424465768700.sql +++ b/data/sql/updates/pending_db_world/rev_1697941424465768700.sql @@ -2,7 +2,7 @@ DELETE FROM `spell_custom_attr` WHERE `spell_id` = 28282; -INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES (28282, `attributes`|67108864); +INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES (28282, 67108864); -- It takes time to open the door with a key in Blizzard servers UPDATE `gameobject_template_addon` SET `flags` = `flags`|2|32