LionM 102 Posted September 24, 2016 Share Posted September 24, 2016 (edited) Adicione a linha no Actions.xml Crie um arquivo no com o nome addonsys.xml em <action itemid="ID DO ADDON ANTES DE APLICAR NO POKEMON" event="script" value="addonsys.lua"/> Actions/Data/addonsys.xml function onUse(cid, item, fromPosition, itemEx, toPosition) local addons = { [12595] = {pokemon= "Arcanine" , looktype = 1469, fly = 0, ride = 1470, surf = 0}, [12686] = {pokemon= "Lucario" , looktype = 1494, fly = 0, ride = 0, surf = 0}, [12685] = {pokemon= "Electabuzz" , looktype = 1493, fly = 0, ride = 0, surf = 0}, [12684] = {pokemon= "Noctowl" , looktype = 1495, fly = 1496, ride = 0, surf = 0}, [12699] = {pokemon= "Shiny Electabuzz" , looktype = 1497, fly = 0, ride = 0, surf = 0}, [ID DO ADDON] = {pokemon= "NOME DO POKEMON" , looktype = O ID DO POKEMON COM A ROUPA, fly = 0, ride = 0, surf = 0}, } if #getCreatureSummons(cid) > 0 then doPlayerSendCancel(cid, "Please back your pokemon.") return false end local addon = addons[item.itemid].looktype local fly = addons[item.itemid].fly local ride = addons[item.itemid].ride local surf = addons[item.itemid].surf -- local addonItem = addons[item.itemid] local pb = getPlayerSlotItem(cid, 8).uid local pk = addons[item.itemid].pokemon if getItemAttribute(pb,"poke") ~= pk then doPlayerSendCancel(cid, "Sorry, you can't use this addon on this poke.") return false end if getItemAttribute(pb,"addon") >= 0 then doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid, 27, "Congratulations! Your Pokémon received a Addon.") doSetItemAttribute(pb,"addon",addon) doSetItemAttribute(pb,"addonItem",addonItem) doSetItemAttribute(pb,"addonfly",fly) doSetItemAttribute(pb,"addonride",ride) doSetItemAttribute(pb,"addonsurf",surf) return true end if getItemAttribute(getPlayerSlotItem(cid, 8).uid, "ehditto") or getItemAttribute(getPlayerSlotItem(cid, 8).uid, "ehshinyditto") thendoPlayerSendCancel(cid, "Você não pode usar Addons em Dittos transformados.")end return trueend No goback.lua antes de return true end Adicione: local pk = getCreatureSummons(cid)[1] local pb = getPlayerSlotItem(cid, 8).uid local look = getItemAttribute(pb,"addon") if not look then doSetItemAttribute(pb,"addon",0) return false end if look > 0 then doSetCreatureOutfit(pk, {lookType = look}, -1) return true endelse doPlayerSendCancel(cid, "This pokemon is fainted.")end Prints: Citar Créditos Bluester Edited September 24, 2016 by LionM Link to comment Share on other sites More sharing options...
L3K0T 149 Posted September 24, 2016 Share Posted September 24, 2016 (edited) alguém pode fazer ler os pokemon aqui nesse system ai não ? local pokes = { ["Bulbasaur"] = {level = 1, cons = 2, vida = 3500}, } local msgunica = true local msgunicago1, msgunicaback1 = "Go, doka!", "Come back, doka!" local msgunicago2, msgunicaback2 = "Let's do it, doka!", "Thanks for helping, doka!" local msgunicago3, msgunicaback3 = "I choose you, doka!", "That's enough, come back!" local msgunicago4, msgunicaback4 = "I need your help, doka!", "You were great, doka!" local msgunicago5, msgunicaback5 = "Let's fight, doka!", "Excellent work, doka!" local msgunicago6, msgunicaback6 = "It's battle time, doka!", "Well done, doka!" function onUse(cid, item, frompos, item2, topos) local random2 = math.random(1,6) if random2 == 1 then msgunicaback = msgunicaback1 elseif random2 == 2 then msgunicaback = msgunicaback2 elseif random2 == 3 then msgunicaback = msgunicaback3 elseif random2 == 4 then msgunicaback = msgunicaback4 elseif random2 == 5 then msgunicaback = msgunicaback5 elseif random2 == 6 then msgunicaback = msgunicaback6 end local random = math.random(1,6) if random == 1 then msgunicago = msgunicago1 elseif random == 2 then msgunicago = msgunicago2 elseif random == 3 then msgunicago = msgunicago3 elseif random == 4 then msgunicago = msgunicago4 elseif random == 5 then msgunicago = msgunicago5 elseif random == 6 then msgunicago = msgunicago6 end if item.itemid == 2222 or item.itemid == 2223 then gobackeff = 188 elseif item.itemid == 2220 or item.itemid == 2221 then gobackeff = 191 elseif item.itemid == 2651 or item.itemid == 2652 then gobackeff = 189 elseif item.itemid == 2653 or item.itemid == 2654 then gobackeff = 190 elseif item.itemid == 2655 or item.itemid == 2656 then gobackeff = 195 end local effect = gobackeff local storageexe = 100 local exhausted = 1 -- segundos if item.itemid == 2223 or item.itemid == 2221 or item.itemid == 2652 or item.itemid == 2654 or item.itemid == 2656 then if #getCreatureSummons(cid) >= 1 then local z = getCreatureSummons(cid)[1] local pokename = getCreatureName(z) local mbk = msgunicaback:gsub("doka", pokename) if getItemAttribute(item.uid, "poke"):find(getCreatureName(z)) then doTransformItem(item.uid, item.itemid-1) doCreatureSay(cid, mbk, TALKTYPE_SAY) local summom = getCreatureSummons(cid) local maxh = pokes[getCreatureName(summom[1])].vida local pct2 = ((getCreatureHealth(summom[1])) / (getCreatureMaxHealth(summom[1]))) local vids = pokes[getCreatureName(summom[1])].vida doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")) .. " HP = ["..getCreatureHealth(z).."/"..getCreatureMaxHealth(z).."]") setPlayerStorageValue(cid, 61204, 0) setPlayerStorageValue(cid, 2, 0) doSendMagicEffect(getCreaturePosition(z), effect) setPlayerStorageValue(cid, storageexe,os.time()+exhausted) doRemoveCreature(z) return true end end elseif item.itemid == 2222 or item.itemid == 2220 or item.itemid == 2651 or item.itemid == 2653 or item.itemid == 2655 then for i,x in pairs(pokes) do if i == getItemAttribute(item.uid, "poke"):sub(9, findLetter(getItemAttribute(item.uid, "poke"), "'")-1) then if getPlayerLevel(cid) < x.level then doPlayerSendCancel(cid, "You need level "..x.level.." or higher to use this pokemon.") return true end local removed = doCreateItem(1285, 1, getThingPos(cid)) doSummonMonster(cid, i) local pk = getCreatureSummons(cid)[1] doTeleportThing(pk, getClosestFreeTile(pk, getThingPos(cid)), false) doRemoveItem(removed, 1) doCreatureSetLookDir(pk, 2) local maxh = pokes[getCreatureName(pk)].vida local levellife = ((getPlayerLevel(cid)) * (pokes[getCreatureName(pk)].cons)) local health = tonumber(getItemAttribute(item.uid, "poke"):match("%[(.-)/")) doConvinceCreature(cid, pk) doCreatureAddHealth(pk, health-maxh) local pct = ((getCreatureHealth(pk)) / (getCreatureMaxHealth(pk))) local vidis = (getCreatureHealth(pk)) setCreatureMaxHealth(pk, ((maxh) + (levellife))) doCreatureAddHealth(pk, 2) doCreatureAddHealth(pk, -vidis) doCreatureAddHealth(pk, ((getCreatureMaxHealth(pk)) * (pct)) - 2) doTransformItem(item.uid, item.itemid+1) local pokename = getCreatureName(getCreatureSummons(cid)[1]) local mgo = msgunicago:gsub("doka", pokename) doCreatureSay(cid, mgo, TALKTYPE_SAY) doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), "."))) doSendMagicEffect(getCreaturePosition(pk), effect) setPlayerStorageValue(cid, 61204, 1) setPlayerStorageValue(cid, 2, 0) registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(pk, "Exp3") break end end end return TRUE end @Deadpool @Daniel Edited September 24, 2016 by Alexy Brocanello Link to comment Share on other sites More sharing options...
wevertonvrb 25 Posted September 29, 2016 Share Posted September 29, 2016 Em 24/09/2016 at 18:50, LionM disse: Adicione a linha no Actions.xml Crie um arquivo no com o nome addonsys.xml em <action itemid="ID DO ADDON ANTES DE APLICAR NO POKEMON" event="script" value="addonsys.lua"/> Actions/Data/addonsys.xml function onUse(cid, item, fromPosition, itemEx, toPosition) local addons = { [12595] = {pokemon= "Arcanine" , looktype = 1469, fly = 0, ride = 1470, surf = 0}, [12686] = {pokemon= "Lucario" , looktype = 1494, fly = 0, ride = 0, surf = 0}, [12685] = {pokemon= "Electabuzz" , looktype = 1493, fly = 0, ride = 0, surf = 0}, [12684] = {pokemon= "Noctowl" , looktype = 1495, fly = 1496, ride = 0, surf = 0}, [12699] = {pokemon= "Shiny Electabuzz" , looktype = 1497, fly = 0, ride = 0, surf = 0}, [ID DO ADDON] = {pokemon= "NOME DO POKEMON" , looktype = O ID DO POKEMON COM A ROUPA, fly = 0, ride = 0, surf = 0}, } if #getCreatureSummons(cid) > 0 then doPlayerSendCancel(cid, "Please back your pokemon.") return false end local addon = addons[item.itemid].looktype local fly = addons[item.itemid].fly local ride = addons[item.itemid].ride local surf = addons[item.itemid].surf -- local addonItem = addons[item.itemid] local pb = getPlayerSlotItem(cid, 8).uid local pk = addons[item.itemid].pokemon if getItemAttribute(pb,"poke") ~= pk then doPlayerSendCancel(cid, "Sorry, you can't use this addon on this poke.") return false end if getItemAttribute(pb,"addon") >= 0 then doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid, 27, "Congratulations! Your Pokémon received a Addon.") doSetItemAttribute(pb,"addon",addon) doSetItemAttribute(pb,"addonItem",addonItem) doSetItemAttribute(pb,"addonfly",fly) doSetItemAttribute(pb,"addonride",ride) doSetItemAttribute(pb,"addonsurf",surf) return true end if getItemAttribute(getPlayerSlotItem(cid, 8).uid, "ehditto") or getItemAttribute(getPlayerSlotItem(cid, 8).uid, "ehshinyditto") thendoPlayerSendCancel(cid, "Você não pode usar Addons em Dittos transformados.")end return trueend No goback.lua antes de return true end Adicione: local pk = getCreatureSummons(cid)[1] local pb = getPlayerSlotItem(cid, 8).uid local look = getItemAttribute(pb,"addon") if not look then doSetItemAttribute(pb,"addon",0) return false end if look > 0 then doSetCreatureOutfit(pk, {lookType = look}, -1) return true endelse doPlayerSendCancel(cid, "This pokemon is fainted.")end Prints: Créditos Bluester ta mas cade o resto? Link to comment Share on other sites More sharing options...
aleknpto 4 Posted October 22, 2016 Share Posted October 22, 2016 Gostaria do que falta na script, porque fly,ride,surf etc não funcionam Link to comment Share on other sites More sharing options...
Recommended Posts