Salja
Respected Member
Not 100% done yet but working on it =)
Code:
--[[
Script DONE 60%
NOTE:
Missing RemoveEvents from Mumur wehn only Enter in Combat with Player
Missing Add Spells to Cabal SpellBinder and Cabal Summoner for Player fight
Check is Say Event Chance 10% Right ?
Check must Respawn all Cabal SpellBinder wehn die ?
RUN SQL for remove EventAI:
DELETE FROM `creature_ai_scripts` WHERE creature_id = 18639;
DELETE FROM `creature_ai_texts` WHERE `entry` IN (-664, -665, -666, -667, -668, -669);
UPDATE `creature_template` SET `AIName` = '' WHERE `entry` = 18639;
--]]
local NPC_CABAL_SPELLBINDER = 18639
local NPC_CABAL_SUMMONER = 18634
local NPC_MURMUR = 18708
local SAY_CABAL_SPELLBINDER_1 = "I shall be rewarded!"
local SAY_CABAL_SPELLBINDER_2 = "I do as I must!"
local SAY_CABAL_SPELLBINDER_3 = "The Legion reigns!"
local SAY_CABAL_SPELLBINDER_4 = "The end comes for you!"
local SAY_CABAL_SPELLBINDER_5 = "Ruin finds us all!"
local SAY_CABAL_SPELLBINDER_6 = "In Sargeras' name!"
local SPELL_SUPPRESSION_BLAST = 33332
local SPELL_MURMURS_WRATH = 33331
local SPELL_SHADOWBOLT = 33335
local CabalSpellBinder = {}
local CabalSummoner = {}
local Murmur = {}
function CabalSummoner.OnSpawn(event, creature)
creature:RegisterEvent(CabalSummoner.ShadowBolt, math.random(4000, 8000), 0)
end
function CabalSummoner.ShadowBolt(event, delay, pCall, creature)
local target = creature:GetNearestCreature(300, NPC_MURMUR)
creature:CastSpell(target, SPELL_SHADOWBOLT)
end
function CabalSpellBinder.OnSpawn(event, creature)
creature:RegisterEvent(CabalSpellBinder.ShadowBolt , math.random(4000, 8000), 0)
creature:RegisterEvent(CabalSpellBinder.Emote, math.random(6000, 10000), 0)
end
function CabalSpellBinder.ShadowBolt(event, delay, pCall, creature)
local target = creature:GetNearestCreature(300, NPC_MURMUR)
creature:CastSpell(target, SPELL_SHADOWBOLT)
end
function CabalSpellBinder.Emote(event, delay, pCall, creature)
creature:Emote(5)
end
function CabalSpellBinder.EnterCombat(event, creature, killer)
local chance = (math.random(1, 6) <= 10) -- Event Say Chance 10% ?
creature:RemoveEvents()
if (chance == 1) then
creature:SendUnitSay(SAY_CABAL_SPELLBINDER_1, 0)
elseif (chance == 2) then
creature:SendUnitSay(SAY_CABAL_SPELLBINDER_2, 0)
elseif (chance == 3) then
creature:SendUnitSay(SAY_CABAL_SPELLBINDER_3, 0)
elseif (chance == 4) then
creature:SendUnitSay(SAY_CABAL_SPELLBINDER_4, 0)
elseif (chance == 5) then
creature:SendUnitSay(SAY_CABAL_SPELLBINDER_5, 0)
elseif (chance == 6) then
creature:SendUnitSay(SAY_CABAL_SPELLBINDER_6, 0)
end
end
function Murmur.OnSpawn(event, creature)
creature:RegisterEvent(Murmur.SuppressionBlast, 15000, 0)
creature:RegisterEvent(Murmur.Wrath, 20000, 0)
end
function Murmur.SuppressionBlast(event, delay, pCall, creature)
creature:CastSpell(creature, SPELL_SUPPRESSION_BLAST)
end
function Murmur.Wrath(event, delay, pCall, creature)
local results = creature:GetCreaturesInRange(300, NPC_CABAL_SPELLBINDER)
local target = results[math.random(1, #results)]
if(target) then
creature:CastSpell(target, SPELL_MURMURS_WRATH)
else
print ("No Creature found!")
end
end
RegisterCreatureEvent(NPC_CABAL_SUMMONER, 5, CabalSummoner.OnSpawn)
RegisterCreatureEvent(NPC_CABAL_SPELLBINDER, 1, CabalSpellBinder.EnterCombat)
RegisterCreatureEvent(NPC_CABAL_SPELLBINDER, 5, CabalSpellBinder.OnSpawn)
RegisterCreatureEvent(NPC_MURMUR, 5, Murmur.OnSpawn)