• 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!

Lua Exp extra

Godshiryu

New Member
Joined
Mar 15, 2010
Messages
40
Reaction score
0
Hello all. I came here because I have doubts in a script.
My server has Extra Exp for VIP players (30%), this script:
Code:
function onLogin(cid)

local rate = 1.3 -- 30%
local config = {
vip = "Você tem "..((rate - 1)*100).."% de exp a mais agora!",
notvip = "Tornesse vip e ganhe "..((rate - 1)*100).."% a mais de experiencia!",
}

if vip.hasVip(cid) == TRUE then
doPlayerSetExperienceRate(cid, rate)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.vip)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.notvip)
end
return TRUE
end

And extra for vip who conquered the castle (20%), this script:
Code:
dofile("./_woe.lua")

function onLogin(cid)
	Woe.getInfo()
	local Guild_ID = getPlayerGuildId(cid)
	if (Guild_ID == infoLua[2]) and (infoLua[2] ~= 0) then
		doPlayerSetExperienceRate(cid, 1.20)	-- here 
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your guild has won the last War of Emperium, for that reason you have 20% extra experience.")
	end
	return true
end

Who won the castle and it's VIP, right is to gain 50% extra for VIP, but not giving, is giving only 30%
I tried to edit a script to gain 50% exp, that:
Code:
dofile("./_woe.lua")
function onLogin(cid)
	Woe.getInfo()
	local Guild_ID = getPlayerGuildId(cid)
local rate = 1.5 -- 50%
local config = {
vipecastle = "Logo voce tem "..((rate - 1)*100).."% de exp a mais por ter conquistado o castelo e ser vip!",
notviporcastle = "Tornesse vip e ganhe "..((rate - 1)*100).."% a mais de experiencia!",
}

if (vip.hasVip(cid) == TRUE) and (Guild_ID == infoLua[2]) and (infoLua[2] ~= 0) then
doPlayerSetExperienceRate(cid, rate)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.vipecastle)
else

end
return TRUE
end
But did not really work, can someone tell me what's wrong? Grateful.
 
Try this:
Lua:
config =
{
	bonus_percent 	= 30,
	vipstorage	= 1000
}

function onKill(cid, target)
	if (isMonster(target) and getCreatureStorage(cid, config.vipstorage)) then
		doPlayerAddExperience(cid, math.ceil(config.bonus_percent / 100 * getMonsterInfo(getCreatureName(target)).experience))
	end

	return true
end
 
Back
Top