Ir para conteúdo

[Encerrado] Adaptação De Script


Markowiicz

Posts Recomendados

Algum Scripter, Poderia Dar Uma Ajudinha Aqui?, Bem Como No Titulo, Gostaria De Adaptar Este Script:



Para Este Look:

function onLook(cid, thing, position, lookDistance)

local str = ""

if not isCreature(thing.uid) then

local iname = getItemInfo(thing.itemid)

if not isPokeball(thing.itemid) then
if priceList[getItemInfo(thing.itemid).name] then
price = priceList[getItemInfo(thing.itemid).name].price
if thing.type > 1 then
str = "You see "..thing.type.." "..getItemInfo(thing.itemid).plural.."."
price = price * thing.type
else
str = "You see "..getItemInfo(thing.itemid).article.." "..getItemInfo(thing.itemid).name.."."
end
str = str.." Price: $"..price.."."
if getItemAttribute(thing.uid, "description") then
str = str.."\n"..getItemAttribute(thing.uid, "description").."."
end
if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
str = str.."\nItemID: ["..thing.itemid.."]." --alterado v1.7
local pos = getThingPos(thing.uid)
str = str.."\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]"
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
end
end

if isPokeball(thing.itemid) then

local owner = getItemAttribute(thing.uid, "firstpoke")

local pokename = getItemAttribute(thing.uid, "poke")
local item = getItemInfo(thing.itemid)

str = "You see "..item.article.." "..item.name..".\n"
str = str.."Contains "..getArticle(pokename)..""
if getItemAttribute(thing.uid, "gender") == SEX_MALE then
str = str.." Male"
elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
str = str.." Female"
end
if pokename == "Shiny Onix" then
pokename = "Crystal Onix"
elseif pokename == "Shiny Gyarados" then
pokename = "Red Gyarados"
elseif pokename == "Shiny Charizard" then
pokename = "Elder Charizard"
elseif pokename == "Shiny Venusaur" then
pokename = "Ancient Venusaur"
elseif pokename == "Shiny Blastoise" then
pokename = "Ancient Blastoise"
elseif pokename == "Shiny Farfetch'd" then
pokename = "Elite Farfetch'd"
elseif pokename == "Shiny Hitmonlee" then
pokename = "Elite Hitmonlee"
elseif pokename == "Shiny Hitmonchan" then
pokename = "Elite Hitmonchan"
elseif pokename == "Shiny Abra" then
pokename = "Dark Abra"
elseif pokename == "Shiny Snorlax" then
pokename = "Big Snorlax"
elseif pokename == "Shiny Hitmontop" then
pokename = "Elite Hitmontop"
end
str = str.." "..pokename..""
if getItemAttribute(thing.uid, "nick") then
str = str.." ("..getItemAttribute(thing.uid, "nick")..")"
end
local boost = getItemAttribute(thing.uid, "boost") or 0
if boost > 0 then
str = str.." +"..boost..""
end
str = str.."."

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)

return false

elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then

str = "You see a "..string.lower(iname.name)..".\n"

if getItemAttribute(thing.uid, "gender") == SEX_MALE then
elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
else
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)

return false

else

return true

end
end

local NPCBattle = {
["Brock"] = {artig = "He is", cidbat = "Pewter"},
["Misty"] = {artig = "She is", cidbat = "Cerulean"},
["Kira"] = {artig = "She is", cidbat = "Viridian"},
["Erika"] = {artig = "She is", cidbat = "Celadon"},
["Sabrina"] = {artig = "She is", cidbat = "Saffron"},
["Surge"] = {artig = "He is", cidbat = "Vermilion"},
["Blaine"] = {artig = "He is", cidbat = "Cinnabar"},
["Koga"] = {artig = "He is", cidbat = "Fuchsia"},
}

NPCname = {"Brock", "Misty", "Kira", "Erika", "Sabrina", "Surge", "Blaine", "Koga"}

local npcname = getCreatureName(thing.uid)
if not isPlayer(thing.uid) and not isMonster(thing.uid) and isInArray(NPCname, npcname) then
str = "You see "..npcname..". "..NPCBattle[npcname].artig.." a leader gym from "..NPCBattle[npcname].cidbat.."."
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
end

if not isPlayer(thing.uid) and not isMonster(thing.uid) then
str = "You see "..getCreatureName(thing.uid).."."
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
end

look = {
[1] = {"a Volcanic Spark", "a Volcanic Flame","a Volcanic Firetamer","a Volcanic Pyromancer","a Volcanic Master"},
[2] = {"a Seavell Drop", "a Seavell Icelake","a Seavell Waterfall","a Seavell Frost","a Seavell Master"},
[3] = {"an Orebound Sand", "an Orebound Rock","an Orebound Solid","an Orebound Hardskin","an Orebound Hero"},
[4] = {"a Wingeon Cloud", "a Wingeon Wind","a Wingeon Sky","a Wingeon Falcon","a Wingeon Dragon"},
[5] = {"a Malefic Troublemaker", "a Malefic Venomancer","a Malefic Spectre","a Malefic Nightwalker","a Malefic Master"},
[6] = {"a Gardestrike Fist", "a Gardestrike Tamer","a Gardestrike Fighter","a Gardestrike DeathHand","a Gardestrike Champion"},
[7] = {"a Psycraft Mind", "a Psycraft Brain","a Psycraft Scholar","a Psycraft Telepath","a Psycraft Medium"},
[8] = {"a Naturia Seed", "a Naturia Sprout","a Naturia Webhead","a Naturia Woodtrunk","a Naturia Keeper"},
[9] = {"a Raibolt Shock", "a Raibolt Watt","a Raibolt Electrician","a Raibolt Overcharged","a Raibolt Legend"},
}

youAre = {
[3] = "a Tutor",
[4] = "a Game Master",
[5] = "a Comunit Mananger", --alterado v1.3
[6] = "a Administrador"
}

if thing.uid == cid then
local city = getPlayerTown(thing.uid)
local cityname = getTownName(city)

if getPlayerStorageValue(thing.uid, 86228) <= 0 then
if getPlayerGroupId(thing.uid) >= 3 and getPlayerGroupId(thing.uid) <= 6 then
pos = getCreaturePosition(thing.uid)
ocupacao = youAre[getPlayerGroupId(thing.uid)] --alterado v1.3
str = "You see yourself. You are Pokemon Trainer. You are from the "..cityname..".\n"
else
str = "You see yourself. You are a Pokemon Trainer. You are from the "..cityname.."."
end

else
vocation = getPlayerStorageValue(thing.uid, 86228)
rank = getPlayerStorageValue(thing.uid, 862281)
promote = look[vocation][rank]
if getPlayerGroupId(thing.uid) >= 3 and getPlayerGroupId(thing.uid) <= 6 then
pos = getCreaturePosition(cid)
ocupacao = youAre[getPlayerGroupId(thing.uid)]
str = "You see yourself. You are "..promote..". You are from the "..cityname..".\n"
else
str = "You see yourself. You are "..promote..". You are from the "..cityname.."."
end
end
local id = getPlayerGroupId(thing.uid)
if id > 2 then
if id == 3 then
str = str.."You are Tutor"
elseif id == 4 then
str = str.."You are Game Master"
elseif id == 5 then
str = str.."You are Comunit Mananger"
elseif id == 6 then
str = str.."You are Administrador"
end
end
if getPlayerGuildId(thing.uid) > 0 then
str = str.." You are "..getPlayerGuildRank(thing.uid).." from the "..getPlayerGuildName(thing.uid).."."
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)

return false
end
--edited clan system


if isPlayer(thing.uid) and thing.uid ~= cid then
local city = getPlayerTown(thing.uid)
local cityname = getTownName(city)

vocation2 = getPlayerStorageValue(thing.uid, 86228)
rank2 = getPlayerStorageValue(thing.uid, 862281)

if getPlayerStorageValue(thing.uid, 86228) <= 0 then
promote2 = "a Pokemon Trainer"
else
promote2 = look[vocation2][rank2]
end

if getPlayerSex(thing.uid) == 1 then
artic = "He is"
elseif getPlayerSex(thing.uid) == 0 then
artic = "She is"
end

youAre = {
[3] = "a Tutor",
[4] = "a Game Master",
[5] = "a Sub", --alterado v1.3
[6] = "a Administrador"
}

if getPlayerGroupId(thing.uid) >= 3 and getPlayerGroupId(thing.uid) <= 6 then
pos = getCreaturePosition(thing.uid) --alterado v1.3
ocupacao = youAre[getPlayerGroupId(thing.uid)]
str = "You see "..getCreatureName(thing.uid)..". "..artic.." "..promote2..". "..artic.." from the "..cityname..".\n"
else
str = "You see "..getCreatureName(thing.uid)..". "..artic.." "..promote2..". "..artic.." from the "..cityname.."."
end
local id = getPlayerGroupId(thing.uid)
if id > 2 then
if id == 3 then
str = str..""..artic.." Tutor"
elseif id == 4 then
str = str..""..artic.." Game Master"
elseif id == 5 then
str = str..""..artic.." Sub"
elseif id == 6 then
str = str..""..artic.." Administrador"
end
end
if getPlayerGuildId(thing.uid) > 0 then
str = str.." "..artic.." "..getPlayerGuildRank(thing.uid).." from the "..getPlayerGuildName(thing.uid).."."
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)

return false
end

if getCreatureName(thing.uid) == "Evolution" then return false end
if not isSummon(thing.uid) then
local str = "You see a "
if getPokemonGender(thing.uid) == SEX_MALE then
str = str.."male"
elseif getPokemonGender(thing.uid) == SEX_FEMALE then
str = str.."female"
end
str = str.." "..string.lower(getCreatureName(thing.uid))..".\n"
if getPlayerGroupId(cid) > 3 then
str = str.."\nHP:"..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..""
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
elseif isSummon(thing.uid) then
str = "You see a "..string.lower(getCreatureName(thing.uid))..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid)).."."
if getPlayerGroupId(cid) > 3 then
str = str.."\nHP:"..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..""
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
end
return true
end




A Parte Do Configuration, Pode Deixar, Eu Sei Editar sleep.png

 

Thanks!

Link para o comentário
Compartilhar em outros sites

Lembre-se: o nome da tabela deve ser pokes_price.

 

 

function onLook(cid, thing, position, lookDistance)
 
local str = ""
 
if not isCreature(thing.uid) then
 
local iname = getItemInfo(thing.itemid)
 
if not isPokeball(thing.itemid) then
if priceList[getItemInfo(thing.itemid).name] then
price = priceList[getItemInfo(thing.itemid).name].price
if thing.type > 1 then
str = "You see "..thing.type.." "..getItemInfo(thing.itemid).plural.."."
price = price * thing.type
else
str = "You see "..getItemInfo(thing.itemid).article.." "..getItemInfo(thing.itemid).name.."."
end
str = str.." Price: $"..price.."."
if getItemAttribute(thing.uid, "description") then
str = str.."\n"..getItemAttribute(thing.uid, "description").."."
end
if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
str = str.."\nItemID: ["..thing.itemid.."]." --alterado v1.7
local pos = getThingPos(thing.uid)
str = str.."\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]"
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
end
end
 
if isPokeball(thing.itemid) then
 
local owner = getItemAttribute(thing.uid, "firstpoke")
 
local pokename = getItemAttribute(thing.uid, "poke")
local item = getItemInfo(thing.itemid)
 
str = "You see "..item.article.." "..item.name.."."
    if pokes_price[pokename] then
        str = str.." Price: $"..pokes_price[pokename].."."
    end
    str = str.."\n"
str = str.."Contains "..getArticle(pokename)..""
if getItemAttribute(thing.uid, "gender") == SEX_MALE then
str = str.." Male"
elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
str = str.." Female"
end
if pokename == "Shiny Onix" then
pokename = "Crystal Onix"
elseif pokename == "Shiny Gyarados" then
pokename = "Red Gyarados"
elseif pokename == "Shiny Charizard" then
pokename = "Elder Charizard"
elseif pokename == "Shiny Venusaur" then
pokename = "Ancient Venusaur"
elseif pokename == "Shiny Blastoise" then
pokename = "Ancient Blastoise"
elseif pokename == "Shiny Farfetch'd" then
pokename = "Elite Farfetch'd"
elseif pokename == "Shiny Hitmonlee" then
pokename = "Elite Hitmonlee"
elseif pokename == "Shiny Hitmonchan" then
pokename = "Elite Hitmonchan"
elseif pokename == "Shiny Abra" then
pokename = "Dark Abra"
elseif pokename == "Shiny Snorlax" then
pokename = "Big Snorlax"
elseif pokename == "Shiny Hitmontop" then
pokename = "Elite Hitmontop"
end
str = str.." "..pokename..""
if getItemAttribute(thing.uid, "nick") then
str = str.." ("..getItemAttribute(thing.uid, "nick")..")"
end
local boost = getItemAttribute(thing.uid, "boost") or 0
if boost > 0 then
str = str.." +"..boost..""
end
str = str.."."
 
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
 
return false
 
elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then
 
str = "You see a "..string.lower(iname.name)..".\n"
 
if getItemAttribute(thing.uid, "gender") == SEX_MALE then
elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
else
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
 
return false
 
else
 
return true
 
end
end
 
local NPCBattle = {
["Brock"] = {artig = "He is", cidbat = "Pewter"},
["Misty"] = {artig = "She is", cidbat = "Cerulean"},
["Kira"] = {artig = "She is", cidbat = "Viridian"},
["Erika"] = {artig = "She is", cidbat = "Celadon"},
["Sabrina"] = {artig = "She is", cidbat = "Saffron"},
["Surge"] = {artig = "He is", cidbat = "Vermilion"},
["Blaine"] = {artig = "He is", cidbat = "Cinnabar"},
["Koga"] = {artig = "He is", cidbat = "Fuchsia"},
}
 
NPCname = {"Brock", "Misty", "Kira", "Erika", "Sabrina", "Surge", "Blaine", "Koga"}
 
local npcname = getCreatureName(thing.uid)
if not isPlayer(thing.uid) and not isMonster(thing.uid) and isInArray(NPCname, npcname) then
str = "You see "..npcname..". "..NPCBattle[npcname].artig.." a leader gym from "..NPCBattle[npcname].cidbat.."."
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
end
 
if not isPlayer(thing.uid) and not isMonster(thing.uid) then
str = "You see "..getCreatureName(thing.uid).."."
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
end
 
look = {
[1] = {"a Volcanic Spark", "a Volcanic Flame","a Volcanic Firetamer","a Volcanic Pyromancer","a Volcanic Master"},
[2] = {"a Seavell Drop", "a Seavell Icelake","a Seavell Waterfall","a Seavell Frost","a Seavell Master"},
[3] = {"an Orebound Sand", "an Orebound Rock","an Orebound Solid","an Orebound Hardskin","an Orebound Hero"},
[4] = {"a Wingeon Cloud", "a Wingeon Wind","a Wingeon Sky","a Wingeon Falcon","a Wingeon Dragon"},
[5] = {"a Malefic Troublemaker", "a Malefic Venomancer","a Malefic Spectre","a Malefic Nightwalker","a Malefic Master"},
[6] = {"a Gardestrike Fist", "a Gardestrike Tamer","a Gardestrike Fighter","a Gardestrike DeathHand","a Gardestrike Champion"},
[7] = {"a Psycraft Mind", "a Psycraft Brain","a Psycraft Scholar","a Psycraft Telepath","a Psycraft Medium"},
[8] = {"a Naturia Seed", "a Naturia Sprout","a Naturia Webhead","a Naturia Woodtrunk","a Naturia Keeper"},
[9] = {"a Raibolt Shock", "a Raibolt Watt","a Raibolt Electrician","a Raibolt Overcharged","a Raibolt Legend"},
}
 
youAre = {
[3] = "a Tutor",
[4] = "a Game Master",
[5] = "a Comunit Mananger", --alterado v1.3
[6] = "a Administrador"
}
 
if thing.uid == cid then
local city = getPlayerTown(thing.uid)
local cityname = getTownName(city)
 
if getPlayerStorageValue(thing.uid, 86228) <= 0 then
if getPlayerGroupId(thing.uid) >= 3 and getPlayerGroupId(thing.uid) <= 6 then
pos = getCreaturePosition(thing.uid)
ocupacao = youAre[getPlayerGroupId(thing.uid)] --alterado v1.3
str = "You see yourself. You are Pokemon Trainer. You are from the "..cityname..".\n"
else
str = "You see yourself. You are a Pokemon Trainer. You are from the "..cityname.."."
end
 
else
vocation = getPlayerStorageValue(thing.uid, 86228)
rank = getPlayerStorageValue(thing.uid, 862281)
promote = look[vocation][rank]
if getPlayerGroupId(thing.uid) >= 3 and getPlayerGroupId(thing.uid) <= 6 then
pos = getCreaturePosition(cid)
ocupacao = youAre[getPlayerGroupId(thing.uid)]
str = "You see yourself. You are "..promote..". You are from the "..cityname..".\n"
else
str = "You see yourself. You are "..promote..". You are from the "..cityname.."."
end
end
local id = getPlayerGroupId(thing.uid)
if id > 2 then
if id == 3 then
str = str.."You are Tutor"
elseif id == 4 then
str = str.."You are Game Master"
elseif id == 5 then
str = str.."You are Comunit Mananger"
elseif id == 6 then
str = str.."You are Administrador"
end
end
if getPlayerGuildId(thing.uid) > 0 then
str = str.." You are "..getPlayerGuildRank(thing.uid).." from the "..getPlayerGuildName(thing.uid).."."
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
 
return false
end
--edited clan system
 
 
if isPlayer(thing.uid) and thing.uid ~= cid then
local city = getPlayerTown(thing.uid)
local cityname = getTownName(city)
 
vocation2 = getPlayerStorageValue(thing.uid, 86228)
rank2 = getPlayerStorageValue(thing.uid, 862281)
 
if getPlayerStorageValue(thing.uid, 86228) <= 0 then
promote2 = "a Pokemon Trainer"
else
promote2 = look[vocation2][rank2]
end
 
if getPlayerSex(thing.uid) == 1 then
artic = "He is"
elseif getPlayerSex(thing.uid) == 0 then
artic = "She is"
end
 
youAre = {
[3] = "a Tutor",
[4] = "a Game Master",
[5] = "a Sub", --alterado v1.3
[6] = "a Administrador"
}
 
if getPlayerGroupId(thing.uid) >= 3 and getPlayerGroupId(thing.uid) <= 6 then
pos = getCreaturePosition(thing.uid) --alterado v1.3
ocupacao = youAre[getPlayerGroupId(thing.uid)]
str = "You see "..getCreatureName(thing.uid)..". "..artic.." "..promote2..". "..artic.." from the "..cityname..".\n"
else
str = "You see "..getCreatureName(thing.uid)..". "..artic.." "..promote2..". "..artic.." from the "..cityname.."."
end
local id = getPlayerGroupId(thing.uid)
if id > 2 then
if id == 3 then
str = str..""..artic.." Tutor"
elseif id == 4 then
str = str..""..artic.." Game Master"
elseif id == 5 then
str = str..""..artic.." Sub"
elseif id == 6 then
str = str..""..artic.." Administrador"
end
end
if getPlayerGuildId(thing.uid) > 0 then
str = str.." "..artic.." "..getPlayerGuildRank(thing.uid).." from the "..getPlayerGuildName(thing.uid).."."
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
 
return false
end
 
if getCreatureName(thing.uid) == "Evolution" then return false end
if not isSummon(thing.uid) then
local str = "You see a "
if getPokemonGender(thing.uid) == SEX_MALE then
str = str.."male"
elseif getPokemonGender(thing.uid) == SEX_FEMALE then
str = str.."female"
end
str = str.." "..string.lower(getCreatureName(thing.uid))..".\n"
if getPlayerGroupId(cid) > 3 then
str = str.."\nHP:"..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..""
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
elseif isSummon(thing.uid) then
str = "You see a "..string.lower(getCreatureName(thing.uid))..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid)).."."
if getPlayerGroupId(cid) > 3 then
str = str.."\nHP:"..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..""
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
return false
end
return true
end

 

 

 

Modelo da tabela:

local pokes_price = {
    ["Nome do pokémon"] = preço,
}
Ex.:
local pokes_price = {
    ["Bulbasaur"] = 5000,
}
Editado por zipter98
Link para o comentário
Compartilhar em outros sites

Quando Vou Dar Look No Pokémon (Não Só o Da Lista, São Todos), Aparece Este Erro Na Distro:

 

[Error - CreatureScript Interface]
data/creaturescripts/scripts/look.lua:onLook
Description:
data/creaturescripts/scripts/look.lua:40: attempt to index global 'pokes_price' (a nil value)
stack traceback:
data/creaturescripts/scripts/look.lua:40: in function

@Edited, Consegui Resolver, Pode Mover o Tópico!
Editado por Lostnick
Link para o comentário
Compartilhar em outros sites

  • 4 years later...
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...