hi , there
first you need to add script when the boss died or the buff activated for that matter then run this script which store the buff start time on global variable
Code:
-- when world boss died
function on_boss_world()
local now_time = get_os_time() -- get now time
--set global variable of buff start time
set_global_variable("world_boss_buff",now_time)
end
then use this function on login to check buff time and add it to the player when he logs in
Code:
-- on player login
function world_boss_buff()
local now_time = get_os_time() -- get now time
local buff_time = get_global_variable("world_boss_buff") -- buff start time
if buff_time == nil or buff_time == "" then buff_time = 0 end
local state_time = now_time - buff_time -- buff time
local state_id = 14011 -- buff id
local state_power = 10 -- buff power
-- check buff time if still running
if now_time > buff_time then
add_cstate(state_id,state_power,state_time)
end
end
--NOTICE--
Quote:
|
you may wanna add a remove_cstate to a script when player login to remove the buff in case player logged in couple times in case you encounter problem
|