Ray Rewind
Doctor
Pvp Arena ain't working
The arena doesn't work it says you need 2 players to duell.
action script
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local firstPlayerPosition = {x = 889, y = 1025, z = 7, stackpos = STACKPOS_TOP_CREATURE}
local getFirstPlayer = getThingFromPos(firstPlayerPosition)
local secondPlayerPosition = {x = 889, y = 1027, z = 7, stackpos = STACKPOS_TOP_CREATURE}
local getSecondPlayer = getThingFromPos(secondPlayerPosition)
local arenaLevel = 100
local newFirstPlayerPosition = {x = 881, y = 1025, z = 7}
local newSecondPlayerPosition = {x = 886, y = 1025, z = 7}
if(item.uid == 7005) then
if(getFirstPlayer.itemid > 0 and getSecondPlayer.itemid > 0) then
if(getPlayerLevel(getFirstPlayer.uid) >= arenaLevel and getPlayerLevel(getSecondPlayer.uid) >= arenaLevel) then
for arenax = 880, 1022 do
for arenay = 887, 1029 do
local arenaPosition = {x=arenax, y=arenay, z=7, stackpos=253}
local arenaCreature = getThingFromPos(arenaPosition)
if(arenaCreature.itemid > 0 and isPlayer(arenaCreature.uid) == FALSE) then
if(isMonster(arenaCreature.uid) == TRU[ATTACH=full]23752[/ATTACH] E) then
doRemoveCreature(arenaCreature.uid)
end
elseif(arenaCreature.itemid > 0 and isPlayer(arenaCreature.uid) == TRUE) then
doPlayerSendCancel(cid, "Wait for current duel to end.")
return TRUE
end
end
end
if(item.itemid == 1945) then
doTransformItem(item.uid, 1946)
elseif(item.itemid == 1946) then
doTransformItem(item.uid, 1945)
end
doSendMagicEffect(firstPlayerPosition, 2)
doSendMagicEffect(secondPlayerPosition, 2)
doTeleportThing(getFirstPlayer.uid, newFirstPlayerPosition)
doTeleportThing(getSecondPlayer.uid, newSecondPlayerPosition)
doSendMagicEffect(newFirstPlayerPosition, 10)
doSendMagicEffect(newSecondPlayerPosition, 10)
doPlayerSendTextMessage(getFirstPlayer.uid, 18, "FIGHT!")
doPlayerSendTextMessage(getSecondPlayer.uid, 18, "FIGHT!")
else
doPlayerSendCancel(cid, "Both fighters must have level 100.")
end
else
doPlayerSendCancel(cid, "You need 2 players for a duel.")
end
end
return TRUE
end
movements
Code:
function onStepIn(cid, item, fromPosition, itemEx, toPosition)
local playerPosition = getPlayerPosition(cid)
local newPosition = {x=1038, y=988, z=8}
local gethp = getCreatureHealth(cid)
local getmaxhp = getCreatureMaxHealth(cid)
local add = getmaxhp - gethp
if(item.actionid == 7709) then
getThingfromPos(playerPosition)
doSendMagicEffect(playerPosition,2)
doTeleportThing(cid,newPosition)
doSendMagicEffect(newPosition,10)
doCreatureAddHealth(cid, add, TRUE)
doRemoveCondition(cid, CONDITION_INFIGHT)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have escaped.")
end
return TRUE
end
Code:
function onStepIn(cid, item, pos)
local tpout = {x=891, y=1026, z=7}
local level = 1
if isCreature(cid) == TRUE then
if getPlayerLevel(cid) > level then
doTeleportThing(cid, tpout)
doSendMagicEffect(getPlayerPosition(cid), 10)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You left the arena.")
return 0
end
else
return 0
end
return true
end