[Encerrado] Reduzindo Xp De Acordo Com O Level ! Novo Erro ! Pda

rodrigoorgirdor
em Tópicos Sem Resposta

rodrigoorgirdor

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 28/09/12Posts: 106

Pessoal, coloquei esse script que o slicer me passou, deu certo... só que dava um erro aki no server...

me explicaram aki como resolver o erro... tambem deu certo, eu matava o monstro e o erro não apareceu mais... só que depois que modifiquei o script a experiencia não divide mais e só agora eu percebi.... o script é o tal

 

 

 

 

local balls = {11826, 11828, 11829, 11831, 11832, 11834, 11835, 11837,

11737, 11739, 11740, 11742, 11743, 11745, 11746, 11748}

 

local Exps = {

[{1, 49}] = 1,

[{50, 74}] = 0.8,

[{75, 99}] = 0.6,

[{100, 149}] = 0.5,

[{150, 199}] = 0.4,

}

--2798 -normal- //

local function playerAddExp(cid, exp)

doPlayerAddExp(cid, exp)

doSendAnimatedText(getThingPos(cid), exp, 215)

end

 

local function calculaExp(cid, expTotal)

if not isPlayer(cid) then return 0 end

local expFinal = expTotal

for lvl, exp in pairs(Exps) do

if getPlayerLevel(cid) >= lvl[1] or getPlayerLevel(cid) <= lvl[2] then

expFinal = expFinal * exp

break

end

end

if expFinal == expTotal then expFinal = expFinal * 0.1 end --lvl 200+

return math.floor(expFinal)

end

 

local function giveExpToPlayer(pk, expTotal, givenexp, expstring) --alterado v2.7

playerAddExp(pk, expTotal)

local firstball = getPlayerSlotItem(pk, 8)

 

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) --alterado v2.7

elseif isInParty(pk) and firstball.uid ~= 0 then

givePokemonExp(pk, firstball, expTotal*3) --alterado v2.7

end

 

for b = 1, #balls do

local pokes = getItemsInContainerById(getPlayerSlotItem(pk, 3).uid, balls)

if #pokes >= 1 then

for _, uid in pairs (pokes) do

if not isInParty(pk) and getItemAttribute(uid, expstring) and getItemAttribute(uid, expstring) > 0 then

local percent = getItemAttribute(uid, expstring) <= 1 and getItemAttribute(uid, expstring) or 1

local gainexp = math.ceil(percent * givenexp)

doItemSetAttribute(uid, expstring, 0)

givePokemonExpInBp(pk, uid, gainexp, balls) --alterado v2.7

elseif isInParty(pk) and getItemAttribute(uid, expstring) and getItemAttribute(uid, expstring) > 0 then

givePokemonExpInBp(pk, uid, expTotal*3, balls)

end

end

end

end

end

 

 

function onDeath(cid, corpse, deathList)

--if not isCreature(cid) then return true end

if isSummon(cid) or not deathList or corpse.itemid == 0 or getCreatureName(cid) == "Evolution" then return true end

 

-------------Edited Golden Arena------------------------- --alterado v2.7 \/\/

if getPlayerStorageValue(cid, 22546) == 1 then

setGlobalStorageValue(22548, getGlobalStorageValue(22548)-1)

doItemSetAttribute(corpse.uid, "golden", 1)

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, 21, "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)

local expstring = ""..cid.."expEx"

if givenexp > 0 then

for a = 1, #deathList do

local pk = deathList[a]

if isCreature(pk) then

local list = getSpectators(getThingPosWithDebug(pk), 30, 30, false)

local expTotal = math.floor(playerExperienceRate * givenexp * getDamageMapPercent(pk, cid))

expTotal = calculaExp(pk, expTotal)

local party = getPartyMembers(pk)

if isInParty(pk) and getPlayerStorageValue(pk, 4875498) <= -1 then

expTotal = math.floor(expTotal/#party) --alterado v2.6.1

for i = 1, #party do

if isInArray(list, party) and getDamageMapPercent(party, cid) > 0 then --alterado v2.8

giveExpToPlayer(party, expTotal, givenexp, expstring)--alterado v2.7

end

end

else

giveExpToPlayer(pk, expTotal, givenexp, expstring) --alterado v2.7

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

 

doItemSetAttribute(corpse.uid, "offense", getPlayerStorageValue(cid, 1011))

doItemSetAttribute(corpse.uid, "defense", getPlayerStorageValue(cid, 1012))

doItemSetAttribute(corpse.uid, "speed", getPlayerStorageValue(cid, 1013))

doItemSetAttribute(corpse.uid, "vitality", getPlayerStorageValue(cid, 1014))

doItemSetAttribute(corpse.uid, "spattack", getPlayerStorageValue(cid, 1015))

doItemSetAttribute(corpse.uid, "level", getPokemonLevel(cid))

doItemSetAttribute(corpse.uid, "gender", getPokemonGender(cid))

return true

end

 

 

 

 

 

Mauz ae por postar de novo o mesmo erro. fiz muitos testes... mas não percebi que o xp não dividia.

 

esse arquivo é o pokeexp.lua

Eu quero que o xp que player ganha vá se reduzindo nos leveis 50, 75,100 .........

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

amigo vc ativo a divisao de exp? ;/ pq o script esta tudo correto...

o lider da party tem q flar, !partyexp, para ativar/desativar a divisao de exp...

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

rodrigoorgirdor

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 28/09/12Posts: 106

acho que no outro script todo mundo entendeu errado... e eu não entendi o que me explicaram e coloquei pensando que ia resolver meu tilte... resumindo... fiz bagunça aki... o que eu quero não é divisão de xp na party.... olha... vou explicar detalhadamente.

 

 

quando um player entra no jogo... ele tira 350 do geodude... quero que quando ele cheguar no level 50 ele tire 260 do geodude,no level 75 ele vai tirar menos ainda e no level 100 menos ainda... isso se tiver como lógico !

 

acho que eu não soube explicar direito no primeiro pedido

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

mano o script ali decima ja faz isso.. n sei como fica assim certinhuuu mas q diminui aos poucos no lvl diminui ;x

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

rodrigoorgirdor

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 28/09/12Posts: 106

aki os players estão tirando a mesma quantidade de xp independente do level.. vou fuçando aki

 

Tentei de todo geito aki... e não deu.... presumo que ninguem pode me ajudar.... certo? 24 horas sem respostas...

MrCatra

avatar
Banidos
Banidos

INFOS

Grupo: BanidosRegistrado: 25/09/12Posts: 208

Voce esta falando da XP do player ou do pokemon nao entendi ainda.

 

 

 

Se for do player,tente mexer no stages.xml

S5aHt.png

 

XTibia

Desde 20/11/2010

 

--Meus Trabalhos--

 

WebDesigner :

ModernACC

Template Poketibia v1 By MrCatra

Template WoDBO v1 By MrCatra

 

 

 

 

 

 

WebDesigner - 17/08/2012

Designer - 16/05/2012

Mapper iniciante - 10/03/2009

rodrigoorgirdor

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 28/09/12Posts: 106

MrCatra seguinte. quero que a experiencia tirada de um pokemon caia a cada 25 leveis....

 

tipo: até o level 50 o player tira 350 do geodude

do 50 ao 75 ele tira 262

do 75 até o 100 diminui mais

do 100 em diante diminui mais assim sucessivamente até o lvl 150

 

da pra regular isso nas stages?

 

acho que a galera aki tentou nas stages.. me falaram que não da certo, mas vou olhar aki mesmo assim

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

cleba

n era pra funcionar ;x pq a exp eh calculada no pokeexp.lua e eh adicionada la tb pela function doPlayerAddExp.. ;x deve ta bugado ae ms uahuah vai saber..

bem q tb n sei como funciona ms o stages... pensei q soh afetava a exp q o player ganha dos monstros... mas se ta funcionando ae, entao ele pode funcionar para qlqr exp q o player ganhe.. vai saber kkk

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

rodrigoorgirdor

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 28/09/12Posts: 106

aew... olhei no topico que eu tinha colocado antes.... fiz igual o cleber colocou la.... e deu certo agora............ ta dividindo...

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

kkkkk entao ta neh.. o stages deve dividir qlqr exp q o player ganhe, idependente de onde ela venha xD

 

duvida sanada, movido!

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

Stigal

don't ever stop...
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 28/11/10Posts: 3402Gênero: Masculino
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.

VI6MDIG.png

 

"O fracasso é a oportunidade de se começar de novo inteligentemente"

Minhas Redes Sociais: Youtube | Página & Grupo | Steam  | Discord Xtibia | Skype: @mrooger

 

OTpanel