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

Bug in demon oak quest

picachu

Member
Joined
Dec 2, 2007
Messages
970
Reaction score
11
Error:

28vc4nd.jpg


Script:

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
treepos = {x=159, y=106, z=7, stackpos=1}
treepos2 = {x=157, y=113, z=7, stackpos=1} --- position of left arm
treepos3 = {x=159, y=111, z=7, stackpos=1} --- position of crow
treepos4 = {x=159, y=114, z=7, stackpos=1} --- position of mouth
monster1 = {x=157, y=109, z=7}
monster2 = {x=163, y=110, z=7}
monster3 = {x=155, y=116, z=7}
monster4 = {x=162, y=116, z=7}
tree = getThingfromPos(treepos).uid
tree2 = getThingfromPos(treepos2).uid
tree3 = getThingfromPos(treepos3).uid
tree4 = getThingfromPos(treepos4).uid
playerPos = getCreaturePosition(cid)
local randomizer = math.random(1,6)
queststatus = getPlayerStorageValue(cid,8181)
queststatus2 = getPlayerStorageValue(cid,8282)
queststatus3 = getPlayerStorageValue(cid,8383)
queststatus4 = getPlayerStorageValue(cid,8484)
Level = getPlayerLevel(cid)

	if itemEx.itemid == 2709 and itemEx.actionid == 7787 and Level >= 170 then
		doRemoveItem(tree)
		doTeleportThing(cid, toPosition, TRUE)
		setPlayerStorageValue(cid,8181,1)
	else
		doSendMagicEffect(toPosition, CONST_ME_POFF)
		end
	if itemEx.itemid == 2709 and itemEx.actionid == 7788 then
		doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "A player is already doing this quest.")
	end
	if itemEx.itemid == 8289 and itemEx.actionid == 8181 and (randomizer == 1) and queststatus == 1 then
		doSummonCreature("Crypt Shambler", monster1)
		doSummonCreature("Crypt Shambler", monster2)
		doSummonCreature("Crypt Shambler", monster3)
		doSummonCreature("Crypt Shambler", monster4)
	elseif itemEx.itemid == 8289 and itemEx.actionid == 8181 and (randomizer == 2) and queststatus == 1 then
		doSummonCreature("Bone Beast", monster1)
		doSummonCreature("Bone Beast", monster2)
		doSummonCreature("Bone Beast", monster3)
		doSummonCreature("Bone Beast", monster4)
	elseif itemEx.itemid == 8289 and itemEx.actionid == 8181 and (randomizer == 3) and queststatus == 1 then
		doSummonCreature("Orshabaal", monster1)
		setPlayerStorageValue(cid,8181,-1)
		setPlayerStorageValue(cid,8282,1)
	elseif itemEx.itemid == 8289 and itemEx.actionid == 8181 and (randomizer >= 4) and queststatus == 1 then
		doSendMagicEffect(playerPos, 45)
		doCreatureAddHealth(cid, -1000)
		doSendAnimatedText(playerPos, '1000', TEXTCOLOR_LIGHTGREEN)
		end
	if itemEx.itemid == 8289 and itemEx.actionid == 8181 and queststatus == -1 then
		doSendMagicEffect(toPosition, CONST_ME_POFF)
		end
	if itemEx.itemid == 8288 and itemEx.actionid == 8282 and (randomizer == 1) and queststatus2 == 1 then
		doSummonCreature("Crypt Shambler", monster1)
		doSummonCreature("Crypt Shambler", monster2)
		doSummonCreature("Crypt Shambler", monster3)
		doSummonCreature("Crypt Shambler", monster4)
	elseif itemEx.itemid == 8288 and itemEx.actionid == 8282 and (randomizer == 2) and queststatus2 == 1 then
		doSummonCreature("Giant Spider", monster1)
		doSummonCreature("Giant Spider", monster4)
	elseif itemEx.itemid == 8288 and itemEx.actionid == 8282 and (randomizer == 3) and queststatus2 == 1 then
		doSummonCreature("Blightwalker", monster1)
		setPlayerStorageValue(cid,8282,-1)
		setPlayerStorageValue(cid,8383,1)
	elseif itemEx.itemid == 8288 and itemEx.actionid == 8282 and (randomizer >= 4) and queststatus2 == 1 then
		doSendMagicEffect(playerPos, 45)
		doCreatureAddHealth(cid, -1000)
		doSendAnimatedText(playerPos, '1000', TEXTCOLOR_LIGHTGREEN)
		end
	if itemEx.itemid == 8288 and itemEx.actionid == 8282 and queststatus2 == -1 then
		doSendMagicEffect(toPosition, CONST_ME_POFF)
		end
	if itemEx.itemid == 8290 and itemEx.actionid == 8383 and (randomizer == 1) and queststatus3 == 1 then
		doSummonCreature("Crypt Shambler", monster1)
		doSummonCreature("Crypt Shambler", monster2)
		doSummonCreature("Crypt Shambler", monster3)
		doSummonCreature("Crypt Shambler", monster4)
	elseif itemEx.itemid == 8290 and itemEx.actionid == 8383 and (randomizer == 2) and queststatus3 == 1 then
		doSummonCreature("Lich", monster1)
		doSummonCreature("Lich", monster2)
		doSummonCreature("Lich", monster3)
		doSummonCreature("Massacre", monster4)
	elseif itemEx.itemid == 8290 and itemEx.actionid == 8383 and (randomizer == 3) and queststatus3 == 1 then
		doSummonCreature("Plaguesmith", monster1)
		setPlayerStorageValue(cid,8383,-1)
		setPlayerStorageValue(cid,8484,1)
	elseif itemEx.itemid == 8290 and itemEx.actionid == 8383 and (randomizer >= 4) and queststatus3 == 1 then
		doSendMagicEffect(playerPos, 45)
		doCreatureAddHealth(cid, -1000)
		doSendAnimatedText(playerPos, '1000', TEXTCOLOR_LIGHTGREEN)
		end
	if itemEx.itemid == 8290 and itemEx.actionid == 8383 and queststatus3 == -1 then
		doSendMagicEffect(toPosition, CONST_ME_POFF)
		end
	if itemEx.itemid == 8291 and itemEx.actionid == 8484 and (randomizer == 1) and queststatus4 == 1 then
		doSummonCreature("Hellgorak", monster1)
		doSummonCreature("Crypt Shambler", monster2)
		doSummonCreature("Crypt Shambler", monster3)
		doSummonCreature("Crypt Shambler", monster4)
	elseif itemEx.itemid == 8291 and itemEx.actionid == 8484 and (randomizer == 2) and queststatus4 == 1 then
		doSummonCreature("Lich", monster1)
		doSummonCreature("Lich", monster2)
		doSummonCreature("Giant Spider", monster2)
		doSummonCreature("Giant Spider", monster3)
	elseif itemEx.itemid == 8291 and itemEx.actionid == 8484 and (randomizer == 3) and queststatus4 == 1 then
		doSummonCreature("Ushuriel", monster1)
		doSummonCreature("Juggernaut", monster2)
		setPlayerStorageValue(cid,8484,-1)
		setPlayerStorageValue(cid,8585,1)
	elseif itemEx.itemid == 8291 and itemEx.actionid == 8484 and (randomizer >= 4) and queststatus4 == 1 then
		doSendMagicEffect(playerPos, 45)
		doCreatureAddHealth(cid, -1000)
		doSendAnimatedText(playerPos, '1000', TEXTCOLOR_LIGHTGREEN)
		end
	if itemEx.itemid == 8291 and itemEx.actionid == 8484 and queststatus4 == -1 then
		doSendMagicEffect(toPosition, CONST_ME_POFF)
		end
end

Help :wub: i rep++
 
Lua:
  function onUse(cid, item, fromPosition, itemEx, toPosition)

local onePerQuest = true
local level = 250
local positions =
{
        kick = { x = 3797, y = 3018, z = 7 },
        summon =
        {
                {x=3790, y=3031, z=7},
                {x=3801, y=3031, z=7},
                {x=3790, y=3038, z=7},
                {x=3801, y=3038, 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=3789, y=3029, z=7, stackpos = 255},
        {x=3802, y=3039, 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

                local tree = toPosition
                if isInRange(tree, areaPosition[1], areaPosition[2]) then
                        print("[Warning - Error::Demon Oak] Dead tree position is inside the quest area positions.\nDead tree position (x: " .. tree.x .. ", y: " .. tree.y .. ", z: " .. tree.z .. ")\nNorth-West area position (x: " .. areaPosition[1].x .. ", y: " .. areaPosition[1].y .. ", z: " .. areaPosition[1].z .. ")\nSouth-West area position (x: " .. areaPosition[2].x .. ", y: " .. areaPosition[2].y .. ", z: " .. areaPosition[2].z .. ")\nScript will not work correctly, please fix it.")
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Something is wrong, please contact a gamemaster.")
                        return false
                end

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

                if onePerQuest 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)
                return true

        elseif isInArray(demonOak, itemEx.itemid) then

                local get = getPlayerStorageValue(cid, itemEx.itemid)
                if get == -1 then
                        doPlayerSetStorageValue(cid, itemEx.itemid, 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) <= 1) then
                        doPlayerSetStorageValue(cid, itemEx.itemid, 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
 
You have to set the correct actionid to the dead tree, also the correct pos of it -> x,y,z

PHP:
actionid of the deadtree = "7787"
and
Lua:
treepos = {x=159, y=106, z=7, stackpos=1} -- change to the correct place.

Regards, Efren.
 

Similar threads

Back
Top