• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

PANDORA BOX(mods)

bartol150

New Member
Joined
Oct 16, 2013
Messages
18
Reaction score
0
I have that problem.

[19:25:35.855] > Loading pandorabox.xml...[Error - ScriptManager::loadFromXml] Cannot load mod pandorabox.xml
[19:25:35.855] Line: 1, Info: Start tag expected, '<' not found

script:
Code:
<mod name="Pandora Box" version="1.2" author="Bobciu" contact="[email protected]" enabled="yes">
<config name="pandoraBox_conf"><![CDATA[
pandoraBox = {
monstersPositions = {
leftTopCorner = {x=1002,y=978,z=7},
rightBottomCorner = {x=1016,y=974,z=7}
},
pandoraBoxAccesToUseCommand = 4,
--box config
boxId = 9661,
timeOnPutBox = 10, --in minutes
chance = 100,
pandoraBoxPosition = {x=1008,y=975,z=7},

--monsters config
monstersName = {'dragon lord',4,'serpent spawn',8,'Grim Reaper',6,'demon',5,'Hand Of Cursed Fate',11,'dragon',10,'Blightwalker',4,
'Fury',1,'Hellhound',2,'Undead Dragon',6,'Juggernaut',5,'Draken Elite',4,
'diabolic imp',10,'fire elemental',4,'Medusa',9,'Lost Soul',1,'Hellfire Fighter',1,'Defiler',3,'Draken Abomination',2}, --'name', chance, 'name1', chance1
monstersSpawnCount = {80,110}, --{from, to}

--waves config
wavesCount = {9,11}, --{from, to}
timeBetweenWaves = 90, --in seconds

timeOnKillAllMonsters = 13, --in minutes
timeOnGetRewards = 20, --in seconds
bossPositionToSamePandoraBox = true,
bossName = 'Pandora',
pandoraGuards = 'fallen island warlock',
pandoraGuardsCount = 10,
expRateValue = 0.25,
}

pandoraBoxRewards = {
--[vocationId] = {itemid, count, itemid1, count1, ...}
[1] = {2160, 25, 9969, 1, 9932, 1}, --sorc
[2] = {2160, 25, 9969, 1, 9932, 1}, --druid
[3] = {2160, 25, 9969, 1, 9932, 100}, --pall
[4] = {2160, 25, 9969, 1, 9932, 1}, --knight
[5] = {2160, 30, 9969, 1, 9932, 1}, --ms
[6] = {2160, 30, 9969, 1, 9932, 1}, --ed
[7] = {2160, 30, 9969, 1, 9932, 1}, --rp
[8] = {2160, 30, 9969, 1, 9932, 1}, --ek
}

function getArea(pandoraBox)
local LTCx, LTCy, LTCz = pandoraBox.monstersPositions.leftTopCorner.x, pandoraBox.monstersPositions.leftTopCorner.y, pandoraBox.monstersPositions.leftTopCorner.z
local RBCx, RBCy, RBCz = pandoraBox.monstersPositions.rightBottomCorner.x, pandoraBox.monstersPositions.rightBottomCorner.y, pandoraBox.monstersPositions.rightBottomCorner.z
local centerPos, rangex, rangey = {x=(LTCx+RBCx)/2,y=(LTCy+RBCy)/2,z=(LTCz+RBCz)/2}, math.abs(RBCx-LTCx), math.abs(RBCy-LTCy)
return centerPos, rangex, rangey
end

function isWalkable(pos, creature, proj, pz)
if getTileThingByPos({x=pos.x,y=pos.y,z=pos.z,stackpos=0}).itemid == 0 then return false end
if getTopCreature(pos).uid > 0 and creature then return false end
if getTileInfo(pos).protection and pz then return false, true end
local n = not proj and 3 or 2
for i = 0, 255 do
pos.stackpos = i
local tile = getTileThingByPos(pos)
if tile.itemid ~= 0 and not isCreature(tile.uid) then
if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
return false
end
end
end
return true
end

function checkPositions(fromPos, toPos, nb)
local pos = {x=math.random(fromPos.x,toPos.x), y=math.random(fromPos.y,toPos.y), z=math.random(fromPos.z,toPos.z)}
if isWalkable(pos, true, true, true) then
return pos
end
return (nb < 200 and checkPositions(fromPos, toPos, nb+1) or pos)
end

function setMonster(pandoraBox)
for i = 1, #pandoraBox.monstersName/2 do
local pos = checkPositions(pandoraBox.monstersPositions.leftTopCorner, pandoraBox.monstersPositions.rightBottomCorner, 0)
if pos and math.random(100000) <= pandoraBox.monstersName[i*2]*1000 then
local mon = doCreateMonster(pandoraBox.monstersName[i*2-1], pos, false, false, false)
return (isCreature(mon) and doCreatureSetStorage(mon, 1000, 1) or true)
end
end
return setMonster(pandoraBox)
end

function setPandoraBoxMonsters(pandoraBox)
for j = 1, math.random(pandoraBox.wavesCount[1], pandoraBox.wavesCount[2]) do
addEvent(function()
doBroadcastMessage('Next wave is raid on the city! Beware mortals, death come for you!')
for i = 1, math.random(pandoraBox.monstersSpawnCount[1], pandoraBox.monstersSpawnCount[2]) do
setMonster(pandoraBox)
end return true end,
(j == 1 and 1000 or pandoraBox.timeBetweenWaves * 1000 * (j-1)),
pandoraBox
)
end
return true
end

function setPandoraBox(pandoraBox)
if getStorage(5000) ~= -1 then
return addEvent(setPandoraBox, pandoraBox.timeOnPutBox * 60 * 1000, pandoraBox) end
if math.random(100000) <= pandoraBox.chance*1000 then
doSetStorage(5000, 0)
local item = doCreateItem(pandoraBox.boxId, pandoraBox.pandoraBoxPosition)
doItemSetAttribute(item, 'uid', 2000)
doItemSetAttribute(item, 'name', 'Pandora Box')
return doBroadcastMessage('Pandora Box is appeared somewhere in the city!')
end
return doSetStorage(5000, -1) and addEvent(setPandoraBox, pandoraBox.timeOnPutBox * 60 * 1000, pandoraBox)
end

function checkMonsters(pandoraBox, n)
local centerPos, rangex, rangey = getArea(pandoraBox)
if getSpectators(centerPos, rangex, rangey) then
for _, v in ipairs(getSpectators(centerPos, rangex, rangey)) do
if isMonster(v) and getCreatureStorage(v, 1000) == 1 then
for _, k in ipairs(getPlayersOnline()) do
if n == 0 then
doBroadcastMessage('Experience rate is to decreased by '.. pandoraBox.expRateValue * 100 ..' percent and not grow, until the evil from Pandora Box walk on the city.')
n = 60
end
doPlayerSetExperienceRate(k, pandoraBox.expRateValue)
end
return addEvent(checkMonsters, 5000, pandoraBox, n - 1)
end
end
end
doBroadcastMessage('Evil from Pandora Box is defeated! '..pandoraBox.bossName..' in his own person be came to the city for revenage!')
local pand = doCreateMonster(pandoraBox.bossName, (pandoraBox.bossPositionToSamePandoraBox and pandoraBox.pandoraBoxPosition or checkPositions(pandoraBox.monstersPositions.leftTopCorner, pandoraBox.monstersPositions.rightBottomCorner, 0)), false, false, false)
local pos = getThingPos(pand)
for i = 1, pandoraBox.pandoraGuardsCount do
pos.x = pos.x + math.random(-4,4)
pos.y = pos.y + math.random(-4,4)
doCreateMonster(pandoraBox.pandoraGuards, pos, false, false, false)
end
return (isMonster(pand) and registerCreatureEvent(pand, 'pandoraDeath') or false)
end
]]></config>

<event type="death" name="pandoraDeath" event="script"><![CDATA[
domodlib('pandoraBox_conf')
function onDeath(cid)
if getTileItemById(pandoraBox.pandoraBoxPosition, pandoraBox.boxId).uid == 2000 then
item = getTileItemById(pandoraBox.pandoraBoxPosition, pandoraBox.boxId)
end
addEvent(function()
doSetStorage(5000, -1)
doBroadcastMessage('Pandora Box is disappeared from the world!')
if getTileItemById(pandoraBox.pandoraBoxPosition, pandoraBox.boxId).uid == 2000 then
return doRemoveItem(getTileItemById(pandoraBox.pandoraBoxPosition, pandoraBox.boxId).uid)
end
return true end,
pandoraBox.timeOnGetRewards * 1000,
pandoraBox
)
return item and doItemSetAttribute(item.uid, 'pandoraBox', 1000) and doBroadcastMessage('The ancient evil has been defeated! The Pandora\'s Box are the reward for each, but only for '..timeOnGetRewards..' seconds!') or true
end
]]></event>

<action uniqueid="2000" event="script"><![CDATA[
domodlib('pandoraBox_conf')
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == pandoraBox.boxId and getItemAttribute(item.uid, 'pandoraBox') == nil then
doItemSetAttribute(item.uid, 'pandoraBox', 500)
addEvent(checkMonsters, pandoraBox.timeOnKillAllMonsters * 1000 * 60, pandoraBox, 0)
return setPandoraBoxMonsters(pandoraBox)
elseif item.itemid == pandoraBox.boxId and getItemAttribute(item.uid, 'pandoraBox') == 1000 then
if getPlayerStorageValue(cid, 150) ~= -1 then
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'It\'s empty.') end
if pandoraBoxRewards[getPlayerVocation(cid)] then
doPlayerSetStorageValue(cid, 150, 0)
msg = 'You have found '
for i = 1, #pandoraBoxRewards[getPlayerVocation(cid)]/2 do
msg = msg .. getItemNameById(pandoraBoxRewards[getPlayerVocation(cid)][i*2-1]) .. (i < #pandoraBoxRewards[getPlayerVocation(cid)]/2-1 and ', ' or i == #pandoraBoxRewards[getPlayerVocation(cid)]/2-1 and ' and ' or '.')
doPlayerAddItem(cid, pandoraBoxRewards[getPlayerVocation(cid)][i*2-1], pandoraBoxRewards[getPlayerVocation(cid)][i*2])
end
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg)
end
end
return false
end
]]></action>

<globalevent name="pandoraTime" time="19:00" event="script"><![CDATA[
domodlib("pandoraBox_conf")
function onTime(time)
return doSetStorage(5000, -1) and setPandoraBox(pandoraBox)
end
]]></globalevent>

<talkaction words="!pandoraBox" event="script"><![CDATA[
domodlib('pandoraBox_conf')
function onSay(cid, words, param, channel)
return getPlayerAccess(cid) >= pandoraBox.pandoraBoxAccesToUseCommand and doSetStorage(5000, -1) and setPandoraBox(pandoraBox) or true
end
]]></talkaction>
</mod>
 
This is my pandorabox.xml in mods. Im have tfs 0.4 and Tibia 8.6.

Code:
<?xml version='1.0' encoding='UTF-8'?>
<mod name="pandoraBox" version="0.1.2" author="Oskar" contact="http://otibia.pl/members/oskar-5/" enabled="yes">
    <config name="pandoraBox_conf"><![CDATA[
    dateToStart = {
    ['monday'] = false,
    ['tuesday'] = true,
    ['wednesday'] = false,
    ['thursday'] = false,
    ['friday'] = true,
    ['saturday'] = true,
    ['sunday'] = false
    }
   
    eventDate = {}
    for k, v in pairs(dateToStart) do
    if v then
    table.insert(eventDate, k)
    end
    end
   
    pandoraBox = {
    monstersPositions = {
    leftTopCorner = {x=1004,y=972,z=7},
    rightBottomCorner = {x=1013,y=980,z=7}
    },
    pandoraBoxAccesToUseCommand = 6,
    --box config
    boxId = 9661,
    timeOnPutBox = 5, --in minutes
    chance = 100,
    pandoraBoxPosition = {x=1010,y=976,z=7},
   
    --monsters config
    monstersName = {'slime',4,'dragon',25}, --'name', chance, 'name1', chance1
    monstersSpawnCount = {80,110}, --{from, to}
   
    --waves config
    wavesCount = {9,11}, --{from, to}
    timeBetweenWaves = 90, --in seconds
   
    timeOnKillAllMonsters = 15, --in minutes
    timeOnGetRewards = 25, --in seconds
    bossPositionToSamePandoraBox = true,
    bossName = 'Pandora',
    pandoraGuards = 'fallen island warlock',
    pandoraGuardsCount = 10,
    expRateValue = 0.25,
    }
   
    pandoraBoxRewards = {
    --[vocationId] = {itemid, count, itemid1, count1, ...}
    [1] = {2160, 25, 7898, 1, 7899, 1}, --sorc
    [2] = {2160, 25, 7884, 1, 7897, 1}, --druid
    [3] = {2160, 25, 8891, 1, 7368, 100}, --pall
    [4] = {2160, 25, 8889, 1, 5741, 1}, --knight
    [5] = {2160, 30, 8868, 1, 8867, 1}, --ms
    [6] = {2160, 30, 8866, 1, 8869, 1}, --ed
    [7] = {2160, 30, 8888, 1, 2537, 1}, --rp
    [8] = {2160, 30, 8881, 1, 2522, 1}, --ek
    }
   
    function getArea(pandoraBox)
    local LTCx, LTCy, LTCz = pandoraBox.monstersPositions.leftTopCorner.x, pandoraBox.monstersPositions.leftTopCorner.y, pandoraBox.monstersPositions.leftTopCorner.z
    local RBCx, RBCy, RBCz = pandoraBox.monstersPositions.rightBottomCorner.x, pandoraBox.monstersPositions.rightBottomCorner.y, pandoraBox.monstersPositions.rightBottomCorner.z
    local centerPos, rangex, rangey = {x=(LTCx+RBCx)/2,y=(LTCy+RBCy)/2,z=(LTCz+RBCz)/2}, math.abs(RBCx-LTCx), math.abs(RBCy-LTCy)
    return centerPos, rangex, rangey
    end
   
    function isWalkable(pos, creature, proj, pz)
    if getTileThingByPos({x=pos.x,y=pos.y,z=pos.z,stackpo s=0}).itemid == 0 then return false end
    if getTopCreature(pos).uid > 0 and creature then return false end
    if getTileInfo(pos).protection and pz then return false, true end
    local n = not proj and 3 or 2
    for i = 0, 255 do
    pos.stackpos = i
    local tile = getTileThingByPos(pos)
    if tile.itemid ~= 0 and not isCreature(tile.uid) then
    if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
    return false
    end
    end
    end
    return true
    end
   
    function checkPositions(fromPos, toPos, nb)
    local pos = {x=math.random(fromPos.x,toPos.x), y=math.random(fromPos.y,toPos.y), z=math.random(fromPos.z,toPos.z)}
    if isWalkable(pos, true, true, true) then
    return pos
    end
    return (nb < 200 and checkPositions(fromPos, toPos, nb+1) or pos)
    end
   
    function setMonster(pandoraBox)
    for i = 1, #pandoraBox.monstersName/2 do
    local pos = checkPositions(pandoraBox.monstersPositions.leftTo pCorner, pandoraBox.monstersPositions.rightBottomCorner, 0)
    if pos and math.random(100000) <= pandoraBox.monstersName[i*2]*1000 then
    local mon = doCreateMonster(pandoraBox.monstersName[i*2-1], pos, false)
    return (isCreature(mon) and doCreatureSetStorage(mon, 1000, 1) or true)
    end
    end
    return setMonster(pandoraBox)
    end
   
    function setPandoraBoxMonsters(pandoraBox)
    for j = 1, math.random(pandoraBox.wavesCount[1], pandoraBox.wavesCount[2]) do
    addEvent(function()
    doBroadcastMessage('Next wave is raid on the city! Beware mortals, death come for you!')
    for i = 1, math.random(pandoraBox.monstersSpawnCount[1], pandoraBox.monstersSpawnCount[2]) do
    addEvent(setMonster, i * 50, pandoraBox)
    end return true end,
    (j == 1 and 1000 or pandoraBox.timeBetweenWaves * 1000 * (j-1)),
    pandoraBox)
    end
    return true
    end
   
    function setPandoraBox(pandoraBox)
    if getStorage(5000) ~= -1 then
    return addEvent(setPandoraBox, pandoraBox.timeOnPutBox * 60 * 1000, pandoraBox)
    end
    if math.random(100000) <= pandoraBox.chance*1000 then
    doSetStorage(5000, 0)
    local item = doCreateItem(pandoraBox.boxId, pandoraBox.pandoraBoxPosition)
    doItemSetAttribute(item, 'uid', 2000)
    doItemSetAttribute(item, 'name', 'Pandora Box')
    return doBroadcastMessage('Pandora Box is appeared somewhere in the city!')
    end
    return doSetStorage(5000, -1) and addEvent(setPandoraBox, pandoraBox.timeOnPutBox * 60 * 1000, pandoraBox)
    end
   
    function checkMonsters(pandoraBox, n)
    local centerPos, rangex, rangey = getArea(pandoraBox)
    local newSpectators = getSpectators(centerPos, rangex, rangey)
    if newSpectators then
    for _, v in ipairs(newSpectators) do
    if isMonster(v) and getCreatureStorage(v, 1000) == 1 then
    for _, k in ipairs(getPlayersOnline()) do
    if n == 0 then
    doBroadcastMessage('Experience rate is to decreased by '.. pandoraBox.expRateValue * 100 ..' percent and not grow, until the evil from Pandora Box walk on the city.')
    n = 60
    end
    doPlayerSetExperienceRate(k, pandoraBox.expRateValue)
    end
    return addEvent(checkMonsters, 5000, pandoraBox, n - 1)
    end
    end
    end
    doBroadcastMessage('Evil from Pandora Box is defeated! '..pandoraBox.bossName..' in his own person be came to the city for revenage!')
    local pand = doCreateMonster(pandoraBox.bossName, (pandoraBox.bossPositionToSamePandoraBox and pandoraBox.pandoraBoxPosition or checkPositions(pandoraBox.monstersPositions.leftTo pCorner, pandoraBox.monstersPositions.rightBottomCorner, 0)), false)
    local pos = getThingPos(pand)
    for i = 1, pandoraBox.pandoraGuardsCount do
    pos.x = pos.x + math.random(-4,4)
    pos.y = pos.y + math.random(-4,4)
    doCreateMonster(pandoraBox.pandoraGuards, pos, false)
    end
    return (isMonster(pand) and registerCreatureEvent(pand, 'pandoraDeath') or false)
    end
   
    function isCorrectDate(days, months, years)
    local years, months, days = years or {os.date('%Y')}, months or {os.date('%B')}, days or {os.date('%A')}
    local year, month, day = os.date('%Y'), os.date('%B'), os.date('%A')
    if isInArray(years, year) and isInArray(months, month:lower()) and isInArray(days, day:lower()) then
    return true
    end
    return false
    end
    ]]>
    </config>
   
    <event type="death" name="pandoraDeath" event="script"><![CDATA[
    domodlib('pandoraBox_conf')
    function onDeath(cid)
    if getTileItemById(pandoraBox.pandoraBoxPosition, pandoraBox.boxId).uid == 2000 then
    item = getTileItemById(pandoraBox.pandoraBoxPosition, pandoraBox.boxId)
    end
    for _, k in ipairs(getPlayersOnline()) do
    doPlayerSetExperienceRate(k, 1)
    end
    addEvent(function()
    doSetStorage(5000, -1)
    doBroadcastMessage('Pandora Box is disappeared from the world!')
    if getTileItemById(pandoraBox.pandoraBoxPosition, pandoraBox.boxId).uid == 2000 then
    return doRemoveItem(getTileItemById(pandoraBox.pandoraBox Position, pandoraBox.boxId).uid)
    end
    return true end,
    pandoraBox.timeOnGetRewards * 1000,
    pandoraBox
    )
    return item and doItemSetAttribute(item.uid, 'pandoraBox', 1000) and doBroadcastMessage('The ancient evil has been defeated! The Pandora\'s Box are the reward for each, but only for '..timeOnGetRewards..' seconds!') or true
    end
    ]]>
    </event>
   
    <action uniqueid="2000" event="script"><![CDATA[
    domodlib('pandoraBox_conf')
    function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == pandoraBox.boxId and not getItemAttribute(item.uid, 'pandoraBox') then
    doItemSetAttribute(item.uid, 'pandoraBox', 500)
    addEvent(checkMonsters, pandoraBox.timeOnKillAllMonsters * 1000 * 60, pandoraBox, 0)
    return setPandoraBoxMonsters(pandoraBox)
    elseif item.itemid == pandoraBox.boxId and getItemAttribute(item.uid, 'pandoraBox') == 1000 then
    if getCreatureStorage(cid, 150) ~= -1 then
    return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'It\'s empty.')
    end
    if pandoraBoxRewards[getPlayerVocation(cid)] then
    doCreatureSetStorage(cid, 150, 0)
    msg = 'You have found '
    for i = 1, #pandoraBoxRewards[getPlayerVocation(cid)]/2 do
    msg = msg .. getItemNameById(pandoraBoxRewards[getPlayerVocation(cid)][i*2-1]) .. (i < #pandoraBoxRewards[getPlayerVocation(cid)]/2-1 and ', ' or i == #pandoraBoxRewards[getPlayerVocation(cid)]/2-1 and ' and ' or '.')
    doPlayerAddItem(cid, pandoraBoxRewards[getPlayerVocation(cid)][i*2-1], pandoraBoxRewards[getPlayerVocation(cid)][i*2])
    end
    return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg)
    end
    end
    return false
    end
    ]]>
    </action>
   
    <globalevent name='pandoraTime' time='20:00' event='script'><![CDATA[
    domodlib('TeamBattleIslandEvent_conf')
    function onTime(time)
    if isCorrectDate(eventDate) then
    return doSetStorage(5000, -1) and setPandoraBox(pandoraBox)
    end
    return true
    end
    ]]>
    </globalevent>
   
    <talkaction words="!pandoraBox" event="script"><![CDATA[
    domodlib('pandoraBox_conf')
    function onSay(cid, words, param, channel)
    return getPlayerAccess(cid) >= pandoraBox.pandoraBoxAccesToUseCommand and doSetStorage(5000, -1) and setPandoraBox(pandoraBox)
    end
    ]]>
    </talkaction>
    </mod>
 
Back
Top