PA

(Help) Envolve System

Por paulincarvalhoo22, 14 de set. de 2010 em Archived

script
4
1.1k
14 de setembro de 2010 às 13:43

Aí , eu estou usando um script de envolve do Kydrai, funciona tudo correto!

Mas eu estou precisando de um que a 2º evolução precise de 2 items no caso (2 stones)

 

Esse é o Script:

 

local evo = {
       ["Seel"] = "Dewgong",
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
       if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then
               local monster  = getCreatureName(itemEx.uid)
               if evo[monster] then
                       local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid)
                       doRemoveCreature(itemEx.uid)
                       doRemoveItem(item.uid)
                       local summon = doCreateMonster(evo[monster], toPosition)
                       doConvinceCreature(cid, summon)
                       doCreatureAddHealth(summon, health-maxHealth)
                       return TRUE
               end
       end
       return TRUE
end

 

Eu uso essa tag no actions.xml:

 

<action itemid="7764" script="ice/seeldewgong.lua" allowfaruse="1" blockwalls="1" />

 

Como disse ali em cima está funcionando corretamente, mas como faço pra ter que remover 2 items (stones) do player?!

 

Vlw!

aguardando...

comedinhasssC
14 de setembro de 2010 às 14:48

Assim?:

local evo = {
       ["Seel"] = "Dewgong",
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
       if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then
               local monster  = getCreatureName(itemEx.uid)
               if evo[monster] then
                       local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid)
                       doRemoveCreature(itemEx.uid)
                       doRemoveItem(item.uid)
                       doRemoveItem(item.uid)
                       local summon = doCreateMonster(evo[monster], toPosition)
                       doConvinceCreature(cid, summon)
                       doCreatureAddHealth(summon, health-maxHealth)
                       return TRUE
               end
       end
       return TRUE
end

 

MechainyM
14 de setembro de 2010 às 14:55

É só mudar:

 

doRemoveItem(item.uid)

 

Para:

 

doRemoveItem(item.uid,2)

 

local evo = {
       ["Seel"] = "Dewgong",
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
       if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then
               local monster  = getCreatureName(itemEx.uid)
               if evo[monster] then
                       local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid)
                       doRemoveCreature(itemEx.uid)
                       doRemoveItem(item.uid,2)
                       local summon = doCreateMonster(evo[monster], toPosition)
                       doConvinceCreature(cid, summon)
                       doCreatureAddHealth(summon, health-maxHealth)
                       return TRUE
               end
       end
       return TRUE
end

Editado Setembro 14 por Mechainy

14 de setembro de 2010 às 23:15

É só mudar:

 

doRemoveItem(item.uid)

 

Para:

 

doRemoveItem(item.uid,2)

 

local evo = {
       ["Seel"] = "Dewgong",
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
       if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then
               local monster  = getCreatureName(itemEx.uid)
               if evo[monster] then
                       local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid)
                       doRemoveCreature(itemEx.uid)
                       doRemoveItem(item.uid,2)
                       local summon = doCreateMonster(evo[monster], toPosition)
                       doConvinceCreature(cid, summon)
                       doCreatureAddHealth(summon, health-maxHealth)
                       return TRUE
               end
       end
       return TRUE
end

 

@Mechainy : eu já tentei isso, até remove as duas, mais se eu utilizar 1 só ainda evolui :|