Ir para conteúdo
  • 0

Passar Usando Certo Item


Darkwath

Pergunta

bom o script é esse:

function onUse(cid, item, fromPosition, itemEx, toPosition)
local position = {x=1095, y=1104, z=7} -- reward room
       if getPlayerLevel(cid) > 200 then
               doTeleportThing(cid, position)
               doSendMagicEffect(position, CONST_ME_TELEPORT)
       else
               return FALSE
       end
       return TRUE
end

 

e um script da demon oak q eu to fuçando ake keria q alguem mudasse pra funfa apenas quando usasse o hallowed axe no item q esta o uniqid

e se der tbm alguem q me fle como faze pra so entra 1 na oak :p

Editado por Darkwath
Link para o comentário
Compartilhar em outros sites

7 respostass a esta questão

Posts Recomendados

  • 0

retirado de: Reset System 100%

Actions:

 

Dando função ao Hallowed Axe:

Primeiramente, crie um arquivo de nome Hallowed Axe.lua, dentro da pasta data/actions/scripts/tools, e adicione o conteúdo a ele:

 

function onUse(cid,item,frompos,item2,topos)

number = math.random(1,100)

chance = 80

minItem = 1

maxItem = 3

mind = 300

maxd = 500

 

 

if chance > 100 or chance == 0 then

chance = 100

end

----------------- Variables ----------------------

leftspikedballpos11 = {x=topos.x-1, y=topos.y+2, z=topos.z}

leftspikedballpos12 = {x=topos.x+2, y=topos.y+1, z=topos.z}

leftspikedballpos13 = {x=topos.x-1, y=topos.y-2, z=topos.z}

leftspikedballpos14 = {x=topos.x+2, y=topos.y-1, z=topos.z}

leftspikedballpos21 = {x=topos.x-1, y=topos.y-2, z=topos.z}

leftspikedballpos22 = {x=topos.x-2, y=topos.y-1, z=topos.z}

leftspikedballpos31 = {x=topos.x-1, y=topos.y+2, z=topos.z}

leftspikedballpos32 = {x=topos.x-2, y=topos.y+1, z=topos.z}

 

birdpos11 = {x=topos.x+2, y=topos.y+1, z=topos.z}

birdpos12 = {x=topos.x+1, y=topos.y+2, z=topos.z}

birdpos13 = {x=topos.x+2, y=topos.y, z=topos.z}

birdpos14 = {x=topos.x+1, y=topos.y, z=topos.z}

birdpos21 = {x=topos.x+2, y=topos.y+1, z=topos.z}

birdpos22 = {x=topos.x+1, y=topos.y+2, z=topos.z}

birdpos31 = {x=topos.x-2, y=topos.y+1, z=topos.z}

birdpos32 = {x=topos.x-1, y=topos.y, z=topos.z}

 

rightspikedballpos11 = {x=topos.x+1, y=topos.y, z=topos.z}

rightspikedballpos12 = {x=topos.x+2, y=topos.y-1, z=topos.z}

rightspikedballpos13 = {x=topos.x+1, y=topos.y+2, z=topos.z}

rightspikedballpos14 = {x=topos.x+2, y=topos.y+1, z=topos.z}

rightspikedballpos21 = {x=topos.x+1, y=topos.y+2, z=topos.z}

rightspikedballpos22 = {x=topos.x+2, y=topos.y+1, z=topos.z}

rightspikedballpos31 = {x=topos.x-1, y=topos.y+2, z=topos.z}

rightspikedballpos32 = {x=topos.x-2, y=topos.y+1, z=topos.z}

 

faceoftreepos11 = {x=topos.x-2, y=topos.y-1, z=topos.z}

faceoftreepos12 = {x=topos.x+1, y=topos.y-2, z=topos.z}

faceoftreepos13 = {x=topos.x+2, y=topos.y-1, z=topos.z}

faceoftreepos14 = {x=topos.x-1, y=topos.y-2, z=topos.z}

faceoftreepos21 = {x=topos.x-2, y=topos.y-1, z=topos.z}

faceoftreepos22 = {x=topos.x-1, y=topos.y-2, z=topos.z}

faceoftreepos31 = {x=topos.x-2, y=topos.y+1, z=topos.z}

faceoftreepos32 = {x=topos.x-1, y=topos.y+2, z=topos.z}

 

--------------------Demon oak(O braço esquerdo da arvore)--------------------

if item2.itemid == 8289 then

leftspikedball = getPlayerStorageValue(cid,20000)

if leftspikedball == -1 or leftspikedball == 0 then

if number <= chance then

surp = math.random(minItem, maxItem)

if surp == 1 then

if number <= 75 then

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("bone beast",leftspikedballpos11)

doSummonCreature("bone beast",leftspikedballpos12)

doSummonCreature("bone beast",leftspikedballpos13)

doSummonCreature("bone beast",leftspikedballpos14)

else

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("lich",leftspikedballpos11)

doSummonCreature("lich",leftspikedballpos12)

doSummonCreature("lich",leftspikedballpos13)

doSummonCreature("lich",leftspikedballpos14)

end

end

if surp == 2 then

if number <= 75 then

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("lich",leftspikedballpos21)

doSummonCreature("giant spider",leftspikedballpos22)

else

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("grim reaper",leftspikedballpos21)

doSummonCreature("dark torturer",leftspikedballpos22)

end

end

if surp == 3 then

if number <= 50 then

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("undead dragon",leftspikedballpos31)

else

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("grim reaper",leftspikedballpos31)

doSummonCreature("dark torturer",leftspikedballpos32)

end

end

 

else

doSendMagicEffect(topos,2)

setPlayerStorageValue(cid,20000,1)

end

else

doSendMagicEffect(topos,2)

end

return 1

end

 

--------------------Demon oak(O passaro atraz da arvore)--------------------

if item2.itemid == 8288 then

bird = getPlayerStorageValue(cid,20001)

if bird == -1 or bird == 0 then

if number <= chance then

surp = math.random(minItem, maxItem)

if surp == 1 then

if number <= 75 then

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("banshee",birdpos11)

doSummonCreature("banshee",birdpos12)

doSummonCreature("banshee",birdpos13)

doSummonCreature("banshee",birdpos14)

else

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("braindeath",birdpos11)

doSummonCreature("braindeath",birdpos12)

doSummonCreature("braindeath",birdpos13)

doSummonCreature("braindeath",birdpos14)

end

end

if surp == 2 then

if number <= 75 then

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("demon",birdpos21)

doSummonCreature("diabolic imp",birdpos22)

else

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("blightwalker",birdpos21)

doSummonCreature("betrayed wraith",birdpos22)

end

end

if surp == 3 then

if number <= 50 then

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("undead dragon",birdpos31)

else

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("hand of cursed fate",birdpos31)

doSummonCreature("dark torturer",birdpos32)

end

end

 

else

doSendMagicEffect(topos,2)

setPlayerStorageValue(cid,20001,1)

end

else

doSendMagicEffect(topos,2)

end

return 1

end

 

--------------------Demon oak(O braço direito da arvore)--------------------

if item2.itemid == 8290 then

rightspikedball = getPlayerStorageValue(cid,20002)

if rightspikedball == -1 or rightspikedball == 0 then

if number <= chance then

surp = math.random(minItem, maxItem)

if surp == 1 then

if number <= 75 then

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("lich",rightspikedballpos11)

doSummonCreature("lich",rightspikedballpos12)

doSummonCreature("lich",rightspikedballpos13)

doSummonCreature("lich",rightspikedballpos14)

else

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("giant spider",rightspikedballpos11)

doSummonCreature("giant spider",rightspikedballpos12)

doSummonCreature("giant spider",rightspikedballpos13)

doSummonCreature("giant spider",rightspikedballpos14)

end

end

if surp == 2 then

if number <= 75 then

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("dark torturer",rightspikedballpos21)

doSummonCreature("demon",rightspikedballpos22)

else

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("diabolic imp",rightspikedballpos21)

doSummonCreature("diabolic imp",rightspikedballpos22)

end

end

if surp == 3 then

if number <= 50 then

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("hand of cursed fate",rightspikedballpos31)

else

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("grim reaper",rightspikedballpos31)

doSummonCreature("grim reaper",rightspikedballpos32)

end

end

 

else

doSendMagicEffect(topos,2)

setPlayerStorageValue(cid,20002,1)

end

else

doSendMagicEffect(topos,2)

end

return 1

end

 

--------------------Demon oak(O rosto da arvore)--------------------

if item2.itemid == 8291 then

faceoftree = getPlayerStorageValue(cid,20003)

if faceoftree == -1 or faceoftree == 0 then

if number <= chance then

surp = math.random(minItem, maxItem)

if surp == 1 then

if number <= 75 then

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("vampire",faceoftreepos11)

doSummonCreature("vampire",faceoftreepos12)

doSummonCreature("vampire",faceoftreepos13)

doSummonCreature("vampire",faceoftreepos14)

else

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("diabolic imp",faceoftreepos11)

doSummonCreature("diabolic imp",faceoftreepos12)

doSummonCreature("diabolic imp",faceoftreepos13)

doSummonCreature("diabolic imp",faceoftreepos14)

end

end

if surp == 2 then

if number <= 75 then

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("demon",faceoftreepos21)

doSummonCreature("grim reaper",faceoftreepos22)

else

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("hand of cursed fate",faceoftreepos21)

doSummonCreature("hand of cursed fate",faceoftreepos22)

end

end

if surp == 3 then

if number <= 50 then

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("undead dragon",faceoftreepos31)

doSummonCreature("hand of cursed fate",faceoftreepos32)

else

doSendMagicEffect(topos,0)

doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)

doSummonCreature("grim reaper",faceoftreepos31)

doSummonCreature("hand of cursed fate",faceoftreepos32)

end

end

 

else

doSendMagicEffect(topos,2)

setPlayerStorageValue(cid,20003,1)

end

else

doSendMagicEffect(topos,2)

end

return 1

end

 

return 0

end

 

Salve, e feche o arquivo. Ele está as configurações padões, não há necessidade de mudar.

Link para o comentário
Compartilhar em outros sites

  • 0

Vê se é isso:

 

function onUse(cid, item, fromPosition, itemEx, toPosition)
local position = {x=1095, y=1104, z=7} -- reward room
if item.itemid == ID_HALLOWED_AXE and itemEx.uid == UNIQUEID then
       if getPlayerLevel(cid) > 200 then
               doTeleportThing(cid, position)
               doSendMagicEffect(position, CONST_ME_TELEPORT)
       else
               return FALSE
       end
end
       return TRUE
end

 

Edita ali o ID_HALLOWED_AXE e o UNIQUEID.

Link para o comentário
Compartilhar em outros sites

  • 0

ééé quaaaase isso so ta tendo 1 problema ele so funfa se eu coloca o mesmo actionid no axe e na arvore e quando eu clico com o axe em cima dele mesmo ta teleportando o player mas é so pra quando usa na arvore tem como ajeita isso ae?

Link para o comentário
Compartilhar em outros sites

  • 0

Sim parceiro, ai a gente coloca pro script verificar o id da arvore, assim:

 

function onUse(cid, item, fromPosition, itemEx, toPosition)
local position = {x=1095, y=1104, z=7} -- reward room
if item.itemid == ID_HALLOWED_AXE and itemEx.uid == UNIQUEID and isInArray({ID1, ID2}, itemEx.itemid) then
       if getPlayerLevel(cid) > 200 then
               doTeleportThing(cid, position)
               doSendMagicEffect(position, CONST_ME_TELEPORT)
       else
               return FALSE
       end
end
       return TRUE
end

 

Se eu não me engano são dois ids de arvores possíveis né? Ai em ID1 tu coloca um id e em ID2 tu coloca o outro.

 

Abraço.

Editado por Demonbholder
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...