Code:
--[[Created and Developed by ~sheepking.
--please do NOT delete this Credits. Thank you.]]
function OnEnterCombat (pUnit, Event)
pUnit:RegisterEvent("FelExplosionLookup", 1000, 0)
pUnit:RegisterEvent("drainlife", 20000, 0)
pUnit:RegisterEvent("entry", 1000, 1)
--[[-- pUnit:RegisterEvent("despawnbeforedie", 1000, 0)]]
end
function OnDied (pUnit, Event)
pUnit:RemoveEvents()
pUnit:RegisterEvent("exit1", 1000, 1)
pUnit:RegisterEvent("exit2", 1000, 1)
end
function RootCrystal (pUnit, Event)
pUnit:Root()
end
--[[function despawnbeforedie (pUnit, Event)
if pUnit:GetHealthPct() < 3 then
pUnit:RemoveEvents()
end
--end]]
function entry (pUnit, Event)
pUnit:GetGameObjectNearestCoords(585, 271.5, 0.8, 9)
pUnit:ActivateGameObject(1)
end
function exit1 (pUnit, Event)
pUnit:GetGameObjectNearestCoords(585, 247, -0.25, 1.88)
pUnit:DeactivateGameObject(0)
end
function exit2 (pUnit, Event)
pUnit:GetGameObjectNearestCoords(585, 271.5, 0.8, 9)
pUnit:DeactivateGameObject(0)
end
function drainlife (pUnit, Event)
pUnit:FullCastSpellOnTarget(44294, pUnit:GetMainTank())
end
function FelExplosionLookup (pUnit, Event)
if pUnit:GetHealthPct() < 50 then
pUnit:RemoveEvents()
pUnit:RegisterEvent("Registers", 1000, 1)
end
end
function Registers (pUnit, Event)
--[[ pUnit:RegisterEvent("Crystal1", 1000, 1)
pUnit:RegisterEvent("Crystal2", 30000, 1)
-- pUnit:RegisterEvent("Crystal3", 60000, 1)]]
pUnit:RegisterEvent("crystal", 1000, 1)
end
function FelExplosionCast (pUnit, Event)
pUnit:CastSpell(44314)
end
--[[function Crystal1 (pUnit, Event)
pUnit:FullCastSpellOnTarget(46466, pUnit:GetUnitBySqlId(229014))
pUnit:RegisterEvent("FelExplosionCast", 4000, 7)
--end]]
--[[function Crystal2 (pUnit, Event)
pUnit:FullCastSpellOnTarget(46466, pUnit:GetUnitBySqlId(229017))
pUnit:RegisterEvent("FelExplosionCast", 4000, 7)
--end]]
--[[function Crystal3 (pUnit, Event)
pUnit:FullCastSpellOnTarget(46466, pUnit:GetUnitBySqlId(229018))
pUnit:RegisterEvent("FelExplosionCast", 4000, 7)
--end]]
RegisterUnitEvent(24723, 4, "OnDied")
RegisterUnitEvent(24723, 1, "OnEnterCombat")
RegisterUnitEvent(24722, 6, "RootCrystal")
--crystalrandom = math.random(1, 5)
function crystal (pUnit, Event)
pUnit:RemoveEvents()
pUnit:RegisterEvent("crystaltwo", 30000, 0)
-- if crystalrandom == 1 then
if crystal1 == 1 then
pUnit:RemoveEvents()
pUnit:RegisterEvent("crystaltwo", 1000, 1)
else
pUnit:GetUnitBySqlId(146657)
if pUnit:IsAlive() == true then
pUnit:RegisterEvent("FelExplosionCast", 4000, 7)
pUnit:FullCastSpellOnTarget(46466, pUnit:GetUnitBySqlId(146657))
crystal1 = 1
end
end
end
function crystaltwo (pUnit, Event)
pUnit:RemoveEvents()
pUnit:RegisterEvent("crystalthree", 30000, 0)
-- if crystalrandom == 2 then
if crystal2 == 1 then
pUnit:RemoveEvents()
pUnit:RegisterEvent("crystalthree", 1000, 1)
else
pUnit:GetUnitBySqlId(145490)
if pUnit:IsAlive() == true then
pUnit:RegisterEvent("FelExplosionCast", 4000, 7)
pUnit:FullCastSpellOnTarget(46466, pUnit:GetUnitBySqlId(145490))
crystal2 = 1
end
end
end
function crystalthree (pUnit, Event)
pUnit:RemoveEvents()
pUnit:RegisterEvent("crystalfour", 30000, 0)
-- if crystalrandom == 3 then
if crystal3 == 1 then
pUnit:RemoveEvents()
pUnit:RegisterEvent("crystalfour", 1000, 1)
else
pUnit:GetUnitBySqlId(207222)
if pUnit:IsAlive() == true then
pUnit:RegisterEvent("FelExplosionCast", 4000, 7)
pUnit:FullCastSpellOnTarget(46466, pUnit:GetUnitBySqlId(207222))
crystal3 = 1
end
end
end
function crystalfour (pUnit, Event)
pUnit:RemoveEvents()
pUnit:RegisterEvent("crystalfive", 30000, 0)
-- if crystalrandom == 4 then
if crystal4 == 1 then
pUnit:RemoveEvents()
pUnit:RegisterEvent("crystalfive", 1000, 1)
else
pUnit:GetUnitBySqlId(146188)
if pUnit:IsAlive() == true then
pUnit:RegisterEvent("FelExplosionCast", 4000, 7)
pUnit:FullCastSpellOnTarget(46466, pUnit:GetUnitBySqlId(146188))
crystal4 = 1
end
end
end
function crystalfive (pUnit, Event)
pUnit:RemoveEvents()
-- if crystalrandom == 5 then
if crystal5 == 1 then
pUnit:RemoveEvents()
else
pUnit:GetUnitBySqlId(145837)
if pUnit:IsAlive() == true then
pUnit:RegisterEvent("FelExplosionCast", 4000, 7)
pUnit:FullCastSpellOnTarget(46466, pUnit:GetUnitBySqlId(145837))
crystal5 = 1
end
end
end
And here the SQL Code:
Code:
INSERT INTO `creature_spawns` VALUES ('146657', '24722', '585', '226.314', '20.2183', '-2.98127', '5.32325', '1', '22669', '190', '33816576', '0', '4097', '0', '0', '44355', '0', '0', '0');
INSERT INTO `creature_spawns` VALUES ('145490', '24722', '585', '225.969', '-20.0775', '-2.9731', '0.942478', '1', '22669', '190', '33816576', '0', '4097', '0', '0', '44355', '0', '0', '0');
INSERT INTO `creature_spawns` VALUES ('207222', '24722', '585', '247.888', '-14.6252', '3.80777', '2.33874', '1', '22669', '190', '33816576', '16908544', '4097', '0', '0', '44355', '0', '0', '0');
INSERT INTO `creature_spawns` VALUES ('146188', '24722', '585', '263.149', '0.309245', '1.32057', '3.15905', '1', '22669', '190', '33816576', '0', '4097', '0', '0', '44355', '0', '0', '0');
INSERT INTO `creature_spawns` VALUES ('145837', '24722', '585', '248.053', '14.592', '3.74882', '3.94444', '1', '22669', '190', '33816576', '0', '4097', '0', '0', '44355', '0', '0', '0');
INSERT INTO `creature_proto` VALUES ('24722', '70', '70', '474', '4000', '4000', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '', '0', '0', '0', '0', '2.5', '8', '14', '0', '0');
INSERT INTO `creature_names` VALUES ('24722', 'Fel Crystal', '', '', '72', '9', '0', '0', '0', '0', '22669', '0', '0', '0', '1', '1', '0', '0');
INSERT INTO `creature_names` VALUES ('24723', 'Selin Fireheart', '', '', '72', '7', '0', '1', '0', '0', '22642', '0', '0', '0', '27.5', '10', '0', '0');
INSERT INTO `creature_proto` VALUES ('24723', '71', '71', '4075', '210000', '210000', '32310', '1', '0', '3000', '0', '5000', '6000', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '360000', '5000', '0', '0', '0', '0', '0', '0', '0', '0', '', '0', '0', '0', '0', '2.5', '8', '14', '0', '0');
INSERT INTO `creature_spawns` VALUES ('206419', '24723', '585', '242.075', '0.300781', '1.83991', '3.19395', '1', '22642', '14', '32832', '512', '4097', '64', '0', '0', '0', '0', '0');
Have fun!