Ir para conteúdo

Featured Replies

Resolvido por Kemmlly

Ir para solução
Postado

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!

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

Postado
  • Autor
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

Postado
  • 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"/>

 

Postado
  • Autor
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.

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