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

Action Working Demon Oak Quest

iguin

New Member
Joined
May 31, 2009
Messages
2
Reaction score
0
[31/08/2009 20:46:23] Lua Script Error: [Npc interface]
[31/08/2009 20:46:23] data/npc/scripts/oldrak.lua

[31/08/2009 20:46:23] data/npc/scripts/oldrak.lua:51: attempt to index global 'npcHandler' (a nil value)
[31/08/2009 20:46:23] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/oldrak.lua

For me it's this bug, help me please. I'm using the version 0.3.4 :S
 

Boss44

New Member
Joined
Apr 29, 2009
Messages
1
Reaction score
0
Yo anyone know whats wrong with this
Lua Script Error: [Action Interface]
[02/09/2009 11:40:24] data/actions/scripts/doq/demonOak.lua:eek:nUse

[02/09/2009 11:40:24] data/actions/scripts/doq/demonOak.lua:112: attempt to call global 'doPlayerSetStorageValue' (a nil value)
[02/09/2009 11:40:24] stack traceback:
[02/09/2009 11:40:24] data/actions/scripts/doq/demonOak.lua:112: in function <data/actions/scripts/doq/demonOak.lua:1>
 
OP
OP
Darkhaos
Joined
Apr 17, 2008
Messages
1,922
Solutions
1
Reaction score
184
Location
Venezuela
If you're using a TFS version under 0.3.4, then change all "doPlayerSetStorageValue" to "setPlayerStorageValue", and change "isInRange" to "isInArea"
 

Ranzar

New Member
Joined
Aug 31, 2009
Messages
19
Reaction score
0
tuyu.png



help D;
 

Ranzar

New Member
Joined
Aug 31, 2009
Messages
19
Reaction score
0
Code:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>

	<event type="login" name="PlayerLogin" event="script" value="login.lua"/>
	<event type="kill" name="ArenaKill" event="script" value="arenakill.lua"/>  
	<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
	<event type="receivemail" name="Mail" event="script" value="mail.lua"/>
	<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
	<event type="think" name="Idle" event="script" value="idle.lua"/>
	<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>
	<event type="death" name="Pythius the rottenTeleport" script="Pythius the rotten_teleport.lua"/>
	<event type="death" name="inquisitionPortals" script="inquisitionPortals.lua"/> 
	<event type="logout" name="demonOakLogout" event="script" value="demonOakLogout.lua"/>
        <event type="death" name="demonOakDeath" event="script" value="demonOakDeath.lua"/

</creaturescripts>
 
OP
OP
Darkhaos
Joined
Apr 17, 2008
Messages
1,922
Solutions
1
Reaction score
184
Location
Venezuela
Change
Lua:
        <event type="death" name="demonOakDeath" event="script" value="demonOakDeath.lua"/

TO
Lua:
        <event type="death" name="demonOakDeath" event="script" value="demonOakDeath.lua"/>
 

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Solutions
2
Reaction score
113
Dark, can you explain what all the positions are, and where they are?
 
OP
OP
Darkhaos
Joined
Apr 17, 2008
Messages
1,922
Solutions
1
Reaction score
184
Location
Venezuela
Lua:
local positions =
{
        kick = { x = 571, y = 621, z = 7 }, --Position where the player will be kicked out from the quest when he finish the quest.
        summon = --Positios where the monsters will be summoned.
        {
                {x=575, y=630, z=7},
                {x=583, y=629, z=7},
                {x=579, y=635, z=7},
                {x=575, y=634, z=7}
        }
}

local areaPosition = --Positions to check the demonOak area
{
        {x=568, y=624, z=7, stackpos = 255}, --North-West
        {x=589, y=640, z=7, stackpos = 255} --South-East
}
 

Ablebal

New Member
Joined
Jul 3, 2007
Messages
8
Reaction score
0
Location
Poland
Hey. The script is awesome but i got one problem: when i want to cut the dead tree with hallowed axe it normaly says 'You cannot use this object'. The tree have uid 32193, and the h axe is from npc. Plus the areaPosition does not contain dead tree [doesn't matter if id does or not, always same]. I only want to mention that i tried it with God lvl 1, dunno if it helps.

Thanks for answers.

@edit: Ah, OK, sorry, it does not inform if you have too low level, instead it perform normal action [returning 'You cannot use this object']. I changed needed level to 1 and tried to cut tree with h axe and it showed i did the quest [what's true].

Thanks for the script!
 
Last edited:

Xito

n00b
Joined
Sep 14, 2009
Messages
75
Reaction score
0
Location
Swe
I got a problem when iam done whit quest i dont get teleported out and it dont set my storage to 35700 what shold i do?
 
OP
OP
Darkhaos
Joined
Apr 17, 2008
Messages
1,922
Solutions
1
Reaction score
184
Location
Venezuela
@Ablebal and Xito!!

Post yours scripts to see if there is any problem.

PD: What TFS version are you using?
 

Xito

n00b
Joined
Sep 14, 2009
Messages
75
Reaction score
0
Location
Swe
Code:
  function onUse(cid, item, fromPosition, itemEx, toPosition)

local onePerQuest = "yes"
local level = 120
local positions =
{
        kick = { x = 301, y = 287, z = 7 },
        summon =
        {
                {x=299, y=299, z=7},
                {x=305, y=299, z=7},
                {x=299, y=304, z=7},
                {x=304, y=304, 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=295, y=294, z=7, stackpos = 255},
        {x=311, y=308, 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
Iam using
[17/09/2009 18:27:10] The Forgotten Server, version 0.3.5 (Crying Damson)
[17/09/2009 18:27:10] Compiled with GNU C++ version 3.4.5 (mingw special)

Edite:
I fixed it now and thx for this :D
 
Last edited:
Top