fix(DB/Quest): Port Cleansing Witch Hill from Trinity. (#17420)

* fix(DB/Quest): Port Cleansing Witch Hill from Trinity.

https: //github.com/TrinityCore/TrinityCore/issues/22262
Co-Authored-By: Carlos Morales <carlos.morales@insmet.cu>

* ""

Co-Authored-By: Carlos Morales <carlos.morales@insmet.cu>

---------

Co-authored-by: Carlos Morales <carlos.morales@insmet.cu>
This commit is contained in:
avarishd
2023-10-11 02:26:43 +03:00
committed by GitHub
parent 824bede115
commit 214948bafb
2 changed files with 50 additions and 88 deletions

View File

@@ -15,99 +15,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Dustwallow_Marsh
SD%Complete: 95
SDComment: Quest support: 11180, 11126, 11174
SDCategory: Dustwallow Marsh
EndScriptData */
/* ContentData
npc_cassa_crimsonwing - handled by npc_taxi
EndContentData */
#include "Player.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellScript.h"
/*######
## npc_zelfrax
######*/
Position const MovePosition = {-2967.030f, -3872.1799f, 35.620f, 0.0f};
enum Zelfrax
{
SAY_ZELFRAX1 = 0,
SAY_ZELFRAX2 = 1
};
class npc_zelfrax : public CreatureScript
{
public:
npc_zelfrax() : CreatureScript("npc_zelfrax") { }
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_zelfraxAI(creature);
}
struct npc_zelfraxAI : public ScriptedAI
{
npc_zelfraxAI(Creature* creature) : ScriptedAI(creature)
{
MoveToDock();
}
void AttackStart(Unit* who) override
{
if (!who)
return;
if (me->Attack(who, true))
{
me->SetInCombatWith(who);
who->SetInCombatWith(me);
if (IsCombatMovementAllowed())
me->GetMotionMaster()->MoveChase(who);
}
}
void MovementInform(uint32 Type, uint32 /*Id*/) override
{
if (Type != POINT_MOTION_TYPE)
return;
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
me->SetImmuneToPC(false);
SetCombatMovement(true);
if (me->IsInCombat())
if (Unit* unit = me->GetVictim())
me->GetMotionMaster()->MoveChase(unit);
}
void MoveToDock()
{
SetCombatMovement(false);
me->GetMotionMaster()->MovePoint(0, MovePosition);
Talk(SAY_ZELFRAX1);
Talk(SAY_ZELFRAX2);
}
void UpdateAI(uint32 /*Diff*/) override
{
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
};
};
enum SpellScripts
{
SPELL_OOZE_ZAP = 42489,
@@ -243,7 +156,6 @@ public:
void AddSC_dustwallow_marsh()
{
new npc_zelfrax();
new spell_ooze_zap();
new spell_ooze_zap_channel_end();
new spell_energize_aoe();