(Help) Envolve System

paulincarvalhoo22
em Lixeira Pública

paulincarvalhoo22

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 06/11/09Posts: 17

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...

comedinhasss

Comedinha
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 08/08/07Posts: 520Gênero: MasculinoChar no Tibia: Sir Morths

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

 

Bruno de Carvalho Câmara
[email protected]<script data-cfhash='f9e31' type="text/javascript"> /* */</script> / (18) 9 9640-4544
 

 

 

 

 

 

 

 

 

 

facebook.png&key=5c75f89868a8711c49cc20315645ab5fd3ef2d384bf666dd888f1c280a6b75ed&resource=1 twitter.png&key=a62b8fde99e302436f4cc04056c02768d777c0d27d77011e8931ced8099246e6&resource=1 googleplus.png&key=f287787442661f4422363039ba86e9c578c4921ad397c8f0d88f31709d26c48a&resource=1 youtube.png&key=08e8d5ba725e0a7bfedfe6c9d413ff55e2febb19493974e3a1fd5160d3cabc9f&resource=1 skype.png&key=0aee9c9483d4f4dee341915e654aa361f40598341a31a62afec9f83a2734e0ad&resource=1 steam-icon.png&key=b869d73d6be3b894b7204e151a9582d3b2a84a5d853d940297fec82e1ae25b55&resource=1

 

 

 

 

 

 

 

 

 

 

btn_donateCC_LG.gif&key=ea1b6265cec82d379c00914ab97fd15478f9983200fa273984872388d20f0b62&resource=1 180x25-doar.gif&key=8671e0307e2a7fd446670d1b16671d35069b1c91bed3d028b8f7db698c59eac5&resource=1

 

"Pesadelos? Sonhos? Calma, é apenas eu pensando em você!"

 

wMwSJFE.png?1&key=101925b29f8396357ec8f63d177a708785a8da5f96f154f44e9a4c6599794673&resource=1

Mechainy

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 10/09/10Posts: 31

É 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

paulincarvalhoo22

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 06/11/09Posts: 17

É 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 :|