CaioSilva99 28 Postado Abril 17, 2016 Share Postado Abril 17, 2016 Olá eu uso o addon system para o PDE 3.0 más ao utiliza-ló e dar look na ball fica normal seria possível a criação de um sistema para quando der LOOK aparecer o nome do item utilizado como addon? Link para o comentário Compartilhar em outros sites More sharing options...
0 Refe 320 Postado Abril 17, 2016 Share Postado Abril 17, 2016 1 hora atrás, CaioSilva99 disse: Olá eu uso o addon system para o PDE 3.0 más ao utiliza-ló e dar look na ball fica normal seria possível a criação de um sistema para quando der LOOK aparecer o nome do item utilizado como addon? Me manda o arquivo looksystem, look, ou algo assim no creaturescripts. Link para o comentário Compartilhar em outros sites More sharing options...
0 CaioSilva99 28 Postado Abril 18, 2016 Autor Share Postado Abril 18, 2016 22 horas atrás, Ceetros disse: Me manda o arquivo looksystem, look, ou algo assim no creaturescripts. local NPCBattle = { ["Brock"] = {artig = "He is", cidbat = "Pewter"}, ["Misty"] = {artig = "She is", cidbat = "Cerulean"}, ["Blaine"] = {artig = "He is", cidbat = "Cinnabar"}, ["Sabrina"] = {artig = "She is", cidbat = "Saffron"}, --alterado v1.9 \/ peguem tudo! ["Kira"] = {artig = "She is", cidbat = "Viridian"}, ["Koga"] = {artig = "He is", cidbat = "Fushcia"}, ["Erika"] = {artig = "She is", cidbat = "Celadon"}, ["Surge"] = {artig = "He is", cidbat = "Vermilion"}, } function onLook(cid, thing, position, lookDistance) local str = {} if not isCreature(thing.uid) then local iname = getItemInfo(thing.itemid) if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then unLock(thing.uid) local lock = getItemAttribute(thing.uid, "lock") local pokename = getItemAttribute(thing.uid, "poke") table.insert(str, "You see "..iname.article.." "..iname.name..".") if getItemAttribute(thing.uid, "unique") then table.insert(str, " It's an unique item.") end table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..".\n") if lock and lock > 0 then table.insert(str, "It will unlock in ".. os.date("%d/%m/%y %X", lock)..".\n") end local boost = getItemAttribute(thing.uid, "boost") or 0 if boost > 0 then table.insert(str, "Boost level: +"..boost..".\n") end if getItemAttribute(thing.uid, "nick") then table.insert(str, "It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n") end if getItemAttribute(thing.uid, "gender") == SEX_MALE then table.insert(str, "It is male.") elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then table.insert(str, "You see a "..string.lower(iname.name)..". ") if isContainer(thing.uid) then table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")") end table.insert(str, "\n") if getItemAttribute(thing.uid, "gender") == SEX_MALE then table.insert(str, "It is male.") elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif isContainer(thing.uid) then --containers if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ") table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ") table.insert(str, getItemAttribute(thing.uid, "attacker")..".") else table.insert(str, "You see "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").") end if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then table.insert(str, "\nItemID: ["..thing.itemid.."]") local pos = getThingPos(thing.uid) table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif getItemAttribute(thing.uid, "unique") then local p = getThingPos(thing.uid) table.insert(str, "You see ") if thing.type > 1 then table.insert(str, thing.type.." "..iname.plural..".") else table.insert(str, iname.article.." "..iname.name..".") end table.insert(str, " It's an unique item.\n"..iname.description) if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then table.insert(str, "\nItemID: ["..thing.itemid.."]") table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]") end sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false else return true end end local npcname = getCreatureName(thing.uid) if ehNPC(thing.uid) and NPCBattle[npcname] then --npcs duel table.insert(str, "You see "..npcname..". "..NPCBattle[npcname].artig.." leader of the gym from "..NPCBattle[npcname].cidbat..".") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false end if getPlayerStorageValue(thing.uid, 697548) ~= -1 then table.insert(str, getPlayerStorageValue(thing.uid, 697548)) local pos = getThingPos(thing.uid) if youAre[getPlayerGroupId(cid)] then table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false end if not isPlayer(thing.uid) and not isMonster(thing.uid) then --outros npcs table.insert(str, "You see "..getCreatureName(thing.uid)..".") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false end if isPlayer(thing.uid) then --player doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getPlayerDesc(cid, thing.uid, false)) return false end if getCreatureName(thing.uid) == "Evolution" then return false end if not isSummon(thing.uid) then --monstros table.insert(str, "You see a wild "..string.lower(getCreatureName(thing.uid))..".\n") table.insert(str, "Hit Points: "..getCreatureHealth(thing.uid).." / "..getCreatureMaxHealth(thing.uid)..".\n") if getPokemonGender(thing.uid) == SEX_MALE then table.insert(str, "It is male.") elseif getPokemonGender(thing.uid) == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif isSummon(thing.uid) and not isPlayer(thing.uid) then --summons local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0 if getCreatureMaster(thing.uid) == cid then local myball = getPlayerSlotItem(cid, 8).uid table.insert(str, "You see your "..string.lower(getCreatureName(thing.uid))..".") if boostlevel > 0 then table.insert(str, "\nBoost level: +"..boostlevel..".") end table.insert(str, "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".") table.insert(str, "\n"..getPokemonHappinessDescription(thing.uid)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid))..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".") end return false end return true end Link para o comentário Compartilhar em outros sites More sharing options...
0 Refe 320 Postado Abril 18, 2016 Share Postado Abril 18, 2016 addon.lua (actions) function onUse(cid, item, fromPosition, itemEx, toPosition) local addons = { [iD DO ITEM] = {pokemon= "NOME DO POKEMON" , looktype = LOOKTYPE NORMAL, fly = FLY, SE NÃO TIVER PONHA 0, ride = RIDE, SE NÃO TIVER PONHA 0, surf = SE NÃO TIVER SURF PONHA 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! Now your pokemon will use the addon.") doSetItemAttribute(pb,"addon",addon) doSetItemAttribute(pb,"addonItem",addonItem) doSetItemAttribute(pb,"addonfly",fly) doSetItemAttribute(pb,"addonride",ride) doSetItemAttribute(pb,"addonsurf",surf) return true end return trueend look: function onLook(cid, thing, position, lookDistance) local str = {} if not isCreature(thing.uid) then local iname = getItemInfo(thing.itemid) if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then unLock(thing.uid) local lock = getItemAttribute(thing.uid, "lock") local pokename = getItemAttribute(thing.uid, "poke") table.insert(str, "You see "..iname.article.." "..iname.name..".") if getItemAttribute(thing.uid, "unique") then table.insert(str, " It's an unique item.") end table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..".\n") if lock and lock > 0 then table.insert(str, "It will unlock in ".. os.date("%d/%m/%y %X", lock)..".\n") end local boost = getItemAttribute(thing.uid, "boost") or 0 if boost > 0 then table.insert(str, "Boost level: +"..boost..".\n") end local addon = getItemAttribute(thing.uid, "addon") if addon > 1 then local addonitema = getItemAttribute(thing.uid, "addonItem") table.insert(str, "Addon "..getItemNameById(addonitema)..".\n") end if getItemAttribute(thing.uid, "nick") then table.insert(str, "It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n") end if getItemAttribute(thing.uid, "gender") == SEX_MALE then table.insert(str, "It is male.") elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then table.insert(str, "You see a "..string.lower(iname.name)..". ") if isContainer(thing.uid) then table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")") end table.insert(str, "\n") if getItemAttribute(thing.uid, "gender") == SEX_MALE then table.insert(str, "It is male.") elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif isContainer(thing.uid) then --containers if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ") table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ") table.insert(str, getItemAttribute(thing.uid, "attacker")..".") else table.insert(str, "You see "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").") end if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then table.insert(str, "\nItemID: ["..thing.itemid.."]") local pos = getThingPos(thing.uid) table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif getItemAttribute(thing.uid, "unique") then local p = getThingPos(thing.uid) table.insert(str, "You see ") if thing.type > 1 then table.insert(str, thing.type.." "..iname.plural..".") else table.insert(str, iname.article.." "..iname.name..".") end table.insert(str, " It's an unique item.\n"..iname.description) if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then table.insert(str, "\nItemID: ["..thing.itemid.."]") table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]") end sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false else return true endendlocal npcname = getCreatureName(thing.uid)if ehNPC(thing.uid) and NPCBattle[npcname] then --npcs duel table.insert(str, "You see "..npcname..". "..NPCBattle[npcname].artig.." leader of the gym from "..NPCBattle[npcname].cidbat..".") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return falseendif getPlayerStorageValue(thing.uid, 697548) ~= -1 then table.insert(str, getPlayerStorageValue(thing.uid, 697548)) local pos = getThingPos(thing.uid) if youAre[getPlayerGroupId(cid)] then table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return falseendif not isPlayer(thing.uid) and not isMonster(thing.uid) then --outros npcs table.insert(str, "You see "..getCreatureName(thing.uid)..".") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return falseendif isPlayer(thing.uid) then --player doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getPlayerDesc(cid, thing.uid, false)) return falseendif getCreatureName(thing.uid) == "Evolution" then return false endif not isSummon(thing.uid) then --monstros table.insert(str, "You see a wild "..string.lower(getCreatureName(thing.uid))..".\n") table.insert(str, "Hit Points: "..getCreatureHealth(thing.uid).." / "..getCreatureMaxHealth(thing.uid)..".\n") if getPokemonGender(thing.uid) == SEX_MALE then table.insert(str, "It is male.") elseif getPokemonGender(thing.uid) == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return falseelseif isSummon(thing.uid) and not isPlayer(thing.uid) then --summons local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0 if getCreatureMaster(thing.uid) == cid then local myball = getPlayerSlotItem(cid, 8).uid table.insert(str, "You see your "..string.lower(getCreatureName(thing.uid))..".") if boostlevel > 0 then table.insert(str, "\nBoost level: +"..boostlevel..".") end table.insert(str, "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".") table.insert(str, "\n"..getPokemonHappinessDescription(thing.uid)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid))..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".") end return falseendreturn trueend Depois só adiciona o item no XML Link para o comentário Compartilhar em outros sites More sharing options...
0 CaioSilva99 28 Postado Abril 18, 2016 Autor Share Postado Abril 18, 2016 2 minutos atrás, Ceetros disse: addon.lua (actions) function onUse(cid, item, fromPosition, itemEx, toPosition) local addons = { [iD DO ITEM] = {pokemon= "NOME DO POKEMON" , looktype = LOOKTYPE NORMAL, fly = FLY, SE NÃO TIVER PONHA 0, ride = RIDE, SE NÃO TIVER PONHA 0, surf = SE NÃO TIVER SURF PONHA 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! Now your pokemon will use the addon.") doSetItemAttribute(pb,"addon",addon) doSetItemAttribute(pb,"addonItem",addonItem) doSetItemAttribute(pb,"addonfly",fly) doSetItemAttribute(pb,"addonride",ride) doSetItemAttribute(pb,"addonsurf",surf) return true end return trueend look: function onLook(cid, thing, position, lookDistance) local str = {} if not isCreature(thing.uid) then local iname = getItemInfo(thing.itemid) if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then unLock(thing.uid) local lock = getItemAttribute(thing.uid, "lock") local pokename = getItemAttribute(thing.uid, "poke") table.insert(str, "You see "..iname.article.." "..iname.name..".") if getItemAttribute(thing.uid, "unique") then table.insert(str, " It's an unique item.") end table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..".\n") if lock and lock > 0 then table.insert(str, "It will unlock in ".. os.date("%d/%m/%y %X", lock)..".\n") end local boost = getItemAttribute(thing.uid, "boost") or 0 if boost > 0 then table.insert(str, "Boost level: +"..boost..".\n") end local addon = getItemAttribute(thing.uid, "addon") if addon > 1 then local addonitema = getItemAttribute(thing.uid, "addonItem") table.insert(str, "Addon "..getItemNameById(addonitema)..".\n") end if getItemAttribute(thing.uid, "nick") then table.insert(str, "It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n") end if getItemAttribute(thing.uid, "gender") == SEX_MALE then table.insert(str, "It is male.") elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then table.insert(str, "You see a "..string.lower(iname.name)..". ") if isContainer(thing.uid) then table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")") end table.insert(str, "\n") if getItemAttribute(thing.uid, "gender") == SEX_MALE then table.insert(str, "It is male.") elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif isContainer(thing.uid) then --containers if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ") table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ") table.insert(str, getItemAttribute(thing.uid, "attacker")..".") else table.insert(str, "You see "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").") end if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then table.insert(str, "\nItemID: ["..thing.itemid.."]") local pos = getThingPos(thing.uid) table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif getItemAttribute(thing.uid, "unique") then local p = getThingPos(thing.uid) table.insert(str, "You see ") if thing.type > 1 then table.insert(str, thing.type.." "..iname.plural..".") else table.insert(str, iname.article.." "..iname.name..".") end table.insert(str, " It's an unique item.\n"..iname.description) if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then table.insert(str, "\nItemID: ["..thing.itemid.."]") table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]") end sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false else return true endendlocal npcname = getCreatureName(thing.uid)if ehNPC(thing.uid) and NPCBattle[npcname] then --npcs duel table.insert(str, "You see "..npcname..". "..NPCBattle[npcname].artig.." leader of the gym from "..NPCBattle[npcname].cidbat..".") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return falseendif getPlayerStorageValue(thing.uid, 697548) ~= -1 then table.insert(str, getPlayerStorageValue(thing.uid, 697548)) local pos = getThingPos(thing.uid) if youAre[getPlayerGroupId(cid)] then table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return falseendif not isPlayer(thing.uid) and not isMonster(thing.uid) then --outros npcs table.insert(str, "You see "..getCreatureName(thing.uid)..".") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return falseendif isPlayer(thing.uid) then --player doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getPlayerDesc(cid, thing.uid, false)) return falseendif getCreatureName(thing.uid) == "Evolution" then return false endif not isSummon(thing.uid) then --monstros table.insert(str, "You see a wild "..string.lower(getCreatureName(thing.uid))..".\n") table.insert(str, "Hit Points: "..getCreatureHealth(thing.uid).." / "..getCreatureMaxHealth(thing.uid)..".\n") if getPokemonGender(thing.uid) == SEX_MALE then table.insert(str, "It is male.") elseif getPokemonGender(thing.uid) == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return falseelseif isSummon(thing.uid) and not isPlayer(thing.uid) then --summons local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0 if getCreatureMaster(thing.uid) == cid then local myball = getPlayerSlotItem(cid, 8).uid table.insert(str, "You see your "..string.lower(getCreatureName(thing.uid))..".") if boostlevel > 0 then table.insert(str, "\nBoost level: +"..boostlevel..".") end table.insert(str, "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".") table.insert(str, "\n"..getPokemonHappinessDescription(thing.uid)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid))..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".") end return falseendreturn trueend Depois só adiciona o item no XML Seu rep já foi adicionado vou testar aqui(nem preciso já sei que foi mesmo) Como eu marco como melhor resposta? Link para o comentário Compartilhar em outros sites More sharing options...
0 Refe 320 Postado Abril 18, 2016 Share Postado Abril 18, 2016 1 hora atrás, CaioSilva99 disse: Seu rep já foi adicionado vou testar aqui(nem preciso já sei que foi mesmo) Como eu marco como melhor resposta? Não sei ;-; Link para o comentário Compartilhar em outros sites More sharing options...
0 CaioSilva99 28 Postado Abril 18, 2016 Autor Share Postado Abril 18, 2016 3 horas atrás, CaioSilva99 disse: local NPCBattle = { ["Brock"] = {artig = "He is", cidbat = "Pewter"}, ["Misty"] = {artig = "She is", cidbat = "Cerulean"}, ["Blaine"] = {artig = "He is", cidbat = "Cinnabar"}, ["Sabrina"] = {artig = "She is", cidbat = "Saffron"}, --alterado v1.9 \/ peguem tudo! ["Kira"] = {artig = "She is", cidbat = "Viridian"}, ["Koga"] = {artig = "He is", cidbat = "Fushcia"}, ["Erika"] = {artig = "She is", cidbat = "Celadon"}, ["Surge"] = {artig = "He is", cidbat = "Vermilion"}, } function onLook(cid, thing, position, lookDistance) local str = {} if not isCreature(thing.uid) then local iname = getItemInfo(thing.itemid) if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then unLock(thing.uid) local lock = getItemAttribute(thing.uid, "lock") local pokename = getItemAttribute(thing.uid, "poke") table.insert(str, "You see "..iname.article.." "..iname.name..".") if getItemAttribute(thing.uid, "unique") then table.insert(str, " It's an unique item.") end table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..".\n") if lock and lock > 0 then table.insert(str, "It will unlock in ".. os.date("%d/%m/%y %X", lock)..".\n") end local boost = getItemAttribute(thing.uid, "boost") or 0 if boost > 0 then table.insert(str, "Boost level: +"..boost..".\n") end if getItemAttribute(thing.uid, "nick") then table.insert(str, "It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n") end if getItemAttribute(thing.uid, "gender") == SEX_MALE then table.insert(str, "It is male.") elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then table.insert(str, "You see a "..string.lower(iname.name)..". ") if isContainer(thing.uid) then table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")") end table.insert(str, "\n") if getItemAttribute(thing.uid, "gender") == SEX_MALE then table.insert(str, "It is male.") elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif isContainer(thing.uid) then --containers if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ") table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ") table.insert(str, getItemAttribute(thing.uid, "attacker")..".") else table.insert(str, "You see "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").") end if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then table.insert(str, "\nItemID: ["..thing.itemid.."]") local pos = getThingPos(thing.uid) table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif getItemAttribute(thing.uid, "unique") then local p = getThingPos(thing.uid) table.insert(str, "You see ") if thing.type > 1 then table.insert(str, thing.type.." "..iname.plural..".") else table.insert(str, iname.article.." "..iname.name..".") end table.insert(str, " It's an unique item.\n"..iname.description) if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then table.insert(str, "\nItemID: ["..thing.itemid.."]") table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]") end sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false else return true end end local npcname = getCreatureName(thing.uid) if ehNPC(thing.uid) and NPCBattle[npcname] then --npcs duel table.insert(str, "You see "..npcname..". "..NPCBattle[npcname].artig.." leader of the gym from "..NPCBattle[npcname].cidbat..".") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false end if getPlayerStorageValue(thing.uid, 697548) ~= -1 then table.insert(str, getPlayerStorageValue(thing.uid, 697548)) local pos = getThingPos(thing.uid) if youAre[getPlayerGroupId(cid)] then table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false end if not isPlayer(thing.uid) and not isMonster(thing.uid) then --outros npcs table.insert(str, "You see "..getCreatureName(thing.uid)..".") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false end if isPlayer(thing.uid) then --player doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getPlayerDesc(cid, thing.uid, false)) return false end if getCreatureName(thing.uid) == "Evolution" then return false end if not isSummon(thing.uid) then --monstros table.insert(str, "You see a wild "..string.lower(getCreatureName(thing.uid))..".\n") table.insert(str, "Hit Points: "..getCreatureHealth(thing.uid).." / "..getCreatureMaxHealth(thing.uid)..".\n") if getPokemonGender(thing.uid) == SEX_MALE then table.insert(str, "It is male.") elseif getPokemonGender(thing.uid) == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif isSummon(thing.uid) and not isPlayer(thing.uid) then --summons local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0 if getCreatureMaster(thing.uid) == cid then local myball = getPlayerSlotItem(cid, 8).uid table.insert(str, "You see your "..string.lower(getCreatureName(thing.uid))..".") if boostlevel > 0 then table.insert(str, "\nBoost level: +"..boostlevel..".") end table.insert(str, "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".") table.insert(str, "\n"..getPokemonHappinessDescription(thing.uid)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid))..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".") end return false end return true end [18/04/2016 15:51:10] [Error - CreatureScript Interface] [18/04/2016 15:51:10] data/creaturescripts/scripts/look.lua:onLook [18/04/2016 15:51:10] Description: [18/04/2016 15:51:10] data/lib/050-function.lua:227: attempt to index a boolean value [18/04/2016 15:51:10] stack traceback: [18/04/2016 15:51:10] data/lib/050-function.lua:227: in function 'getItemNameById' [18/04/2016 15:51:10] data/creaturescripts/scripts/look.lua:26: in function <data/creaturescripts/scripts/look.lua:1> '-' Link para o comentário Compartilhar em outros sites More sharing options...
0 Refe 320 Postado Abril 18, 2016 Share Postado Abril 18, 2016 37 minutos atrás, CaioSilva99 disse: [18/04/2016 15:51:10] [Error - CreatureScript Interface] [18/04/2016 15:51:10] data/creaturescripts/scripts/look.lua:onLook [18/04/2016 15:51:10] Description: [18/04/2016 15:51:10] data/lib/050-function.lua:227: attempt to index a boolean value [18/04/2016 15:51:10] stack traceback: [18/04/2016 15:51:10] data/lib/050-function.lua:227: in function 'getItemNameById' [18/04/2016 15:51:10] data/creaturescripts/scripts/look.lua:26: in function <data/creaturescripts/scripts/look.lua:1> '-' Atualizou o addon.lua e deu o addon depois disso? Link para o comentário Compartilhar em outros sites More sharing options...
0 CaioSilva99 28 Postado Abril 19, 2016 Autor Share Postado Abril 19, 2016 20 horas atrás, Ceetros disse: Atualizou o addon.lua e deu o addon depois disso? Eu removi e adicionei denovo com seu atualizado o addon.lua ele deu o addon mas deu erro no look. Link para o comentário Compartilhar em outros sites More sharing options...
0 Refe 320 Postado Abril 19, 2016 Share Postado Abril 19, 2016 (editado) Spoiler function onLook(cid, thing, position, lookDistance) local str = {} if not isCreature(thing.uid) then local iname = getItemInfo(thing.itemid) if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then unLock(thing.uid) local lock = getItemAttribute(thing.uid, "lock") local pokename = getItemAttribute(thing.uid, "poke") table.insert(str, "You see "..iname.article.." "..iname.name..".") if getItemAttribute(thing.uid, "unique") then table.insert(str, " It's an unique item.") end table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..".\n") if lock and lock > 0 then table.insert(str, "It will unlock in ".. os.date("%d/%m/%y %X", lock)..".\n") end local boost = getItemAttribute(thing.uid, "boost") or 0 if boost > 0 then table.insert(str, "Boost level: +"..boost..".\n") end local addon = getItemAttribute(thing.uid, "addon") if addon > 1 then local addonitema = getItemAttribute(thing.uid, "addonItem") local lookaddon = getItemNameById(addonitema) table.insert(str, "Addon "..lookaddon..".\n") end if getItemAttribute(thing.uid, "nick") then table.insert(str, "It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n") end if getItemAttribute(thing.uid, "gender") == SEX_MALE then table.insert(str, "It is male.") elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then table.insert(str, "You see a "..string.lower(iname.name)..". ") if isContainer(thing.uid) then table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")") end table.insert(str, "\n") if getItemAttribute(thing.uid, "gender") == SEX_MALE then table.insert(str, "It is male.") elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif isContainer(thing.uid) then --containers if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ") table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ") table.insert(str, getItemAttribute(thing.uid, "attacker")..".") else table.insert(str, "You see "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").") end if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then table.insert(str, "\nItemID: ["..thing.itemid.."]") local pos = getThingPos(thing.uid) table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif getItemAttribute(thing.uid, "unique") then local p = getThingPos(thing.uid) table.insert(str, "You see ") if thing.type > 1 then table.insert(str, thing.type.." "..iname.plural..".") else table.insert(str, iname.article.." "..iname.name..".") end table.insert(str, " It's an unique item.\n"..iname.description) if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then table.insert(str, "\nItemID: ["..thing.itemid.."]") table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]") end sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false else return true endendlocal npcname = getCreatureName(thing.uid)if ehNPC(thing.uid) and NPCBattle[npcname] then --npcs duel table.insert(str, "You see "..npcname..". "..NPCBattle[npcname].artig.." leader of the gym from "..NPCBattle[npcname].cidbat..".") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return falseendif getPlayerStorageValue(thing.uid, 697548) ~= -1 then table.insert(str, getPlayerStorageValue(thing.uid, 697548)) local pos = getThingPos(thing.uid) if youAre[getPlayerGroupId(cid)] then table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return falseendif not isPlayer(thing.uid) and not isMonster(thing.uid) then --outros npcs table.insert(str, "You see "..getCreatureName(thing.uid)..".") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return falseendif isPlayer(thing.uid) then --player doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getPlayerDesc(cid, thing.uid, false)) return falseendif getCreatureName(thing.uid) == "Evolution" then return false endif not isSummon(thing.uid) then --monstros table.insert(str, "You see a wild "..string.lower(getCreatureName(thing.uid))..".\n") table.insert(str, "Hit Points: "..getCreatureHealth(thing.uid).." / "..getCreatureMaxHealth(thing.uid)..".\n") if getPokemonGender(thing.uid) == SEX_MALE then table.insert(str, "It is male.") elseif getPokemonGender(thing.uid) == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return falseelseif isSummon(thing.uid) and not isPlayer(thing.uid) then --summons local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0 if getCreatureMaster(thing.uid) == cid then local myball = getPlayerSlotItem(cid, 8).uid table.insert(str, "You see your "..string.lower(getCreatureName(thing.uid))..".") if boostlevel > 0 then table.insert(str, "\nBoost level: +"..boostlevel..".") end table.insert(str, "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".") table.insert(str, "\n"..getPokemonHappinessDescription(thing.uid)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid))..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".") end return falseendreturn trueend Editado Abril 19, 2016 por Danny0 Link para o comentário Compartilhar em outros sites More sharing options...
0 samlecter 133 Postado Julho 6, 2016 Share Postado Julho 6, 2016 @Ceetros Um amigo me pediu a mesma coisa, Tentei colocar do jeito certo pegando o nome do item no items.xml com getItemNameById mas também não deu certo, então eu fiz de outro jeito e ta funcionando perfeitamente, só que tem que adicionar o nome do item na tabela do addon.lua (gambiarra pois o nome do item já está no items.xml ) @CaioSilva99 Alterei no primeiro addon.lua que vc mandou e em 2 look.lua, pq parece ter 2 diferentes, lembrando que no addon.lua tem mais 1 coisa p/ configurar na tabela OBS: Não entendi qual o seu look.lua , tem 2 diferentes, o seu é o que começa com: local NPCBattle = {["Brock"] = {artig = "He is", cidbat = "Pewter"},["Misty"] = {artig = "She is", cidbat = "Cerulean"}, ["Blaine"] = {artig = "He is", cidbat = "Cinnabar"},["Sabrina"] = {artig = "She is", cidbat = "Saffron"}, --alterado v1.9 \/ peguem tudo!["Kira"] = {artig = "She is", cidbat = "Viridian"}, Ou o que começa com: function onLook(cid, thing, position, lookDistance) local str = {} if not isCreature(thing.uid) then local iname = getItemInfo(thing.itemid) if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then em actions\scripts: Addon.lua: Spoiler function onUse(cid, item, fromPosition, itemEx, toPosition) local addons = { [iD DO ITEM] = {pokemon= "NOME DO POKEMON" , looktype = LOOKTYPE NORMAL, nameitem = "NomeDoItemDoAddon", fly = FLY, SE NÃO TIVER PONHA 0, ride = RIDE, SE NÃO TIVER PONHA 0, surf = SE NÃO TIVER SURF PONHA 0}, -- em nameitem coloca o nome do item do addon, exemplo: Bandana Azul } if #getCreatureSummons(cid) > 0 then doPlayerSendCancel(cid, "Please back your pokemon.") return false end local addon = addons[item.itemid].looktype local addonlookname = addons[item.itemid].nameitem -- Linha adicionada, Sam Lecter 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! Now your pokemon will use the addon.") doSetItemAttribute(pb,"addon",addon) doSetItemAttribute(pb,"addonlook",addonlookname) -- linha adicionada, Sam Lecter doSetItemAttribute(pb,"addonItem",addonItem) doSetItemAttribute(pb,"addonfly",fly) doSetItemAttribute(pb,"addonride",ride) doSetItemAttribute(pb,"addonsurf",surf) return true end return trueend Não entendi qual é o seu look.lua pois tem 2 diferentes nos comentários, então fiz as alterações necessárias nos 2, pegue o certo ou me manda novamente o look.lua que faço as alterações dnv! look.lua: (esse é o que começa com a tabela: local NpcBattle) Spoiler local NPCBattle = {["Brock"] = {artig = "He is", cidbat = "Pewter"},["Misty"] = {artig = "She is", cidbat = "Cerulean"}, ["Blaine"] = {artig = "He is", cidbat = "Cinnabar"},["Sabrina"] = {artig = "She is", cidbat = "Saffron"}, --alterado v1.9 \/ peguem tudo!["Kira"] = {artig = "She is", cidbat = "Viridian"},["Koga"] = {artig = "He is", cidbat = "Fushcia"},["Erika"] = {artig = "She is", cidbat = "Celadon"},["Surge"] = {artig = "He is", cidbat = "Vermilion"},}function onLook(cid, thing, position, lookDistance) local str = {} if not isCreature(thing.uid) then local iname = getItemInfo(thing.itemid) if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then unLock(thing.uid) local lock = getItemAttribute(thing.uid, "lock") local pokename = getItemAttribute(thing.uid, "poke") table.insert(str, "You see "..iname.article.." "..iname.name..".") if getItemAttribute(thing.uid, "unique") then table.insert(str, " It's an unique item.") end table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..".\n") if lock and lock > 0 then table.insert(str, "It will unlock in ".. os.date("%d/%m/%y %X", lock)..".\n") end if getItemAttribute(thing.uid, "addonlook") then -- Linha adicionada, Sam Lecter table.insert(str, "Addon usada: "..getItemAttribute(thing.uid, "addonlook")..".\n") end local boost = getItemAttribute(thing.uid, "boost") or 0 if boost > 0 then table.insert(str, "Boost level: +"..boost..".\n") end if getItemAttribute(thing.uid, "nick") then table.insert(str, "It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n") end if getItemAttribute(thing.uid, "gender") == SEX_MALE then table.insert(str, "It is male.") elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then table.insert(str, "You see a "..string.lower(iname.name)..". ") if isContainer(thing.uid) then table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")") end table.insert(str, "\n") if getItemAttribute(thing.uid, "gender") == SEX_MALE then table.insert(str, "It is male.") elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif isContainer(thing.uid) then --containers if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ") table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ") table.insert(str, getItemAttribute(thing.uid, "attacker")..".") else table.insert(str, "You see "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").") end if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then table.insert(str, "\nItemID: ["..thing.itemid.."]") local pos = getThingPos(thing.uid) table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false elseif getItemAttribute(thing.uid, "unique") then local p = getThingPos(thing.uid) table.insert(str, "You see ") if thing.type > 1 then table.insert(str, thing.type.." "..iname.plural..".") else table.insert(str, iname.article.." "..iname.name..".") end table.insert(str, " It's an unique item.\n"..iname.description) if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then table.insert(str, "\nItemID: ["..thing.itemid.."]") table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]") end sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false else return true endendlocal npcname = getCreatureName(thing.uid)if ehNPC(thing.uid) and NPCBattle[npcname] then --npcs duel table.insert(str, "You see "..npcname..". "..NPCBattle[npcname].artig.." leader of the gym from "..NPCBattle[npcname].cidbat..".") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return falseendif getPlayerStorageValue(thing.uid, 697548) ~= -1 then table.insert(str, getPlayerStorageValue(thing.uid, 697548)) local pos = getThingPos(thing.uid) if youAre[getPlayerGroupId(cid)] then table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return falseendif not isPlayer(thing.uid) and not isMonster(thing.uid) then --outros npcs table.insert(str, "You see "..getCreatureName(thing.uid)..".") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return falseendif isPlayer(thing.uid) then --player doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getPlayerDesc(cid, thing.uid, false)) return falseendif getCreatureName(thing.uid) == "Evolution" then return false endif not isSummon(thing.uid) then --monstros table.insert(str, "You see a wild "..string.lower(getCreatureName(thing.uid))..".\n") table.insert(str, "Hit Points: "..getCreatureHealth(thing.uid).." / "..getCreatureMaxHealth(thing.uid)..".\n") if getPokemonGender(thing.uid) == SEX_MALE then table.insert(str, "It is male.") elseif getPokemonGender(thing.uid) == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) return falseelseif isSummon(thing.uid) and not isPlayer(thing.uid) then --summons local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0 if getCreatureMaster(thing.uid) == cid then local myball = getPlayerSlotItem(cid, 8).uid table.insert(str, "You see your "..string.lower(getCreatureName(thing.uid))..".") if boostlevel > 0 then table.insert(str, "\nBoost level: +"..boostlevel..".") end table.insert(str, "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".") table.insert(str, "\n"..getPokemonHappinessDescription(thing.uid)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid))..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".") end return falseendreturn trueend look.lua: (esse é o que começa com function onUse) Spoiler function onUse(cid, item, fromPosition, itemEx, toPosition) local addons = { [iD DO ITEM] = {pokemon= "NOME DO POKEMON" , looktype = LOOKTYPE NORMAL, nameitem = "NomeDoItemDoAddon", fly = FLY, SE NÃO TIVER PONHA 0, ride = RIDE, SE NÃO TIVER PONHA 0, surf = SE NÃO TIVER SURF PONHA 0}, -- em nameitem coloca o nome do item do addon, exemplo: Bandana Azul } if #getCreatureSummons(cid) > 0 then doPlayerSendCancel(cid, "Please back your pokemon.") return false end local addon = addons[item.itemid].looktype local addonlookname = addons[item.itemid].nameitem -- Linha adicionada, Sam Lecter 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! Now your pokemon will use the addon.") doSetItemAttribute(pb,"addon",addon) doSetItemAttribute(pb,"addonlook",addonlookname) -- linha adicionada, Sam Lecter doSetItemAttribute(pb,"addonItem",addonItem) doSetItemAttribute(pb,"addonfly",fly) doSetItemAttribute(pb,"addonride",ride) doSetItemAttribute(pb,"addonsurf",surf) return true end return trueend Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
CaioSilva99 28
Olá eu uso o addon system para o PDE 3.0 más ao utiliza-ló e dar look na ball fica normal seria possível a criação de um sistema para quando der LOOK aparecer o nome do item utilizado como addon?
Link para o comentário
Compartilhar em outros sites
10 respostass a esta questão
Posts Recomendados