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>
This commit is contained in:
Trond B. Krokli
2020-07-29 13:26:39 +02:00
committed by GitHub
parent 7f7fa8b23d
commit e0dae8feb6
3 changed files with 26 additions and 27 deletions

View File

@@ -0,0 +1,4 @@
--
-- The Force of Neltharaku: Enslaved Netherwing Drake (21722)
UPDATE `creature_template_movement` SET `Flight`= 1 WHERE `CreatureId`= 21722;
UPDATE `creature_addon` SET `bytes1`= 0 WHERE `guid` IN (SELECT `guid` FROM `creature` WHERE `id`= 21722);

View File

@@ -3359,6 +3359,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)

View File

@@ -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)
{
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)
{
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->SetByteFlag(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
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);
}
};
/*#####