Michaelcain6

Untitled

Jun 3rd, 2012
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 KB | None | 0 0
  1. function Guardian_OnSpawn(pUnit, Event)
  2.     pUnit:RegisterEvent("Guardian_Walk", 1000, 1)
  3.     pUnit:RegisterEvent("Guardian_Cast", 7000, 0)
  4.     pUnit:RegisterEvent("Guardian_Check", 1000, 0)
  5.     pUnit:RegisterEvent("Guardian_Plrhealth", 1000, 0)
  6. end
  7.  
  8. function Guardian_Walk(pUnit, event)
  9.     pUnit:MoveTo(16309.560547, 16247.022461, 24.612982, 0.091115)
  10.     pUnit:SendBroadcastMessage("A guardian comes to your aid!")
  11. end
  12.  
  13. function Guardian_Cast(pUnit, event)
  14.     pUnit:MoveTo(16309.560547, 16247.022461, 24.612982, 0.091115)
  15.     pUnit:SetCombatCapable(1)
  16.     pUnit:FullCastSpellOnTarget(11, pUnit:GetCreatureNearestCoords(16309.560547, 16247.022461, 24.612982, 90092))
  17. end
  18.  
  19. function Guardian_Check(pUnit, event)
  20. local boss =  pUnit:GetCreatureNearestCoords(16309.560547, 16247.022461, 24.612982, 90092)
  21. if boss:IsDead() == true then
  22. pUnit:Despawn(0,0)
  23. end
  24. if boss:IsDead() == false then
  25. end
  26.  
  27. function Guardian_Plrhealth(pUnit, event)
  28. local caller = pUnit:GetClosestPlayer()
  29.  
  30.  
  31. pUnit:FullCastSpellOnTarget(34119, caller)
  32. end
  33. end
  34.  
  35. RegisterUnitEvent(90100, 18, Guardian_OnSpawn)
Advertisement
Add Comment
Please, Sign In to add comment