I'm using a mangos one core (for BC 2.4.3).
For my first lua script I'm trying to do this :
A mob enter combat, and every 20s cast a charge on the farthest player, cast a fear and come back to his previous target.
1°) When casting the charge, there is no animation (except the player who is kick on his ass). We don't saw the npc going from the current target to the farthest target and come back.
2°) The fear is not casting on the farthest target but on the previous one.
Spectral charger, in Karazhan.
Made by syneau, for The Geek Crusade server (Mangos).
By using this script, you accept that the software is delivered "AS IS"
and that I take no responsibility whatsoever if you choose to use this
You may not sell this or redistribute this under your name in any way,
shape or form. If you choose to modify this script, do so at your own
discretion and know that I cannot be held responsible for any damage
this may cause to any of your property.
Enjoy the Script!
RUN SQL for remove EventAI:
DELETE FROM `creature_ai_scripts` WHERE creature_id = 15547;
UPDATE `creature_template` SET `AIName` = '' WHERE `entry` = 15547;
local NPC_SPECTRAL_CHARGER = 15547
local SPELL_CHARGE = 29320
local SPELL_FEAR = 29321
-- Charge the farthest player, every 20s, in 45 m (yard ?)
local function SpectralChargerChargeAndFear (eventid, delay, repeats, creature)
local target = creature:GetAITarget( 4, false, 0, 45 )
if (target) then
creature:CastSpell(target, SPELL_CHARGE, true)
creature:CastSpell(target, SPELL_FEAR, true)
print ("Pas de cible disponible")
local function SpectralChargerOnEnterCombat(event, creature, player)
creature:RegisterEvent(SpectralChargerChargeAndFear, 20000, 0, NPC_SPECTRAL_CHARGER)
local function SpectralChargerOnLeaveCombat(event, creature)
local function SpectralChargerOnDied(event, creature, player)
RegisterCreatureEvent(NPC_SPECTRAL_CHARGER, 1, SpectralChargerOnEnterCombat)
RegisterCreatureEvent(NPC_SPECTRAL_CHARGER, 2, SpectralChargerOnLeaveCombat)
RegisterCreatureEvent(NPC_SPECTRAL_CHARGER, 4, SpectralChargerOnDied)