stoneharry

Untitled

Jun 11th, 2011
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.49 KB | None | 0 0
  1.  
  2. -- By Stoneharry
  3.  
  4. -- Variables
  5.  
  6. ICC = {}
  7. ICC.VAR = {}
  8.  
  9. -- Skeleton Beams
  10.  
  11. function ICC.VAR.Skeletal_Mage_OnCombat(pUnit, Event)
  12.     local id = pUnit:GetInstanceID()
  13.     if id == nil then id = 1 end
  14.     ICC[id] = ICC[id] or {VAR={}}
  15.    
  16.     --[[if pUnit:GetX() < -137 and pUnit:GetX() > -134 then
  17.         ICC[id].VAR.portal = pUnit:GetCreatureNearestCoords(-123, 2212, 35, 203112)
  18.         ICC[id].VAR.target = pUnit:GetCreatureNearestCoords(-116, 2212, 35, 203113)
  19.     elseif pUnit:GetY() < 2223 and pUnit:GetY() > 2222 then
  20.         ICC[id].VAR.portal = pUnit:GetCreatureNearestCoords(-232.7, 2223.2, 40, 203112)
  21.         ICC[id].VAR.target = pUnit:GetCreatureNearestCoords(-232, 2217, 40.6, 203113)
  22.     elseif pUnit:GetY() < 2201 and pUnit:GetY() > 2200 then
  23.         ICC[id].VAR.portal = pUnit:GetCreatureNearestCoords(-235, 2200.7, 40.86, 203112)
  24.         ICC[id].VAR.target = pUnit:GetCreatureNearestCoords(-231.35, 2206.86, 40.5, 203113)
  25.     end]]
  26.     ICC[id].VAR.portal = pUnit:GetCreatureNearestCoords(-123, 2212, 35, 203112)
  27.     ICC[id].VAR.target = pUnit:GetCreatureNearestCoords(-116, 2212, 35, 203113)
  28.    
  29.     pUnit:ChannelSpell(31513, ICC[id].VAR.portal) -- red beam
  30.     ICC[id].VAR.portal:ChannelSpell(72594, ICC[id].VAR.target) -- arcane fire channel
  31.     ICC[id].VAR.portal:SetMovementFlags(2)
  32.     ICC[id].VAR.portal:MoveTo(ICC[id].VAR.portal:GetX(), ICC[id].VAR.portal:GetY(), ICC[id].VAR.portal:GetZ()+5, ICC[id].VAR.portal:GetO())
  33.     ICC[id].VAR.target:CastSpell(55653) -- impact
  34.     ICC[id].VAR.target:CastSpell(33343) -- visual
  35.     ICC[id].VAR.target:SetMovementFlags(2)
  36.     local plr = pUnit:GetRandomPlayer(0)
  37.     if plr ~= nil then
  38.         ICC[id].VAR.target:SetUnitToFollow(plr, 0.1, 1)
  39.     else
  40.         ICC[id].VAR.target:SetUnitToFollow(pUnit:GetClosestPlayer(), 0.1, 1)
  41.     end
  42.     ICC[id].VAR.channeling = true
  43.     ICC[id].VAR.caster = pUnit
  44.     ICC[id].VAR.caster:RegisterEvent("ICC.VAR.CheckForPlayerNear", 1500, 0)
  45. end
  46.  
  47. function ICC.VAR.CheckForPlayerNear(pUnit)
  48.     local id = pUnit:GetInstanceID()
  49.     if id == nil then id = 1 end
  50.     ICC[id] = ICC[id] or {VAR={}}
  51.     if ICC[id].VAR.channeling then
  52.         pla = ICC[id].VAR.target:GetClosestPlayer()
  53.         if pla ~= nil then
  54.             --[[if boss:GetDistanceYards(pla) > 30 then
  55.                 trig:SetUnitToFollow(pla, 0.1, 0)
  56.                 print("too far away")
  57.             else
  58.                 trig:SetUnitToFollow(pla, 0.1, 1)
  59.                 print("following")
  60.             end]]
  61.             if ICC[id].VAR.target:GetDistanceYards(pla) < 5 and pla:IsAlive() then
  62.                 pla:CastSpell(43418) -- impact
  63.                 ICC[id].VAR.target:Strike(pla, 0, 38043, 890, 990, 2)
  64.             end
  65.         end
  66.     end
  67. end
  68.  
  69. function ICC.VAR.Skeletal_Mage_OnDeath(pUnit, Event)
  70.     local id = pUnit:GetInstanceID()
  71.     if id == nil then id = 1 end
  72.     ICC[id] = ICC[id] or {VAR={}}
  73.     ICC[id].VAR.caster:StopChannel()
  74.     ICC[id].VAR.channeling = false
  75.     ICC[id].VAR.portal:StopChannel()
  76.     ICC[id].VAR.caster:RemoveEvents()
  77.     ICC[id].VAR.target:SetHealth(1)
  78.     ICC[id].VAR.target:CastSpell(11)
  79. end
  80.  
  81. function ICC.VAR.Skeletal_Mage_OnSpawn(pUnit, Event)
  82.     pUnit:SetCombatCapable(true)
  83.     pUnit:FullCastSpell(29880) -- mana shield
  84. end
  85.  
  86. RegisterUnitEvent(203111, 1, "ICC.VAR.Skeletal_Mage_OnCombat")
  87. RegisterUnitEvent(203111, 4, "ICC.VAR.Skeletal_Mage_OnDeath")
  88. RegisterUnitEvent(203111, 18, "ICC.VAR.Skeletal_Mage_OnSpawn")
  89.  
  90. -- Ghouls
  91.  
  92. function ICC.VAR.Ghoul_Enters_Combat(pUnit, Event)
  93.     if math.random(1,2) == 2 then
  94.         pUnit:FullCastSpell(19451) -- Enrage
  95.     else
  96.         local plr = pUnit:GetRandomPlayer(0)
  97.         if plr ~= nil then
  98.             pUnit:FullCastSpellOnTarget(100, plr)
  99.         end
  100.     end
  101. end
  102.  
  103. RegisterUnitEvent(203114, 1, "ICC.VAR.Ghoul_Enters_Combat")
  104.  
  105. -- Lord Marrow
  106.  
  107. function ICC.VAR.LordMarrowSpawns(pUnit, Event)
  108.     pUnit:SetMaxPower(1000, 6) -- amount is 100, type is rage
  109.     pUnit:SetPowerType(6) -- type is rage
  110. end
  111.  
  112. function ICC.VAR.LordMarrowCombat(pUnit, Event)
  113.     pUnit:PlaySoundToSet(16949)
  114.     pUnit:SendChatMessage(14,0, "The only escape is death!")
  115.     local id = pUnit:GetInstanceID()
  116.     if id == nil then id = 1 end
  117.     ICC[id] = ICC[id] or {VAR={}}
  118.     ICC[id].VAR.rage = 0
  119.     pUnit:RegisterEvent("ICC.VAR.updage_Rage", 3000, 1)
  120.     pUnit:RegisterEvent("ICC.VAR.updage_spellsrandom", 5000, 1)
  121. end
  122.  
  123. function ICC.VAR.LordMarrowLeave(pUnit, Event)
  124.     pUnit:SetPower(0, 6)
  125.     pUnit:RemoveEvents()
  126.     pUnit:PlaySoundToSet(16944)
  127.     pUnit:SendChatMessage(14, 0, "I see... only darkness...")
  128. end
  129.  
  130. function ICC.VAR.updage_spellsrandom(pUnit)
  131.     if math.random(1,2) == 1 then
  132.         if pUnit:GetMainTank() ~= nil then -- just in case
  133.             pUnit:FullCastSpellOnTarget(19983, pUnit:GetMainTank()) -- cleave
  134.         end
  135.     else
  136.         if pUnit:GetRandomPlayer(0) ~= nil then
  137.             if math.random(1,2) == 2 then
  138.                 pUnit:CastSpellOnTarget(29540, pUnit:GetRandomPlayer(0)) -- slow + weaken
  139.                 pUnit:CastSpellOnTarget(29540, pUnit:GetRandomPlayer(0)) -- slow + weaken
  140.                 pUnit:CastSpellOnTarget(29540, pUnit:GetRandomPlayer(0)) -- slow + weaken
  141.             else
  142.                 pUnit:FullCastSpellOnTarget(100, pUnit:GetRandomPlayer(0)) -- charge
  143.                 pUnit:CastSpellOnTarget(11, pUnit:GetMainTank()) -- 1k damage
  144.             end
  145.         end
  146.     end
  147.     pUnit:RegisterEvent("ICC.VAR.updage_spellsrandom", math.random(4000, 8000), 1)
  148. end
  149.  
  150. function ICC.VAR.updage_Rage(pUnit)
  151.     local id = pUnit:GetInstanceID()
  152.     if id == nil then id = 1 end
  153.     ICC[id] = ICC[id] or {VAR={}}
  154.     if ICC[id].VAR.rage == 1000 then
  155.         ICC[id].VAR.rage = 0
  156.         pUnit:CastSpell(27688) -- Bone Shield
  157.         if math.random(1,2) == 1 then
  158.             pUnit:PlaySoundToSet(16943)
  159.             pUnit:SendChatMessage(14, 0, "Languish in damnation!")
  160.         else
  161.             pUnit:PlaySoundToSet(16945)
  162.             pUnit:SendChatMessage(14, 0, "The master's rage courses through me!")
  163.         end
  164.         pUnit:CastSpell(17228) -- Shadow bolt volley
  165.         ICC[id].VAR.raging = true
  166.         ICC[id].VAR.ragecount = 0
  167.         pUnit:RegisterEvent("ICC.VAR.rage_part", 1000, 4)
  168.     else
  169.         ICC[id].VAR.rage = ICC[id].VAR.rage + 100
  170.     end
  171.     pUnit:SetPower(ICC[id].VAR.rage, 6)
  172.     pUnit:RegisterEvent("ICC.VAR.updage_Rage", math.random(2000,4000), 1)
  173. end
  174.  
  175. function ICC.VAR.rage_part(pUnit)
  176.     local id = pUnit:GetInstanceID()
  177.     if id == nil then id = 1 end
  178.     ICC[id] = ICC[id] or {VAR={}}
  179.     if ICC[id].VAR.raging then
  180.         pUnit:FullCastSpell(17228) -- shadow bolt volley
  181.         if pUnit:GetRandomPlayer(0) ~= nil then
  182.             pUnit:CastSpellOnTarget(100, pUnit:GetRandomPlayer(0)) -- charge
  183.         end
  184.         ICC[id].VAR.ragecount = ICC[id].VAR.ragecount + 1
  185.         if ICC[id].VAR.ragecount == 4 then
  186.             ICC[id].VAR.raging = false
  187.             pUnit:RemoveAura(27688) -- Bone shield
  188.         end
  189.     end
  190. end
  191.  
  192. RegisterUnitEvent(203115, 1, "ICC.VAR.LordMarrowCombat")
  193. RegisterUnitEvent(203115, 2, "ICC.VAR.LordMarrowLeave")
  194. RegisterUnitEvent(203115, 4, "ICC.VAR.LordMarrowLeave")
  195. RegisterUnitEvent(203115, 18, "ICC.VAR.LordMarrowSpawns")
  196.  
  197. --
Advertisement
Add Comment
Please, Sign In to add comment