Postado Janeiro 3, 2017 8 anos Em 24/12/2016 ás 22:53, Vodkart disse: claro, você quer por storage assim: storage 1001 = 10% storage 1002 = 20% storage 1003 = 30% etc... ou pode ser por valor da storage assim: storage 1001(value 1) = 10% storage 1001(value 2) = 20% storage 1001(value 3) = 30% Não entendi tentei montar a script e nao deu certo... Tipo eu quero por pra ganhar xp bonus ao fazer quest entendeu? tipo a quest da storage que da xp a+
Postado Janeiro 4, 2017 8 anos 18 horas atrás, Gustavo Ntos disse: Não entendi tentei montar a script e nao deu certo... Tipo eu quero por pra ganhar xp bonus ao fazer quest entendeu? tipo a quest da storage que da xp a+ mas cada quest é uma storage diferente? ou vc vai subindo a quantidade de % de exp? se eu faço a quest 1 ganho 10% se eu faço a quest 2 ganho 20% [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Janeiro 4, 2017 8 anos 6 horas atrás, Vodkart disse: mas cada quest é uma storage diferente? ou vc vai subindo a quantidade de % de exp? se eu faço a quest 1 ganho 10% se eu faço a quest 2 ganho 20% Assim mesmo sem acumular....
Postado Janeiro 5, 2017 8 anos function getExpMonsterKills(cid) local me = { [1] = 0.10, -- 10% [2] = 0.20, -- 20% [3] = 0.30, -- 30% [4] = 0.40 -- 40% } local x = me[getPlayerStorageValue(cid, 178902)] return (not x and 0 or x) end function onKill(cid, target) if isPlayer(cid) and isMonster(target) == true then local percent = getExpMonsterKills(cid) if percent == 0 then return true end local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier) local count = math.floor(((getMonsterInfo(string.lower(getCreatureName(target))).experience*exp)*percent)) doPlayerAddExperience(cid, count) addEvent(doSendAnimatedText, 500, getCreaturePosition(cid), '+'..count, math.random(50,60)) end return true end ai só colocando assim no final da quest quest 1: setPlayerStorageValue(cid, 178902, 1) -- aqui vai dar os 0.10 quest 2: setPlayerStorageValue(cid, 178902, 2) -- aqui vai dar os 0.20 e assim sucessivamente... [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Janeiro 5, 2017 8 anos 15 horas atrás, Vodkart disse: function getExpMonsterKills(cid) local me = { [1] = 0.10, -- 10% [2] = 0.20, -- 20% [3] = 0.30, -- 30% [4] = 0.40 -- 40% } local x = me[getPlayerStorageValue(cid, 178902)] return (not x and 0 or x) end function onKill(cid, target) if isPlayer(cid) and isMonster(target) == true then local percent = getExpMonsterKills(cid) if percent == 0 then return true end local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier) local count = math.floor(((getMonsterInfo(string.lower(getCreatureName(target))).experience*exp)*percent)) doPlayerAddExperience(cid, count) addEvent(doSendAnimatedText, 500, getCreaturePosition(cid), '+'..count, math.random(50,60)) end return true end ai só colocando assim no final da quest quest 1: setPlayerStorageValue(cid, 178902, 1) -- aqui vai dar os 0.10 quest 2: setPlayerStorageValue(cid, 178902, 2) -- aqui vai dar os 0.20 e assim sucessivamente... Se fazer a Quest [1] e [2] vai somar 30% a + de xp ou so 20%? 15 horas atrás, Vodkart disse: function getExpMonsterKills(cid) local me = { [1] = 0.10, -- 10% [2] = 0.20, -- 20% [3] = 0.30, -- 30% [4] = 0.40 -- 40% } local x = me[getPlayerStorageValue(cid, 178902)] return (not x and 0 or x) end function onKill(cid, target) if isPlayer(cid) and isMonster(target) == true then local percent = getExpMonsterKills(cid) if percent == 0 then return true end local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier) local count = math.floor(((getMonsterInfo(string.lower(getCreatureName(target))).experience*exp)*percent)) doPlayerAddExperience(cid, count) addEvent(doSendAnimatedText, 500, getCreaturePosition(cid), '+'..count, math.random(50,60)) end return true end ai só colocando assim no final da quest quest 1: setPlayerStorageValue(cid, 178902, 1) -- aqui vai dar os 0.10 quest 2: setPlayerStorageValue(cid, 178902, 2) -- aqui vai dar os 0.20 e assim sucessivamente... Vai continuar como? <event type="kill" name="exp_pmob" event="script" value=xp.lua"/> <event type="advance" name="exp_pmob" event="script" value=xp.lua"/> <event type="login" name="exp_pmob" event="script" value=xp.lua"/>
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.