• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Working Demon Oak Quest

My:

demonOak.lua
Lua:
  function onUse(cid, item, fromPosition, itemEx, toPosition)

local onePerQuest = "yes"
local level = 120
local positions =
{
        kick = { x = 86, y = 569, z = 7 },
        summon =
        {
                {x=83, y=584, z=7},
                {x=83, y=589, z=7},
                {x=90, y=584, z=7},
                {x=90, y=589, z=7}
        }
}

local summons =
{
        [1] = {"Demon", "Grim Reaper", "Elder Beholder", "Demon Skeleton"},
        [2] = {"Dark Torturer", "Banshee", "Betrayed Wraith", "Blightwalker"},
        [3] = {"Bonebeast", "Braindeath", "Diabolic Imp", "Giant Spider"},
        [4] = {"Hand of Cursed Fate", "Lich", "Undead Dragon", "Vampire"},
        [5] = {"braindeath", "Demon", "Bonebeast", "Diabolic Imp"},
        [6] = {"Demon Skeleton", "Banshee", "Elder Beholder", "Bonebeast"},
        [7] = {"Dark Torturer", "Undead Dragon", "Demon", "Demon"},
        [8] = {"Elder Beholder", "Betrayed Wraith", "Demon Skeleton", "Giant Spider"},
        [9] = {"Demon", "Banshee", "Blightwalker", "Demon Skeleton"},
        [10] = {"Grim Reaper", "Demon", "Diabolic Imp", "Braindeath"},
        [11] = {"Banshee", "Grim Reaper", "Hand of Cursed fate", "Demon"}
}

local areaPosition =
{
        {x=65, y=578, z=7, stackpos = 255},
        {x=109, y=606, z=7, stackpos = 255}
}

local demonOak = {8288, 8289, 8290, 8291}

local storages =
{
        done = 35700,
        cutTree = 36901
}

local blockingTree =
{
        [2709] = {32193, 3669}
}

        if blockingTree[itemEx.itemid] and itemEx.uid == blockingTree[itemEx.itemid][1] then

                if getPlayerLevel(cid) < level then
                        doPlayerSendCancel(cid, "You need level " .. level .. " or more to enter this quest.")
                        return FALSE
                end

                if getPlayerStorageValue(cid, storages.done) > 0 then
                        doPlayerSendCancel(cid, "You already done this quest.")
                        return TRUE
                end

                if getPlayerStorageValue(cid, storages.cutTree) > 0 then
                        return FALSE
                end

                if onePerQuest == "yes" then
                local players = getPlayersOnline()
                        for _, pid in ipairs(players) do
                        if isInRange(getCreaturePosition(pid), areaPosition[1], areaPosition[2]) then
                                doPlayerSendCancel(cid, "Wait until " .. getCreatureName(pid) .. " finish the quest.")
                                return TRUE
                        end
                        end
                end

                doTransformItem(itemEx.uid, blockingTree[itemEx.itemid][2])
                doSendMagicEffect(toPosition, CONST_ME_POFF)
                doMoveCreature(cid, SOUTH)
                doPlayerSetStorageValue(cid, storages.cutTree, 1)
                return TRUE

        elseif isInArray(demonOak, itemEx.itemid) then

                local get = getPlayerStorageValue(cid, itemEx.itemid)
                if get == -1 then
                        get = 1
                end

                if(getPlayerStorageValue(cid, 8288) == 12 and getPlayerStorageValue(cid, 8289) == 12 and getPlayerStorageValue(cid, 8290) == 12 and getPlayerStorageValue(cid, 8291) == 12) then
                        doTeleportThing(cid, positions.kick)
                        doPlayerSetStorageValue(cid, storages.done, 1)
                        return TRUE
                end

                if getPlayerStorageValue(cid, itemEx.itemid) > 11 then
                        doSendMagicEffect(toPosition, CONST_ME_POFF)
                        return TRUE
                end

                if(math.random(100) <= 10) then
                        doPlayerSetStorageValue(cid, itemEx.uid, 12)
                        return TRUE
                end


                if summons[get] then
                for i = 1, #summons[get] do
                        doCreateMonster(summons[get][i], positions.summon[i])
                end
                        doSendMagicEffect(toPosition, CONST_ME_DRAWBLOOD)
                        doPlayerSetStorageValue(cid, itemEx.itemid, get + 1)
                        if math.random(100) >= 50 then
                                doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
                        end
                end
        return FALSE
        end
end
demonOakTree.lua
Lua:
  --- Made by Mazen ---
function onStepOut(cid, item, position, fromPosition)
    if item.uid == 32193 then
        doTransformItem(item.uid, 2709)
    end
    return TRUE
end
demonOakArea.lua
Lua:
  function onStepIn(cid, item, position, fromPosition)

    if isPlayer(cid) == TRUE and math.random(1, 24) == 1 then
        doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
    end
    return TRUE
end
movements
Code:
<!-- Demon Oak Quest -->
<movevent type="StepOut" uniqueid="32193" event="script" value="demonOak/demonOakTree.lua" />
<movevent type="StepIn" itemid="8292" event="script" value="demonOak/demonOakArea.lua" />
actions
Code:
<!-- Demon Oak Quest -->
<action itemid="8293" event="script" value="quests/demonOak/demonOak.lua"/>



I guess that's all 'cause gravestone and demon oak works, only this dead tree don't.. [only doesn't show the requied level, insted it return 'You cannot use this object.', all other things works].

Thanks,
ablebal.
 
workd for tfs 0.3.4???

Onlyif you replace all "doPlayerSetStorageValue" for "setPlayerStorageValue" and "isInRange" for "isInArea"

or add this to compat.lua
Code:
setPlayerStorageValue = doPlayerSetStorageValue
isInArea = isInRange
 
I'm using TFS 0.3.5 and its not working it says in consol cannot load the actions and movements, also oldrak aint working
 
Darkhaos you know what? xD You ROX! xD Thanks 4 da script! xD It's working perfectly on my OT. Thanks a lot! :D
Rep 4 ya!

THANK YOU!!
 
@UP If you done quest you has been kicked out here ;p

I have question: how make text 'Tell oldrak about you greate victory agains demon oak' after kick? and teleport
 
How to buy this axe? What you need to write!


beztytuuvb.png
 
The Tree Doesnt Work At ME:
To get in the demon oak room:
17:42 You see a dead tree.

ItemID: [2709], UniqueID: [32139].
Position: [X: 1127] [Y: 705] [Z: 7].

And when i killed all monsters there notihn happens... (do i have to go back by using axe on tree?)
NEVERMIND FOUND MY BUG
UniqueID: [32139]. has to be UniqueID: [32193].
-- --
 
Last edited:
Im using that on TFS 0.3.4PL2 and i have an error in console

Lua:
[29/10/2009 18:29:24] data/actions/scripts/demonOak.lua:112: attempt to call global 'getPlayerSetStorageValue' (a nil value)
[29/10/2009 18:29:24] stack traceback:
[29/10/2009 18:29:24] 	data/actions/scripts/demonOak.lua:112: in function <data/actions/scripts/demonOak.lua:1>

Can someone tell me what is wrong? ; ))
 
Im using that on TFS 0.3.4PL2 and i have an error in console

Lua:
[29/10/2009 18:29:24] data/actions/scripts/demonOak.lua:112: attempt to call global 'getPlayerSetStorageValue' (a nil value)
[29/10/2009 18:29:24] stack traceback:
[29/10/2009 18:29:24] 	data/actions/scripts/demonOak.lua:112: in function <data/actions/scripts/demonOak.lua:1>

Can someone tell me what is wrong? ; ))

Have you edited the script right? because "getPlayerSetStorageValue" isn't in my script.

Check the script, you've writed wrong a fucntion.
 
right, now i have changed on doPlayerSetStorageValue, and still the same error but in console:

Lua:
[29/10/2009 18:29:24] data/actions/scripts/demonOak.lua:112: attempt to call global 'doPlayerSetStorageValue' 
[29/10/2009 18:29:24] stack traceback:
[29/10/2009 18:29:24]   data/actions/scripts/demonOak.lua:112: in function <data/actions/scripts/demonOak.lua:1>(a nil value)
 
Back
Top