Advertisement
Guest User

Arena Fighting LUA - By Avid

a guest
Mar 12th, 2010
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.77 KB | None | 0 0
  1. -[[
  2.     Custom Arena Fighting
  3.     Teleports to a set area and spawns a custom mob to fight.
  4. ]]
  5.  
  6. -- Variables
  7. local NPC_ID = NPC_ID_HERE
  8.  
  9. -- On Triggers
  10. function ArenaFightingGossipOnTalk(Unit, Event, player)
  11.     Unit:GossipCreateMenu(100, player, 0)
  12.     Unit:GossipMenuAddItem(0, "I want to fight "NPC_NAME"! (Level 80)", 1, 0)
  13.     Unit:GossipMenuAddItem(0, "I'd like to fight "NPC_NAME"! (Level 85)", 2, 0)
  14.     Unit:GossipMenuAddItem(0, "I'd like to attempt "NPC_NAME"! (Level 90)", 3, 0)
  15.     Unit:GossipMenuAddItem(0, "Please can I try "NPC_NAME"! (Level 95)", 4, 0)
  16.     Unit:GossipMenuAddItem(0, "Mabey next time.", 500, 0)
  17.     Unit:GossipSendMenu(player)
  18. end
  19.  
  20. function ArenaFightingGossipOnSelect(Unit, Event, player, id, intid, code, pMisc)
  21.         if (intid == 1) then
  22.             player:SendBroadcastMessage("Your being teleported to the ring, get ready to fight!")
  23.             player:Teleport(ZoneID, X, Y, Z)
  24.             Unit:SpawnCreature(NPC_ID, X, Y, Z, O, Faction, Duration)
  25.             player:GossipComplete()
  26.         end
  27.     end
  28.  
  29.         if (intid == 2) then
  30.             player:SendBroadcastMessage("Your being teleported to the ring, get ready to fight!")
  31.             player:Teleport(ZoneID, X, Y, Z)
  32.             Unit:SpawnCreature(NPC_ID, X, Y, Z, O, Faction, Duration)
  33.             player:GossipComplete()
  34.         end
  35.     end
  36.    
  37.         if (intid == 3) then
  38.             player:SendBroadcastMessage("Your being teleported to the ring, get ready to fight!")
  39.             player:Teleport(ZoneID, X, Y, Z)
  40.             Unit:SpawnCreature(NPC_ID, X, Y, Z, O, Faction, Duration)
  41.             player:GossipComplete()
  42.         end
  43.     end
  44.    
  45.         if (intid == 4) then
  46.             Unit:GossipCreateMenu(100, player, 0)
  47.             Unit:GossipMenuAddItem(0, "Mabey next time.", 500, 0)
  48.             Unit:GossipSendMenu(player)
  49.         end
  50.     end
  51.  
  52. RegisterUnitGossipEvent(NPC_ID, 1, "ArenaFightingGossipOnTalk")
  53. RegisterUnitGossipEvent(NPC_ID, 2, "ArenaFightingGossipOnSelect")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement