Advertisement
Xsniper1000

Graveyard NPC

Apr 11th, 2012
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.34 KB | None | 0 0
  1. --[[#####################CARLSBERG#######################
  2. This script (NPC) should be spawned in graveyards to make it possible for people to remove Resurrection Sickness
  3.  
  4. ]]
  5.  
  6. -- ID is still unknown
  7. local YOUR_NPC = (UNKNOWN)
  8.  
  9. function graveyardGossipOnTalk(Unit, Event, player)
  10.     Unit:GossipCreateMenu(100, player, 0)
  11.     Unit:GossipMenuAddItem(0, "Take me home", 1, 0)
  12.     Unit:GossipMenuAddItem(0, "Remove Resurrection Sickness.", 2, 0)
  13.     Unit:GossipMenuAddItem(0, "Repair my items.", 3, 0)
  14.     Unit:GossipMenuAddItem(0, "BYE.", 4, 0)
  15.     Unit:GossipSendMenu(player)
  16. end
  17.  
  18. function graveyardGossipOnSelect(Unit, Event, player, id, intid, code, pMisc)
  19.     if (intid == 1) then
  20.         player:Teleport(0, 00000000, 0000000000, 0000000)
  21.         player:GossipComplete()
  22.     end
  23.     if (intid == 2) then
  24.         if (player:HasAura(15007) == true) then
  25.             player:SendBroadcastMessage("Resurrection Sickness has been removed!")
  26.             player:RemoveAura(15007)
  27.             player:GossipComplete()
  28.         else
  29.             player:SendBroadcastMessage("You have no Resurrection Sickness!")
  30.             player:GossipComplete()
  31.         end
  32.     end
  33.     if (intid == 3) then
  34.             player:RepairAllPlayerItems()
  35.         player:GossipComplete()
  36.     end
  37.     if (intid == 4) then
  38.             player:GossipComplete()
  39.     end
  40. end
  41.  
  42. RegisterUnitGossipEvent(YOUR_NPC, 1, graveyardGossipOnTalk)
  43. RegisterUnitGossipEvent(YOUR_NPC, 2, graveyardGossipOnSelect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement