From 2ebad68e71f7d54dee4dd4946b1e7c48c129be88 Mon Sep 17 00:00:00 2001 From: ConradBunton Date: Sun, 31 Dec 2017 22:22:37 +0100 Subject: [PATCH] Quest "The end of all things" - Fix the Scarlet balista Scarlet Balista attack the player and can be killed. --- Fix/The end of all things.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Fix/The end of all things.lua diff --git a/Fix/The end of all things.lua b/Fix/The end of all things.lua new file mode 100644 index 0000000..1ddf75f --- /dev/null +++ b/Fix/The end of all things.lua @@ -0,0 +1,29 @@ +-- Fix the Scarlet balista bug + +SBalista_NPC = 29104 +SBalista_Spell = 53117 + +function SBalista_UnderAttack(event, creature, player) + creature:AttackStart(player) +end +RegisterCreatureEvent(SBalista_NPC , 9, SBalista_UnderAttack) + +function SBalista_EnterCombat(event, creature, target) + creature:RegisterEvent(SBalista_Cast, 2000, 0) +end +function SBalista_KilledTarget(event, creature, victim) + creature:RemoveEvents() +end +function SBalista_LeaveCombat(event, creature) + creature:RemoveEvents() +end +function SBalista_Died(event, creature, killer) + creature:RemoveEvents() +end +function SBalista_Cast(event, delay, pCall, creature) + creature:CastSpell(creature:GetVictim(), SBalista_Spell) +end +RegisterCreatureEvent(SBalista_NPC, 1, SBalista_EnterCombat) +RegisterCreatureEvent(SBalista_NPC, 2, SBalista_LeaveCombat) +RegisterCreatureEvent(SBalista_NPC, 3, SBalista_KilledTarget) +RegisterCreatureEvent(SBalista_NPC, 4, SBalista_Died)