Ir para conteúdo

[Encerrado] [Pokemon] Dúvidas? - Pda


lucashgas

Posts Recomendados

@Edit

 

Resolvido!!

 

Estou com outro problema aqui, quando um player terminou o novo duel pelo slicer e tentou usar o fly apareceu a seguinte mensagem "You can't do it while a duel" Alguem pode ajudar?

Editado por PokemonFezin
Link para o comentário
Compartilhar em outros sites

@Slicer,

 

usei um líder de ginásio pra fazer um treinador qualquer, mas parece que tá dando pra batalhar várias vezes, ou ele influência na batalha com o líder mesmo. Poderia ajudar?

 

 

 

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 = "Wigglytuff", optionalLevel = 100, sex = SEX_FEMALE, nick = "", ball = "normal"},

{name = "Pidgeot", optionalLevel = 95, sex = SEX_FEMALE, nick = "", ball = "normal"},

{name = "Lickitung", optionalLevel = 90, sex = SEX_FEMALE, nick = "", ball = "normal"},

{name = "Eevee", optionalLevel = 70, sex = SEX_MALE, nick = "", ball = "normal"},

{name = "Snorlax", optionalLevel = 100, sex = SEX_MALE, nick = "", ball = "normal"},

{name = "Raticate", optionalLevel = 75, sex = SEX_MALE, nick = "", ball = "normal"},

}

 

 

local function doSummonGymPokemon(npc)

local this = npc

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)

addEvent(adjustWildPoke, 15, summon, it.optionalLevel)

local name = it.nick ~= "" and it.nick or getCreatureName(this).."s "..it.name

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

doCreatureSay(npc, "You won the duel! Congratulations, take this reward.", 1)

doPlayerAddExp(cid, 1000) --exp

doPlayerAddItem(cid, 2152, 1) --100dl

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)..", Do you want to duel?")

return true

end

 

if isDuelMsg(msg) and conv == 1 and focus == cid then

 

--if getPlayerItemCount(cid, gymbadges[getCreatureName(getThis())]) >= 1 then

-- selfSay("You have already won my Volcano Badge, maybe some other day we can fight.")

-- 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

 

function onThink()

 

--doSendAnimatedText(getThingPos(getThis()), getCreatureName(getThis()), 215)

 

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])

challenger_turn = challenger_turn + 1

afk_time = 0

else

afk_time = afk_time + 0.5

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

 

 

 

Outra coisa, como faço para todos níveis abaixo de 40 terem 50% de exp bonus?

 

Grato

Link para o comentário
Compartilhar em outros sites

@PokemonFezin

provavelmente ele confundiu os 2 tpw de duel.. e isso pode causar alguns problemas... mas em tese eh soh ele reloga q todas as storages sao setadas pra -1 denovo...

 

@PedroSouza

tem um npc em npc/scripts/duel.lua... tenta copiar o script dele... e achu q n tem nenhum bloqueio pra n poder duelar + de 1x ms... mas eh soh setar uma storage qlqr...

sobre a exp.. q serv tas usando? se for o sem lvl, vai em creaturescripts/scripts/pokeexp.lua.. ache essa parte..

 

local givenexp = getWildPokemonExp(cid)

local killer = getItemAttribute(corpse.uid, "corpseowner")

 

if givenexp > 0 then

for a = 1, #deathList do

local pk = deathList[a]

if isCreature(pk) then

playerAddExp(pk, math.floor(playerExperienceRate * givenexp * getDamageMapPercent(pk, cid)))

end

end

end

 

 

e deixe assim.. ache q deve da certo...

 

local givenexp = getWildPokemonExp(cid)

local killer = getItemAttribute(corpse.uid, "corpseowner")

local extraExp = isSummon(cid) and getPlayerLevel(getCreatureMaster(cid)) <= 40 and 1.5 or 1

 

if givenexp > 0 then

for a = 1, #deathList do

local pk = deathList[a]

if isCreature(pk) then

playerAddExp(pk, math.floor((playerExperienceRate * givenexp * getDamageMapPercent(pk, cid)) * extraExp))

end

end

end

 

Editado por Slicer
Link para o comentário
Compartilhar em outros sites

@Slicer ele ja relogou , ja fechei e abri o servidor e continua com o erro rs.. valeu por responder!

 

@edit

Tava testando o sistema de duelo aqui e ta muito massa mais tem 2 que são corretos e 1 é errado.. (eu acho)

 

Por Order Correto.. Tudo certinho

Por Invite Correto.. Tudo Certinho quando perde é kikado..

Mais por invite tem outra forma, a normal, exemplo eu invito algum player para duelar só que quando eu já invito aparece a mensagem em verde para que ele foi invitado para o duelo e se ele for rápido e aceitar e não espera eu escolher os pokemons ex:1vs1, 2vs2 etc.. vai ser apenas um duelo normal, só que ninguém vai ser kikado e nada..

 

Quem poder me falar se esta certo ou errado hehe.. Valeu ae slicer, muito bom seus novos sistemas..!

Editado por PokemonFezin
Link para o comentário
Compartilhar em outros sites

@Slicer,

 

não deu porque meu arquivo já estava modificado, veja:

 

 

 

local givenexp = getWildPokemonExp(cid)

local killer = getItemAttribute(corpse.uid, "corpseowner")

 

if givenexp > 0 then

for a = 1, #deathList do

local pk = deathList[a]

if isCreature(pk) then

local extra = isPremium(pk) and 0.25 or 0

playerAddExp(pk, math.floor(playerExperienceRate * givenexp * getDamageMapPercent(pk, cid)*(1+extra)))

end

end

end

 

 

 

Como faço para deixar a exp extra pro premium e pra nível 40 ou menos?

Editado por PedroSouza
Link para o comentário
Compartilhar em outros sites

Simplesmente não usem o party pra duel. Slicer ja falo que mais pra frente ele ranca o party de duelar.

Bom pra quem dizia que era impossivel ter um server sem as sourcers, ja temos um duelzin basico com channels e maneiras de balancear o server. Só espero que mais pra frente não aparece um bug crítico e cale minha boca ..rsrs

Link para o comentário
Compartilhar em outros sites

@PedroSouza

tenta isso...

 

local givenexp = getWildPokemonExp(cid)

local killer = getItemAttribute(corpse.uid, "corpseowner")

 

if givenexp > 0 then

for a = 1, #deathList do

local pk = deathList[a]

if isCreature(pk) then

if isPremium(pk) and getPlayerLevel(pk) <= 40 then

extra = 0.75

elseif isPremium(pk) then

extra = 0.25

elseif getPlayerLevel(pk) <= 40 then

extra = 0.5

else

0

end

playerAddExp(pk, math.floor(playerExperienceRate * givenexp * getDamageMapPercent(pk, cid)*(1+extra)))

end

end

end

 

Link para o comentário
Compartilhar em outros sites

o slicer se sabe tirar o lvl dos poke?

 

Rapidao eu do todos reps q der hoje e amanha pra quem me ensinar como q poe barra de attack - tirar level dos poke - colocar raio do +50 - tirar macho e femea

do rep toda vez q ver a pessoa

Link para o comentário
Compartilhar em outros sites

@PedroSouza tenta isso...

local givenexp = getWildPokemonExp(cid) local killer = getItemAttribute(corpse.uid, "corpseowner") if givenexp > 0 then for a = 1, #deathList do local pk = deathList[a] if isCreature(pk) then if isPremium(pk) and getPlayerLevel(pk) <= 40 then extra = 0.75 elseif isPremium(pk) then extra = 0.25 elseif getPlayerLevel(pk) <= 40 then extra = 0.5 else 0 end playerAddExp(pk, math.floor(playerExperienceRate * givenexp * getDamageMapPercent(pk, cid)*(1+extra))) end end end

 

Ao por isso ninguém ganhava exp.

Link para o comentário
Compartilhar em outros sites

@Slicer

man quando vai da surf tando com o poke solto o player começa anda na água como se fosse tile normal, e o poke fica na terra.

 

e da este erro no console

 

 

[03/09/2012 19:17:45] [Error - MoveEvents Interface]

[03/09/2012 19:17:45] data/movements/scripts/surf.lua:onStepIn

[03/09/2012 19:17:45] Description:

[03/09/2012 19:17:45] data/movements/scripts/surf.lua:63: attempt to index global 'surfs' (a nil value)

[03/09/2012 19:17:45] stack traceback:

[03/09/2012 19:17:45] data/movements/scripts/surf.lua:63: in function <data/movements/scripts/surf.lua:11>

 

 

sabe arrumar ? x; vlw

Editado por Wiisht
Link para o comentário
Compartilhar em outros sites

@Wiisht

q tal tu pegar a tabela surfs em lib/configuration.lua --'

 

@Mated

o script q controla os slots ali eh o data/mods/firstitem.xml... mas isso tb soh vai mudar os novos chares... ;p

 

@PkNfan

cria o icone ae q nos ve oq pode fazer... hehe

Editado por Slicer
Link para o comentário
Compartilhar em outros sites

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