• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Double exp area

Status
Not open for further replies.

Himii

Premium User
Premium User
Joined
Jan 19, 2011
Messages
1,267
Solutions
5
Reaction score
183
Location
Sweden
Hello guys!!

Can anyone create a script that gives you 2x exp when you are in an 5 sqm area around an chest with an action id or youst make it an area?
 
Last edited:
Is easier if you just put some action/unique id on the tiles that you want double exp (movements)
 
Lua:
local top_left = {x = 1000, y = 1000, z = 7}
local bottom_right = {x = 1000, y = 1000, z = 7}
local double_exp_area = top_left, bottom_right

local has_double_exp = 99918 --storage

function onStepIn(cid, item, itemEx, fromPosition, toPosition)
if getPlayerStorageValue(cid, has_double_exp) < 1 then
if isInArray(double_exp_area, toPosition) then
setPlayerStorageValue(cid, has_double_exp, 1)
doPlayerSetExtraExpRate(cid, +1)
end
end
end

Lua:
function onStepOut(cid, item, itemEx, fromPosition, toPosition)
if not isInArray(double_exp_area, toPosition) then
if getPlayerStorageValue(cid, has_double_exp) == 1 then
setPlayerStorageValue(cid, has_double_exp, -1)
setPlayerExtraExpRate(cid, -1)
end
end
end
 
use onKill

Lua:
function onKill(cid, target)
local from,to = {x=160, y=54, z=7},{x=165, y=54, z=7}
if isPlayer(cid) and isInRange(getCreaturePosition(cid), from, to) and isMonter(target) 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
return true
end
 
Status
Not open for further replies.
Back
Top