• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Demon oak error

Powtreeman

Member
Joined
Sep 26, 2011
Messages
400
Reaction score
6
Location
USA
it works until you get to the very end. the final part just keeps spawning a demon and then shows this error you see
im using 1.0
since i dont know how to crop and make pics smaller i did this for you dominique :)
solved. answer at very bottom
 

Attachments

  • demon oak quest.png
    demon oak quest.png
    17.9 KB · Views: 26 · VirusTotal
Last edited:
Heres the script Im using

Code:
dofile('data/lib/demonOakQuest.lua')
local start_storage = 1013
local demon_stor = 1015

local floorDamage =
{
   min = 170,
   max = 210,
   type = COMBAT_EARTHDAMAGE,
   effect = CONST_ME_BIGPLANTS
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
   if isInArray(demonOak, itemEx.itemid) then
     local get = getPlayerStorageValue(cid, itemEx.itemid)
     if get == -1 then setPlayerStorageValue(cid, itemEx.itemid, 1) end
     get = getPlayerStorageValue(cid, itemEx.itemid)
     local k = 0
     for i = demonOak[1], demonOak[#demonOak] do
       if(getPlayerStorageValue(cid, i) == (waves and waves > 0 and waves) + 1) then
         k = k + 1
       end
     end
     if killAllBeforeCut or k == #demonOak then
       if (isMonsterInArea(questAreaPosition[1], questAreaPosition[2], true, true)) then
         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to kill all monsters first.")
         return true
       end
     end
     if(k == #demonOak) then
       doTeleportThing(cid, positions.kick)
       doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Tell Oldrak about your great victory against the demon oak.")
       setPlayerStorageValue(cid, storages.done, 1)
       setPlayerStorageValue(cid, start_storage, 3)
       return true
     end
     if getPlayerStorageValue(cid, itemEx.itemid) >= (waves and waves > 0 and waves) + 1 then
       return doSendMagicEffect(toPosition, CONST_ME_POFF)
     end
     local deny = false
     local cbs = 0
     if summons_[itemEx.itemid] then
       if summons_[itemEx.itemid][get] then
         for _, s in ipairs(summons_[itemEx.itemid][get]) do
             for i = 1, s.count do
               local sPos = positions.summon[math.random(#positions.summon)]
               local thing = getTopCreature(sPos)
               local area
               if isMonster(thing.uid) then
                 area = getCreaturesInRange(sPos, 2, 2)
                 for _, pos in pairs(area) do
                   if isCreature(getTopCreature(pos).uid) or not isInRange(pos, questAreaPosition[1], questAreaPosition[2]) then
                     deny = true
                     break
                   else
                     if (getPlayerStorageValue(cid, demon_stor) <= 37 and tonumber(doSummonCreature(s.monster, pos)) == nil) then
                       cbs = cbs + 1
                     end
                     break
                   end
                 end
               else
                 if (getPlayerStorageValue(cid, demon_stor) >= 38) then
                   doSummonCreature("Demon", sPos)
                   local demons = getCreaturesInRange(getPlayerPosition(cid), 7, 7, true,false,true)
                   for i = 1, #demons do
                     doRemoveCreature(demons[i])
                   end
                   doSummonCreature("Demon", sPos)
                 elseif (getPlayerStorageValue(cid, demon_stor) <= 37 and tonumber(doSummonCreature(s.monster, sPos)) == nil) then
                   cbs = cbs + 1
                 end
               end
             end
           end
     
           if cbs > 0 then
             return doPlayerSendCancel(cid, "There are " .. cbs .. " monster that could not be summoned. Wave has not been counted.")
           end
     
           if not deny then
             setPlayerStorageValue(cid, itemEx.itemid, get + 1)
           end
           if isLastCut(cid) then
             doCreatureSay(cid, "HOW IS THAT POSSIBLE?!? MY MASTER WILL CRUSH YOU!! AHRRGGG!", TALKTYPE_ORANGE_2, false, cid, (positions.demonOak or getCreaturePosition(cid)))
           else
             doCreatureSay(cid, sounds[2][math.random(1, #sounds[2])], TALKTYPE_ORANGE_2, false, cid, (positions.demonOak or getCreaturePosition(cid)))
           end
           doSendMagicEffect(toPosition, CONST_ME_DRAWBLOOD)
         else
           local r = math.random(1, 100)
           if (r >= 90) then
             local sPos = positions.summon[math.random(#positions.summon)]
             doSummonCreature("bonebeast", sPos)
             doSummonCreature("bonebeast", sPos)
             doSummonCreature("bonebeast", sPos)
             doSummonCreature("bonebeast", sPos)
           end
         end
       end
       setPlayerStorageValue(cid, itemEx.itemid, get + 1)
       doTargetCombatHealth(0, cid, floorDamage.type, -floorDamage.min, -floorDamage.max, floorDamage.effect)
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPlayerStorageValue(cid, itemEx.itemid))
       doSendMagicEffect(toPosition, CONST_ME_DRAWBLOOD)
       doCreatureSay(cid, "-krrrrak-", TALKTYPE_ORANGE_2, false, cid, getThingPos(itemEx.uid))
       if (getPlayerStorageValue(cid, demon_stor) < 1) then
         setPlayerStorageValue(cid, demon_stor, 1)
       else
         setPlayerStorageValue(cid, demon_stor, getPlayerStorageValue(cid, demon_stor) + 1)
       end
     end
   return true
end  [code/]
 
heres my actions lib if its even necessary
Code:
function destroyItem(cid, itemEx, toPosition)
   if itemEx.uid <= 65535 or itemEx.actionid > 0 then
     return FALSE
   end

   if (itemEx.itemid >= 1724 and itemEx.itemid <= 1741) or (itemEx.itemid >= 2581 and itemEx.itemid <= 2588) or itemEx.itemid == 1770 or itemEx.itemid == 2098 or itemEx.itemid == 1774 or itemEx.itemid == 1775 or itemEx.itemid == 2064 or (itemEx.itemid >= 1747 and itemEx.itemid <= 1753) or (itemEx.itemid >= 1714 and itemEx.itemid <= 1717) or (itemEx.itemid >= 1650 and itemEx.itemid <= 1653) or (itemEx.itemid >= 1666 and itemEx.itemid <= 1677) or (itemEx.itemid >= 1614 and itemEx.itemid <= 1616) or (itemEx.itemid >= 3813 and itemEx.itemid <= 3820) or (itemEx.itemid >= 3807 and itemEx.itemid <= 3810) or (itemEx.itemid >= 2080 and itemEx.itemid <= 2085) or (itemEx.itemid >= 2116 and itemEx.itemid <= 2119) or itemEx.itemid == 2094 or itemEx.itemid == 2095 or itemEx.itemid == 1619 or itemEx.itemid == 2602 or itemEx.itemid == 3805 or itemEx.itemid == 3806 then
     if math.random(1, 7) == 1 then
       if itemEx.itemid == 1738 or itemEx.itemid == 1739 or (itemEx.itemid >= 2581 and itemEx.itemid <= 2588) or itemEx.itemid == 1770 or itemEx.itemid == 2098 or itemEx.itemid == 1774 or itemEx.itemid == 1775 or itemEx.itemid == 2064 then
         doCreateItem(2250, 1, toPosition)
       elseif (itemEx.itemid >= 1747 and itemEx.itemid <= 1749) or itemEx.itemid == 1740 then
         doCreateItem(2251, 1, toPosition)
       elseif (itemEx.itemid >= 1714 and itemEx.itemid <= 1717) then
         doCreateItem(2252, 1, toPosition)
       elseif (itemEx.itemid >= 1650 and itemEx.itemid <= 1653) or (itemEx.itemid >= 1666 and itemEx.itemid <= 1677) or (itemEx.itemid >= 1614 and itemEx.itemid <= 1616) or (itemEx.itemid >= 3813 and itemEx.itemid <= 3820) or (itemEx.itemid >= 3807 and itemEx.itemid <= 3810) then
         doCreateItem(2253, 1, toPosition)
       elseif (itemEx.itemid >= 1724 and itemEx.itemid <= 1737) or (itemEx.itemid >= 2080 and itemEx.itemid <= 2085) or (itemEx.itemid >= 2116 and itemEx.itemid <= 2119) or itemEx.itemid == 2094 or itemEx.itemid == 2095 then
         doCreateItem(2254, 1, toPosition)
       elseif (itemEx.itemid >= 1750 and itemEx.itemid <= 1753) or itemEx.itemid == 1619 or itemEx.itemid == 1741 then
         doCreateItem(2255, 1, toPosition)
       elseif itemEx.itemid == 2602 then
         doCreateItem(2257, 1, toPosition)
       elseif itemEx.itemid == 3805 or itemEx.itemid == 3806 then
         doCreateItem(2259, 1, toPosition)
       end
       doRemoveItem(itemEx.uid, 1)
     end
     doSendMagicEffect(toPosition, CONST_ME_POFF)
     return TRUE
   end
   return FALSE
end  [code/]
 
same error now it just says getSpectators instead of get CreaturesInRange on the console

Here is the function
Code:
function doCreatureSayWithRadius(cid, text, type, radiusx, radiusy, position)
   if position == nil then
     position = getCreaturePosition(cid)
   end

   local spectators = getSpectators(position, radiusx, radiusy, false, true)
   if spectators ~= nil then
     for _, spectator in ipairs(spectators) do
       doCreatureSay(cid, text, type, false, spectator, position)
     end
   end
end
 
Last edited:
This is solved thanks to another thread i found with the same problem.
Its Game.getSpectators
Ninja you were almost right lol
You solved the other one so you still win in the end.
 
Back
Top