Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Script made by Blyitgen @ AC-Web.org
- These credits must stay in place!
- ]]
- -- Varibles
- local NPC = 78000 -- NPC entry for gossip
- local p1_X = 31000 -- X location for Player 1
- local p1_Y = 31000 -- Y location for Player 1
- local p1_Z = 31000 -- Z location for Player 1
- local p2_X = 31000 -- X location for Player 2
- local p2_Y = 31000 -- Y location for Player 2
- local p2_Z = 31000 -- Z location for Player 2
- local started = 0 -- Status of the arena (0 = not started, 1 = started)
- local p1 = {}
- local p2 = {}
- -- Custom Functions
- function addPlayer(player,unit)
- local pid = player
- local p1s = table.getn(p1)
- local p2s = table.getn(p2)
- if (p1s > p2s) then
- p2[p2s + 1] = pid
- else if(p2s > p1s) then
- p1[p1s + 1] = pid
- else if(p1s == p2s) then
- local chance = math.random(1,2)
- if(chance == 1) then
- p1[p1s + 1] = pid
- else
- p2[p2s + 1] = pid
- end
- end
- player:SendBroadcastMessage("You are now added to the queue! Good luck!")
- end
- function getRandom(array)
- local size = table.getn(array)
- if(size == 0) then
- return 0
- else if(size > 1) then
- local m = math.random(1,size)
- return array[math.random(1,size)]
- else if(size == 1) then
- return array[1]
- end
- end
- function sendPlayers()
- end
- -- Script
- function onGossipTalk(Unit, Event, player)
- Unit:GossipCreateMenu(100, player, 0)
- Unit:GossipMenuAddItem(6, "Add me to the queue!", 1)
- Unit:GossipMenuAddItem(0, "Nevermind", 2)
- Unit:GossipSendMenu(player)
- end
- function onGossipSelect(Unit, Event, player, id, intid, code, pMisc)
- if(intid == 1) then
- addPlayer(player)
- end
- if(intid == 2) then
- player:GossipComplete()
- end
- end
- -- Registers
- RegisterTimedEvent("sendPlayers", 30000, 0)
- RegisterUnitGossipEvent(NPC, 1, onGossipTalk)
- RegisterUnitGossipEvent(NPC, 2, onGossipSelect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement