• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Zao arena [Chazorai]

Dankoo

Active Member
Joined
Sep 4, 2010
Messages
1,007
Reaction score
27
I do not want someone to do this for me, I don't want to give ppl work where I can do it myself... But, does someone have a template of a arena script that I can use to make an Zao arena?

The correct name is Chazorai Arena

Where:

5feohz.jpg


To start arena, it's needed 2 players [no level requirement]
Player talks to Chrak and gets access to the lever (this part I know how to do, ignore it)
They pull the lever and gets teleported to the arena

Lever position: {x="33079",y="31014",z="2"} (AID or UID 26840)
Player 1 start position: {x="33080",y="31014",z="2"}
Player 2 start position: {x="33081",y="31014",z="2"}

Where:
2cdcrhs.jpg


monster Baron Brute summoned at position 1 (black) {x="33061",y="31033",z="3"}
monster The Axeorcist summoned at position 2 (black) {x="33064",y="31035",z="3"}
IGNORE 2 BLUE
Player 1 teleported to {x="33059",y="31032",z="3"}
Player 2 teleported to {x="33057",y="31034",z="3"}

Ok, at this points two players are fighting the monsters... The next wave of boss will spawn in the same place after 90 seconds, even if the earlier bosses are still alive.

Now Menace and Fatality will spawn

Now on I can do the rest of the script I think, just repeat the script and adapt to other bosses, right? If I need support then I'll ask in support section, but don't want to give work to ppl lol

Thanks a lot, this will be a great contribution for otland community :]
 
Edit the coordinates in the tables to see if they are correct.

Lua:
local t, player = {
	pedestals = {
		{x=33080, y=31014, z=2},
		{x=33081, y=31014, z=2}
	},
	newPos = {
		{x=33059, y=31032, z=3},
		{x=33057, y=31034, z=3}
	},
	area = {
		fromX = 33054, toX = 33073,
		fromY = 31026, toY = 32356,
		z = 3
	},
	storageDone = 4767,
	level = 80
}, {0, 0}

function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
	local creaturesList = {}
	for x = -radiusx, radiusx do
		for y = -radiusy, radiusy do
			if not (x == 0 and y == 0) then
				creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = 253})
				if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
					table.insert(creaturesList, creature.uid)
				end
			end
		end
	end

	local creature = getTopCreature(position)
	if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
		if not(table.find(creaturesList, creature.uid)) then
			table.insert(creaturesList, creature.uid)
		end
	end
    return creaturesList
end

function Wave1()
       doSendMagicEffect(getCreaturePosition(doCreateMonster('Baron Brute', {x = 33064, y = 31033, z = 3})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doCreateMonster('The Axeorcist', {x = 33065, y = 31034, z = 3})), CONST_ME_TELEPORT)
	addEvent(Wave2, 30 * 1000)
end

function Wave2()
       doSendMagicEffect(getCreaturePosition(doCreateMonster('Menace', {x = 33064, y = 31033, z = 3})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doCreateMonster('Fatality', {x = 33065, y = 31034, z = 3})), CONST_ME_TELEPORT) 
	addEvent(Wave3, 35 * 1000)
end

function Wave3()
       doSendMagicEffect(getCreaturePosition(doCreateMonster('Incineron', {x = 33064, y = 31033, z = 3})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doCreateMonster('Coldheart', {x = 33065, y = 31034, z = 3})), CONST_ME_TELEPORT)
	addEvent(Wave4, 40 * 1000)
end

function Wave4()
       doSendMagicEffect(getCreaturePosition(doCreateMonster('Dreadwing', {x = 33064, y = 31033, z = 3})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doCreateMonster('Doomhowl', {x = 33065, y = 31034, z = 3})), CONST_ME_TELEPORT)
	addEvent(Wave5, 40 * 1000)
end

function Wave5()
       doSendMagicEffect(getCreaturePosition(doCreateMonster('Haunter', {x = 33064, y = 31033, z = 3})), CONST_ME_TELEPORT)
	addEvent(Wave6, 40 * 1000)
end

function Wave6()
       doSendMagicEffect(getCreaturePosition(doCreateMonster('The Dreadorian', {x = 33064, y = 31033, z = 3})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doCreateMonster('Rocko', {x = 33065, y = 31034, z = 3})), CONST_ME_TELEPORT)
       doSendMagicEffect(getCreaturePosition(doCreateMonster('Tremorak', {x = 33064, y = 31032, z = 3})), CONST_ME_TELEPORT)
	addEvent(Wave7, 40 * 1000)
end

function Wave7()
	doSendMagicEffect(getCreaturePosition(doCreateMonster('Tirecz', {x = 33065, y = 31034, z = 3})), CONST_ME_TELEPORT)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local failed = false
	for i = 1, #t.pedestals do
		player[i] = getTopCreature(t.pedestals[i]).uid
		if(not(player[i] > 0 and isPlayer(player[i]) == TRUE and getPlayerStorageValue(player[i], t.storageDone) < 1 and getPlayerLevel(player[i]) >= t.level)) then
			failed = true
			break
		end
	end
	if not failed then
		if #getCreaturesInRange({x=33063, y=31035,z=3}, 10, 9, FALSE, TRUE) > 0 then
			doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT, "Some people are already in the arena.")
			return true
		end
		for i = 1, #player do
			doTeleportThing(player[i], t.newPos[i])
		end
		Wave1()
		doTransformItem(item.uid, 1946)
	else
		doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT)
	end
	return true
end
 
Last edited:
I made this:

Lua:
local tpId = 1387
local tps = {
        ["Tirecz"] = {pos = {x=33063, y=31033, z=3}, toPos = {x=33062, y=31029, z=7}, time = 30},
}

function removeTp(tp)
        local t = getTileItemById(tp.pos, tpId)
        if t then
                doRemoveItem(t.uid, 1)
                doSendMagicEffect(tp.pos, CONST_ME_POFF)
        end
end

function onDeath(cid)
        local tp = tps[getCreatureName(cid)]
        if tp then
                doCreateTeleport(tpId, tp.toPos, tp.pos)
                doCreatureSay(cid, "The teleport will desapear in "..tp.time.." seconds.", TALKTYPE_ORANGE_1)
                addEvent(removeTp, tp.time*1000, tp)
        end
        return TRUE
end

The problem is: teleport desappears in 30 seconds, if another team enter in arena they can pass in teleport.
Is possible to: After 2 players step in teleport it desappears?
 
Should work.

login.lua
Lua:
registerCreatureEvent(cid, "Tirecz")

creaturescripts.xml
XML:
<event type="kill" name="Tirecz" event="script" value="Tirecz.lua"/>

Tirecz.lua
Lua:
local t = {
	newPos = {x=33062, y=31029, z=7},
	msg = "You have won! As new champion take the ancient armor as reward before you leave.",
	area = {
		fromX = 33054, toX = 33073,
		fromY = 31026, toY = 32356,
		z = 3
	}
}

function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
	local creaturesList = {}
	for x = -radiusx, radiusx do
		for y = -radiusy, radiusy do
			if not (x == 0 and y == 0) then
				creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = 253})
				if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
				table.insert(creaturesList, creature.uid)
				end
			end
		end
	end

	local creature = getTopCreature(position)
	if(creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
              if not(table.find(creaturesList, creature.uid)) then
			table.insert(creaturesList, creature.uid)
		end
	end
	return creaturesList
end

function onKill(cid, target, damage, flags)
	local name = getCreatureName(target):lower()
	if name == 'tirecz' then
		local players = getCreaturesInRange({x=33063, y=31035,z=3}, 10, 9, FALSE, TRUE)
		for i = 1, #players do
			doTeleportThing(players[i], t.newPos)
			doCreatureSay(players[i], t.msg, TALKTYPE_ORANGE_1, false, players[i], getCreaturePosition(players[i]))
		end
		return true
	end
	end
 
@up

Coz he's put return in the wrong line P;

Try this:

PHP:
local t = {
	newPos = {x=474, y=145, z=8},
	msg = "You have won! As new champion take the ancient armor as reward before you leave.",
	area = {
		fromX = 451, toX = 150,
		fromY = 472, toY = 167,
		z = 6
	}
}
 
function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
	local creaturesList = {}
	for x = -radiusx, radiusx do
		for y = -radiusy, radiusy do
			if not (x == 0 and y == 0) then
				creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = 253})
				if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
				table.insert(creaturesList, creature.uid)
				end
			end
		end
	end
 
	local creature = getTopCreature(position)
	if(creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
              if not(table.find(creaturesList, creature.uid)) then
			table.insert(creaturesList, creature.uid)
		end
	end
	return creaturesList
end
 
function onKill(cid, target, damage, flags)
	local name = getCreatureName(target):lower()
	if name == 'tirecz' then
		local players = getCreaturesInRange({x=460, y=157,z=6}, 10, 9, FALSE, TRUE)
		for i = 1, #players do
			doTeleportThing(players[i], t.newPos)
			doCreatureSay(players[i], t.msg, TALKTYPE_ORANGE_1, false, players[i], getCreaturePosition(players[i]))
		end
	end
return true
end
 
@up

Coz he's put return in the wrong line P;

Try this:

PHP:
local t = {
	newPos = {x=474, y=145, z=8},
	msg = "You have won! As new champion take the ancient armor as reward before you leave.",
	area = {
		fromX = 451, toX = 150,
		fromY = 472, toY = 167,
		z = 6
	}
}
 
function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
	local creaturesList = {}
	for x = -radiusx, radiusx do
		for y = -radiusy, radiusy do
			if not (x == 0 and y == 0) then
				creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = 253})
				if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
				table.insert(creaturesList, creature.uid)
				end
			end
		end
	end
 
	local creature = getTopCreature(position)
	if(creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
              if not(table.find(creaturesList, creature.uid)) then
			table.insert(creaturesList, creature.uid)
		end
	end
	return creaturesList
end
 
function onKill(cid, target, damage, flags)
	local name = getCreatureName(target):lower()
	if name == 'tirecz' then
		local players = getCreaturesInRange({x=460, y=157,z=6}, 10, 9, FALSE, TRUE)
		for i = 1, #players do
			doTeleportThing(players[i], t.newPos)
			doCreatureSay(players[i], t.msg, TALKTYPE_ORANGE_1, false, players[i], getCreaturePosition(players[i]))
		end
	end
return true
end

Why it is not working?
Lua:
local t = {
    newPos = {x=33062, y=31029, z=7},
    msg = "You have won! As new champion take the ancient armor as reward before you leave.",
    area = {
        fromX = 33053, toX = 33073,
        fromY = 31024, toY = 31044,
        z = 3
    }
}
 
function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
    local creaturesList = {}
    for x = -radiusx, radiusx do
        for y = -radiusy, radiusy do
            if not (x == 0 and y == 0) then
                creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = 253})
                if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
                table.insert(creaturesList, creature.uid)
                end
            end
        end
    end
 
    local creature = getTopCreature(position)
    if(creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
              if not(table.find(creaturesList, creature.uid)) then
            table.insert(creaturesList, creature.uid)
        end
    end
    return creaturesList
end
 
function onKill(cid, target, damage, flags)
    local name = getCreatureName(target):lower()
    if name == 'tirecz' then
        local players = getCreaturesInRange({x=460, y=157,z=6}, 10, 9, FALSE, TRUE)
        for i = 1, #players do
            doTeleportThing(players[i], t.newPos)
            doCreatureSay(players[i], t.msg, TALKTYPE_ORANGE_1, false, players[i], getCreaturePosition(players[i]))
        end
    end
return true
end
 
Back
Top