Postado Fevereiro 2, 2018 7 anos Francamente Não sei aonde errei, ja alterei aqui: 1 hora atrás, PedroSTT disse: if item.itemid == 11390 then e continua na mesma.. vai.lua local voc = {1, 2} -- ID das vocações que poderão usar o Pergaminho. local corpse = {2806} local id = 8302 -- Id do edo pergaminho local edo = { ["[Edo Tensei] Madara"] = {hp = 50000, maxhp = 50000, corpse = 2806, chance = 100}, -- Nome do Edo, HP do Edo quando summoned, max hp do edo , corpo do edo, chance de falhar. } function onUse(cid, item, frompos, item2, topos) if(not(isInArray(voc, getPlayerVocation(cid)))) then return doPlayerSendTextMessage(cid, 25, "Voce nao tem a vocacao nescessaria") end if(not(isInArray(corpse, item2.itemid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "voce precisa usar o pergaminho em um corpse") doSendMagicEffect(pos, CONST_ME_POFF) return true end local perga = doPlayerAddItem(cid, id, 1) for edo_tensei, v in pairs(edo) do if item2.itemid == v.corpse then if math.random(0,100) <= v.chance then doSendMagicEffect(topos, CONST_ME_POFF) doPlayerSendTextMessage(cid, 27, "".. edo_tensei .. " foi selado nesse pergaminho.") doRemoveItem(item.uid, 1) doRemoveItem(item2.uid, 1) doItemSetAttribute(perga, "namepet", edo_tensei) doItemSetAttribute(perga, "description", "Neste pergaminho foi selado um ".. edo_tensei ..".") doItemSetAttribute(perga, "lifepet", v.hp) doItemSetAttribute(perga, "maxlifepet", v.maxhp) else doPlayerSendTextMessage(cid, 27, "O pergaminho falhou") end end end return true end pega.lua local config = { percent = 1, --- Em % quanto de mana irá perder losehp = -3, -- quanto de vida ira perder losemp = -2 -- quanto de mana ira perder } local id = 8301 -- Id do outro pergaminho que conterá o summon local vocs = {1, 2} -- vocs que irão usar o edo tensei function onUse(cid, item, frompos, item2, topos) local health = tonumber(getItemAttribute(item.uid, "lifepet")) local mhp = tonumber(getItemAttribute(item.uid, "maxlifepet")) local lifedraw = math.ceil(getCreatureMaxHealth(cid) * (config.percent)/100) local msg0 = [[ Você ssó pode ter 0 summon(s), A seguinte tabela mostra os leveis e o respectivo número de summons que um player terá ao estar nele Level <~> [summons] ~->50[1] ~->150[2] ~->200[2] ~->350[3] ~->450[4] ]] local msg1 = [[ Você ssó pode ter 1 summon(s), A seguinte tabela mostra os leveis e o respectivo número de summons que um player terá ao estar nele Level <~> [summons] ~->50[1] ~->150[2] ~->200[2] ~->350[3] ~->450[4] ]] local msg2 = [[ Você ssó pode ter 2 summon(s), A seguinte tabela mostra os leveis e o respectivo número de summons que um player terá ao estar nele Level <~> [summons] ~->50[1] ~->150[2] ~->200[2] ~->350[3] ~->450[4] ]] local msg3 = [[ Você ssó pode ter 3 summon(s), A seguinte tabela mostra os leveis e o respectivo número de summons que um player terá ao estar nele Level <~> [summons] ~->50[1] ~->150[2] ~->200[2] ~->350[3] ~->450[4] ]] local msg4 = [[ Você ssó pode ter 4 summon(s), A seguinte tabela mostra os leveis e o respectivo número de summons que um player terá ao estar nele Level <~> [summons] ~->50[1] ~->150[2] ~->200[2] ~->350[3] ~->450[4] ]] if(not(isInArray(vocs, getPlayerVocation(cid)))) then return doPlayerSendTextMessage(cid, 26, "Voce nao tem a vocacao certa") end if health <= 0 then return doPlayerSendCancel(cid, "Esse edo tensei esta morto.") end if #getCreatureSummons(cid) == 0 and getPlayerLevel(cid) <= 49 then doPlayerPopupFYI(cid, msg0) return true end if #getCreatureSummons(cid) == 1 and getPlayerLevel(cid) <= 149 then doPlayerPopupFYI(cid, msg1) return true end if #getCreatureSummons(cid) == 1 and getPlayerLevel(cid) <= 199 then doPlayerPopupFYI(cid, msg1) return true end if #getCreatureSummons(cid) == 2 and getPlayerLevel(cid) <= 349 then doPlayerPopupFYI(cid, msg2) return true end if #getCreatureSummons(cid) == 3 and getPlayerLevel(cid) <= 449 then doPlayerPopupFYI(cid, msg3) return true end if #getCreatureSummons(cid) == 4 and getPlayerLevel(cid) >= 450 then doPlayerPopupFYI(cid, msg4) return true end local pet_name = getItemAttribute(item.uid, "namepet") if item.itemid == 8302 id then if not getTilePzInfo(getPlayerPosition(cid)) then if #getCreatureSummons(cid) < 1 and getPlayerLevel(cid) > 49 or #getCreatureSummons(cid) < 2 and getPlayerLevel(cid) > 149 or #getCreatureSummons(cid) < 2 and getPlayerLevel(cid) > 199 or #getCreatureSummons(cid) < 3 and getPlayerLevel(cid) > 349 or #getCreatureSummons(cid) < 4 and getPlayerLevel(cid) > 449 then if isCreature(cid) then if getCreatureMaxHealth(cid) then local summon = doSummonCreature(pet_name, topos) doRemoveItem(item.uid, 1) doConvinceCreature(cid, summon) setCreatureMaxHealth(summon, mhp) doCreatureAddHealth(summon, mhp) doCreatureAddHealth(summon, health - mhp) doCreatureAddHealth(cid, config.losehp) doCreatureAddMana(cid, config.losemp) doSendMagicEffect(getCreaturePosition(summon), 2) doCreatureSay(cid, "EDO TENSEI!", 19) end else doPlayerSendCancel(cid,'Você não pode invocar uma criatura de uma zona protegida.') end end end end return true end Nesta linha ja tentei deichar: Citar if item.itemid == 8302 id then e Citar if item.itemid == id then Citar if item.itemid == 8302 then XML: <action itemid="8301" event="script" value="vai.lua"/> <action itemid="8302" event="script" value="pega.lua"/> Pergaminho 1: <item id="8301" name="edo pergaminho"> <attribute key="description" value="Neste pergaminho foi selado um [VAZIO]." /> <attribute key="weight" value="1" /> </item> Pergaminho 2: -- nem mechi <item id="8302" name="iced soil"> <attribute key="weight" value="250" /> </item> [Edo Tensei] Madara.lua ( funcionando 100%) <?xml version="1.0" encoding="UTF-8"?> <monster name="[Edo Tensei] Madara" nameDescription="[Edo Tensei] Madara" race="blood" experience="000" speed="250" manacost="0"> <health now="792" max="792"/> <look type="1190" head="0" body="94" legs="79" feet="79" corpse="0"/> <targetchange interval="5000" chance="8"/> <strategy attack="90" defense="20"/> <flags> <flag summonable="1"/> <flag attackable="1"/> <flag hostile="1"/> <flag illusionable="0"/> <flag convinceable="1"/> <flag pushable="0"/> <flag canpushitems="1"/> <flag canpushcreatures="1"/> <flag targetdistance="1"/> <flag staticattack="65"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="3000" min="-30" max="-30"/> </attacks> <defenses armor="80" defense="80"> <defense name="healing" interval="4000" chance="40" min="300" max="300"> <attribute key="areaEffect" value="blueshimmer"/> </defense> <defense name="speed" interval="4000" chance="40" speedchange="450" duration="8000"> <attribute key="areaEffect" value="redshimmer"/> </defense> </defenses> <elements> <element physicalPercent="20"/> <element icePercent="10"/> <element holyPercent="-15"/> <element deathPercent="35"/> </elements> <immunities> <immunity poison="1"/> <immunity lifedrain="1"/> <immunity outfit="1"/> <immunity drunk="1"/> <immunity invisible="1"/> </immunities> <script> <event name="critical"/> </script> </monster> Edo recem capturado Joguei no chao: ( se pegar dnv na bag, fica igual) Editado Fevereiro 2, 2018 7 anos por Hokograma (veja o histórico de edições)
Postado Fevereiro 2, 2018 7 anos Autor @Hokograma Pelo o que eu percebi , o ID dos itens não estão iguais nas scripts , esse é o erro no vai.lua local id = 8302 -- Id do edo pergaminho no pega.lua local id = 8301 -- Id do outro pergaminho que conterá o summon Entendeu ? nas 2 script , coloque o ID do pergaminho que conterá o edo tensei.
Postado Fevereiro 2, 2018 7 anos 26 minutos atrás, PedroSTT disse: nas 2 script , coloque o ID do pergaminho que conterá o edo tensei. Realmente estava aqui o erro do summon ._. obrigado!! Agora pra mim adicionar mais é só continuar a coluna ali né? Tipo: ["[Edo Tensei] Madara"] = {hp = 50000, maxhp = 50000, corpse = 2806, chance = 100}, ["[Edo Tensei] Deidara"] = {hp = 50000, maxhp = 50000, corpse = 2807, chance = 90}, ["[Edo Tensei] Sasori"] = {hp = 50000, maxhp = 50000, corpse = 2808, chance = 80}, ["[Edo Tensei] Kisame"] = {hp = 50000, maxhp = 50000, corpse = 2809, chance = 45}, Ou é só com um mesmo? e teria que repeti a script, colocando outro monster? Reputado +3 vlw a atençao PS: O bug de jogar o item no chao, e desaparecer o mob do pergaminho continua, mas isso é de menos. Editado Fevereiro 2, 2018 7 anos por Hokograma (veja o histórico de edições)
Postado Fevereiro 2, 2018 7 anos Autor @Hokograma Não precisa repetir a script não , basta preencher as colunas.
Postado Março 17, 2021 4 anos local id = 2223 -- Id do edo pergaminho local count = 1 -- Quantos pergaminhos serão adiciondos ao usar o comando function onCastSpell(cid, var) doPlayerAddItem(cid, id, count) doPlayerSendTextMessage(cid, 18, "Voce recebeu um pergaminho EDO") doCreatureSay(cid, "Edo Tensei no Jutsu", TALKTYPE_MONSTER) end agr na hora de soltar da isso!
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.