Code:
--[[
Custom Arena Fighting
Teleports to a set area and spawns a custom mob to fight.
]]
-- Variables
local NPC_ID = 2555
-- On Triggers
function ArenaFightingGossipOnTalk(Unit, Event, player)
Unit:GossipCreateMenu(100, player, 0)
Unit:GossipMenuAddItem(0, "I want to fight NPC_NAME (Level 80)", 1, 0)
Unit:GossipMenuAddItem(0, "I'd like to fight NPC_NAME! (Level 85)", 2, 0)
Unit:GossipMenuAddItem(0, "I'd like to attempt NPC_NAME! (Level 90)", 3, 0)
Unit:GossipMenuAddItem(0, "Please can I try NPC_NAME! (Level 95)", 4, 0)
Unit:GossipMenuAddItem(0, "Mabey next time.", 500, 0)
Unit:GossipSendMenu(player)
end
function ArenaFightingGossipOnSelect(Unit, Event, player, id, intid, code, pMisc)
if (intid == 1) then
player:SendBroadcastMessage("Your being teleported to the ring, get ready to fight!")
player:Teleport(ZoneID, X, Y, Z)
Unit:SpawnCreature(NPC_ID, X, Y, Z, O, Faction, Duration)
player:GossipComplete()
end
end
if (intid == 2) then
player:SendBroadcastMessage("Your being teleported to the ring, get ready to fight!")
player:Teleport(ZoneID, X, Y, Z)
Unit:SpawnCreature(NPC_ID, X, Y, Z, O, Faction, Duration)
player:GossipComplete()
end
if (intid == 3) then
player:SendBroadcastMessage("Your being teleported to the ring, get ready to fight!")
player:Teleport(ZoneID, X, Y, Z)
Unit:SpawnCreature(NPC_ID, X, Y, Z, O, Faction, Duration)
player:GossipComplete()
end
if (intid == 4) then
Unit:GossipCreateMenu(100, player, 0)
Unit:GossipMenuAddItem(0, "Mabey next time.", 500, 0)
Unit:GossipSendMenu(player)
end
RegisterUnitGossipEvent(2555, 1, "ArenaFightingGossipOnTalk")
RegisterUnitGossipEvent(2555, 2, "ArenaFightingGossipOnSelect")
As you can probably tell, I'm new to LUA, so feedback and error reports would be appreciated.