Ir para conteúdo

Demon Oak Quest - Ajuda


ADMJuan

Posts Recomendados

Galera é o seguinte, eu não entendo o que tá acontecendo na demon quest, porque quando eu vou fazer ela, não passa daquela arvore no meio. vou postar aki os scripts:

 

\data\movements\scripts\DOQ

 

demonOakArea:

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

 

demonOakTree:

function onStepOut(cid, item, position, fromPosition)
   if(item.uid == 32193) then
    doTransformItem(item.uid, 2709)
   end
   return true
end

 

movements.xml

<!-- Demon Oak -->
<movevent type="StepOut" uniqueid="32193" event="script" value="DOQ/demonOakTree.lua" />
<movevent type="StepIn" itemid="8292" event="script" value="DOQ/demonOakArea.lua" />

 

 

\data\actions.xml:

 

<!-- Demon Oak Quest -->
<action itemid="8293" event="script" value="Oak/demonOak.lua"/>
<action fromuid="12901" touid ="12904" event="script" value="Oak/demonOakChests.lua"/>
<action uniqueid="55100" event="script" value="Oak/demonOakGravestone.lua" />

 

data\actions\scripts\Oak\demonOak:

function onUse(cid, item, fromPosition, itemEx, toPosition)
local onePerQuest = true
local level = 120
local positions =
{
    kick = { x = 32716, y = 32344, z = 7 },
    summon =
    {
		    {x=32713, y=32348, z=7},
		    {x=32719, y=32348, z=7},
		    {x=32712, y=32353, z=7},
		    {x=32713, y=32344, 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=32705, y=32342, z=7, stackpos = 255},
    {x=32726, y=32358, 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 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 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
				    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
				    doSummonCreature(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

 

data\actions\scripts\Oak\demonOakChests:

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.uid == 12901 then
		    queststatus = getPlayerStorageValue(cid, 12900)
		    if queststatus < 1 then
				    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Demon Legs.")
				    doPlayerAddItem(cid, 2495, 1)
				    doPlayerSetStorageValue(cid, 12900, 1)
		    else
				    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
		    end
    elseif item.uid == 12902 then
		    queststatus = getPlayerStorageValue(cid, 12900)
		    if queststatus < 1 then
				    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Rainbow Shield.")
				    doPlayerAddItem(cid, 8905, 1)
				    doPlayerSetStorageValue(cid, 12900, 1)
		    else
				    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
		    end
    elseif item.uid == 12903 then
		    queststatus = getPlayerStorageValue(cid, 12900)
		    if queststatus < 1 then
				    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Spellbook of Dark Mysteries.")
				    doPlayerAddItem(cid, 8918, 1)
				    doPlayerSetStorageValue(cid, 12900, 1)
		    else
				    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
		    end
    elseif item.uid == 12904 then
		    queststatus = getPlayerStorageValue(cid, 12900)
		    if queststatus < 1 then
				    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Royal Crossbow.")
				    doPlayerAddItem(cid, 8851, 1)
				    doPlayerSetStorageValue(cid, 12900, 1)
		    else
				    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
		    end
    end
    return true
end

 

data\actions\scripts\Oak\demonOakGravestone:

function onUse(cid, item, fromPosition, itemEx, toPosition)

local position = {x=32786, y=32412, z=8}
    if getPlayerStorageValue(cid, 35700) >= 1 and getPlayerStorageValue(cid, 12900) == -1 then
		    doTeleportThing(cid, position)
		    doSendMagicEffect(position, CONST_ME_TELEPORT)
    doPlayerSendTextMessage(cid,22,"Congratulations! You earned the achievement \"Herbicide\".")
   doPlayerAddAchievement(cid, 83)
    else
		    return false
    end
    return true
end

 

os item tá normal e tudo, o teleport para sala também, o problema é só a arvore mesmo.

 

Que puder ajudar, vou dar 50 pontos no meu server.

 

@Edit

Pode fechar o tópico! depois de 15 horas tentando consegui achar o erro!

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...