OT

Ajuda Com A Magia Change Corpse

Por otpira, 02 de abr. de 2012 em Scripts

change
corpse
script
8
1.6k
otpiraO
02 de abril de 2012 às 17:56

Olá pessoal é o seguinte queria que alguem me ajudasse com essa magia

Por favor alguem pode me ajudar? eu queria que o player troque de lado mesmo estando trapado com magic wall aquela runa de trap...

 

segue o script

 

Em spells/scripts crie um arquivo e coloque isso nele:

--< Digaao >--

local config = {

storage = 12456, -- storage que salva o delay da magia

time = 2 * 60, -- tempo que deve esperar para usar a magia em segundos

player = true, -- funciona com player true/false

monster = false, -- funciona com monstros true/false

npc = false, -- funciona com npc true/false

chance = 80, -- numero de 1 a 100 representando a chance de sucesso

}

function onCastSpell(cid, var)

 

local function doSend(pos1, pos2, num)

doSendDistanceShoot(getCreaturePosition(pos1), getCreaturePosition(pos2), 4)

doSendDistanceShoot(getCreaturePosition(pos2), getCreaturePosition(pos1), 4)

if type(num) == "number" and num == 1 then

if math.random(1, 100) <= config.chance then

local pp1 = getCreaturePosition(pos1)

local pp2 = getCreaturePosition(pos2)

doTeleportThing(pos2, pp1)

doTeleportThing(pos1, pp2)

else

doPlayerSendCancel(cid, "Opps que azar, tente denovo!")

end

end

return true

end

 

local target = getCreatureTarget(cid)

 

if type(target) ~= "number" or target == 0 then

doPlayerSendCancel(cid, "Você precisa selecionar alguma creature para fazer isso!")

return false

end

 

if (config.player == false and isPlayer(target)) or (isPlayer(target) and getPlayerAccess(target) > getPlayerAccess(cid)) or (config.monster == false and isMonster(target)) or (config.npc == false and isNpc(target)) then

doPlayerSendCancel(cid, "Voce nao pode fazer isso com essa criatura!")

return false

end

 

if getPlayerStorageValue(cid, config.storage) > os.time() then

doPlayerSendCancel(cid, "Voce so pode utilizar essa magia a cada 2 minutos!")

return false

else

for i = 1, 7 do

addEvent(doSend, i*250, cid, target, 0)

end

addEvent(doSend, 4*500, cid, target, 1)

setPlayerStorageValue(cid, config.storage, os.time() + config.time)

end

 

return true

end

 

Tag XML no arquivo spells.xml:

<instant name="Change Corpse" words="change corpse" lvl="LEVEL PARA USAR A MAGIA" mana="MANA PARA USAR A MAGIA" aggressive="0" needtarget="1" exhaustion="1000" needlearn="0" event="script" value="nome do seu arquivo.lua">

<vocation id="1"/>

<vocation id="2"/>

<vocation id="3"/>

<vocation id="4"/>

<vocation id="5"/>

<vocation id="6"/>

<vocation id="7"/>

<vocation id="8"/>

</instant>

BeekiB
02 de abril de 2012 às 19:53

#Reportado, local errado, o correto seria dúvidas sobre scripts, até

HisashiitYamagutiH
02 de abril de 2012 às 22:37

Tópico para a sessão correta. Gostaria que o dono procurasse a área correta antes de postar, o xtibia agradece :).

otpiraO
04 de abril de 2012 às 12:34

desculpem é que achei que no local de script tava certo........agora alguem pode me ajudar?

 

alguem me ajuda pra vcs q sao feras em script isso deve ser simples

 

pelo jeito ninguem vai ajudar q tragico =/

3 semanas depois...
otpiraO
24 de abril de 2012 às 14:49

helpppppppppppppppppp

Lucaswc15L
24 de abril de 2012 às 15:08

Troca ve se vai funcionar:

 

<instant name="Change Corpse" words="change corpse" lvl="LEVEL PARA USAR A MAGIA" mana="MANA PARA USAR A MAGIA" aggressive="0" needtarget="1" exhaustion="1000" needlearn="0" blockwalls="0" event="script" value="nome do seu arquivo.lua">

<vocation id="1"/>

<vocation id="2"/>

<vocation id="3"/>

<vocation id="4"/>

<vocation id="5"/>

<vocation id="6"/>

<vocation id="7"/>

<vocation id="8"/>

</instant>

 

Eu nao testei, veja se funciona.

Editado Abril 24 por Lucaswc15

otpiraO
01 de maio de 2012 às 00:30

Mano deu certo muitissimo obrigado.....vc foi a unica pessoa q me ajudou REP+ pra tu....

alldakieA
01 de maio de 2012 às 00:37

Duvida sanada, movido para Pedidos e Dúvidas Atendidos.