local storage = 38747
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, storage) == -1 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your extra experience rate is now double for 100 monsters.")
doPlayerSetRate(cid, SKILL__LEVEL, 2)
setPlayerStorageValue(cid, storage, 0)
doRemoveItem(item.uid, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You still have "..(100-getPlayerStorageValue(cid, storage)).." monsters left to kill before the double experience is over.")
end
return true
end
local storage = 38747
function onKill(cid, target)
if getPlayerStorageValue(cid, storage) >= 0 and getPlayerStorageValue(cid, storage) <= 100 then
setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
end
if getPlayerStorageValue(cid, storage) == 100 then
setPlayerStorageValue(cid, storage, -1)
doPlayerSetRate(cid, SKILL__LEVEL, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed 100 monsters, the double experience has ended.")
end
return true
end
local storage = 38747
function onSay(cid, words, param)
if getPlayerStorageValue(cid, storage) == -1 then
doPlayerSetRate(cid, SKILL__LEVEL, 2)
setPlayerStorageValue(cid, storage, 0)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You still have "..(100-getPlayerStorageValue(cid, storage)).." monsters left to kill before the double experience is over.")
end
return true
end
if getPlayerStorageValue(cid, storage) >= 0 then
doPlayerSetRate(cid, SKILL__LEVEL, 2)
end
local storage = 38747
function onKill(cid, target)
if getPlayerStorageValue(cid, storage) >= 0 then
doPlayerSetRate(cid, SKILL__LEVEL, 2)
end
getPlayerStorageValue(cid, storage) <= 100 then
setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
end
if getPlayerStorageValue(cid, storage) == 100 then
setPlayerStorageValue(cid, storage, -1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed 100 monsters, the double experience has ended.")
end
return true
end
local storage = 38747
function onKill(cid, target)
if getPlayerStorageValue(cid, storage) >= 0 and getPlayerStorageValue(cid, storage) <= 100 then
setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
end
if getPlayerStorageValue(cid, storage) == 100 then
setPlayerStorageValue(cid, storage, -1)
doPlayerSetRate(cid, SKILL__LEVEL, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed 100 monsters, the double experience has ended.")
end
return true
end
<event type="Kill" name="onkill" event="script" value="exp100.lua"/>
registerCreatureEvent(cid, "onkill")
You can add this in config.lua.
Code:if getPlayerStorageValue(cid, 38747) >= 0 then doPlayerSetRate(cid, SKILL__LEVEL, 2) end
local storage = 38747
function onSay(cid, words, param)
if getPlayerStorageValue(cid, storage) == -1 then
doPlayerSetRate(cid, SKILL__LEVEL, 2)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You still have "..(100-getPlayerStorageValue(cid, storage)).." monsters left to kill before the double experience is over.")
end
return true
end