Is easier if you just put some action/unique id on the tiles that you want double exp (movements)
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
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
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