• 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 Annihilator script, can't change monster

dixers

Owner of an OT
Joined
May 22, 2010
Messages
22
Reaction score
1
I got the script working with demons, but what do I need to change in order to get for example Ferumbras instead of Demons?

Here is the script:
Code:
local config = {
        daily = "no", -- allow only one team to enter per day? (like in global Tibia)
        level = 100,
        storage = 30015,
        room = {
                {x = 339, y = 287, z = 7},
                {x = 342, y = 291, z = 7}
        },
        stand = {
                {x = 328, y = 289, z = 7},
                {x = 327, y = 289, z = 7},
                {x = 326, y = 289, z = 7},
                {x = 325, y = 289, z = 7}
        },
        destination = {
                {x = 342, y = 289, z = 7},
                {x = 341, y = 289, z = 7},
                {x = 340, y = 289, z = 7},
                {x = 339, y = 289, z = 7}
        },
        wall = {
                {x = 345, y = 289, z = 7}
        },
        rocks = {
                {x = 344, y = 289, z = 7},
                {x = 343, y = 289, z = 7},
                {x = 342, y = 289, z = 7},
                {x = 341, y = 289, z = 7},
                {x = 340, y = 289, z = 7},
                {x = 339, y = 289, z = 7},
                {x = 339, y = 287, z = 7},
                {x = 341, y = 287, z = 7},
                {x = 340, y = 291, z = 7},
                {x = 342, y = 291, z = 7}
        },
        demons = {
                {x = 344, y = 289, z = 7},
                {x = 343, y = 289, z = 7},
                {x = 340, y = 291, z = 7},
                {x = 342, y = 291, z = 7},
                {x = 339, y = 287, z = 7},
                {x = 341, y = 287, z = 7}
        }
}
local function areaCheck(area)
        local monsters, players = {}, {}
        for x = config.room[1].x, config.room[2].x do
                for y = config.room[1].y, config.room[2].y do
                        local t = getThingFromPos({x=x, y=y, z=config.room[1].z, stackpos=253})
                        if t.uid > 0 then
                                if isPlayer(t.uid) then
                                        table.insert(players, t.uid)
                                elseif isMonster(t.uid) then
                                        table.insert(monsters, t.uid)
                                end
                        end
                end
        end
        return monsters, players
end
config.daily = getBooleanFromString(config.daily)
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if(item.itemid == 1945) then
                if(config.daily) then
                        return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
                else
                        local monsters, players = areaCheck(config.room)
                        if #players > 0 then
                                return doPlayerSendCancel(cid, "There are players inside, please be patient.")
                        elseif #monsters > 0 then
                                for _, k in pairs(monsters) do
                                        doRemoveThing(k)
                                end
                        end
                        for _, v in ipairs(config.rocks) do
                                doCreateItem(1285, 1, v)
                        end
                        local closed, open = getTileItemById(config.wall[1], 5108), getTileItemById(config.wall[1], 5109)
                        if(closed.uid > 0) then
                                doTransformItem(closed.uid, 1025)
                        elseif(open.uid > 0) then
                                doTransformItem(open.uid, 1025)
                        end
                        doTransformItem(item.uid, item.itemid + 1)
                end
                return true
        end
        if(item.itemid ~= 1946) then
                return true
        end
        local players = {}
        for _, position in ipairs(config.stand) do
                local pid = getTopCreature(position).uid
                if(pid == 0 or not isPlayer(pid)) then
                        return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
                elseif(getCreatureStorage(pid, config.storage) > 0) then
                        return doPlayerSendCancel(cid, "Someone has already completed this quest.")
                elseif(getPlayerLevel(pid) < config.level) then
                        return doPlayerSendCancel(cid, "Someone is below level 100.")
                end
                table.insert(players, pid)
        end
        local stones = {}
        for _, v in ipairs(config.rocks) do
                local st = getTileItemById(v, 1285)
                table.insert(stones, st)
        end
        for _, st in ipairs(stones) do
                doRemoveItem(st.uid, 1)
        end
        local wall = getTileItemById(config.wall[1], 1025)
        if(wall.uid > 0) then
                doTransformItem(wall.uid, 5108)
        end
        for _, pos in ipairs(config.demons) do
                doCreateMonster("Demon", pos) --# TFS 0.3.6 NEEDS THIS: doCreateMonster("Demon", pos) #--
                doSendMagicEffect(pos, CONST_ME_ENERGYAREA)
        end
        for i, pid in ipairs(players) do
                doSendMagicEffect(config.stand[i], CONST_ME_POFF)
                doTeleportThing(pid, config.destination[i], false)
                doSendMagicEffect(config.destination[i], CONST_ME_TELEPORT)
        end
        doTransformItem(item.uid, item.itemid - 1)
        return true
end
 
Change Demon to Ferumbras in doCreateMonster.
Got that already, as you can see in the other script:
Code:
local config = {
        daily = "no", -- allow only one team to enter per day? (like in global Tibia)
        level = 200,
        storage = 30015,
        room = {
                {x = 339, y = 267, z = 7},
                {x = 342, y = 271, z = 7}
        },
        stand = {
                {x = 328, y = 269, z = 7},
                {x = 327, y = 269, z = 7},
                {x = 326, y = 269, z = 7},
                {x = 325, y = 269, z = 7}
        },
        destination = {
                {x = 342, y = 269, z = 7},
                {x = 341, y = 269, z = 7},
                {x = 340, y = 269, z = 7},
                {x = 339, y = 269, z = 7}
        },
        wall = {
                {x = 345, y = 269, z = 7}
        },
        rocks = {
                {x = 344, y = 269, z = 7},
                {x = 343, y = 269, z = 7},
                {x = 342, y = 269, z = 7},
                {x = 341, y = 269, z = 7},
                {x = 340, y = 269, z = 7},
                {x = 339, y = 269, z = 7},
                {x = 339, y = 267, z = 7},
                {x = 341, y = 267, z = 7},
                {x = 340, y = 271, z = 7},
                {x = 342, y = 271, z = 7}
        },
        demons = {
                {x = 344, y = 269, z = 7},
                {x = 343, y = 269, z = 7},
                {x = 340, y = 271, z = 7},
                {x = 342, y = 271, z = 7},
                {x = 339, y = 267, z = 7},
                {x = 341, y = 267, z = 7}
        }
}
local function areaCheck(area)
        local monsters, players = {}, {}
        for x = config.room[1].x, config.room[2].x do
                for y = config.room[1].y, config.room[2].y do
                        local t = getThingFromPos({x=x, y=y, z=config.room[1].z, stackpos=253})
                        if t.uid > 0 then
                                if isPlayer(t.uid) then
                                        table.insert(players, t.uid)
                                elseif isMonster(t.uid) then
                                        table.insert(monsters, t.uid)
                                end
                        end
                end
        end
        return monsters, players
end
config.daily = getBooleanFromString(config.daily)
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if(item.itemid == 1945) then
                if(config.daily) then
                        return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
                else
                        local monsters, players = areaCheck(config.room)
                        if #players > 0 then
                                return doPlayerSendCancel(cid, "There are players inside, please be patient.")
                        elseif #monsters > 0 then
                                for _, k in pairs(monsters) do
                                        doRemoveThing(k)
                                end
                        end
                        for _, v in ipairs(config.rocks) do
                                doCreateItem(1285, 1, v)
                        end
                        local closed, open = getTileItemById(config.wall[1], 5108), getTileItemById(config.wall[1], 5109)
                        if(closed.uid > 0) then
                                doTransformItem(closed.uid, 1025)
                        elseif(open.uid > 0) then
                                doTransformItem(open.uid, 1025)
                        end
                        doTransformItem(item.uid, item.itemid + 1)
                end
                return true
        end
        if(item.itemid ~= 1946) then
                return true
        end
        local players = {}
        for _, position in ipairs(config.stand) do
                local pid = getTopCreature(position).uid
                if(pid == 0 or not isPlayer(pid)) then
                        return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
                elseif(getCreatureStorage(pid, config.storage) > 0) then
                        return doPlayerSendCancel(cid, "Someone has already completed this quest.")
                elseif(getPlayerLevel(pid) < config.level) then
                        return doPlayerSendCancel(cid, "Someone is below level 100.")
                end
                table.insert(players, pid)
        end
        local stones = {}
        for _, v in ipairs(config.rocks) do
                local st = getTileItemById(v, 1285)
                table.insert(stones, st)
        end
        for _, st in ipairs(stones) do
                doRemoveItem(st.uid, 1)
        end
        local wall = getTileItemById(config.wall[1], 1025)
        if(wall.uid > 0) then
                doTransformItem(wall.uid, 5108)
        end
        for _, pos in ipairs(config.demon) do
                doCreateMonster("Ferumbras", pos) --# TFS 0.3.6 NEEDS THIS: doCreateMonster("Demon", pos) #--
                doSendMagicEffect(pos, CONST_ME_ENERGYAREA)
        end
        for i, pid in ipairs(players) do
                doSendMagicEffect(config.stand[i], CONST_ME_POFF)
                doTeleportThing(pid, config.destination[i], false)
                doSendMagicEffect(config.destination[i], CONST_ME_TELEPORT)
        end
        doTransformItem(item.uid, item.itemid - 1)
        return true
end

The weird thing is that the rocks that should disappear doesn't, but you get teleported to the room.
 
for _, pos in ipairs(config.demons) do

~~~~

You probable accidentally removed the s there.
Post the errors you have in your console, this will make it alot more easy to find mistakes/problems.
 
for _, pos in ipairs(config.demons) do

~~~~

You probable accidentally removed the s there.
Post the errors you have in your console, this will make it alot more easy to find mistakes/problems.

[25/01/2015 22:51:29] [Error - Action Interface]
[25/01/2015 22:51:30] data/actions/scripts/quests/anni2.lua:eek:nUse
[25/01/2015 22:51:30] Description:
[25/01/2015 22:51:30] (luaDoCreateMonster) Cannot create monster: ferumbras
 
First check if you have ferumbras.xml in data/monster
Second check if you have added ferumbras into your monster.xml in data/monster/monster.xml like this
Code:
<monster name="Ferumbras" file="Bosses/ferumbras.xml"/>
Third change the ferumbras to Ferumbras so you have a capital letter in the beginning just as in your monster.xml
 
Do you have ferumbras setup in your monsters.xml file?
Yes!
First check if you have ferumbras.xml in data/monster
Second check if you have added ferumbras into your monster.xml in data/monster/monster.xml like this
Code:
<monster name="Ferumbras" file="Bosses/ferumbras.xml"/>
Third change the ferumbras to Ferumbras so you have a capital letter in the beginning just as in your monster.xml

Tried both, nothing seems to work, worth saying is that the rocks that gets removed in the real anni stays and you can't move. Also: when I tried with Demons like in the first, one of us got tp'd back to quest room.
 
Back
Top