• 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 pvp (proszę pomocy)

nashein

New Member
Joined
Dec 20, 2008
Messages
24
Reaction score
0
Mam problem.
Silnik : TFS
Version : 0.3.3
Tibia : 8.41/8.42

Mam 3 skrypty do areny pvp i ..

Skrypt nr. 1 -

Code:
local arena = {
    frompos = {x=187, y=406, z=10},
    topos = {x=198, y=412, z=10},
    exit = {x=185, y=409, z=9} 
}

local function exitArena(p)
    doSendMagicEffect(p.exit, 10)
    doTeleportThing(p.cid, p.exit, FALSE)
    doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
end

function onPrepareDeath(cid, killer)
    if isInArea(getPlayerPosition(cid), arena.frompos, arena.topos) then
	doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
        addEvent(exitArena, 100, {cid=cid, exit=arena.exit})
    end
    return FALSE
end

function isInArea(pos, fromPos, toPos)
    if pos.x >= fromPos.x and pos.x <= toPos.x then
        if pos.y >= fromPos.y and pos.y <= toPos.y then
            if pos.z >= fromPos.z and pos.z <= toPos.z then
                return true
            end
        end
    end
    return false
end

Skrypt nr. 2 -

Code:
local arena = {
  frompos = {x=31950, y=32068, z=0},
  topos = {x=32192, y=32256, z=15},
  exit = {x=32097, y=32219, z=7} 
}

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
  if isPlayer(cid) == TRUE then
    if isInArea(getPlayerPosition(cid), arena.frompos, arena.topos) then
      if doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE) == TRUE then
        if doTeleportThing(cid, arena.exit) == TRUE then
          doSendMagicEffect(arena.exit, 10)
          doPlayerSendTextMessage(mostDamageKiller,MESSAGE_STATUS_CONSOLE_BLUE,'[ARENA] You have defeated '..getPlayerName(cid)..'!')
          doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'[ARENA] You where defeated by '..getPlayerName(mostDamageKiller)..'!')
          return FALSE
        end
      end
    end
  end
  return TRUE
end

Skrypt nr. 3 -

Code:
local arenapos = {fromx=120, fromy=32, tox=129, toy=39, z=9}  
local exit = {x=125, y=30, z=9} 

function onPrepareDeath(cid, killer) 
    for x=arenapos.fromx, arenapos.tox do  
        for y=arenapos.fromy, arenapos.toy do  
            if comparePos(getPlayerPosition(cid), {x=x, y=y, z=arenapos.z}) then 
                doTeleportThing(cid, exit, TRUE) 
                doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) 
                return TRUE 
            end  
        end  
    end  
    return FALSE  
end

1) Nie wiem, który wybrać, który będzie mi działał.
2) Wkleić go muszę do actions\scripts ?
Jeśli tak to jaką linijkę muszę dodać do actions.xml

Proszę o pomoc.

btw. Jeśli żaden ze skryptów powyżej nie będzie działać proszę o poprawienie.
 
Ja bym wybral ten 3., a dodac je musisz do creaturescripts ;>
 
Aha, a jaką linijkę mam dodać ?

<event type="XXX" name="XXX" event="script" value="arena.lua"/>


XXX - nie wiem co tu wpisać xD
 
Aha,a pokażesz dokładnie gdzie ten przycisk jest? =D repucik poleci.

Aha to chojrak powiedz mi jaką dodać linijke w creaturescripts.xml

Bo jak mówisz, że tam mam dodać skrypt tzn. do creatuescrips/scripts to jaką muszę dodać linijkę proszę powiedz.
 
Last edited by a moderator:
Code:
<event type="preparedeath" name="arena" event="script" value="arena.lua"/>
 
Ok mam nadzieje, ze zadziala.

Mozecie dac skrypt na dzwignie na 2 osoby od 20 lvla ? =d
 
Zapewne taki znajdziesz. Jesli nie - mozesz edytowac skrypt na annihilatora ;> Jesli beda jakies bledy - pisz :)
 
up ale wtedy jak padniesz (nic nie tracisz) to cie tepnie do temple i trzeba biegać i jeszcze ma się spowrotem full many można tak m lvl robić ^^
 
Back
Top