Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local npcID = 190000;
- local randomtext = math.random(1,2);
- function Boss_OnEnterCombat(Event, Creature, Victim)
- Creature:SendUnitYell("How dare you face me, ABOMINATION !?", 0)
- -- There is no idea in using a 20 ms delay for a single event (in this case). Could just add the code here or use it directly as a function
- Creature:RegisterEvent(Fel_Armor, 20, 1)
- end;
- function Boss_OnLeaveCombat(Event, Creature, Victim)
- if randomtext == 1 then
- Creature:SendUnitYell("blabla", 0)
- Creature:RemoveEvents()
- end;
- if randomtext == 2 then
- Creature:SendUnitYell("blabla", 0)
- Creature:CastSpell(Creature, 69131) -- Added Creature target
- Creature:RemoveEvents()
- end
- end;
- function Boss_OnDied(Event, Creature, Victim)
- Creature:SendUnitYell("blabla", 0)
- if (Victim:GetObjectType() == "Player") then -- Added this check
- for k,v in ipairs(Victim:IsInGroup() and Victim:GetGroup():GetMembers() or {Victim}) do -- corrected my own code a little here, note that we can not get players from aggro list
- -- Added v (player) as target to the CastSpell function parameters
- v:CastSpell(v, 58451, true)
- v:CastSpell(v, 58451, true)
- v:CastSpell(v, 48100, true)
- v:CastSpell(v, 58452, true)
- v:CastSpell(v, 48104, true)
- v:CastSpell(v, 48102, true)
- v:CastSpell(v, 48469, true)
- v:CastSpell(v, 61024, true)
- v:CastSpell(v, 20217, true)
- v:CastSpell(v, 48161, true)
- v:CastSpell(v, 48073, true)
- v:CastSpell(v, 48169, true)
- v:CastSpell(v, 54675, true)
- v:CastSpell(v, 15366, true)
- v:CastSpell(v, 33077, true)
- v:CastSpell(v, 53307, true)
- v:CastSpell(v, 43017, true)
- v:CastSpell(v, 5697, true)
- v:CastSpell(v, 132, true)
- v:CastSpell(v, 1706, true)
- v:CastSpell(v, 16618, true)
- end
- end
- Creature:RemoveEvents()
- end;
- function Boss_OnTargetDied(Event, Creature)
- Creature:SendUnitYell("Your weakness destroyed you, fools.", 0)
- Creature:RegisterEvent(SpellWave, 50, 0) -- this timer is way too little to have infinite calls. Called every 50 ms
- Creature:PlayDistanceSound(12498) -- Corrected sound playing method
- end;
- RegisterCreatureEvent(npcID, 1, Boss_OnEnterCombat)
- RegisterCreatureEvent(npcID, 2, Boss_OnLeaveCombat)
- RegisterCreatureEvent(npcID, 3, Boss_OnTargetDied)
- RegisterCreatureEvent(npcID, 4, Boss_OnDied)
- --------------------------------------
- -- Spell Events--
- ---------------------------------------
- function Fel_Armor(Event, delay, repeats, Creature) -- Corrected arguments
- Creature:CastSpell(Creature, 47893) -- Added Creature as target
- end;
- function SpellWave(Event, delay, repeats, Creature) -- Corrected arguments
- Creature:CastSpell(Creature, 38536) -- Added Creature as target
- Creature:PlayDistanceSound(12507) -- Corrected sound playing method
- Creature:SendUnitYell("blablabla", 0)
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement