Talkaction.XML
<talkaction words="/doubleexp" access="5" event="script" value="exp.lua"/>
Taltaction/script/exp.lua
function onSay(cid, words, param, channel)
local config = {
storage = 102590,
}
if(param == 'cancel') then
if getGlobalStorageValue(config.storage) > 0 then
setGlobalStorageValue(config.storage, -1)
doBroadcastMessage("Double Exp cancelado")
end
return true
end
param = tonumber(param)
if(not param or param < 0) then
doPlayerSendCancel(cid, "Apenas maiores que 0.")
return true
end
if getGlobalStorageValue(config.storage) - os.time() <= 0 then
setGlobalStorageValue(config.storage, os.time()+param*60*60)
doBroadcastMessage("Exp bonus ativado 50% + EXP por "..param.." horas! Aproveite.")
end
return true
end
Creature.XML
<event type="kill" name="ExpBonus" event="script" value="exp.lua"/>
Creature/script/exp.lua
function onKill(cid, target) if isPlayer(cid) and isMonster(target) then if getGlobalStorageValue(102590) - os.time() >= 1 then local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier) local count = ((getMonsterInfo(string.lower(getCreatureName(target))).experience*1.5*exp)/2) doPlayerAddExperience(cid, count) addEvent(doSendAnimatedText, 500, getCreaturePosition(cid), '+'..count, math.random(50,60)) end else return TRUE end return TRUE end
Creature/script/login.LUA
registerCreatureEvent(cid, "ExpBonus")
Movido para resolvidos





info
Grupo: Barão
Registrado: 06/02/12
Posts: 207
Reputação: +1
Char no Tibia: Não lembro :(
Ola,
Gostaria de um script que eu pudesse ativar direto do god um comando tipo /doubleexp.
E que startaria double exp durante 24 hrs.
Ou algo parecido.