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

Lock summon in area

Saper1995

Technologic
Joined
Jul 11, 2009
Messages
104
Reaction score
3
Location
Poland
Hi guys!. Is there any function like setPlayerSummon = 2? I'm trying to make pvp arena and want to lock capability to summon any monster there. Is any solution for it?

When summon kill player on arena then owner of that summon and other summon stay in locked arena but this lasthit summon is teleported to winner position. I'm using deathlist[1] so that's the problem

TFS 0.4, 8.6 Tibia
 
Basics, in config.lua
Code:
maxPlayerSummons = 2
For more advanced summon count control:
Code:
        local summons = getCreatureSummons(cid)
        if(not summons or next(summons) == nil) then
            return false
        else
            if #summons >= 2 then
                blablabla
            end
        end

Second answer, you have to edit your arena script to check for summons:
Code:
local master = getCreatureMaster(killer)
if killer ~= master then
    killer = master
end
doTeleportKillerBLABLALBA...
 
Hi guys!. Is there any function like setPlayerSummon = 2? I'm trying to make pvp arena and want to lock capability to summon any monster there. Is any solution for it?

When summon kill player on arena then owner of that summon and other summon stay in locked arena but this lasthit summon is teleported to winner position. I'm using deathlist[1] so that's the problem

TFS 0.4, 8.6 Tibia
like andu say, if winner is summon,
getCreatureMaster, winner = master
 
But how to disable summoning in certain area?
This is a part of my arena script:

There should be something like
setPlayerSummon(player1.uid,2)
setPlayerSummon(player2.uid,2)

after doTeleportThing(player1.uid,nplayer1pos)

Code:
for arenax = 1033,1037 do
                                                  for arenay = 1037,1041 do
                                                            arenapos = {x=arenax, y=arenay, z=5, stackpos=253}
                                                            arenacreature = getThingfromPos(arenapos)
                                                            if isPlayer(arenacreature.uid) == 1 then
                                                                      doPlayerSendCancel(cid,"You must wait until current duel finish.")
                                                                      return 1
                                                            end
                                                  end
                                        end
                                        nplayer1pos = {x = 1033, y = 1041, z = 5}
                                        nplayer2pos = {x = 1037, y = 1037, z = 5}
                                        doSendMagicEffect(player1pos,2)
                                        doSendMagicEffect(player2pos,2)
                                        doTeleportThing(player1.uid,nplayer1pos)
                                        doTeleportThing(player2.uid,nplayer2pos)
                                        doSendMagicEffect(nplayer1pos,10)
                                        doSendMagicEffect(nplayer2pos,10)
                                        doPlayerSendTextMessage(player1.uid,22,"You fight against " .. getCreatureName(player2.uid) .. " for 5 minutes.")
                                        doPlayerSendTextMessage(player2.uid,22,"You fight against " .. getCreatureName(player1.uid) .. " for 5 minutes.")
                                        setPlayerStorageValue(player1.uid, startstorage, os.time())
                                        setPlayerStorageValue(player2.uid, startstorage, os.time())
                                        addEvent(EndFight, kicktime * 60 * 1000)
 
Ye, sure, but where is this file???
Code:
    <instant name="Summon Creature" words="utevo res" lvl="25" params="1" exhaustion="2000" needlearn="0" event="function" value="summonMonster">

There is no lua file to set tile for summons :/
This should be in summon lua but how to get him?.

Code:
function onCastSpell(cid, var)
local fromPosition = {x = 1033,y=1037,z=5} -- top left cornor of the playground
local toPosition = {x = 1038,y=1042,z=5} -- bottom right cornor of the playground
if isInArea(getThingPosition(cid), fromPosition, toPosition) then
return false, doPlayerSendCancel(cid, "You're not allowed to use it here.")
end
return doCombat(cid, combat, var)
end
 
Last edited:
In XML change:
Code:
... event="function" value="summonMonster">
With:
Code:
... script="summonMonster.lua">
And make new lua file with your spell.

Like:
Code:
onCastSpell(cid, param)
if inarea(blablabla)
  return false
else
  dosummon(param)
  blablabla
 
Back
Top