diff --git a/sql/updates/world/2015_08_21_00_world.sql b/sql/updates/world/2015_08_21_00_world.sql new file mode 100644 index 000000000..424ef4c3f --- /dev/null +++ b/sql/updates/world/2015_08_21_00_world.sql @@ -0,0 +1,30 @@ + +UPDATE locales_quest SET EndText_loc3="" WHERE Id=12716; + +UPDATE creature_template SET InhabitType=4 WHERE entry=28906; + +update creature_text set BroadcastTextID=28770 where entry=28942 and groupid=0 and id=0; +update creature_text set BroadcastTextID=29078 where entry=28942 and groupid=0 and id=1; +update creature_text set BroadcastTextID=28765 where entry=28942 and groupid=0 and id=2; +update creature_text set BroadcastTextID=28769 where entry=28942 and groupid=0 and id=3; +update creature_text set BroadcastTextID=29085 where entry=28942 and groupid=0 and id=4; +update creature_text set BroadcastTextID=29086 where entry=28942 and groupid=0 and id=5; +update creature_text set BroadcastTextID=29088 where entry=28942 and groupid=0 and id=6; +update creature_text set BroadcastTextID=29074 where entry=28942 and groupid=0 and id=7; +update creature_text set BroadcastTextID=28788 where entry=28942 and groupid=1 and id=0; +update creature_text set BroadcastTextID=28789 where entry=28942 and groupid=1 and id=1; +update creature_text set BroadcastTextID=28791 where entry=28942 and groupid=1 and id=2; +update creature_text set BroadcastTextID=28792 where entry=28942 and groupid=1 and id=3; +update creature_text set BroadcastTextID=28793 where entry=28942 and groupid=1 and id=4; +update creature_text set BroadcastTextID=28790 where entry=28942 and groupid=1 and id=5; + +UPDATE quest_template SET Method=2, Flags=8328, SpecialFlags=1 WHERE Id=12718; + +UPDATE locales_quest SET EndText_loc3="" WHERE Id=12718; + +update creature_template set AIName="", ScriptName="npc_crusade_persuaded_28610" where entry in (28610, 28939, 28940); + + + + + diff --git a/sql/updates/world/2015_08_21_01_world.sql b/sql/updates/world/2015_08_21_01_world.sql new file mode 100644 index 000000000..a0f50168c --- /dev/null +++ b/sql/updates/world/2015_08_21_01_world.sql @@ -0,0 +1,113 @@ + +DELETE FROM creature_text WHERE entry=28610; +INSERT INTO creature_text (entry, groupid, id, text, type, language, probability, emote, duration, sound, BroadcastTextID, comment) VALUES +(28610, 1, 0, "What is the \"Crimson Dawn?\"", 12, 0, 100, 0, 0, 0, 29133, "player SAY_PERSUADE1"), +(28610, 1, 1, "Tell me what you know about \"Crimson Dawn\" or the beatings will continue!", 12, 0, 100, 0, 0, 0, 29134, "player SAY_PERSUADE2"), +(28610, 1, 2, "I'm through being courteous with your kind, human! What is the \"Crimson Dawn?\"", 12, 0, 100, 0, 0, 0, 29135, "player SAY_PERSUADE3"), +(28610, 1, 3, "\"Crimson Dawn!\" What is it! Speak!", 12, 0, 100, 0, 0, 0, 29136, "player SAY_PERSUADE4"), +(28610, 1, 4, "I can keep this up for a very long time, Scarlet dog! Tell me about the \"Crimson Dawn!\"", 12, 0, 100, 0, 0, 0, 29137, "player SAY_PERSUADE5"), +(28610, 1, 5, "I'll tear the secrets from your soul! Tell me about the \"Crimson Dawn\" and your life may be spared!", 12, 0, 100, 0, 0, 0, 29138, "player SAY_PERSUADE6"), +(28610, 1, 6, "Is your life worth so little? Just tell me what I need to know about \"Crimson Dawn\" and I'll end your suffering quickly.", 12, 0, 100, 0, 0, 0, 29139, "player SAY_PERSUADE7"), +(28610, 1, 7, "I grow tired of these games, human. Tell me of the \"Crimson Dawn\" or I will tear your spine out with my bare hands!", 12, 0, 100, 0, 0, 0, 29140, "player SAY_PERSUADE8"), + +(28610, 2, 0, "I'll tell you nothing, Scourge filth!", 12, 0, 100, 0, 0, 0, 29141, "crusader SAY_CRUSADER1"), +(28610, 2, 1, "You'll have to kill me, monster! I will tell you NOTHING!", 12, 0, 100, 0, 0, 0, 29142, "crusader SAY_CRUSADER2"), +(28610, 2, 2, "Argh... The pain... The pain is almost as unbearable as the lashings I received in grammar school when I was but a child.", 12, 0, 100, 0, 0, 0, 29143, "crusader SAY_CRUSADER3"), +(28610, 2, 3, "You... You'll get nothing... And like it...", 12, 0, 100, 0, 0, 0, 29144, "crusader SAY_CRUSADER4"), +(28610, 2, 4, "Do you think this to be pain? To be suffering? HAH! Destroy this mortal shell so that I may ascend to the heavens!", 12, 0, 100, 0, 0, 0, 29145, "crusader SAY_CRUSADER5"), +(28610, 2, 5, "You hit like a girl. Honestly. Is that the best you can do?", 12, 0, 100, 0, 0, 0, 29146, "crusader SAY_CRUSADER6"), +(28610, 2, 6, "The crimson what? Never heard of it...", 12, 0, 100, 0, 0, 0, 29147, "crusader SAY_CRUSADER7"), +(28610, 2, 7, "The pain is momentary. It pales in comparison to what the High General would do to me...", 12, 0, 100, 0, 0, 0, 29148, "crusader SAY_CRUSADER8"), +(28610, 2, 8, "You'll be hanging in the gallows shortly, Scourge fiend!", 12, 0, 100, 0, 0, 0, 29160, "crusader SAY_CRUSADER9"), +(28610, 2, 9, "I used to work for Grand Inquisitor Isillien! Your idea of pain is a normal mid-afternoon for me!", 12, 0, 100, 0, 0, 0, 29161, "crusader SAY_CRUSADER10"), +(28610, 2, 10, "ARGH! You burned my last good tabard!", 12, 0, 100, 0, 0, 0, 29162, "crusader SAY_CRUSADER11"), +(28610, 2, 11, "You know nothing of pain, monster!", 12, 0, 100, 0, 0, 0, 29155, "crusader SAY_CRUSADER12"), +(28610, 2, 12, "HAH! I've survived three separate inquisitions! This is nothing in comparison!", 12, 0, 100, 0, 0, 0, 29156, "crusader SAY_CRUSADER13"), +(28610, 2, 13, "Look out! There's a bee loose and it's on a stinging rampage!", 12, 0, 100, 0, 0, 0, 29157, "crusader SAY_CRUSADER14"), +(28610, 2, 14, "That one tickled...", 12, 0, 100, 0, 0, 0, 29158, "crusader SAY_CRUSADER15"), +(28610, 2, 15, "I'm going to send you back to the Lich King in pieces!", 12, 0, 100, 0, 0, 0, 29159, "crusader SAY_CRUSADER16"), + +(28610, 3, 0, "I'll tell you everything! STOP! PLEASE!", 12, 0, 100, 0, 0, 0, 29149, "break crusader SAY_PERSUADED1"), +(28610, 4, 0, "We... We have only been told that the \"Crimson Dawn\" is an awakening. You see, the Light speaks to the High General. It is the Light...", 12, 0, 100, 0, 0, 0, 29150, "break crusader SAY_PERSUADED2"), +(28610, 5, 0, "The Light that guides us. The movement was set in motion before you came... We... We do as we are told. It is what must be done.", 12, 0, 100, 0, 0, 0, 29151, "break crusader SAY_PERSUADED3"), +(28610, 6, 0, "I know very little else... The High General chooses who may go and who must stay behind. There's nothing else... You must believe me!", 12, 0, 100, 0, 0, 0, 29152, "break crusader SAY_PERSUADED4"), +(28610, 7, 0, "LIES! The pain you are about to endure will be talked about for years to come!", 12, 0, 100, 0, 0, 0, 29163, "break player SAY_PERSUADED5"), +(28610, 8, 0, "NO! PLEASE! There is one more thing that I forgot to mention... A courier comes soon... From Hearthglen. It...", 12, 0, 100, 0, 0, 0, 29153, "break crusader SAY_PERSUADED6"), +(28610, 9, 0, "%s dies from the torture.", 16, 0, 100, 0, 0, 0, 29154, "dead crusader"); + +DELETE FROM creature_text WHERE entry=28939; +INSERT INTO creature_text (entry, groupid, id, text, type, language, probability, emote, duration, sound, BroadcastTextID, comment) VALUES +(28939, 1, 0, "What is the \"Crimson Dawn?\"", 12, 0, 100, 0, 0, 0, 29133, "player SAY_PERSUADE1"), +(28939, 1, 1, "Tell me what you know about \"Crimson Dawn\" or the beatings will continue!", 12, 0, 100, 0, 0, 0, 29134, "player SAY_PERSUADE2"), +(28939, 1, 2, "I'm through being courteous with your kind, human! What is the \"Crimson Dawn?\"", 12, 0, 100, 0, 0, 0, 29135, "player SAY_PERSUADE3"), +(28939, 1, 3, "\"Crimson Dawn!\" What is it! Speak!", 12, 0, 100, 0, 0, 0, 29136, "player SAY_PERSUADE4"), +(28939, 1, 4, "I can keep this up for a very long time, Scarlet dog! Tell me about the \"Crimson Dawn!\"", 12, 0, 100, 0, 0, 0, 29137, "player SAY_PERSUADE5"), +(28939, 1, 5, "I'll tear the secrets from your soul! Tell me about the \"Crimson Dawn\" and your life may be spared!", 12, 0, 100, 0, 0, 0, 29138, "player SAY_PERSUADE6"), +(28939, 1, 6, "Is your life worth so little? Just tell me what I need to know about \"Crimson Dawn\" and I'll end your suffering quickly.", 12, 0, 100, 0, 0, 0, 29139, "player SAY_PERSUADE7"), +(28939, 1, 7, "I grow tired of these games, human. Tell me of the \"Crimson Dawn\" or I will tear your spine out with my bare hands!", 12, 0, 100, 0, 0, 0, 29140, "player SAY_PERSUADE8"), + +(28939, 2, 0, "I'll tell you nothing, Scourge filth!", 12, 0, 100, 0, 0, 0, 29141, "crusader SAY_CRUSADER1"), +(28939, 2, 1, "You'll have to kill me, monster! I will tell you NOTHING!", 12, 0, 100, 0, 0, 0, 29142, "crusader SAY_CRUSADER2"), +(28939, 2, 2, "Argh... The pain... The pain is almost as unbearable as the lashings I received in grammar school when I was but a child.", 12, 0, 100, 0, 0, 0, 29143, "crusader SAY_CRUSADER3"), +(28939, 2, 3, "You... You'll get nothing... And like it...", 12, 0, 100, 0, 0, 0, 29144, "crusader SAY_CRUSADER4"), +(28939, 2, 4, "Do you think this to be pain? To be suffering? HAH! Destroy this mortal shell so that I may ascend to the heavens!", 12, 0, 100, 0, 0, 0, 29145, "crusader SAY_CRUSADER5"), +(28939, 2, 5, "You hit like a girl. Honestly. Is that the best you can do?", 12, 0, 100, 0, 0, 0, 29146, "crusader SAY_CRUSADER6"), +(28939, 2, 6, "The crimson what? Never heard of it...", 12, 0, 100, 0, 0, 0, 29147, "crusader SAY_CRUSADER7"), +(28939, 2, 7, "The pain is momentary. It pales in comparison to what the High General would do to me...", 12, 0, 100, 0, 0, 0, 29148, "crusader SAY_CRUSADER8"), +(28939, 2, 8, "You'll be hanging in the gallows shortly, Scourge fiend!", 12, 0, 100, 0, 0, 0, 29160, "crusader SAY_CRUSADER9"), +(28939, 2, 9, "I used to work for Grand Inquisitor Isillien! Your idea of pain is a normal mid-afternoon for me!", 12, 0, 100, 0, 0, 0, 29161, "crusader SAY_CRUSADER10"), +(28939, 2, 10, "ARGH! You burned my last good tabard!", 12, 0, 100, 0, 0, 0, 29162, "crusader SAY_CRUSADER11"), +(28939, 2, 11, "You know nothing of pain, monster!", 12, 0, 100, 0, 0, 0, 29155, "crusader SAY_CRUSADER12"), +(28939, 2, 12, "HAH! I've survived three separate inquisitions! This is nothing in comparison!", 12, 0, 100, 0, 0, 0, 29156, "crusader SAY_CRUSADER13"), +(28939, 2, 13, "Look out! There's a bee loose and it's on a stinging rampage!", 12, 0, 100, 0, 0, 0, 29157, "crusader SAY_CRUSADER14"), +(28939, 2, 14, "That one tickled...", 12, 0, 100, 0, 0, 0, 29158, "crusader SAY_CRUSADER15"), +(28939, 2, 15, "I'm going to send you back to the Lich King in pieces!", 12, 0, 100, 0, 0, 0, 29159, "crusader SAY_CRUSADER16"), + +(28939, 3, 0, "I'll tell you everything! STOP! PLEASE!", 12, 0, 100, 0, 0, 0, 29149, "break crusader SAY_PERSUADED1"), +(28939, 4, 0, "We... We have only been told that the \"Crimson Dawn\" is an awakening. You see, the Light speaks to the High General. It is the Light...", 12, 0, 100, 0, 0, 0, 29150, "break crusader SAY_PERSUADED2"), +(28939, 5, 0, "The Light that guides us. The movement was set in motion before you came... We... We do as we are told. It is what must be done.", 12, 0, 100, 0, 0, 0, 29151, "break crusader SAY_PERSUADED3"), +(28939, 6, 0, "I know very little else... The High General chooses who may go and who must stay behind. There's nothing else... You must believe me!", 12, 0, 100, 0, 0, 0, 29152, "break crusader SAY_PERSUADED4"), +(28939, 7, 0, "LIES! The pain you are about to endure will be talked about for years to come!", 12, 0, 100, 0, 0, 0, 29163, "break player SAY_PERSUADED5"), +(28939, 8, 0, "NO! PLEASE! There is one more thing that I forgot to mention... A courier comes soon... From Hearthglen. It...", 12, 0, 100, 0, 0, 0, 29153, "break crusader SAY_PERSUADED6"), +(28939, 9, 0, "%s dies from the torture.", 16, 0, 100, 0, 0, 0, 29154, "dead crusader"); + +DELETE FROM creature_text WHERE entry=28940; +INSERT INTO creature_text (entry, groupid, id, text, type, language, probability, emote, duration, sound, BroadcastTextID, comment) VALUES +(28940, 1, 0, "What is the \"Crimson Dawn?\"", 12, 0, 100, 0, 0, 0, 29133, "player SAY_PERSUADE1"), +(28940, 1, 1, "Tell me what you know about \"Crimson Dawn\" or the beatings will continue!", 12, 0, 100, 0, 0, 0, 29134, "player SAY_PERSUADE2"), +(28940, 1, 2, "I'm through being courteous with your kind, human! What is the \"Crimson Dawn?\"", 12, 0, 100, 0, 0, 0, 29135, "player SAY_PERSUADE3"), +(28940, 1, 3, "\"Crimson Dawn!\" What is it! Speak!", 12, 0, 100, 0, 0, 0, 29136, "player SAY_PERSUADE4"), +(28940, 1, 4, "I can keep this up for a very long time, Scarlet dog! Tell me about the \"Crimson Dawn!\"", 12, 0, 100, 0, 0, 0, 29137, "player SAY_PERSUADE5"), +(28940, 1, 5, "I'll tear the secrets from your soul! Tell me about the \"Crimson Dawn\" and your life may be spared!", 12, 0, 100, 0, 0, 0, 29138, "player SAY_PERSUADE6"), +(28940, 1, 6, "Is your life worth so little? Just tell me what I need to know about \"Crimson Dawn\" and I'll end your suffering quickly.", 12, 0, 100, 0, 0, 0, 29139, "player SAY_PERSUADE7"), +(28940, 1, 7, "I grow tired of these games, human. Tell me of the \"Crimson Dawn\" or I will tear your spine out with my bare hands!", 12, 0, 100, 0, 0, 0, 29140, "player SAY_PERSUADE8"), + +(28940, 2, 0, "I'll tell you nothing, Scourge filth!", 12, 0, 100, 0, 0, 0, 29141, "crusader SAY_CRUSADER1"), +(28940, 2, 1, "You'll have to kill me, monster! I will tell you NOTHING!", 12, 0, 100, 0, 0, 0, 29142, "crusader SAY_CRUSADER2"), +(28940, 2, 2, "Argh... The pain... The pain is almost as unbearable as the lashings I received in grammar school when I was but a child.", 12, 0, 100, 0, 0, 0, 29143, "crusader SAY_CRUSADER3"), +(28940, 2, 3, "You... You'll get nothing... And like it...", 12, 0, 100, 0, 0, 0, 29144, "crusader SAY_CRUSADER4"), +(28940, 2, 4, "Do you think this to be pain? To be suffering? HAH! Destroy this mortal shell so that I may ascend to the heavens!", 12, 0, 100, 0, 0, 0, 29145, "crusader SAY_CRUSADER5"), +(28940, 2, 5, "You hit like a girl. Honestly. Is that the best you can do?", 12, 0, 100, 0, 0, 0, 29146, "crusader SAY_CRUSADER6"), +(28940, 2, 6, "The crimson what? Never heard of it...", 12, 0, 100, 0, 0, 0, 29147, "crusader SAY_CRUSADER7"), +(28940, 2, 7, "The pain is momentary. It pales in comparison to what the High General would do to me...", 12, 0, 100, 0, 0, 0, 29148, "crusader SAY_CRUSADER8"), +(28940, 2, 8, "You'll be hanging in the gallows shortly, Scourge fiend!", 12, 0, 100, 0, 0, 0, 29160, "crusader SAY_CRUSADER9"), +(28940, 2, 9, "I used to work for Grand Inquisitor Isillien! Your idea of pain is a normal mid-afternoon for me!", 12, 0, 100, 0, 0, 0, 29161, "crusader SAY_CRUSADER10"), +(28940, 2, 10, "ARGH! You burned my last good tabard!", 12, 0, 100, 0, 0, 0, 29162, "crusader SAY_CRUSADER11"), +(28940, 2, 11, "You know nothing of pain, monster!", 12, 0, 100, 0, 0, 0, 29155, "crusader SAY_CRUSADER12"), +(28940, 2, 12, "HAH! I've survived three separate inquisitions! This is nothing in comparison!", 12, 0, 100, 0, 0, 0, 29156, "crusader SAY_CRUSADER13"), +(28940, 2, 13, "Look out! There's a bee loose and it's on a stinging rampage!", 12, 0, 100, 0, 0, 0, 29157, "crusader SAY_CRUSADER14"), +(28940, 2, 14, "That one tickled...", 12, 0, 100, 0, 0, 0, 29158, "crusader SAY_CRUSADER15"), +(28940, 2, 15, "I'm going to send you back to the Lich King in pieces!", 12, 0, 100, 0, 0, 0, 29159, "crusader SAY_CRUSADER16"), + +(28940, 3, 0, "I'll tell you everything! STOP! PLEASE!", 12, 0, 100, 0, 0, 0, 29149, "break crusader SAY_PERSUADED1"), +(28940, 4, 0, "We... We have only been told that the \"Crimson Dawn\" is an awakening. You see, the Light speaks to the High General. It is the Light...", 12, 0, 100, 0, 0, 0, 29150, "break crusader SAY_PERSUADED2"), +(28940, 5, 0, "The Light that guides us. The movement was set in motion before you came... We... We do as we are told. It is what must be done.", 12, 0, 100, 0, 0, 0, 29151, "break crusader SAY_PERSUADED3"), +(28940, 6, 0, "I know very little else... The High General chooses who may go and who must stay behind. There's nothing else... You must believe me!", 12, 0, 100, 0, 0, 0, 29152, "break crusader SAY_PERSUADED4"), +(28940, 7, 0, "LIES! The pain you are about to endure will be talked about for years to come!", 12, 0, 100, 0, 0, 0, 29163, "break player SAY_PERSUADED5"), +(28940, 8, 0, "NO! PLEASE! There is one more thing that I forgot to mention... A courier comes soon... From Hearthglen. It...", 12, 0, 100, 0, 0, 0, 29153, "break crusader SAY_PERSUADED6"), +(28940, 9, 0, "%s dies from the torture.", 16, 0, 100, 0, 0, 0, 29154, "dead crusader"); + + + + + diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 50a85eb42..a002c7efe 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4737,18 +4737,23 @@ void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOT } } -enum GilneasValues -{ - NPC_KRENNAN_ARANAS = 35753, - SPELL_RESCUE_KRENNAN_ARANAS = 68219, -}; - SpellCastResult Spell::CheckCast(bool strict) { + enum eCheckCast + { + NPC_KRENNAN_ARANAS = 35753, + SPELL_RESCUE_KRENNAN_ARANAS = 68219, + }; + Unit* Target = m_targets.GetUnitTarget(); switch (m_spellInfo->Id) { + case 52781: + if (Player* player = m_caster->ToPlayer()) + if (player->GetQuestStatus(12720) == QUEST_STATUS_INCOMPLETE) + return SPELL_CAST_OK; + break; case 68219: if (Unit* unit = this->GetOriginalCaster()) if (Vehicle* horse = unit->GetVehicle()) diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index c5ecd0112..e6ef9292b 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -23,140 +23,6 @@ #include "SpellInfo.h" #include "CreatureTextMgr.h" -//How to win friends and influence enemies -// texts signed for creature 28939 but used for 28939, 28940, 28610 -enum win_friends -{ - SAY_CRUSADER = 1, - SAY_PERSUADED1 = 2, - SAY_PERSUADED2 = 3, - SAY_PERSUADED3 = 4, - SAY_PERSUADED4 = 5, - SAY_PERSUADED5 = 6, - SAY_PERSUADED6 = 7, - SAY_PERSUADE_RAND = 8, - SPELL_PERSUASIVE_STRIKE = 52781, - SPELL_THREAT_PULSE = 58111, - QUEST_HOW_TO_WIN_FRIENDS = 12720, -}; - -class npc_crusade_persuaded : public CreatureScript -{ -public: - npc_crusade_persuaded() : CreatureScript("npc_crusade_persuaded") { } - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_crusade_persuadedAI(creature); - } - - struct npc_crusade_persuadedAI : public ScriptedAI - { - npc_crusade_persuadedAI(Creature* creature) : ScriptedAI(creature) { } - - uint32 speechTimer; - uint32 speechCounter; - uint64 playerGUID; - - void Reset() override - { - speechTimer = 0; - speechCounter = 0; - playerGUID = 0; - me->SetReactState(REACT_AGGRESSIVE); - me->RestoreFaction(); - } - - void SpellHit(Unit* caster, const SpellInfo* spell) override - { - if (spell->Id == SPELL_PERSUASIVE_STRIKE && caster->GetTypeId() == TYPEID_PLAYER && me->IsAlive() && !speechCounter) - { - if (Player* player = caster->ToPlayer()) - { - if (player->GetQuestStatus(QUEST_HOW_TO_WIN_FRIENDS) == QUEST_STATUS_INCOMPLETE) - { - playerGUID = player->GetGUID(); - speechTimer = 1000; - speechCounter = 1; - me->setFaction(player->getFaction()); - me->CombatStop(true); - me->GetMotionMaster()->MoveIdle(); - me->SetReactState(REACT_PASSIVE); - DoCastAOE(SPELL_THREAT_PULSE, true); - - sCreatureTextMgr->SendChat(me, SAY_PERSUADE_RAND, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player); - Talk(SAY_CRUSADER); - } - } - } - } - - void UpdateAI(uint32 diff) override - { - if (speechCounter) - { - if (speechTimer <= diff) - { - Player* player = ObjectAccessor::GetPlayer(*me, playerGUID); - if (!player) - { - EnterEvadeMode(); - return; - } - - switch (speechCounter) - { - case 1: - Talk(SAY_PERSUADED1); - speechTimer = 8000; - break; - - case 2: - Talk(SAY_PERSUADED2); - speechTimer = 8000; - break; - - case 3: - Talk(SAY_PERSUADED3); - speechTimer = 8000; - break; - - case 4: - Talk(SAY_PERSUADED4); - speechTimer = 8000; - break; - - case 5: - sCreatureTextMgr->SendChat(me, SAY_PERSUADED5, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player); - speechTimer = 8000; - break; - - case 6: - Talk(SAY_PERSUADED6); - player->Kill(me); - speechCounter = 0; - player->GroupEventHappens(QUEST_HOW_TO_WIN_FRIENDS, me); - return; - } - - ++speechCounter; - DoCastAOE(SPELL_THREAT_PULSE, true); - - } else - speechTimer -= diff; - - return; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; - -}; - /*###### ## npc_koltira_deathweaver ######*/ @@ -1014,7 +880,6 @@ class npc_a_special_surprise : public CreatureScript void AddSC_the_scarlet_enclave_c2() { - new npc_crusade_persuaded(); new npc_scarlet_courier(); new npc_koltira_deathweaver(); new npc_high_inquisitor_valroth(); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp index 9aefa2810..35ede2abd 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp @@ -23,6 +23,7 @@ #include "Player.h" #include "CreatureTextMgr.h" #include "Vehicle.h" +#include "GameObjectAI.h" // npc 28534 class npc_valkyr_battle_maiden : public CreatureScript @@ -1749,7 +1750,6 @@ class npc_gothik_the_harvester_28658 : public CreatureScript { player->KilledMonsterCredit(NPC_GHOULS); creature->DespawnOrUnsummon(); - //player->RemoveAllMinionsByEntry(NPC_GHOSTS); } // @todo Creatures must not be removed, but, must instead // stand next to Gothik and be commanded into the pit @@ -2142,6 +2142,163 @@ class npc_prince_valanar_28907 : public CreatureScript }; +//28610, 28939, 28940 +class npc_crusade_persuaded_28610 : public CreatureScript +{ +public: + npc_crusade_persuaded_28610() : CreatureScript("npc_crusade_persuaded_28610") { } + + enum win_friends + { + SAY_PLAYER = 1, + SAY_CRUSADER = 2, + SAY_BREAK1 = 3, + SAY_BREAK2 = 4, + SAY_BREAK3 = 5, + SAY_BREAK4 = 6, + SAY_BREAK5 = 7, + SAY_BREAK6 = 8, + SAY_DEAD1 = 9, + SPELL_PERSUASIVE_STRIKE = 52781, + SPELL_THREAT_PULSE = 58111, + QUEST_HOW_TO_WIN_FRIENDS = 12720, + }; + + struct npc_crusade_persuaded_28610AI : public ScriptedAI + { + npc_crusade_persuaded_28610AI(Creature* creature) : ScriptedAI(creature) { } + + uint32 speechTimer; + uint32 speechCounter; + uint64 playerGUID; + + void Reset() override + { + speechTimer = 0; + speechCounter = 0; + playerGUID = 0; + me->SetReactState(REACT_AGGRESSIVE); + me->RestoreFaction(); + } + + void DamageTaken(Unit* attacker, uint32& damage) + { + switch (speechCounter) + { + case 0: + return; + break; + case 1: + if (me->GetHealthPct() < 20) + { + damage = 1; + speechCounter++; + } + break; + default: + damage /= 2; + break; + } + } + + void SpellHit(Unit* caster, const SpellInfo* spell) override + { + if (spell->Id == SPELL_PERSUASIVE_STRIKE && caster->GetTypeId() == TYPEID_PLAYER && me->IsAlive() && !speechCounter) + { + if (Player* player = caster->ToPlayer()) + { + if (player->GetQuestStatus(QUEST_HOW_TO_WIN_FRIENDS) == QUEST_STATUS_INCOMPLETE) + { + playerGUID = player->GetGUID(); + speechTimer = 500; + speechCounter = 1; + } + } + } + } + + void UpdateAI(uint32 diff) override + { + if (speechCounter) + { + if (speechTimer <= diff) + { + Player* player = ObjectAccessor::GetPlayer(*me, playerGUID); + if (!player) + { + EnterEvadeMode(); + return; + } + + switch (speechCounter) + { + case 1: + sCreatureTextMgr->SendChat(me, SAY_PLAYER, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player); + Talk(SAY_CRUSADER); + speechTimer = 8000; + break; + case 2: + Talk(SAY_BREAK1); + me->setFaction(player->getFaction()); + me->CombatStop(true); + me->GetMotionMaster()->MoveIdle(); + me->SetReactState(REACT_PASSIVE); + DoCastAOE(SPELL_THREAT_PULSE, true); + speechTimer = 8000; + break; + case 3: + Talk(SAY_BREAK2); + speechTimer = 8000; + break; + case 4: + Talk(SAY_BREAK3); + speechTimer = 8000; + break; + case 5: + Talk(SAY_BREAK4); + speechTimer = 8000; + break; + case 6: + sCreatureTextMgr->SendChat(me, SAY_BREAK5, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player); + speechTimer = 8000; + break; + case 7: + Talk(SAY_BREAK6); + speechTimer = 8000; + break; + case 8: + Talk(SAY_DEAD1); + player->Kill(me); + speechCounter = 0; + player->GroupEventHappens(QUEST_HOW_TO_WIN_FRIENDS, me); + return; + } + + if (speechCounter > 1) + ++speechCounter; + + DoCastAOE(SPELL_THREAT_PULSE, true); + + } + else + speechTimer -= diff; + + return; + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_crusade_persuaded_28610AI(creature); + } +}; + void AddSC_the_scarlet_enclave() { @@ -2163,4 +2320,5 @@ void AddSC_the_scarlet_enclave() new npc_scarlet_miner_cart_28817(); new npc_scarlet_miner_28841(); new npc_prince_valanar_28907(); + new npc_crusade_persuaded_28610(); }