diff options
author | Trond B. Krokli <38162891+illfated@users.noreply.github.com> | 2020-07-29 13:26:39 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-01-24 13:19:36 +0100 |
commit | fa444aca6679da243a2e844d75631fa6f10bf92d (patch) | |
tree | a047deb7778f9b3a2c017107d443a0fd6a9d3f33 /src | |
parent | 9c38dc2367e1bb59a5a4ad7a52abd522a035ae5d (diff) |
Scripts/Quest: Force of Neltharaku quest credit (#24807)
* Scripts/Quest: Force of Neltharaku quest credit
**Description:**
Suggested solution to resolve the kill credit double cast issue
in the quest "The Force of Neltharaku" (10854).
by Rushor
**Changes proposed:**
- Remove duplicate spell casts in the zone quest script
- Remove commented-out script section
- Set a couple of unit flags (anim/stand/hover)
- Move return new creature script override to end of script
- Move PlayerGUID, FlyTimer, and Tapped to Private
- Add DB flight movement control to Enslaved Netherwing Drake
- Add SpellMgr MaxAffectedTargets = 1 for spell 38762
- Add movement enum POINT_MOVE_UP
- Add missing enum for quest ID
**Target branch(es):** 3.3.5/master
- [X] 3.3.5
- [X] master
**Issues addressed:** Closes #24796
**Tests performed:** (Does it build, tested in-game, etc.)
Pending for now.
**Known issues and TODO list:** (add/remove lines as needed)
- [X] Open PR in draft mode until testing is cleared
- [ ] Compile and create local server
- [ ] Test changes on local server
* Rename 9999_99_99_99_world.sql to 2020_07_29_00_world.sql
Co-authored-by: Rushor <Rushor@users.noreply.github.com>
Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
(cherry picked from commit e0dae8feb6607b5190d14b56ecfc10bbfa667c95)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 1 | ||||
-rw-r--r-- | src/server/scripts/Outland/zone_shadowmoon_valley.cpp | 48 |
2 files changed, 22 insertions, 27 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 27023887431..de75e59205c 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3566,6 +3566,7 @@ void SpellMgr::LoadSpellInfoCorrections() 58552, // Return to Orgrimmar 58533, // Return to Stormwind 21855, // Challenge Flag + 38762, // Force of Neltharaku 51122, // Fierce Lightning Stike 71848 // Toxic Wasteling Find Target }, [](SpellInfo* spellInfo) diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp index 21abe9e7e2e..de8146baf60 100644 --- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp @@ -346,8 +346,13 @@ enum EnshlavedNetherwingDrake // Creatures NPC_DRAGONMAW_SUBJUGATOR = 21718, - NPC_ESCAPE_DUMMY = 22317 + NPC_ESCAPE_DUMMY = 22317, + // Quests + QUEST_THE_FORCE_OF_NELTHARAKU = 10854, + + // Movement + POINT_MOVE_UP = 1 }; class npc_enslaved_netherwing_drake : public CreatureScript @@ -355,11 +360,6 @@ class npc_enslaved_netherwing_drake : public CreatureScript public: npc_enslaved_netherwing_drake() : CreatureScript("npc_enslaved_netherwing_drake") { } - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_enslaved_netherwing_drakeAI(creature); - } - struct npc_enslaved_netherwing_drakeAI : public ScriptedAI { npc_enslaved_netherwing_drakeAI(Creature* creature) : ScriptedAI(creature) @@ -368,16 +368,11 @@ public: Reset(); } - ObjectGuid PlayerGUID; - uint32 FlyTimer; - bool Tapped; - void Reset() override { if (!Tapped) me->SetFaction(FACTION_ORC_DRAGONMAW); - FlyTimer = 10000; me->SetDisableGravity(false); } @@ -393,7 +388,6 @@ public: PlayerGUID = playerCaster->GetGUID(); me->SetFaction(FACTION_FLAYER_HUNTER); - DoCast(playerCaster, SPELL_FORCE_OF_NELTHARAKU, true); Unit* Dragonmaw = me->FindNearestCreature(NPC_DRAGONMAW_SUBJUGATOR, 50); if (Dragonmaw) @@ -402,6 +396,7 @@ public: AttackStart(Dragonmaw); } + FlyTimer = 10 * IN_MILLISECONDS; me->GetThreatManager().ClearThreat(playerCaster); } } @@ -414,13 +409,7 @@ public: if (id == 1) { if (!PlayerGUID.IsEmpty()) - { - Unit* player = ObjectAccessor::GetUnit(*me, PlayerGUID); - if (player) - DoCast(player, SPELL_FORCE_OF_NELTHARAKU, true); - PlayerGUID.Clear(); - } me->DespawnOrUnsummon(1ms); } @@ -438,16 +427,9 @@ public: if (!PlayerGUID.IsEmpty()) { Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID); - if (player && player->GetQuestStatus(10854) == QUEST_STATUS_INCOMPLETE) + if (player && player->GetQuestStatus(QUEST_THE_FORCE_OF_NELTHARAKU) == QUEST_STATUS_INCOMPLETE) { DoCast(player, SPELL_FORCE_OF_NELTHARAKU, true); - /* - float x, y, z; - me->GetPosition(x, y, z); - - float dx, dy, dz; - me->GetRandomPoint(x, y, z, 20, dx, dy, dz); - dz += 20; // so it's in the air, not ground*/ Position pos; if (Unit* EscapeDummy = me->FindNearestCreature(NPC_ESCAPE_DUMMY, 30)) @@ -458,8 +440,10 @@ public: pos.m_positionZ += 25; } + me->SetCanFly(true); me->SetDisableGravity(true); - me->GetMotionMaster()->MovePoint(1, pos); + me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), true); + me->GetMotionMaster()->MoveTakeoff(POINT_MOVE_UP, pos); } } } else FlyTimer -= diff; @@ -469,7 +453,17 @@ public: DoMeleeAttackIfReady(); } + + private: + ObjectGuid PlayerGUID; + uint32 FlyTimer; + bool Tapped; }; + + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_enslaved_netherwing_drakeAI(creature); + } }; /*##### |