• 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!

Arena Lever Request!!

test this

download
dowload script and map
actions.xml
PHP:
  <action actionid="42366" script="quests/arenadoors.lua"/>
    <action actionid="42376" script="quests/arenadoors.lua"/>
    <action actionid="42386" script="quests/arenadoors.lua"/>
    <action actionid="42357" script="quests/arenadoors.lua"/>
    <action actionid="42361" script="quests/arenareward.lua"/>
    <action actionid="42362" script="quests/arenareward.lua"/>
    <action actionid="42363" script="quests/arenareward.lua"/>
    <action actionid="42364" script="quests/arenareward.lua"/>
    <action actionid="42365" script="quests/arenareward.lua"/>
    <action actionid="42371" script="quests/arenareward.lua"/>
    <action actionid="42372" script="quests/arenareward.lua"/>
    <action actionid="42373" script="quests/arenareward.lua"/>
    <action actionid="42374" script="quests/arenareward.lua"/>
    <action actionid="42375" script="quests/arenareward.lua"/>
    <action actionid="42381" script="quests/arenareward.lua"/>
    <action actionid="42382" script="quests/arenareward.lua"/>
    <action actionid="42383" script="quests/arenareward.lua"/>
    <action actionid="42384" script="quests/arenareward.lua"/>
    <action actionid="42385" script="quests/arenareward.lua"/>

Now in
movements.xml
PHP:
 <action actionid="42366" script="quests/arenadoors.lua"/>
    <action actionid="42376" script="quests/arenadoors.lua"/>
    <action actionid="42386" script="quests/arenadoors.lua"/>
    <action actionid="42357" script="quests/arenadoors.lua"/>
    <action actionid="42361" script="quests/arenareward.lua"/>
    <action actionid="42362" script="quests/arenareward.lua"/>
    <action actionid="42363" script="quests/arenareward.lua"/>
    <action actionid="42364" script="quests/arenareward.lua"/>
    <action actionid="42365" script="quests/arenareward.lua"/>
    <action actionid="42371" script="quests/arenareward.lua"/>
    <action actionid="42372" script="quests/arenareward.lua"/>
    <action actionid="42373" script="quests/arenareward.lua"/>
    <action actionid="42374" script="quests/arenareward.lua"/>
    <action actionid="42375" script="quests/arenareward.lua"/>
    <action actionid="42381" script="quests/arenareward.lua"/>
    <action actionid="42382" script="quests/arenareward.lua"/>
    <action actionid="42383" script="quests/arenareward.lua"/>
    <action actionid="42384" script="quests/arenareward.lua"/>
    <action actionid="42385" script="quests/arenareward.lua"/>

Data/global.lua
PHP:
-- arena script
InitArenaScript = 0
arena_room_max_time = 240
arenaKickPosition = {x=481, y=1088, z=6} -- position where kick from arena when you leave/you did arena level
arena_monsters = {}
arena_monsters[42300] = 'frostfur' -- first monster from 1 arena
arena_monsters[42301] = 'bloodpaw'
arena_monsters[42302] = 'bovinus'
arena_monsters[42303] = 'achad'
arena_monsters[42304] = 'colerian the barbarian'
arena_monsters[42305] = 'the hairy one'
arena_monsters[42306] = 'axeitus headbanger'
arena_monsters[42307] = 'rocky'
arena_monsters[42308] = 'cursed gladiator'
arena_monsters[42309] = 'orcus the cruel'
arena_monsters[42310] = 'avalanche' -- first monster from 2 arena
arena_monsters[42311] = 'kreebosh the exile'
arena_monsters[42312] = 'the dark dancer'
arena_monsters[42313] = 'the hag'
arena_monsters[42314] = 'slim'
arena_monsters[42315] = 'grimgor guteater'
arena_monsters[42316] = 'drasilla'
arena_monsters[42317] = 'spirit of earth'
arena_monsters[42318] = 'spirit of water'
arena_monsters[42319] = 'spirit of fire'
arena_monsters[42320] = 'webster' -- first monster from 3 arena
arena_monsters[42321] = 'darakan the executioner'
arena_monsters[42322] = 'norgle glacierbeard'
arena_monsters[42323] = 'the pit lord'
arena_monsters[42324] = 'svoren the mad'
arena_monsters[42325] = 'the masked marauder'
arena_monsters[42326] = 'gnorre chyllson'
arena_monsters[42327] = "fallen mooh'tah master ghar"
arena_monsters[42328] = 'deathbringer'
arena_monsters[42329] = 'the obliverator'

function getArenaMonsterIdByName(name)
    name = string.lower(tostring(name))
    for i = 42300, 42329 do
        if tostring(arena_monsters[i]) == name then
            return i
        end
    end
    return 0
end

Data/creaturescipts/
creaturescripts.xml

data/creaturescripts/script/
login.lua
under
PHP:
function onLogin(cid)
add this
PHP:
   registerCreatureEvent(cid, "PlayerKill")
    if (InitArenaScript ~= 0) then
    InitArenaScript = 1
    -- make arena rooms free
        for i = 42300, 42309 do
            setGlobalStorageValue(i, 0)
            setGlobalStorageValue(i+100, 0)
        end
    end
    -- if he did not make full arena 1 he must start from zero
    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 2 he must start from zero
    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 3 he must start from zero
    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0) -- did not arena level
    end
    setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
    setPlayerStorageValue(cid, 42352, 0) -- is not in arena

Open arena map ( data/world/Arena_map.otbm ), copy and paste somewhere on you map. Remember to change in data/global.lua:
PHP:
arenaKickPosition = {x=481, y=1088, z=6}
 
-- pvp arena lever

function onUse(cid, item, frompos, item2, topos)

if item.uid == 7001 and item.itemid == 1945 then
player1pos = {x=1058, y=1018, z=9, stackpos=253}
player1 = getThingfromPos(player1pos)

player2pos = {x=1058, y=1020, z=9, stackpos=253}
player2 = getThingfromPos(player2pos)

if player1.itemid > 0 and player2.itemid > 0 then
arenalevel = 25
player1level = getPlayerLevel(player1.uid)
player2level = getPlayerLevel(player2.uid)

if player1level >= arenalevel and player2level >= arenalevel then
for arenax = 121,128 do
for arenay = 33,37 do
arenapos = {x=arenax, y=arenay, z=9, stackpos=253}
arenacreature = getThingfromPos(arenapos)

if arenacreature.itemid > 0 then
doPlayerSendCancel(cid,"Wait for current duel to end.")
return 1
end
end
end

nplayer1pos = {x=1059, y=1018, z=10}
nplayer2pos = {x=1067, y=1018, z=10}

doSendMagicEffect(player1pos,2)
doSendMagicEffect(player2pos,2)

doTeleportThing(player1.uid,nplayer1pos)
doTeleportThing(player2.uid,nplayer2pos)

doSendMagicEffect(nplayer1pos,10)
doSendMagicEffect(nplayer2pos,10)

doPlayerSendTextMessage(player1.uid,18,"FIGHT!")
doPlayerSendTextMessage(player2.uid,18,"FIGHT!")
else
doPlayerSendCancel(cid,"Both fighters must have level 25.")
end
else
doPlayerSendCancel(cid,"You need 2 players for a duel.")
end
else
return 0
end

return 1
end

This script tell me what i need to change i have already change the pos but i get errors:S this is the error

[25/04/2010 17:19:28] [Error - Action Interface]
[25/04/2010 17:19:28] data/actions/scripts/other/arenalever.luanUse
[25/04/2010 17:19:28] Description:
[25/04/2010 17:19:28] (luaGetThingFromPos) Tile not found

That i have change on the script is the poz... this

if item.uid == 7001 and item.itemid == 1945 then
player1pos = {x=1058, y=1018, z=9, stackpos=253}
player1 = getThingfromPos(player1pos)

player2pos = {x=1058, y=1020, z=9, stackpos=253}
player2 = getThingfromPos(player2pos)

Then this....

nplayer1pos = {x=1059, y=1018, z=10}
nplayer2pos = {x=1067, y=1018, z=10}

Do i need to change someting more on the script?.... PLease help me...
 
Open
data/actions/scripts
erase your script
and paste this

PHP:
-- pvp arena lever

function onUse(cid, item, frompos, item2, topos)

	if item.uid == 7001 and item.itemid == 1945 then
		player1pos = {x=119, y=35, z=9, stackpos=253}
		player1 = getThingfromPos(player1pos)

		player2pos = {x=130, y=35, z=9, stackpos=253}
		player2 = getThingfromPos(player2pos)

		if player1.itemid > 0 and player2.itemid > 0 then
			arenalevel = 25
			player1level = getPlayerLevel(player1.uid)
			player2level = getPlayerLevel(player2.uid)

			if player1level >= arenalevel and player2level >= arenalevel then
				for arenax = 121,128 do
					for arenay = 33,37 do
						arenapos = {x=arenax, y=arenay, z=9, stackpos=253}
						arenacreature = getThingfromPos(arenapos)

						if arenacreature.itemid > 0 then
							doPlayerSendCancel(cid,"Wait for current duel to end.")
							return 1
						end
					end
				end

				nplayer1pos = {x=121, y=35, z=9}
				nplayer2pos = {x=128, y=35, z=9}

				doSendMagicEffect(player1pos,2)
				doSendMagicEffect(player2pos,2)

				doTeleportThing(player1.uid,nplayer1pos)
				doTeleportThing(player2.uid,nplayer2pos)

				doSendMagicEffect(nplayer1pos,10)
				doSendMagicEffect(nplayer2pos,10)

				doPlayerSendTextMessage(player1.uid,18,"FIGHT!")
				doPlayerSendTextMessage(player2.uid,18,"FIGHT!")
			else
				doPlayerSendCancel(cid,"Both fighters must have level 25.")
			end
		else
			doPlayerSendCancel(cid,"You need 2 players for a duel.")
		end
	else
		return 0
   	end

	return 1
end

actions.xml
PHP:
<action uniqueid="7001" script="arenalever.lua" />
 
Open
data/actions/scripts
erase your script
and paste this

PHP:
-- pvp arena lever

function onUse(cid, item, frompos, item2, topos)

	if item.uid == 7001 and item.itemid == 1945 then
		player1pos = {x=119, y=35, z=9, stackpos=253}
		player1 = getThingfromPos(player1pos)

		player2pos = {x=130, y=35, z=9, stackpos=253}
		player2 = getThingfromPos(player2pos)

		if player1.itemid > 0 and player2.itemid > 0 then
			arenalevel = 25
			player1level = getPlayerLevel(player1.uid)
			player2level = getPlayerLevel(player2.uid)

			if player1level >= arenalevel and player2level >= arenalevel then
				for arenax = 121,128 do
					for arenay = 33,37 do
						arenapos = {x=arenax, y=arenay, z=9, stackpos=253}
						arenacreature = getThingfromPos(arenapos)

						if arenacreature.itemid > 0 then
							doPlayerSendCancel(cid,"Wait for current duel to end.")
							return 1
						end
					end
				end

				nplayer1pos = {x=121, y=35, z=9}
				nplayer2pos = {x=128, y=35, z=9}

				doSendMagicEffect(player1pos,2)
				doSendMagicEffect(player2pos,2)

				doTeleportThing(player1.uid,nplayer1pos)
				doTeleportThing(player2.uid,nplayer2pos)

				doSendMagicEffect(nplayer1pos,10)
				doSendMagicEffect(nplayer2pos,10)

				doPlayerSendTextMessage(player1.uid,18,"FIGHT!")
				doPlayerSendTextMessage(player2.uid,18,"FIGHT!")
			else
				doPlayerSendCancel(cid,"Both fighters must have level 25.")
			end
		else
			doPlayerSendCancel(cid,"You need 2 players for a duel.")
		end
	else
		return 0
   	end

	return 1
end

actions.xml
PHP:
<action uniqueid="7001" script="arenalever.lua" />

Already done it... i mean what i need to change on the script.. tex the poz and that... i hope you know what i mean!!
 
change position x y z?

done but i get errors.... do i need to change someting here -->

if player1level >= arenalevel and player2level >= arenalevel then
for arenax = 121,128 do
for arenay = 33,37 do
arenapos = {x=arenax, y=arenay, z=9, stackpos=253}
arenacreature = getThingfromPos(arenapos)
 
Look when i am standing on the tile --> look screenshot: http://i44.tinypic.com/27zho9g.png

Then when i pull the switch i got this errors like 40 times
But the charater goes down to the poz i write in the script here is screenshot --> http://i43.tinypic.com/2j151di.png

[26/04/2010 00:45:27] [Error - Action Interface]
[26/04/2010 00:45:27] data/actions/scripts/other/arenalever.lua:eek:nUse
[26/04/2010 00:45:27] Description:
[26/04/2010 00:45:27] (luaGetThingFromPos) Tile not found

Why do i get this errors:S??
 
Thanks But Why level 100?:S put like lvl 25 and you think is possible when the other guy dies then the winner goes up and dont stay down on the arena i hope you understand me..
 
Lol I get errors !! from JDB Script:S

The errors-->

[26/04/2010 14:39:31] [Error - LuaScriptInterface::loadFile] data/actions/scripts/other/arenalever.lua:8: '}' expected (to close '{' at line 1) near 'destination'
[26/04/2010 14:39:31] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/other/arenalever.lua)
[26/04/2010 14:39:31] data/actions/scripts/other/arenalever.lua:8: '}' expected (to close '{' at line 1) near 'destination'
 
Thanks But Why level 100?:S put like lvl 25 and you think is possible when the other guy dies then the winner goes up and dont stay down on the arena i hope you understand me..

You can change the level yourself. <_<

Fixed Config
Code:
local config = {
	daily = "no", -- allow only one enter per day?
	level = 100,
	stand = {
		{x = 100, y = 100, z = 7}, -- Player 1 Stands
		{x = 100, y = 100, z = 7} -- Player 2 Stands
	},
	destination = {
		{x = 100, y = 100, z = 7}, -- Player 1 Goes
		{x = 100, y = 100, z = 7} -- Player 2 Goes
	}
}
 
Back
Top