Eae pessoal do xtibia hoje vou monstrar o novo edo tensei system.
O player fala "edo tensei" se ele conseguir capturar o inimigo vai ser criado um item que invoca o edo tensei.
Vá em spells e crie um arquivo lua chamado de edo tensei e coloque isto:
function onCastSpell(cid, var)local playerpos = getPlayerPosition(cid)
local targetpos = getPlayerPosition(getCreatureTarget(cid))
local cloth = getCreatureOutfit(cid)
local health = getCreatureHealth(getCreatureTarget(cid))
if not isMonster(getCreatureTarget(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você so deve pegar o corpo para edo tensei de ninjas e monstros selvagens.")
return 0
end
if health >= getCreatureMaxHealth(getCreatureTarget(cid))/100*70 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..getCreatureName(getCreatureTarget(cid)).." esta resistindo ao edo tensei retire mais vida dele")
return 0
end
if getCreatureMaxHealth(getCreatureTarget(cid)) > getCreatureMaxHealth(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você so pode invocar criaturas com o poder mais baixo que o seu")
return 0
end
local item = doPlayerAddItem(cid, 2525)
doItemSetAttribute(item, "corpse", ""..getCreatureName(getCreatureTarget(cid)).."")
doItemSetAttribute(item, "health", ""..getCreatureMaxHealth(getCreatureTarget(cid)).."")
doSendMagicEffect(playerpos, 2)
doSendMagicEffect(targetpos, 2)
doItemSetAttribute(item, "name", "Edo tensei "..getCreatureName(getCreatureTarget(cid)).."")
doRemoveCreature(getCreatureTarget(cid))
return true
end
Agora vá em spells e coloque esta tag:
<instant name="edo tensei" words="edo tensei" lvl="100" mana="1000" selftarget="1" prem="0" exhaustion="2000" needlearn="1" script="edo tensei.lua"></instant>
Agora vá em actions e crie um arquivo chamado de edo tensei e coloque isto:
function onUse(cid, item, frompos, item2, topos)local monstro = getItemAttribute(item.uid, "corpse")
local health = getItemAttribute(item.uid, "health")
local name = getItemAttribute(item.uid, "monstro")
if #getCreatureSummons(cid) > 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você ja esta usando uma reencarnação ou um pet")
return true
end
if getPlayerMana(cid) < health/100*70 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem chakra suficiente")
return true
end
if getPlayerStorageValue(cid, 24436) == 1 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode invocar mais de reanimação junto.")
return true
end
t = doCreateMonster(monstro, getThingPos(cid))
doConvinceCreature(cid, t)
setCreatureMaxHealth(t, health)
doCreatureAddHealth(t, health)
doPlayerAddMana(t, -getItemAttribute(item.uid, "health")/90)
setPlayerStorageValue(cid, 24436, name)
return true
end
Coloque esta tag em actions.xml:
<action itemid="2525" event="script" value="edo tensei.lua"/>
Configurando.
E simples na hora de colocar a tag em actions.xml você coloca o id do itemid que o player ira usar para invocar o edo tensei.
CREDITOS:
Hero: por postar em um outro forum.
Junior001: por postar aque para voçês.