roirodrigo 3 Postado Fevereiro 26, 2012 Share Postado Fevereiro 26, 2012 @chucknorris é so vc abrir seu mapa e colocar nos depots de todas as towns configurados somente pra town 1 ai funfa Link para o comentário https://xtibia.com/forum/topic/177592-encerrado-pokemon-d%C3%BAvidas-pda/page/235/#findComment-1206199 Compartilhar em outros sites More sharing options...
Dudu08267 7 Postado Fevereiro 26, 2012 Share Postado Fevereiro 26, 2012 (editado) em lib tem configuration.lua faz 1 copia e abre ele e vai ter pokemonExpPerLevelRate = 20 baseExpRate = 0.5 generalExpRate = 100 tenta aumentar 1 dos 3 caso de algum erro ja tem a copia de configuration, mude 1 de cada vez e tbm em configuration la embaixo tem os stats dos pokemons e + pro fim da linha em cada pokémon tem escrito exp tenta aumentar veja se funciona. Editado Fevereiro 26, 2012 por Dudu08267 Link para o comentário https://xtibia.com/forum/topic/177592-encerrado-pokemon-d%C3%BAvidas-pda/page/235/#findComment-1206205 Compartilhar em outros sites More sharing options...
Denuvo 71 Postado Fevereiro 26, 2012 Share Postado Fevereiro 26, 2012 vlw rukia rep+ jáa! Link para o comentário https://xtibia.com/forum/topic/177592-encerrado-pokemon-d%C3%BAvidas-pda/page/235/#findComment-1206235 Compartilhar em outros sites More sharing options...
peralta52 2 Postado Fevereiro 26, 2012 Share Postado Fevereiro 26, 2012 Alguem Me ajuda tipo eu puis o portrait johto certinho so q u portrait nao aparece na cooldown bar :S Link para o comentário https://xtibia.com/forum/topic/177592-encerrado-pokemon-d%C3%BAvidas-pda/page/235/#findComment-1206338 Compartilhar em outros sites More sharing options...
fernandofw 2 Postado Fevereiro 26, 2012 Share Postado Fevereiro 26, 2012 Alguem Me ajuda tipo eu puis o portrait johto certinho so q u portrait nao aparece na cooldown bar :S Tem algum erro, portraits nao existentes, ja aconteceu isso comigo, ai tive que copiar os pokemons do configuration.lua os portraits tudo denovo, sorte que fiz um grupo com só portraits johto, tinha algum erro em pokemons kanto, OU SENÃÃÃO tenta criar char normal, o meu GOD não pode ver portraits mas meu player pode. Link para o comentário https://xtibia.com/forum/topic/177592-encerrado-pokemon-d%C3%BAvidas-pda/page/235/#findComment-1206339 Compartilhar em outros sites More sharing options...
Denuvo 71 Postado Fevereiro 26, 2012 Share Postado Fevereiro 26, 2012 Galera to cm um probleminha aki .. seguinte eu o arquivo cooldown.lua do meu servidor e estou usando o client do zeref pq naum gosto daqela cooldown bar só qe tem um seguinte agora qando usa m1 m2 m3 etc aparece o nome ou seja vs ataca m1 ai aparece "M1" eu qeria saber se tem como deixar normal como antes atacar mais naum aparecer o nome.. algen mim ajuda do REP+ Link para o comentário https://xtibia.com/forum/topic/177592-encerrado-pokemon-d%C3%BAvidas-pda/page/235/#findComment-1206341 Compartilhar em outros sites More sharing options...
FlamesAdmin 262 Postado Fevereiro 26, 2012 Share Postado Fevereiro 26, 2012 (editado) Alguem pode arrumar para mim o npc chuck norris para poder duelar com ele só uma vez? se puder dou rep+ local focus = 0 local 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 Machamp", level = 100, extralevel = 200, sex = SEX_MALE, nick = "Hulk", 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, 344487, 1) doCreatureSay(npc, "You won the duel! Congratulations, choose your prize!", 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 Chuck Norris and I'm Last's Fight Trainer. How may I help you?") return true end if isDuelMsg(msg) and conv == 1 and focus == cid then if getPlayerStorageValue(cid, 344481) ~= 1 or getPlayerStorageValue(cid, 344482) ~= 1 or getPlayerStorageValue(cid, 344483) ~= 1 or getPlayerStorageValue(cid, 344484) ~= 1 or getPlayerStorageValue(cid, 344485) ~= 1 or getPlayerStorageValue(cid, 344485) ~= 1 then selfSay("You need defeated the first, second, third, fourth, fifth and sixth trainer.") focus = 0 return true end if getPlayerStorageValue(cid, 344487) == 1 then selfSay("You have defeated my, choose your prize!") 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 e alguem poderia me dizer novamente como se faz spoiler? rep+ Editado Fevereiro 26, 2012 por FlamesAdmin Link para o comentário https://xtibia.com/forum/topic/177592-encerrado-pokemon-d%C3%BAvidas-pda/page/235/#findComment-1206350 Compartilhar em outros sites More sharing options...
Danielzs 0 Postado Fevereiro 26, 2012 Share Postado Fevereiro 26, 2012 Por favor se alguem poder me ajuda , eu to com o starter.lua aki mais tipo a pessoa cata o pokemon quantas vezes quiser queria por pra nascer la no lugar na onde ta o bau , e nao voltar mais la tipo , pq quando pega o pokemon ja é teletransportado para o templo ai tipo não quero que volta mais lá no lugar dos bau quem puder me ajudar fala aki no topico ou entao manda msn por pm Link para o comentário https://xtibia.com/forum/topic/177592-encerrado-pokemon-d%C3%BAvidas-pda/page/235/#findComment-1206352 Compartilhar em outros sites More sharing options...
Slicer 1070 Postado Fevereiro 26, 2012 Share Postado Fevereiro 26, 2012 tenta assim.. [.spoiler] [./spoiler] sem os "." Link para o comentário https://xtibia.com/forum/topic/177592-encerrado-pokemon-d%C3%BAvidas-pda/page/235/#findComment-1206361 Compartilhar em outros sites More sharing options...
FlamesAdmin 262 Postado Fevereiro 26, 2012 Share Postado Fevereiro 26, 2012 tenta assim.. [.spoiler] [./spoiler] sem os "." vlw Slice rep pra tu lek Link para o comentário https://xtibia.com/forum/topic/177592-encerrado-pokemon-d%C3%BAvidas-pda/page/235/#findComment-1206365 Compartilhar em outros sites More sharing options...
peralta52 2 Postado Fevereiro 26, 2012 Share Postado Fevereiro 26, 2012 pra add portrait precisa por nu item.xml? Link para o comentário https://xtibia.com/forum/topic/177592-encerrado-pokemon-d%C3%BAvidas-pda/page/235/#findComment-1206368 Compartilhar em outros sites More sharing options...
Slicer 1070 Postado Fevereiro 26, 2012 Share Postado Fevereiro 26, 2012 (editado) @FlamesAdmin posta o script pra ganha a ball dos hitmonchan e lee tb.. @peralta52 n necessariamente.. ques add o portrait onde? se for na barra de CD o numero q vai la n eh o do item.otb e sim do .dat ... Editado Fevereiro 26, 2012 por Slicer Link para o comentário https://xtibia.com/forum/topic/177592-encerrado-pokemon-d%C3%BAvidas-pda/page/235/#findComment-1206371 Compartilhar em outros sites More sharing options...
FlamesAdmin 262 Postado Fevereiro 26, 2012 Share Postado Fevereiro 26, 2012 (editado) ta ae Slicer local starterpokes = { ["Hitmonlee"] = {x = 1034, y = 866, z = 1}, ["Hitmonchan"] = {x = 1032, y = 866, z = 1}, } local level = 1 local extrastr = 5 local btype = "normal" function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, 344487) == 2 then return doPlayerSendCancel(cid, "You have picked your prize!") end if getPlayerStorageValue(cid, 344487) ~= 1 then return doPlayerSendCancel(cid, "You need own all fight trainer to choose your prize!") end local pokemon = "" if getPlayerMana(cid) >= 6 then return doPlayerSendCancel(cid, "You don't have capacity for your prize!") end for a, b in pairs (starterpokes) do if isPosEqualPos(topos, b) then pokemon = a end end if pokemon == "" then return true end local gender = getRandomGenderByName(pokemon) local mypoke = getPokemonStatus(pokemon) if not mypoke then return true end local offense = mypoke.off * level * extrastr local defense = mypoke.def * level * extrastr local speed = mypoke.agi * level * extrastr local vit = mypoke.vit * level * extrastr local spatk = mypoke.spatk * level * extrastr local happy = 180 local leveltable = getPokemonExperienceTable(pokemon) doPlayerAddItem(cid, 2394, 10) local item = doCreateItemEx(2219) doItemSetAttribute(item, "poke", pokemon) doItemSetAttribute(item, "hp", 1) doItemSetAttribute(item, "level", level) doItemSetAttribute(item, "exp", leveltable[level]) doItemSetAttribute(item, "nextlevelexp", leveltable[level+1] - leveltable[level]) doItemSetAttribute(item, "offense", offense) doItemSetAttribute(item, "defense", defense) doItemSetAttribute(item, "speed", speed) doItemSetAttribute(item, "vitality", vit) doItemSetAttribute(item, "specialattack", spatk) doItemSetAttribute(item, "happy", happy) doItemSetAttribute(item, "gender", gender) doItemSetAttribute(item, "description", "Contains a "..pokemon..".") doItemSetAttribute(item, "fakedesc", "Contains a "..pokemon..".") doItemSetAttribute(item, "firstpoke", getCreatureName(cid)) doItemSetAttribute(item, "hands", 0) doPlayerAddItemEx(cid, item, true) doTransformItem(item, pokeballs[btype].on) doPlayerSendTextMessage(cid, 27, "You choose a "..pokemon..".") setPlayerStorageValue(cid, 344487, 2) doSendMagicEffect(getThingPos(cid), 29) doSendMagicEffect(getThingPos(cid), 27) doSendMagicEffect(getThingPos(cid), 29) return TRUE end Editado Fevereiro 26, 2012 por FlamesAdmin Link para o comentário https://xtibia.com/forum/topic/177592-encerrado-pokemon-d%C3%BAvidas-pda/page/235/#findComment-1206372 Compartilhar em outros sites More sharing options...
Slicer 1070 Postado Fevereiro 26, 2012 Share Postado Fevereiro 26, 2012 soh troca o teu script do chuck por esse... eu n testei mas achu q deve da certo... qlqr coisa soh flar.. local focus = 0 local 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 Machamp", level = 100, extralevel = 200, sex = SEX_MALE, nick = "Hulk", 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, 344487, 1) doCreatureSay(npc, "You won the duel! Congratulations, choose your prize!", 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 Chuck Norris and I'm Last's Fight Trainer. How may I help you?") return true end if isDuelMsg(msg) and conv == 1 and focus == cid then if getPlayerStorageValue(cid, 344481) ~= 1 or getPlayerStorageValue(cid, 344482) ~= 1 or getPlayerStorageValue(cid, 344483) ~= 1 or getPlayerStorageValue(cid, 344484) ~= 1 or getPlayerStorageValue(cid, 344485) ~= 1 or getPlayerStorageValue(cid, 344485) ~= 1 then selfSay("You need defeated the first, second, third, fourth, fifth and sixth trainer.") focus = 0 return true end if getPlayerStorageValue(cid, 344487) == 1 then selfSay("You have defeated me, choose your prize!") focus = 0 return true end if getPlayerStorageValue(cid, 344487) == 2 then selfSay("You have already defeated me!") 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 Link para o comentário https://xtibia.com/forum/topic/177592-encerrado-pokemon-d%C3%BAvidas-pda/page/235/#findComment-1206377 Compartilhar em outros sites More sharing options...
FlamesAdmin 262 Postado Fevereiro 26, 2012 Share Postado Fevereiro 26, 2012 (editado) soh troca o teu script do chuck por esse... eu n testei mas achu q deve da certo... qlqr coisa soh flar.. local focus = 0 local 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 Machamp", level = 100, extralevel = 200, sex = SEX_MALE, nick = "Hulk", 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, 344487, 1) doCreatureSay(npc, "You won the duel! Congratulations, choose your prize!", 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 Chuck Norris and I'm Last's Fight Trainer. How may I help you?") return true end if isDuelMsg(msg) and conv == 1 and focus == cid then if getPlayerStorageValue(cid, 344481) ~= 1 or getPlayerStorageValue(cid, 344482) ~= 1 or getPlayerStorageValue(cid, 344483) ~= 1 or getPlayerStorageValue(cid, 344484) ~= 1 or getPlayerStorageValue(cid, 344485) ~= 1 or getPlayerStorageValue(cid, 344485) ~= 1 then selfSay("You need defeated the first, second, third, fourth, fifth and sixth trainer.") focus = 0 return true end if getPlayerStorageValue(cid, 344487) == 1 then selfSay("You have defeated me, choose your prize!") focus = 0 return true end if getPlayerStorageValue(cid, 344487) == 2 then selfSay("You have already defeated me!") 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 vlw lek funfo + 1 rep pra tu ae ----EDIT---- ops so amanha ja ti dei rep pelo spoiler Editado Fevereiro 26, 2012 por FlamesAdmin Link para o comentário https://xtibia.com/forum/topic/177592-encerrado-pokemon-d%C3%BAvidas-pda/page/235/#findComment-1206385 Compartilhar em outros sites More sharing options...
Posts Recomendados