Ir para conteúdo

Featured Replies

Postado
  • Autor
12 horas atrás, Pedro 469 disse:
  Mostrar conteúdo oculto

local function playerAddExp(cid, exp)
    playerAddExp(pk, expTotal / 10)
    doSendAnimatedText(getThingPos(cid), exp, 215)
end

function onDeath(cid, corpse, deathList)
        
    if isSummon(cid) or not deathList or getCreatureName(cid) == "Evolution" then return true end --alterado v1.8

    -------------Edited Golden Arena-------------------------   --alterado v1.7 \/\/
    if getPlayerStorageValue(cid, 22546) == 1 then
       setGlobalStorageValue(22548, getGlobalStorageValue(22548)-1)
       if corpse.itemid ~= 0 then doItemSetAttribute(corpse.uid, "golden", 1) end  --alterado v1.8    
    end   
    if getPlayerStorageValue(cid, 22546) == 1 and getGlobalStorageValue(22548) == 0 then
       local wave = getGlobalStorageValue(22547)
       for _, sid in ipairs(getPlayersOnline()) do
           if isPlayer(sid) and getPlayerStorageValue(sid, 22545) == 1 then
              if getGlobalStorageValue(22547) < #wavesGolden+1 then
                 doPlayerSendTextMessage(sid, 20, "Wave "..wave.." will begin in "..timeToWaves.."seconds!")   
                 doPlayerSendTextMessage(sid, 28, "Wave "..wave.." will begin in "..timeToWaves.."seconds!") 
                 addEvent(creaturesInGolden, 100, GoldenUpper, GoldenLower, false, true, true)
                 addEvent(doWave, timeToWaves*1000)
              elseif getGlobalStorageValue(22547) == #wavesGolden+1 then
                 doPlayerSendTextMessage(sid, 20, "You have win the golden arena! Take your reward!")
                 doPlayerAddItem(sid, 2152, getPlayerStorageValue(sid, 22551)*2)    --premio
                 setPlayerStorageValue(sid, 22545, -1)
                 doTeleportThing(sid, getClosestFreeTile(sid, posBackGolden), false) 
                 setPlayerRecordWaves(sid)
              end
           end
       end
       if getGlobalStorageValue(22547) == #wavesGolden+1 then
          endGoldenArena()
       end
    end   
    ---------------------------------------------------   /\/\
    local givenexp = getWildPokemonExp(cid)  

if givenexp > 0 then
for a = 1, #deathList do
local pk = deathList[a]
---
local list = getSpectators(getThingPosWithDebug(pk), 30, 30, false)
if isCreature(pk) then 
   local expTotal = math.floor(playerExperienceRate * givenexp)
   local party = getPartyMembers(pk)
   if isInParty(pk) and getPlayerStorageValue(pk, 4875498) <= -1 then
      expTotal = math.floor(expTotal/#party)         --alterado v1.6.1
      for i = 1, #party do
          if isInArray(list, party) then
             playerAddExp(party, expTotal)
          end
      end
   else
      playerAddExp(pk, expTotal / 10) -- Editado 
   end       
end
end
end

    if isNpcSummon(cid) then
        local master = getCreatureMaster(cid)
        doSendMagicEffect(getThingPos(cid), getPlayerStorageValue(cid, 10000))
        doCreatureSay(master, getPlayerStorageValue(cid, 10001), 1)
        doRemoveCreature(cid)
    return false
    end

if corpse.itemid ~= 0 then   --alterado v1.8
   doItemSetAttribute(corpse.uid, "level", getPokemonLevel(cid))
   doItemSetAttribute(corpse.uid, "gender", getPokemonGender(cid))  
end
return true
end

PokeExp.lua

 

provavelmente seu poketibia não ta dando exp pro pokemon apenas pro player nesse caso nóis vamos adicionar essa função:

if not isInParty(pk) and firstball and getItemAttribute(firstball.uid,  expstring) and getItemAttribute(firstball.uid,  expstring) > 0 then
   local percent = getItemAttribute(firstball.uid, expstring) <= 1 and getItemAttribute(firstball.uid, expstring) or 1
   local gainexp = math.ceil(percent * givenexp)
   doItemSetAttribute(firstball.uid, expstring, 0)
   givePokemonExp(pk, firstball, expTotal / 15)  --alterado v2.7
elseif isInParty(pk) and firstball.uid ~= 0 then
   givePokemonExp(pk, firstball, expTotal / 15)    --alterado v2.7
end

acima de:
local list = getSpectators(getThingPosWithDebug(pk), 30, 30, false)

  • 10 months later...
  • Respostas 8
  • Visualizações 3k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Postado
Em 05/06/2019 em 23:30, Atiralol Korobeiniki disse:

provavelmente seu poketibia não ta dando exp pro pokemon apenas pro player nesse caso nóis vamos adicionar essa função:


if not isInParty(pk) and firstball and getItemAttribute(firstball.uid,  expstring) and getItemAttribute(firstball.uid,  expstring) > 0 then
   local percent = getItemAttribute(firstball.uid, expstring) <= 1 and getItemAttribute(firstball.uid, expstring) or 1
   local gainexp = math.ceil(percent * givenexp)
   doItemSetAttribute(firstball.uid, expstring, 0)
   givePokemonExp(pk, firstball, expTotal / 15)  --alterado v2.7
elseif isInParty(pk) and firstball.uid ~= 0 then
   givePokemonExp(pk, firstball, expTotal / 15)    --alterado v2.7
end

acima de:
local list = getSpectators(getThingPosWithDebug(pk), 30, 30, false)

 

Estou com o mesmo problema, ja copiei os codigos aqui porém não funcionou, meu char recebe com a rate normal...Bixo da 100 de xp e a rate está em 20 entao meu char recebe 2000 mas meu poke ainda ganha 100 somente...me ajuda por favor

  • 2 weeks later...
Postado
Em 04/06/2019 em 01:11, Atiralol Korobeiniki disse:

É o seguinte galera, vocês vão ter que ir em:

/data/creaturescripts/pokeexp.lua

 

PARA EDITAR O EXP QUE O PLAYER GANHA QUANDO MATA POKEMONS:

procurem por:


playerAddExp(pk, expTotal)

 

e depois disso do lado da variavel expTotal vocês botam '/' que significa dividir, no caso vai ser expTotal dividido por o numero que você quiser. Vou botar 10 de exemplo

 


playerAddExp(pk, expTotal / 10)

 

e salvem

ai no caso se um ratata tiver dando 20k de exp ele agora vai tar dando 2k de exp graças a essa divisão. Mas ai vocês escolhem o numero que vcs querem dividir.

 

PARA EDITAR EXP QUE SEU POKEMON GANHA AO MATAR POKEMONS:

procurem por:

 


givePokemonExp(pk, firstball, expTotal)

 

Vai ter 2 desses o que ta em cima do elseif vai ser o exp que vai ser ganho sem tar em party e o de baixo vai ser o exp q vai ser ganho quando estiver em party

e agora vamos fazer a mesma coisa de antes vamos dividir o expTotal


givePokemonExp(pk, firstball, expTotal / 15)

No caso o exp que o pokemon irá ganhar vai ser dividido por 15.

 

CASO VOCES QUEIRAM QUE APAREÇAM NUMEROS INTEIROS E NÃO NUMEROS COM VIRGULA SEGUE AI O TUTORIAL:

EM CIMA DO local function giveExpToPlayer

COLOQUEM:
 

  Ocultar conteúdo


function toint(n)
    local s = tostring(n)
    local i, j = s:find('%.')
    if i then
        return tonumber(s:sub(1, i-1))
    else
        return n
    end
end

 

 

E AGORA DEPOIS VOCES IRÃO MODIFICAR O expTotal / 15

por:

 


toint(expTotal / 15)

 

e o expTotal / 10 por:

 


toint(expTotal / 10)

 

ESPERO QUE TENHA AJUDADO VOCES! SOU NOVO AINDA NO TIBIAKING GOSTARIA QUE VOCÊS DEIXEM UM FEEDBACK BOM CASO EU AJUDEI VOCÊS <3

 

PRA QUEM NÃO ENTENDEU DEVERÁ FICAR ASSIM:

 


playerAddExp(pk, toint(expTotal / 10))  

givePokemonExp(pk, firstball, toint(expTotal / 15))

 

 

 

n caso d base DXP..

 

local function playerAddExp(cid, exp)
    doPlayerAddExp(cid, exp)
    doSendAnimatedText(getThingPos(cid), exp, 215)
end


function onDeath(cid, corpse, deathList)
        
    --if not isCreature(cid) then return true end
    if isSummon(cid) or not deathList or getCreatureName(cid) == "Evolution" then return true end --alterado v1.8

    local givenexp = getWildPokemonExp(cid)
    ---local killer = getItemAttribute(corpse.uid, "corpseowner") 
if givenexp > 0 then
for a = 1, #deathList do
local pk = deathList[a]
---
local list = getSpectators(getThingPosWithDebug(pk), 30, 30, false)
if isCreature(pk) then 
   local expTotal = math.floor(givenexp * getDamageMapPercent(pk, cid))
   local party = getPartyMembers(pk)
   if isInParty(pk) and getPlayerStorageValue(pk, 4875498) <= -1 then
      expTotal = math.floor(expTotal/#party)         --alterado v1.6.1
      for i = 1, #party do
          if isInArray(list, party[i]) then             
if getPlayerLevel(pk) <= 50 then
             playerAddExp(party[i], expTotal * 200)  
elseif getPlayerLevel(pk) >= 51 and getPlayerLevel(pk) <= 75 then
             playerAddExp(party[i], expTotal * 150)
elseif getPlayerLevel(pk) >= 76 and getPlayerLevel(pk) <= 100 then
             playerAddExp(party[i], expTotal * 100)
elseif getPlayerLevel(pk) >= 101 and getPlayerLevel(pk) <= 150 then
             playerAddExp(party[i], expTotal * 80)
elseif getPlayerLevel(pk) >= 151 and getPlayerLevel(pk) <= 250 then
             playerAddExp(party[i], expTotal * 60)
elseif getPlayerLevel(pk) >= 251 and getPlayerLevel(pk) <= 350 then
             playerAddExp(party[i], expTotal * 40)
elseif getPlayerLevel(pk) >= 351 then
             playerAddExp(party[i], expTotal * 30)
             end
          end
      end
   elseif not isInParty(pk) then
if getPlayerLevel(pk) <= 50 then
playerAddExp(pk, math.floor(5 * (givenexp * getDamageMapPercent(pk, cid))))
elseif getPlayerLevel(pk) >= 51 and getPlayerLevel(pk) <= 75 then
playerAddExp(pk, math.floor(5 * (givenexp * getDamageMapPercent(pk, cid))))
elseif getPlayerLevel(pk) >= 76 and getPlayerLevel(pk) <= 100 then
playerAddExp(pk, math.floor(5 * (givenexp * getDamageMapPercent(pk, cid))))
elseif getPlayerLevel(pk) >= 101 and getPlayerLevel(pk) <= 150 then
playerAddExp(pk, math.floor(5 * (givenexp * getDamageMapPercent(pk, cid))))
elseif getPlayerLevel(pk) >= 151 and getPlayerLevel(pk) <= 250 then
playerAddExp(pk, math.floor(5 * (givenexp * getDamageMapPercent(pk, cid))))
elseif getPlayerLevel(pk) >= 251 and getPlayerLevel(pk) <= 350 then
playerAddExp(pk, math.floor(5 * (givenexp * getDamageMapPercent(pk, cid))))
elseif getPlayerLevel(pk) >= 351 then
playerAddExp(pk, math.floor(5 * (givenexp * getDamageMapPercent(pk, cid))))
return true end      
   end       
end
end
end

    if isNpcSummon(cid) then
        local master = getCreatureMaster(cid)
        doSendMagicEffect(getThingPos(cid), getPlayerStorageValue(cid, 10000))
        doCreatureSay(master, getPlayerStorageValue(cid, 10001), 1)
        doRemoveCreature(cid)
    return false
    end
if corpse.itemid ~= 0 then   --alterado v1.8
   doItemSetAttribute(corpse.uid, "level", getPokemonLevel(cid))
   doItemSetAttribute(corpse.uid, "gender", getPokemonGender(cid))  
end
return true
end

 

onde modifico?

  • 2 weeks later...
Postado

Uma ajuda para o tópico...
Ao invés de usar uma nova função (totalmente desnecessária, pesando na memória ram do servidor) para mostrar números inteiros, utilize uma função padrão da linguagem lua..
exemplo:

playerAddExp(pk, math.floor(expTotal / 10))

ou

playerAddExp(pk, math.ceil(expTotal / 10))

 

Explicação:
math.floor vai retornar um número inteiro menor ou igual ao resultado da equação.
math.ceil vai retornar um número inteiro maior ou igual ao resultado da equação.

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo