SHOW:
|
|
- or go back to the newest paste.
| 1 | - | local npcID= 123123; |
| 1 | + | local npcID = 190000; |
| 2 | - | local randomtext = math.random(1,2) ; |
| 2 | + | local randomtext = math.random(1,2); |
| 3 | ||
| 4 | - | function Boss_OnEnterCombat(Event, Creature, Victim); |
| 4 | + | function Boss_OnEnterCombat(Event, Creature, Victim) |
| 5 | - | Creature:SendUnitYell("How dare you face me, ABOMINATION !?",0)
|
| 5 | + | Creature:SendUnitYell("How dare you face me, ABOMINATION !?", 0)
|
| 6 | - | Creature:RegisterEvent(Fel_Armor, 20, 1) |
| 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 | - | function Boss_OnLeaveCombat(Event, Creature, Victim) |
| 9 | + | |
| 10 | - | if randomtext == 1 then |
| 10 | + | function Boss_OnLeaveCombat(Event, Creature, Victim) |
| 11 | - | Creature:SendUnitYell("blabla",0)
|
| 11 | + | if randomtext == 1 then |
| 12 | Creature:SendUnitYell("blabla", 0)
| |
| 13 | Creature:RemoveEvents() | |
| 14 | end; | |
| 15 | - | if randomtext == 2 then |
| 15 | + | |
| 16 | - | Creature:SendUnitYell( "blabla",0) |
| 16 | + | if randomtext == 2 then |
| 17 | - | Creature:CastSpell(69131) |
| 17 | + | Creature:SendUnitYell("blabla", 0)
|
| 18 | - | Creature:RemoveEvents() |
| 18 | + | Creature:CastSpell(Creature, 69131) -- Added Creature target |
| 19 | - | end |
| 19 | + | Creature:RemoveEvents() |
| 20 | end | |
| 21 | end; | |
| 22 | ||
| 23 | - | function Boss_OnDied(Event, Creature, Victim); |
| 23 | + | |
| 24 | - | Creature:SendUnitYell("blabla",0)
|
| 24 | + | function Boss_OnDied(Event, Creature, Victim) |
| 25 | - | |
| 25 | + | Creature:SendUnitYell("blabla", 0)
|
| 26 | - | for k,v in ipairs(Creature:GetPlayersInRange(Creature:GetAggroRange())) do |
| 26 | + | if (Victim:GetObjectType() == "Player") then -- Added this check |
| 27 | - | |
| 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 | - | v:CastSpell(58451,true) |
| 28 | + | -- Added v (player) as target to the CastSpell function parameters |
| 29 | - | v:CastSpell(58451,true) |
| 29 | + | v:CastSpell(v, 58451, true) |
| 30 | - | v:CastSpell(48100,true) |
| 30 | + | v:CastSpell(v, 58451, true) |
| 31 | - | v:CastSpell(58452,true) |
| 31 | + | v:CastSpell(v, 48100, true) |
| 32 | - | v:CastSpell(48104,true) |
| 32 | + | v:CastSpell(v, 58452, true) |
| 33 | - | v:CastSpell(48102,true) |
| 33 | + | v:CastSpell(v, 48104, true) |
| 34 | - | v:CastSpell(48469,true) |
| 34 | + | v:CastSpell(v, 48102, true) |
| 35 | - | v:CastSpell(61024,true) |
| 35 | + | v:CastSpell(v, 48469, true) |
| 36 | - | v:CastSpell(20217,true) |
| 36 | + | v:CastSpell(v, 61024, true) |
| 37 | - | v:CastSpell(48161,true) |
| 37 | + | v:CastSpell(v, 20217, true) |
| 38 | - | v:CastSpell(48073,true) |
| 38 | + | v:CastSpell(v, 48161, true) |
| 39 | - | v:CastSpell(48169,true) |
| 39 | + | v:CastSpell(v, 48073, true) |
| 40 | - | v:CastSpell(54675,true) |
| 40 | + | v:CastSpell(v, 48169, true) |
| 41 | - | v:CastSpell(15366,true) |
| 41 | + | v:CastSpell(v, 54675, true) |
| 42 | - | v:CastSpell(33077,true) |
| 42 | + | v:CastSpell(v, 15366, true) |
| 43 | - | v:CastSpell(53307,true) |
| 43 | + | v:CastSpell(v, 33077, true) |
| 44 | - | v:CastSpell(43017,true) |
| 44 | + | v:CastSpell(v, 53307, true) |
| 45 | - | v:CastSpell(5697,true) |
| 45 | + | v:CastSpell(v, 43017, true) |
| 46 | - | v:CastSpell(132,true) |
| 46 | + | v:CastSpell(v, 5697, true) |
| 47 | - | v:CastSpell(1706,true) |
| 47 | + | v:CastSpell(v, 132, true) |
| 48 | - | v:CastSpell(16618,true) |
| 48 | + | v:CastSpell(v, 1706, true) |
| 49 | - | end |
| 49 | + | v:CastSpell(v, 16618, true) |
| 50 | - | Creature:RemoveEvents() |
| 50 | + | end |
| 51 | end | |
| 52 | Creature:RemoveEvents() | |
| 53 | end; | |
| 54 | ||
| 55 | ||
| 56 | - | Creature:SendUnitYell("Your weakness destroyed you, fools.",0)
|
| 56 | + | |
| 57 | - | Creature:RegisterEvent(SpellWave, 50, 0) |
| 57 | + | |
| 58 | - | Creature:PlaySoundToSet(12498) |
| 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 | - | function Fel_Armor(Event, Creature) |
| 70 | + | |
| 71 | - | Creature:CastSpell(47893) |
| 71 | + | |
| 72 | function Fel_Armor(Event, delay, repeats, Creature) -- Corrected arguments | |
| 73 | Creature:CastSpell(Creature, 47893) -- Added Creature as target | |
| 74 | - | function SpellWave(Event, Creature) |
| 74 | + | |
| 75 | - | Creature:CastSpell(38536) |
| 75 | + | |
| 76 | - | Creature:PlaySoundToSet(12507) |
| 76 | + | function SpellWave(Event, delay, repeats, Creature) -- Corrected arguments |
| 77 | - | Creature:SendUnitYell("blablabla",0)
|
| 77 | + | Creature:CastSpell(Creature, 38536) -- Added Creature as target |
| 78 | Creature:PlayDistanceSound(12507) -- Corrected sound playing method | |
| 79 | Creature:SendUnitYell("blablabla", 0)
| |
| 80 | end; |