Advertisement
Rochet2

Untitled

Jun 7th, 2014
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local npcID = 190000;
  2. local randomtext = math.random(1,2);
  3.  
  4. function Boss_OnEnterCombat(Event, Creature, Victim)
  5.     Creature:SendUnitYell("How dare you face me,  ABOMINATION !?", 0)
  6.     -- 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
  7.     Creature:RegisterEvent(Fel_Armor, 20, 1)
  8. end;
  9.  
  10. function Boss_OnLeaveCombat(Event, Creature,  Victim)
  11.     if randomtext == 1 then
  12.         Creature:SendUnitYell("blabla", 0)
  13.         Creature:RemoveEvents()
  14.     end;
  15.  
  16.     if randomtext == 2 then
  17.         Creature:SendUnitYell("blabla", 0)
  18.         Creature:CastSpell(Creature, 69131) -- Added Creature target
  19.         Creature:RemoveEvents()
  20.     end
  21. end;
  22.  
  23.  
  24. function Boss_OnDied(Event, Creature,  Victim)
  25.     Creature:SendUnitYell("blabla", 0)
  26.     if (Victim:GetObjectType() == "Player") then -- Added this check
  27.         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
  28.             -- Added v (player) as target to the CastSpell function parameters
  29.             v:CastSpell(v, 58451, true)
  30.             v:CastSpell(v, 58451, true)
  31.             v:CastSpell(v, 48100, true)
  32.             v:CastSpell(v, 58452, true)
  33.             v:CastSpell(v, 48104, true)
  34.             v:CastSpell(v, 48102, true)
  35.             v:CastSpell(v, 48469, true)
  36.             v:CastSpell(v, 61024, true)
  37.             v:CastSpell(v, 20217, true)
  38.             v:CastSpell(v, 48161, true)
  39.             v:CastSpell(v, 48073, true)
  40.             v:CastSpell(v, 48169, true)
  41.             v:CastSpell(v, 54675, true)
  42.             v:CastSpell(v, 15366, true)
  43.             v:CastSpell(v, 33077, true)
  44.             v:CastSpell(v, 53307, true)
  45.             v:CastSpell(v, 43017, true)
  46.             v:CastSpell(v, 5697, true)
  47.             v:CastSpell(v, 132, true)
  48.             v:CastSpell(v, 1706, true)
  49.             v:CastSpell(v, 16618, true)
  50.         end
  51.     end
  52.     Creature:RemoveEvents()
  53. end;
  54.  
  55.  
  56.  
  57. function Boss_OnTargetDied(Event, Creature)
  58.     Creature:SendUnitYell("Your weakness destroyed you, fools.", 0)
  59.     Creature:RegisterEvent(SpellWave, 50, 0) -- this timer is way too little to have infinite calls. Called every 50 ms
  60.     Creature:PlayDistanceSound(12498) -- Corrected sound playing method
  61. end;
  62.  
  63.  
  64. RegisterCreatureEvent(npcID, 1, Boss_OnEnterCombat)
  65. RegisterCreatureEvent(npcID, 2, Boss_OnLeaveCombat)
  66. RegisterCreatureEvent(npcID, 3, Boss_OnTargetDied)
  67. RegisterCreatureEvent(npcID, 4, Boss_OnDied)
  68.  
  69. --------------------------------------
  70. -- Spell Events--
  71. ---------------------------------------
  72. function Fel_Armor(Event, delay, repeats, Creature) -- Corrected arguments
  73.     Creature:CastSpell(Creature, 47893) -- Added Creature as target
  74. end;
  75.  
  76. function SpellWave(Event, delay, repeats, Creature) -- Corrected arguments
  77.     Creature:CastSpell(Creature, 38536) -- Added Creature as target
  78.     Creature:PlayDistanceSound(12507) -- Corrected sound playing method
  79.     Creature:SendUnitYell("blablabla", 0)
  80. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement