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

Lua Fixing MoD

_Aion_

Nothing Else
Joined
Jan 19, 2010
Messages
400
Solutions
4
Reaction score
10
Location
Jequie,Bahia,Brazil
Hello.
Someone can help me?
I'm trying put new function on this mod "isWalkable".
No erros on console.
No summon monsters
PS: withou "isWalkable" works fine, but give erros "cannot summon XXXX"
I'm using OTX 2.x for 8.60

here my mod

XML:
<?xml version="1.0" encoding="UTF-8"?>  
<mod name="Automatic Raids" version="1.0" author="Vodkart And xotservx" contact="xtibia.com" enabled="yes">  
<config name="raids_func"><![CDATA[
days = {
["19:48"] = {nome = "Shenlong EVENTO BOSS 1 horda", pos = {fromPosition = {x=240, y=662, z=7},toPosition = {x=317, y=723, z=7}},m = {"200 Red Ribbon Force", "12 Red Ribbon Machine"}, Time = 15},
}

function isWalkable(pos)-- by Nord / editado por Omega
    if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then
        return false
    elseif isCreature(getTopCreature(pos).uid) then
        return false
    elseif getTileInfo(pos).protection then
        return false
    elseif hasProperty(getThingFromPos(pos).uid, 3) or hasProperty(getThingFromPos(pos).uid, 7) then
        return false
    end
return true
end

]]></config>    
<globalevent name="AutomaticRaids" interval="60000" event="script"><![CDATA[
domodlib('raids_func')
function onThink(interval, lastExecution)  
if days[os.date("%A")] then
hours = tostring(os.date("%X")):sub(1, 5)        
tb = days[os.date("%A")][hours]
if tb then              
function removeCreature(tb)
for x = ((tb.pos.fromPosition.x)-10), ((tb.pos.toPosition.x)+10) do
for y = ((tb.pos.fromPosition.y)-10), ((tb.pos.toPosition.y)+10) do
local m = getTopCreature({x=x, y=y, z= tb.pos.fromPosition.z}).uid
if m ~= 0 and isMonster(m) then
doRemoveCreature(m)
end
end
end
end
doBroadcastMessage("A invasão de " .. tb.nome .. " começou")
if isWalkable({x=x, y=y, z=pos.z}) then
for _,x in pairs(tb.m) do
for s = 1, tonumber(x:match("%d+")) do
pos = {x = math.random(tb.pos.fromPosition.x, tb.pos.toPosition.x), y = math.random(tb.pos.fromPosition.y, tb.pos.toPosition.y), z = tb.pos.fromPosition.z}
doSummonCreature(x:match("%s(.+)"), pos)
end
end
addEvent(removeCreature, tb.Time*60*1000, tb)
end
end
return true
end
end
]]></globalevent>
</mod>
 
ave you solved the error of otx 2 regarding to poison and fire healing conditions?
the bug consists in if you are fired or poisoned and you are wlking and you use exana flam or exana pox it doesn't works atleaast you stop walking
 
Back
Top