Tem como escrever em português? Tenta explicar bem explicado porque não entendi nada..
Só não faço pq é npc, mas deve ser algo só doTransformItem
Por lucashgas, 10 de jan. de 2012 em Tópicos Sem Resposta
info
Grupo: Conde
Registrado: 06/08/11
Posts: 752
Reputação: +112

info
Grupo: Campones
Registrado: 21/05/12
Posts: 3
Reputação: 0
Char no Tibia: Impactuos

Ei galera eu vi um server ali pokemon sagas , e eles tem um sistema de treinadores tipo gba pra batalhar , eu tou querendo fazer isso , não deve ser muito dificil.
tipo tem um cara aqui da equipe rocket q tem como duela com ele e tals, mas tipo depois de duela 1 vez n tem mais como, quero arrumar isso pra da pra duelar umas 2 , 3 vezes ao dia.
aki ta o bagui do npc, e tipo eu fui copia , fis otro npc e tals, com o mesmo script e eu ja tinha duelado com 1, dai falo q eu ja tinha duelo.
local focus = 0local max_distance = 8
local talk_start = 0
local conv = 0
local fighting = false
local challenger = 0
local afk_limit_time = 30 -- seconds
local afk_time = 0 -- don't change
local battle_turn = 1 -- don't change
local challenger_turn = 0 -- don't change
local pokemons = {
{name = "Shiny Nidoking", level = 100, extralevel = 80, sex = SEX_MALE, nick = "", ball = "normal"},
{name = "Shiny Nidoqueen", level = 100, extralevel = 80, sex = SEX_MALE, nick = "", ball = "normal"},
{name = "Shiny Kangaskhan", level = 100, extralevel = 80, sex = SEX_MALE, nick = "", ball = "normal"},
{name = "Shiny Snorlax", level = 100, extralevel = 80, sex = SEX_MALE, nick = "", ball = "normal"},
{name = "Shiny Clefable", level = 100, extralevel = 80, sex = SEX_MALE, nick = "", ball = "normal"},
{name = "Shiny Wigglytuff", level = 100, extralevel = 80, sex = SEX_MALE, nick = "", ball = "normal"},
}
local function doSummonGymPokemon(npc)
local this = npc
if not isCreature(this) then return true end
if #getCreatureSummons(this) >= 1 or focus == 0 then return true end
local it = pokemons[battle_turn]
doSummonMonster(this, it.name)
local summon = getCreatureSummons(this)[1]
local balleffect = pokeballs["normal"].effect
if it.ball and pokeballs[it.ball] then
balleffect = pokeballs[it.ball].effect
end
doSendMagicEffect(getThingPos(summon), balleffect)
setPlayerStorageValue(summon, 10000, balleffect)
setPlayerStorageValue(summon, 10001, gobackmsgs[math.random(#gobackmsgs)].back:gsub("doka", it.nick ~= "" and it.nick or it.name))
setPlayerStorageValue(summon, 1007, it.nick ~= "" and it.nick or it.name)
doSetMonsterGym(summon, focus)
local name = it.nick ~= "" and it.nick or getCreatureName(this).."s "..it.name
setWildPokemonLevel(summon, it.level, getPokemonStatus(it.name, (it.extralevel + it.level)), name, 1.5)
doCreatureSay(this, gobackmsgs[math.random(#gobackmsgs)].go:gsub("doka", getPlayerStorageValue(summon, 1007)), 1)
fighting = true
battle_turn = battle_turn + 1
end
local function doWinDuel(cid, npc)
if not isCreature(cid) then return true end
local this = npc
doPlayerSetStorageValue(cid, 344582, 1)
doCreatureSay(npc, "You won the duel! Congratulations, go now to next fight!", 1)
end
function onCreatureSay(cid, type, msg)
local msg = string.lower(msg)
if focus == cid then
talk_start = os.clock()
end
if msgcontains(msg, 'hi') and focus == 0 and getDistanceToCreature(cid) <= 4 then
focus = cid
talk_start = os.clock()
conv = 1
selfSay("Hello "..getCreatureName(cid)..", my name is Laura and I'm Second's Chansey Trainer. How may I help you?")
return true
end
if isDuelMsg(msg) and conv == 1 and focus == cid then
if getPlayerStorageValue(cid, 344581) ~= 1 then
selfSay("You need defeated the first trainer.")
focus = 0
return true
end
if getPlayerStorageValue(cid, 344582) == 1 then
selfSay("You have defeated my, pass for next trainer.")
focus = 0
return true
end
if not hasPokemon(cid) then
selfSay("To battle agains't a gym leader you need pokemons.")
return true
end
selfSay("You are challenging me to a battle. It will be a "..#pokemons.." pokemon limit battle, let's start?")
conv = 2
return true
end
if isConfirmMsg(msg) and conv == 2 and focus == cid then
challenger = focus
setPlayerStorageValue(cid, 990, 1)
selfSay("Yea, let's fight!")
talk_start = os.clock()
addEvent(doSummonGymPokemon, 850, getThis())
conv = 3
return true
end
if isNegMsg(msg) and conv == 2 and focus == cid then
focus = 0
selfSay("It is better for you to refuse a battle against me!")
return true
end
if msgcontains(msg, 'bye') and focus == cid then
selfSay('Bye and do your best trainer!')
setPlayerStorageValue(focus, 990, -1)
focus = 0
return true
end
end
local afk_warning = false
local change = false
function onThink()
if focus == 0 then
selfTurn(2)
fighting = false
challenger = 0
challenger_turn = 0
battle_turn = 1
afk_time = 0
afk_warning = false
if #getCreatureSummons(getThis()) >= 1 then
setPlayerStorageValue(getCreatureSummons(getThis())[1], 1006, 0)
doCreatureAddHealth(getCreatureSummons(getThis())[1], -getCreatureMaxHealth(getCreatureSummons(getThis())[1]))
end
return true
else
if not isCreature(focus) then
focus = 0
return true
end
if fighting then
talk_start = os.clock()
if not isCreature(getCreatureTarget(getThis())) then
if #getCreatureSummons(challenger) >= 1 then
selfAttackCreature(getCreatureSummons(challenger)[1])
change = true
afk_time = 0
else
afk_time = afk_time + 0.5
if change then
change = false
challenger_turn = challenger_turn + 1
end
end
end
if afk_time > afk_limit_time then
setPlayerStorageValue(focus, 990, -1)
focus = 0
selfSay("I have waited too long, come back when you are ready!")
return true
end
if not afk_warning and afk_time > afk_limit_time / 2 then
selfSay("Where's your pokemon? Let's fight!")
afk_warning = true
end
if #getCreatureSummons(getThis()) == 0 then
if battle_turn > #pokemons then
addEvent(doWinDuel, 1000, focus, getThis())
setPlayerStorageValue(focus, 990, -1)
focus = 0
return true
end
addEvent(doSummonGymPokemon, 1000, getThis())
end
if not hasPokemon(challenger) or challenger_turn >= 7 or challenger_turn > #pokemons then
selfSay("You lost our duel! Maybe some other time you'll defeat me.")
setPlayerStorageValue(focus, 990, -1)
focus = 0
return true
end
end
local npcpos = getThingPos(getThis())
local focpos = getThingPos(focus)
if npcpos.z ~= focpos.z then
setPlayerStorageValue(focus, 990, -1)
focus = 0
selfSay("Bye then.")
return true
end
if (os.clock() - talk_start) > 30 then
selfSay("Good bye and keep training!")
setPlayerStorageValue(focus, 990, -1)
focus = 0
end
if getDistanceToCreature(focus) > max_distance then
setPlayerStorageValue(focus, 990, -1)
focus = 0
return true
end
local dir = doRedirectDirection(getDirectionTo(npcpos, focpos))
selfTurn(dir)
end
return true
end
Editado Maio 22 por Marlinhofoz
info
Grupo: Artesão
Registrado: 27/04/11
Posts: 112
Reputação: +2

Como eu coloco para aparecer o Level dos players no look?
info
Grupo: Campones
Registrado: 01/04/12
Posts: 49
Reputação: +3

@dz2 me manda teu script de monster depis que eu dou uma olhada.
O carinha do suicune,me manda o xml dele que eu ajudo.
@Marlinhofoz
vey naum usa quote,quase num xego no final.
usa spoileer..
@zeref
Vey so algumas das vocation que muda,outras não,testei todas e vi que 3 mudam.
Vo tentar arrumar aqui.
Mas tu sabe onde esse erro ficaa?Se souber manda ae,poupa trabalho,xD....vllws.
info
Grupo: Barão
Registrado: 01/05/11
Posts: 234
Reputação: +43
Gênero: Masculino

Zeref faz um sistema de base
ex: da use no item e troca o looktype do pokemon ![]()
dai agente configura o resto ![]()
info
Grupo: Visconde
Registrado: 03/01/11
Posts: 303
Reputação: +47

Eu vi agora aqui que tao pedindo esse sistema de addon, vo fazer aqui, daqui uma meia hora eu posto ![]()
__
Edit: Testando aqui, se funcionar de primeira já posto ![]()
Editado Maio 22 por RicardoSohnn
info
Grupo: Barão
Registrado: 01/05/11
Posts: 234
Reputação: +43
Gênero: Masculino

ok mano se postar repp+++ infinitamente ashuhuashushuaahus
info
Grupo: Barão
Registrado: 17/10/10
Posts: 230
Reputação: +10
Char no Tibia: Nascont

aew galera alguem sabe arruma esse bug
[22/05/2012 14:36:14] [Error - CreatureScript Interface][22/05/2012 14:36:14] data/creaturescripts/scripts/pokeexp.lua:onDeath
[22/05/2012 14:36:14] Description:
[22/05/2012 14:36:14] data/lib/level system.lua:31: attempt to perform arithmetic on local 'd' (a nil value)
[22/05/2012 14:36:14] stack traceback:
[22/05/2012 14:36:14] data/lib/level system.lua:31: in function 'getPokemonXMLOutfit'
[22/05/2012 14:36:14] data/lib/level system.lua:53: in function 'doStartEvolution'
[22/05/2012 14:36:14] data/lib/level system.lua:407: in function 'adjustPokemonLevel'
[22/05/2012 14:36:14] data/lib/level system.lua:245: in function 'givePokemonExp'
[22/05/2012 14:36:14] data/creaturescripts/scripts/pokeexp.lua:30: in function <data/creaturescripts/scripts/pokeexp.lua:10>
acontece quando alguns pokes vao evoluir com level
quem souber min fala dou rep+
Editado Maio 22 por cacaiu
info
Grupo: Visconde
Registrado: 03/01/11
Posts: 303
Reputação: +47

Segue a base pro sistema de addons pokemon feito por mim
Em actions.xml adicione a seguinte tag:
<action itemid="xxxx" event="script" value="addons.lua"/>
Sendo, xxxx o id do item que vai dar o addon.
addons.lua
function onUse(cid, item, fromPosition, itemEx, toPosition)
local addons = {
[xxxx] = {pokemon= "Scyther" , looktype = 510}, --xxxx = id do item do addon --- "Scyther" = nome do pokemon --- looktype = 1 é o looktype do pokemon com addon
}
if #getCreatureSummons(cid) > 0 then
doPlayerSendCancel(cid, "Please back your pokemon.")
return false
end
local numero = addons[item.itemid].looktype
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") < 1 then
doRemoveItem(item.uid, 1)
doPlayerSendTextMessage(cid, 27, "Congratulations! Now your pokemon will use the addon.")
doSetItemAttribute(pb,"addon",numero)
return true
end
return true
end
Na action do goback, no finalzinho antes de
else doPlayerSendCancel(cid, "This pokemon is fainted.") end
Coloque:
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
end
Agora em data/lib/catch system.lua
Depois de:
doItemSetAttribute(item, "description", description)
Coloque:
doItemSetAttribute(item, "addon", 0)
Depois em data/talkactions/scripts/createpokeball.lua depois de:
doItemSetAttribute(item, "description", "Contains a "..name..".")
Coloque:
doItemSetAttribute(item, "addon", 0)
Gostou ? Rep +
Editado Maio 22 por RicardoSohnn
RicardoSohnn me add ae: ricardao-nice@hotmail.com para me expelicar melhor isso ae
se poder e claro depois dou rep e gostar ;
info
Grupo: Campones
Registrado: 07/11/10
Posts: 18
Reputação: +1

Alguem ai sabe arrumar esse bug?
[22/05/2012 14:54:24] [Error - CreatureScript Interface]
[22/05/2012 14:54:24] data/creaturescripts/scripts/look.lua:onLook
[22/05/2012 14:54:24] Description:
[22/05/2012 14:54:24] data/lib/050-function.lua:107: attempt to index local 'str' (a nil value)
[22/05/2012 14:54:24] stack traceback:
[22/05/2012 14:54:24] data/lib/050-function.lua:107: in function 'getArticle'
[22/05/2012 14:54:24] data/creaturescripts/scripts/look.lua:16: in function <data/creaturescripts/scripts/look.lua:1>
Outro bug de quando da dex no Ditto
[22/05/2012 15:40:46] [Error - Action Interface][22/05/2012 15:40:46] data/actions/scripts/pokedex.lua:onUse
[22/05/2012 15:40:46] Description:
[22/05/2012 15:40:46] data/lib/pokedex system.lua:100: attempt to index local 'x' (a nil value)
[22/05/2012 15:40:46] stack traceback:
[22/05/2012 15:40:46] data/lib/pokedex system.lua:100: in function 'getMoveDexDescr'
[22/05/2012 15:40:46] data/lib/pokedex system.lua:249: in function 'doShowPokedexRegistration'
[22/05/2012 15:40:46] data/actions/scripts/pokedex.lua:33: in function <data/actions/scripts/pokedex.lua:3>
Editado Maio 22 por DeanWInchesterr
info
Grupo: Barão
Registrado: 01/05/11
Posts: 234
Reputação: +43
Gênero: Masculino

cara como fasso para no fly surf ride ficar com addon tambem?
Como posso arrumar o poketibia para que não apareça os itens do Tibia convencional?
info
Grupo: Conde
Registrado: 02/01/12
Posts: 526
Reputação: +21
Zeref teria como passr um script action base, onde vamos dizer, eu do use no item, ai no script vai ta assim +-. Se tal poke (nome) change the looktype to number (...). Assim ficaria facil fazer um addon system por item, era só dar use que mudaria o looktype se o pokemon tivesse o nome certo.
Ex: se o pokemon no sloot for o scyther, troca o looktype pelo looktype xxyy.