Hello, i made easy script for funny exp event. Script changing exp ever 1 hour, changed exp is random lot.
configs in script.. ; )
in talkactions.xml
and talkactions/scripts/expevent.lua
and in creaturescripts to login.lua add:
Yours,
azi.
configs in script.. ; )
in talkactions.xml
PHP:
<talkaction access="5" log="yes" words="/expevent" script="expevent.lua"/>
PHP:
config = {
minExp = 5, -- lowest multiple of exp
maxExp = 20, -- highest multiple of exp
changeTime = 60 -- how many time (minutes) for change
}
function changeExpRate(params)
for i, pid in ipairs(params.players) do
setPlayerExtraExpRate(pid, params.expRate)
end
doBroadcastMessage("The exp rate set to "..params.expRate.." next exp rate update in next "..config.changeTime.." minutes!", MESSAGE_STATUS_WARNING)
setGlobalStorageValue(55555, params.expRate)
addEvent(changeExpRate,(config.changeTime*60*1000), {players=params.players, expRate=math.random(config.minExp, config.maxExp)})
end
function onSay(cid, words, param)
changeExpRate({players=getPlayersOnline(), expRate=math.random(config.minExp, config.maxExp)})
end
and in creaturescripts to login.lua add:
PHP:
expRate = getGlobalStorageValue(55555)
function onLogin(cid)
if expRate > 0 then
setPlayerExtraExpRate(cid, expRate)
doPlayerSendTextMessage(cid, 18, "The exp rate set to "..expRate.." next exp rate update in next 60 minutes!")
end
return TRUE
end
Yours,
azi.
Last edited: