-- Svargrond Arena by Szuwar
-- Thanks to Noxitu for help
local stone1pos = {x=585,y=742,z=7,stackpos=1}
local stone2pos = {x=568,y=742,z=7,stackpos=1}
local stone3pos = {x=551,y=742,z=7,stackpos=1}
local stone4pos = {x=534,y=742,z=7,stackpos=1}
local stone5pos = {x=543,y=727,z=7,stackpos=1}
local stone6pos = {x=560,y=727,z=7,stackpos=1}
local stone7pos = {x=577,y=727,z=7,stackpos=1}
local stone8pos = {x=569,y=712,z=7,stackpos=1}
local stone9pos = {x=552,y=712,z=7,stackpos=1}
local stone10pos = {x=561,y=697,z=7,stackpos=1}
function onStepIn(cid, item, pos)
local function doCheckLvl(cid, storage)
if getPlayerStorageValue(cid, storage) == 1 then -- Greenhorn
monsters = {"Frostfur", "Bloodpaw", "Bovinus", "Achad", "The Hairy One", "Colerian The Barbarian", "Axeitus Headbanger", "Rocky", "Cursed Gladiator", "Orcus The Cruel"}
elseif getPlayerStorageValue(cid, storage) == 2 then -- Scrapper
monsters = {"Avalanche", "Kreebosh the Exile", "The Dark Dancer", "The Hag", "Slim", "Grimgor Guteater", "Drasilla", "Spirit of Earth", "Spirit of Water", "Spirit of Fire"}
elseif getPlayerStorageValue(cid, storage) == 3 then -- Warlord
monsters = {"Webster", "Darakan the Executioner", "Norgle Glacierbeard", "The Pit Lord", "Svoren the Mad", "The Masked Marauder", "Gnorre Chyllson", "Fallen Mooh'tah Master Ghar", "Deathbringer", "The Obliverator"}
end
end
local function doChange(cid, pos, creature, tpos)
local stone = getThingfromPos(pos)
doSetItemActionId(stone.uid,6000)
doTeleportThing(cid,tpos)
doSendMagicEffect(pos,10)
local pos = getThingPos(stone.uid)
monster = doSummonCreature(creature, pos)
doSendAnimatedText(tpos,"Fight!",198)
end
local function doCheckStone(stonepos)
local stone = getThingfromPos(stonepos)
if stone.actionid ~= 6000 and stone.itemid == 1354 then
return 0
elseif stone.actionid == 6000 or stone.itemid ~= 1354 then
return 1
end
end
local function roomBusy(cid, pos)
pos.x = pos.x + 1
doTeleportThing(cid, pos)
doPlayerSendTextMessage(cid, 22, "Somebody is before you in next room. Please wait.")
end
doCheckLvl(cid, 5029)
if item.actionid == 2004 and doCheckStone(stone1pos) == 0 then
local npos = {x=590,y=745,z=7}
doChange(cid, stone1pos, monsters[1], npos)
elseif item.actionid == 2005 and doCheckStone(stone2pos) == 0 then
local npos = {x=572,y=745,z=7}
doChange(cid, stone2pos, monsters[2], npos)
doCreateItem(1354,1,stone1pos)
elseif item.actionid == 2006 and doCheckStone(stone3pos) == 0 then
local npos = {x=555,y=745,z=7}
doChange(cid, stone3pos, monsters[3], npos)
doCreateItem(1354,1,stone2pos)
elseif item.actionid == 2007 and doCheckStone(stone4pos) == 0 then
local npos = {x=538,y=745,z=7}
doChange(cid, stone4pos, monsters[4], npos)
doCreateItem(1354,1,stone3pos)
elseif item.actionid == 2008 and doCheckStone(stone5pos) == 0 then
local npos = {x=546,y=730,z=7}
doChange(cid, stone5pos, monsters[5], npos)
doCreateItem(1354,1,stone4pos)
elseif item.actionid == 2009 and doCheckStone(stone6pos) == 0 then
local npos = {x=564,y=730,z=7}
doChange(cid, stone6pos, monsters[6], npos)
doCreateItem(1354,1,stone5pos)
elseif item.actionid == 2010 and doCheckStone(stone7pos) == 0 then
local npos = {x=580,y=730,z=7}
doChange(cid, stone7pos, monsters[7], npos)
doCreateItem(1354,1,stone6pos)
elseif item.actionid == 2011 and doCheckStone(stone8pos) == 0 then
local npos = {x=573,y=715,z=7}
doChange(cid, stone8pos, monsters[8], npos)
doCreateItem(1354,1,stone7pos)
elseif item.actionid == 2012 and doCheckStone(stone9pos) == 0 then
local npos = {x=555,y=715,z=7}
doChange(cid, stone9pos, monsters[9], npos)
doCreateItem(1354,1,stone8pos)
elseif item.actionid == 2013 and doCheckStone(stone10pos) == 0 then
local npos = {x=565,y=700,z=7}
doChange(cid, stone10pos, monsters[10], npos)
doCreateItem(1354,1,stone9pos)
elseif item.actionid == 2014 then
doCreateItem(1354,1,stone10pos)
local npos = {x=605,y=726,z=6}
doTeleportThing(cid, npos)
doSendMagicEffect(npos,10)
elseif doCheckStone(stone10pos) == 1 then
roomBusy(cid, pos)
elseif doCheckStone(stone9pos) == 1 then
roomBusy(cid, pos)
elseif doCheckStone(stone8pos) == 1 then
roomBusy(cid, pos)
elseif doCheckStone(stone7pos) == 1 then
roomBusy(cid, pos)
elseif doCheckStone(stone6pos) == 1 then
roomBusy(cid, pos)
elseif doCheckStone(stone5pos) == 1 then
roomBusy(cid, pos)
elseif doCheckStone(stone4pos) == 1 then
roomBusy(cid, pos)
elseif doCheckStone(stone3pos) == 1 then
roomBusy(cid, pos)
elseif doCheckStone(stone2pos) == 1 then
roomBusy(cid, pos)
elseif doCheckStone(stone1pos) == 1 then
roomBusy(cid, pos)
end
end
function onAddItem(moveitem, tileitem, pos)
local function doCheckBody(moveitem, stonepos, monster)
local stone = getThingfromPos(stonepos)
if moveitem.itemid == 7349 and stone.itemid ~= 0 then
doRemoveItem(stone.uid,1)
doRemoveItem(moveitem.uid,1)
doSendMagicEffect(stonepos,2)
elseif moveitem.itemid == 3058 or moveitem.itemid == 3065 then
doRemoveItem(moveitem.uid,1)
local pos = getThingPos(monster)
doCreatureAddHealth(monster,-10000)
doCreateItem(1354,1,stonepos)
doSetItemActionId(stone.uid,5999)
end
end
if tileitem.actionid == 3001 then
doCheckBody(moveitem, stone1pos, monster)
elseif tileitem.actionid == 3002 then
doCheckBody(moveitem, stone2pos, monster)
elseif tileitem.actionid == 3003 then
doCheckBody(moveitem, stone3pos, monster)
elseif tileitem.actionid == 3004 then
doCheckBody(moveitem, stone4pos, monster)
elseif tileitem.actionid == 3005 then
doCheckBody(moveitem, stone5pos, monster)
elseif tileitem.actionid == 3006 then
doCheckBody(moveitem, stone6pos, monster)
elseif tileitem.actionid == 3007 then
doCheckBody(moveitem, stone7pos, monster)
elseif tileitem.actionid == 3008 then
doCheckBody(moveitem, stone8pos, monster)
elseif tileitem.actionid == 3009 then
doCheckBody(moveitem, stone9pos, monster)
elseif tileitem.actionid == 3010 then
doCheckBody(moveitem, stone10pos, monster)
end
end