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

Annihilator quest doesnt work!

medium

New Member
Joined
Nov 2, 2011
Messages
54
Reaction score
0
I have it :

ani_solo.lua :
Code:
local config = {
    daily = "no", -- allow only one enter per day? (like in global Tibia)
    level = 100,
    storage = 11014
}

local playerPosition =
{
    {x = 974, y = 894, z = 8}
}

local newPosition =
{
    {x = 541, y = 827, z = 7}
}

config.daily = getBooleanFromString(config.daily)
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(item.itemid == 1946) then
        if(config.daily) then
            doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
        else
            doTransformItem(item.uid, item.itemid - 1)
        end

        return true
    end

    if(item.itemid ~= 1945) then
        return true
    end

    local players = {}
    for _, pos in ipairs(playerPosition) do
        local pid = getTopCreature(pos).uid
        if(pid == 0 or not isPlayer(pid) or getPlayerStorageValue(pid, config.storage) > 0 or getPlayerLevel(pid) < config.level) then
            doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
            return true
        end

        players[i] = pid
    end

    for i, pid in ipairs(players) do
        doSendMagicEffect(playerPosition[i], 10)
        doTeleportThing(pid, newPosition[i], false)
        doSendMagicEffect(newPosition[i], 10)
    end

    doTransformItem(item.uid, item.itemid + 1)
    return true
end

actions.xml :
Code:
-Ani-Solo
    <action uniqueid="11014" event="script" value="moje/ani_solo.lua"/>

vfj2f.jpg


And console error :
Code:
 [Error - Action Interface]
[15/10/2013 19:15:26] data/actions/scripts/moje/ani_solo.lua:onUse
[15/10/2013 19:15:26] Description:
[15/10/2013 19:15:26] data/actions/scripts/moje/ani_solo.lua:41: table index is nil
[15/10/2013 19:15:26] stack traceback:
[15/10/2013 19:15:26]    data/actions/scripts/moje/ani_solo.lua:41: in function <data/actions/scripts/moje/ani_solo.lua:18>

It don't teleport me - Please Help !
 
Code:
local config = {
    daily = "no", -- allow only one enter per day? (like in global Tibia)
    level = 100,
    storage = 11014
}
config.daily = getBooleanFromString(config.daily)

local newPosition = {x = 541, y = 827, z = 7}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(item.itemid == 1946) then
        if(config.daily) then
            doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
            return true
        end 
       
        doTransformItem(item.uid, item.itemid - 1)
    end

    if(item.itemid ~= 1945) then
        return true
    end

    if getPlayerStorageValue(cid, config.storage) > 0 then
        doPlayerSendCancel(cid, "You already completed this quest.")
        return true
    end
   
    if getPlayerLevel(cid) < config.level then
        doPlayerSendCancel(cid, "Your level is too low.")
        return true
    end
   

    doSendMagicEffect(getThingPos(cid), 10)
    doTeleportThing(cid, newPosition, false)
    doSendMagicEffect(newPosition, 10)

    doTransformItem(item.uid, item.itemid + 1)
    return true
end
 
You didn't have 6 positions, it was solo annihilator.
If you have more just search for a normal anni script and add 2 positions, most of them should support that.
 
But this script is for a lot of players and i think "he must work for 1 person and 1 position" . Is it true ?


- - - Updated - - -


And what does that function :
Code:
getTopCreature(pos)
?
 
Last edited by a moderator:
You wanted a solo anni script so I edited the script so it is really solo.
If you wanted anni for 6 people then your thread is wrong. As I said just search for any annihilator they should support more than 4 players.
 
Here is the script I use in my OT, tweak it to your liking, should be pretty easy to add extra tp positions.

Works in version 0.3.6 for protocol 8.60, you might have to tweak it if you use a different version

Code:
local playerPosition =
{
    {x = 1224, y = 969, z = 11, stackpos = STACKPOS_TOP_CREATURE},
    {x = 1223, y = 969, z = 11, stackpos = STACKPOS_TOP_CREATURE},
    {x = 1222, y = 969, z = 11, stackpos = STACKPOS_TOP_CREATURE},
    {x = 1221, y = 969, z = 11, stackpos = STACKPOS_TOP_CREATURE}
}
local newPosition =
{
    {x=1224, y=969, z=12},
    {x=1223, y=969, z=12},
    {x=1222, y=969, z=12},
    {x=1221, y=969, z=12}
}
local demonPosition =
{
    {x=1222, y=967, z=12},
    {x=1224, y=967, z=12},
    {x=1225, y=969, z=12},
    {x=1226, y=969, z=12},
    {x=1221, y=971, z=12},
    {x=1223, y=971, z=12}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = {0, 0, 0, 0}
    local failed = TRUE
    local count = 0
    item.new = 1946
    if(item.itemid == 1945) then
        if(os.time(t) >= (getGlobalStorageValue(9000) + 3600)) then
            for i = 1, 4 do
                player[i] = getThingfromPos(playerPosition[i])
                if(player[i].itemid > 0) then
                    if(isPlayer(player[i].uid) == TRUE) then
                        if(getPlayerStorageValue(player[i].uid, 9000) < 1) then
                            if(getPlayerLevel(player[i].uid) >= 100 or getPlayerAccess(player[i].uid) >= 3) then
                                failed = FALSE
                                count = count + 1
                            end
                        end
                    end
                end
                if(failed == TRUE) then
                    doTransformItem(item.uid, 1946)
                    return TRUE
                end
            end
            if(count == 4) then
                for i = 1, 6 do
                    doSummonCreature("Demon", demonPosition[i])
                end
                for i = 1, 4 do
                    doSendMagicEffect(playerPosition[i], CONST_ME_POFF)
                    doTeleportThing(player[i].uid, newPosition[i], FALSE)
                    doSendMagicEffect(newPosition[i], CONST_ME_ENERGYAREA)
                    setPlayerStorageValue(player[i].uid, 9000, 1)
                end
                setGlobalStorageValue(9000, os.time(t))
            end
        end
    else
        item.new = 1945
    end
    doTransformItem(item.uid, item.new)
    return TRUE
end
 
Back
Top