Ir para conteúdo
  • Cadastre-se

(Resolvido)Script que o player dobra o exp


Ir para solução Resolvido por Kemmlly,

Posts Recomendados

Creaturescript:

local storage = 48999 -- str que precisa ter

function onLogin(cid)
local rate = 1.3 -- 30%, 1.2 = 20%...
if getPlayerStorageValue(cid) == storage then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Você tem "..((rate - 1)*100).."% de exp a mais!")
end
return true
end
function onKill(cid, target)
if isPlayer(cid) and isMonster(target) then
if getPlayerStorageValue(cid) == storage then
local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier)
local count = ((getMonsterInfo(string.lower(getCreatureName(target))).experience*1.3*exp)/2) --30%
doPlayerAddExperience(cid, count)
addEvent(doSendAnimatedText, 500, getCreaturePosition(cid), '+'..count, math.random(50,60))
end
end
return true
end
<event type="login" name="ExpGuild_L" event="script" value="arquivo.lua"/>
<event type="kill" name="ExpGuild" event="script" value="arquivo.lua"/>

Só registrar o kill no seu login.lua.

════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═══╗

Te Ajudei? Rep + e ficamos Quits

166420979_logoyanliimaornight.png.33f822b8970081a5b3646e85dbfd5934.png

Precisando de ajuda?

discord.png.1ecd188791d0141f74d99db371a2e0a4.png.890d5a38d7bcde75543c72b624a65de1.pngDiscord: Yan Liima #3702

Programador Júnior de LUA, PHP e JavaScript

Juntos somos lendas, separados somos Mitos!

╚══════════════════════════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═════════════════════════════╝

Link para o post
Compartilhar em outros sites
49 minutos atrás, Yan Liima disse:

Creaturescript:


local storage = 48999 -- str que precisa ter

function onLogin(cid)
local rate = 1.3 -- 30%, 1.2 = 20%...
if getPlayerStorageValue(cid) == storage then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Você tem "..((rate - 1)*100).."% de exp a mais!")
end
return true
end
function onKill(cid, target)
if isPlayer(cid) and isMonster(target) then
if getPlayerStorageValue(cid) == storage then
local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier)
local count = ((getMonsterInfo(string.lower(getCreatureName(target))).experience*1.3*exp)/2) --30%
doPlayerAddExperience(cid, count)
addEvent(doSendAnimatedText, 500, getCreaturePosition(cid), '+'..count, math.random(50,60))
end
end
return true
end

<event type="login" name="ExpGuild_L" event="script" value="arquivo.lua"/>
<event type="kill" name="ExpGuild" event="script" value="arquivo.lua"/>

Só registrar o kill no seu login.lua.

 

Mano, aparentemente está funcionando, porém quando eu tento aumentar a % de exp, não faz diferença alguma

Link para o post
Compartilhar em outros sites
  • Solução

arquivo /data/creaturescripts/scripts/double.lua

function onLogin(cid)
	local storage = 998899 -- STORAGE QUE QUER USAR
	local xp = 2 -- QUANTIDADE QUE VAI MULTIPLICAR O XP
    if getPlayerStorageValue(cid, storage) == 1 then		
        local rates = getPlayerRates(cid)
        doCreatureSay(cid, "Voce esta com o XP dobrado, aproveite!", TALKTYPE_ORANGE_1, true, cid)
		doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]*xp)
     end  
return true
end

tag /data/creaturescripts/creaturescripts.xml

<event type="login" name="double" event="script" value="double.lua"/>

 

Link para o post
Compartilhar em outros sites
Em 23/08/2019 em 14:23, Kemmlly disse:

arquivo /data/creaturescripts/scripts/double.lua


function onLogin(cid)
	local storage = 998899 -- STORAGE QUE QUER USAR
	local xp = 2 -- QUANTIDADE QUE VAI MULTIPLICAR O XP
    if getPlayerStorageValue(cid, storage) == 1 then		
        local rates = getPlayerRates(cid)
        doCreatureSay(cid, "Voce esta com o XP dobrado, aproveite!", TALKTYPE_ORANGE_1, true, cid)
		doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]*xp)
     end  
return true
end

tag /data/creaturescripts/creaturescripts.xml


<event type="login" name="double" event="script" value="double.lua"/>

 

 

Funcionou, obrigado.

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo