hichay
16-02-14, 07:14 PM
Script ủy thác bà kon lấy mà tham khảo.
--DarkMoon (10/25/13)
-- 3:15 pm
--Uy Thac
-----------------------------------
Include("\\script\\source\\lib_exp\\sum_exp_lib.lu a")
Include("\\script\\source\\IOFile.lua")
tbUyThac = {}
tbUyThac.TASK =
{
BCH = 54,
ONOFF = 83,
DATE = 84,
TIME = 85,
DAYORNIGHT = 86,
EXP = 87,
HOUR = 88,
MINUTE = 89,
SECOND = 90,
DAY = 91,
MONTH = 92,
YEAR = 93,
BCH_LEFT = 94,
MIN_UT = 95,
}
function tbUyThac:ChooseOption()
local Option = {}
local OptionOn = {}
local OptionOff = {}
tinsert(Option,"Ta muèn Uû Th¸c Online/UyThac")
tinsert(Option,"Ta muèn Uû Th¸c Offline/UyThac")
tinsert(Option,"KÕt thóc ®èi tho¹i/UyThac")
tinsert(OptionOn,"Dõng Uû Th¸c Online/UyThacOn")
tinsert(OptionOn,"KÕt thóc ®èi tho¹i/UyThacOn")
tinsert(OptionOff,"NhËn Exp ñy th¸c offline/UyThacOff")
tinsert(OptionOff,"KÕt thóc ®èi tho¹i/UyThacOff")
if (GetFightState() == 1) then Say("HiÖn t¹i ng*¬i ®ang trong tr¹ng th¸i chiÕn ®Êu, kh«ng thÓ ®i vµo tr¹ng th¸i rêi m¹ng ñy th¸c ®*îc, xinh h·y trë l¹i tr¹ng th¸i phi chiÕn ®Êu sau ®ã h·y tiÕn hµnh rêi m¹ng ñy th¸c nhÐ.",1,"KÕt thóc ®èi tho¹i/Cancel") return end
local Exp_Show = tbUyThac:CalExp()
local Exp_TIMES_BY_MINUTES = GetTask(self.TASK.MIN_UT) * tbUyThac:ExpByLevel()
if (Exp_Show > 0) then SetTask(self.TASK.EXP,Exp_Show) end
local Str = "ñy th¸c bao gåm Online vµ Offline. HiÖn b¹n cã : "..GetTask(self.TASK.BCH).." phót ñy th¸c, ng*¬i muèn chän chøc n¨ng ñy th¸c nµo?"
local StrOn = format("B¾t ®Çu ñy th¸c Online: <color=fire>%d/%d/%d - %d:%d:%d<color>\nB¹ch CÇu Hoµn: %d phót\nExp %d phót Uû Th¸c: %d",
GetTask(self.TASK.DAY),
GetTask(self.TASK.MONTH),
GetTask(self.TASK.YEAR),
GetTask(self.TASK.HOUR),
GetTask(self.TASK.MINUTE),
GetTask(self.TASK.SECOND),
GetTask(self.TASK.BCH),
GetTask(self.TASK.MIN_UT),
GetTask(self.TASK.EXP))
local StrOff = format("B¾t ®Çu ñy th¸c Offline: <color=fire>%d/%d/%d - %d:%d:%d<color>\nB¹ch CÇu Hoµn: %d phót\nExp Uû Th¸c cña %d phót: %d",
GetTask(self.TASK.DAY),
GetTask(self.TASK.MONTH),
GetTask(self.TASK.YEAR),
GetTask(self.TASK.HOUR),
GetTask(self.TASK.MINUTE),
GetTask(self.TASK.SECOND),
GetTask(self.TASK.BCH),
GetTask(self.TASK.MIN_UT),
GetTask(self.TASK.EXP))
if (GetLevel() < 50) then Talk(1,"","§¼ng cÊp cña c¸c h¹ kh«ng ®ñ ®Ó tham gia chøc n¨ng ñy th¸c. Yªu cÇu ®¼ng cÊp 50 trë lªn.") return end
if (GetTask(self.TASK.TIME) == 0) then
SayNew(Str,getn(Option),Option)
else
if (GetTask(self.TASK.ONOFF) == 1) then -- on
SayNew(StrOn,getn(OptionOn),OptionOn)
return
end
SayNew(StrOff,getn(OptionOff),OptionOff)
end
end
Cancel = function()
end
UyThac = function(nsel)
local Sec = nsel + 1
if (Sec == 1) then tbUyThac:Online() return end
if (Sec == 2) then tbUyThac:Offline() return end
if (Sec == 3) then return end
end
function tbUyThac:Online()
if (GetTask(self.TASK.BCH) == 0) then Talk(1,"","Yªu cÇu b¹n ph¶i sö dông B¹ch CÇu Hoµn") return end
local Hour,Minute,Second = tonumber(date("%H")),tonumber(date("%M")),tonumber (date("%S"))
local nDate,month,year = tonumber(date("%d")),tonumber(date("%m")),tonumber (date("%y"))
local StartTime = nDate*24*3600 + Hour *3600 + Minute*60 + Second
SetTask(self.TASK.TIME,StartTime)
SetTask(self.TASK.DATE,nDate)
SetTask(self.TASK.ONOFF,1)
SetTask(self.TASK.DAY,nDate)
SetTask(self.TASK.MONTH,month)
SetTask(self.TASK.YEAR,year)
SetTask(self.TASK.HOUR,Hour)
SetTask(self.TASK.MINUTE,Minute)
SetTask(self.TASK.SECOND,Second)
tbUyThac:SetAmOrPm(Hour)
SetOffline(1)
SayNew("B¾t ®Çu ñy th¸c Online: <color=fire>"..nDate.."/"..month.."/"..year.." - "..Hour..":"..Minute..":"..Second.." <color><enter>(Chó ý: Di chuyÓn qua c¸c Thµnh ThÞ + C¸c khu vùc train + Logout ra khái game sÏ bÞ mÊt hiÖu lùc)",0)
end
function tbUyThac:Offline()
if (GetTask(self.TASK.BCH) == 0) then Talk(1,"","Yªu cÇu b¹n ph¶i sö dông B¹ch CÇu Hoµn") return end
local Hour,Minute,Second = tonumber(date("%H")),tonumber(date("%M")),tonumber (date("%S"))
local nDate,month,year = tonumber(date("%d")),tonumber(date("%m")),tonumber (date("%y"))
local StartTime = nDate*24*3600 + Hour *3600 + Minute*60 + Second
SetTask(self.TASK.TIME,StartTime)
SetTask(self.TASK.DATE,nDate)
SetTask(self.TASK.DAY,nDate)
SetTask(self.TASK.MONTH,month)
SetTask(self.TASK.YEAR,year)
SetTask(self.TASK.HOUR,Hour)
SetTask(self.TASK.MINUTE,Minute)
SetTask(self.TASK.SECOND,Second)
tbUyThac:SetAmOrPm(Hour)
SetTask(self.TASK.ONOFF,2)
OutGame(1)
end
function tbUyThac:FunctLogOut()
if (GetTask(self.TASK.ONOFF) == 1) then
local Exp = tbUyThac:CalExp()
if (Exp == 0) then tbUyThac:ResetTask() return end
local BCH_LEFT = GetTask(self.TASK.BCH_LEFT)
AddUp_Exp.CongDon(Exp)
SetTask(self.TASK.BCH,BCH_LEFT)
tbUyThac:ResetTask()
WriteLog("dulieu/Activity/uythac/Exp_Uy_Thac.txt",format("Ngµy: %d/%d/%d giê: %d:%d:%d nh©n vËt: %s ®¼ng cÊp %d ®· nhËn ®*îc %d Exp",tonumber(date("%d")),tonumber(date("%m")),ton umber(date("%y")),tonumber(date("%H")),tonumber(da te("%M")),tonumber(date("%S")),GetName(),GetLevel( ),Exp))
end
end
function tbUyThac:IsVisible()
if (GetTask(self.TASK.ONOFF) == 1) then
return 1
elseif (GetTask(self.TASK.ONOFF) == 2) then
return 2
end
end
function tbUyThac:SetAmOrPm(hour)
if hour >= 1 and hour <= 12 then
SetTask(self.TASK.DAYORNIGHT,1)
else
SetTask(self.TASK.DAYORNIGHT,2)
end
end
UyThacOn = function(nsel)
local Sec = nsel + 1
if (Sec == 2) then return end
local Exp = tbUyThac:CalExp()
if (Exp == 0) then Talk(1,"","Thêi gian ñy th¸c kh«ng ®ñ ®Ó ®æi kinh nghiÖm.") tbUyThac:ResetTask() return end
AddUp_Exp.CongDon(Exp)
SetTask(54,GetTask(94))
tbUyThac:ResetTask()
WriteLog("dulieu/Activity/uythac/Exp_Uy_Thac.txt",format("Ngµy: %d/%d/%d giê: %d:%d:%d nh©n vËt: %s ®¼ng cÊp %d ®· nhËn ®*îc %d Exp",tonumber(date("%d")),tonumber(date("%m")),ton umber(date("%y")),tonumber(date("%H")),tonumber(da te("%M")),tonumber(date("%S")),GetName(),GetLevel( ),Exp))
end
UyThacOff = function(nsel)
local Sec = nsel + 1
if (Sec == 2) then return end
local Exp = tbUyThac:CalExp()
if (Exp == 0) then Talk(1,"","Thêi gian ñy th¸c kh«ng ®ñ ®Ó ®æi kinh nghiÖm.") tbUyThac:ResetTask() return end
AddUp_Exp.CongDon(Exp)
SetTask(54,GetTask(94))
tbUyThac:ResetTask()
WriteLog("dulieu/Activity/uythac/Exp_Uy_Thac.txt",format("Ngµy: %d/%d/%d giê: %d:%d:%d nh©n vËt: %s ®¼ng cÊp %d ®· nhËn ®*îc %d Exp",tonumber(date("%d")),tonumber(date("%m")),ton umber(date("%y")),tonumber(date("%H")),tonumber(da te("%M")),tonumber(date("%S")),GetName(),GetLevel( ),Exp))
end
function tbUyThac:CalExp()
local Hour,Minute,Second = tonumber(date("%H")),tonumber(date("%M")),tonumber (date("%S"))
local nDate,month,year = tonumber(date("%d")),tonumber(date("%m")),tonumber (date("%y"))
local CurTime = nDate*24*3600 + Hour *3600 + Minute*60 + Second
local OldTime = GetTask(self.TASK.TIME)
local OldDay = GetTask(self.TASK.DATE)
local Exp_UyThac = tbUyThac:ExpByLevel()
local TotalMinUyThacHave = GetTask(self.TASK.BCH)
local Total_Exp_Get = 0
if (OldDay == nDate) then
if (CurTime > OldTime) then
local GetSecondUyThac = CurTime - OldTime
local GetMinuteUyThac = tbUyThac:ConverSecondToMinute(GetSecondUyThac)
if (OldTime == 0) then GetMinuteUyThac = 0 end
if (GetMinuteUyThac == 0) then return Total_Exp_Get end
SetTask(self.TASK.MIN_UT,GetMinuteUyThac)
Total_Exp_Get = tbUyThac:AwardExpToPlayer(GetMinuteUyThac,TotalMin UyThacHave,Exp_UyThac)
return Total_Exp_Get
end
else
local GetSecondUyThac = CurTime - OldTime
local GetMinuteUyThac = tbUyThac:ConverSecondToMinute(GetSecondUyThac)
if (OldTime == 0) then GetMinuteUyThac = 0 end
if (GetMinuteUyThac == 0) then return Total_Exp_Get end
SetTask(self.TASK.MIN_UT,GetMinuteUyThac)
Total_Exp_Get = tbUyThac:AwardExpToPlayer(GetMinuteUyThac,TotalMin UyThacHave,Exp_UyThac)
return Total_Exp_Get
end
end
function tbUyThac:AwardExpToPlayer(nMin_UyThac,nMin_BCH,nEx p)
local Cal_Exp,Cal_Min_Left = 0,0
local Min = 0
local Min_BCH_Left = 0
if (nMin_UyThac > nMin_BCH) then
Cal_Min_Left = nMin_UyThac - nMin_BCH
Min = nMin_BCH
elseif (nMin_UyThac < nMin_BCH) then
Cal_Min_Left = nMin_BCH - nMin_UyThac
Min_BCH_Left = Cal_Min_Left
else
Cal_Min_Left = 0
end
SetTask(self.TASK.BCH_LEFT,Min_BCH_Left)
if (Cal_Min_Left == 0 or Min > 0) then
Cal_Exp = nMin_BCH*nExp
return Cal_Exp
end
if (Min == 0) then
Cal_Exp = nMin_UyThac*nExp
return Cal_Exp
end
end
function tbUyThac:ResetTask()
SetTask(self.TASK.TIME,0)
SetTask(self.TASK.ONOFF,0)
SetTask(self.TASK.DATE,0)
SetTask(self.TASK.EXP,0)
SetTask(self.TASK.DAY,0)
SetTask(self.TASK.MONTH,0)
SetTask(self.TASK.YEAR,0)
SetTask(self.TASK.HOUR,0)
SetTask(self.TASK.MINUTE,0)
SetTask(self.TASK.SECOND,0)
SetTask(self.TASK.MIN_UT,0)
SetOffline(0)
end
function tbUyThac:ConverSecondToMinute(nSecond)
local nMinute = 0
if (nSecond >= 60) then
nMinute = floor(nSecond/60)
return nMinute
end
return nMinute
end
function tbUyThac:ExpByLevel()
local Level = GetLevel()
if (Level >= 50 and Level < 80) then
return 20*100
elseif (Level >= 80 and Level < 150) then
return 1000
elseif (Level >= 150) then
return 800
end
end
500 hình đây.
<b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b>
<b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b>
<b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b>
nguồn maze-gamevn
--DarkMoon (10/25/13)
-- 3:15 pm
--Uy Thac
-----------------------------------
Include("\\script\\source\\lib_exp\\sum_exp_lib.lu a")
Include("\\script\\source\\IOFile.lua")
tbUyThac = {}
tbUyThac.TASK =
{
BCH = 54,
ONOFF = 83,
DATE = 84,
TIME = 85,
DAYORNIGHT = 86,
EXP = 87,
HOUR = 88,
MINUTE = 89,
SECOND = 90,
DAY = 91,
MONTH = 92,
YEAR = 93,
BCH_LEFT = 94,
MIN_UT = 95,
}
function tbUyThac:ChooseOption()
local Option = {}
local OptionOn = {}
local OptionOff = {}
tinsert(Option,"Ta muèn Uû Th¸c Online/UyThac")
tinsert(Option,"Ta muèn Uû Th¸c Offline/UyThac")
tinsert(Option,"KÕt thóc ®èi tho¹i/UyThac")
tinsert(OptionOn,"Dõng Uû Th¸c Online/UyThacOn")
tinsert(OptionOn,"KÕt thóc ®èi tho¹i/UyThacOn")
tinsert(OptionOff,"NhËn Exp ñy th¸c offline/UyThacOff")
tinsert(OptionOff,"KÕt thóc ®èi tho¹i/UyThacOff")
if (GetFightState() == 1) then Say("HiÖn t¹i ng*¬i ®ang trong tr¹ng th¸i chiÕn ®Êu, kh«ng thÓ ®i vµo tr¹ng th¸i rêi m¹ng ñy th¸c ®*îc, xinh h·y trë l¹i tr¹ng th¸i phi chiÕn ®Êu sau ®ã h·y tiÕn hµnh rêi m¹ng ñy th¸c nhÐ.",1,"KÕt thóc ®èi tho¹i/Cancel") return end
local Exp_Show = tbUyThac:CalExp()
local Exp_TIMES_BY_MINUTES = GetTask(self.TASK.MIN_UT) * tbUyThac:ExpByLevel()
if (Exp_Show > 0) then SetTask(self.TASK.EXP,Exp_Show) end
local Str = "ñy th¸c bao gåm Online vµ Offline. HiÖn b¹n cã : "..GetTask(self.TASK.BCH).." phót ñy th¸c, ng*¬i muèn chän chøc n¨ng ñy th¸c nµo?"
local StrOn = format("B¾t ®Çu ñy th¸c Online: <color=fire>%d/%d/%d - %d:%d:%d<color>\nB¹ch CÇu Hoµn: %d phót\nExp %d phót Uû Th¸c: %d",
GetTask(self.TASK.DAY),
GetTask(self.TASK.MONTH),
GetTask(self.TASK.YEAR),
GetTask(self.TASK.HOUR),
GetTask(self.TASK.MINUTE),
GetTask(self.TASK.SECOND),
GetTask(self.TASK.BCH),
GetTask(self.TASK.MIN_UT),
GetTask(self.TASK.EXP))
local StrOff = format("B¾t ®Çu ñy th¸c Offline: <color=fire>%d/%d/%d - %d:%d:%d<color>\nB¹ch CÇu Hoµn: %d phót\nExp Uû Th¸c cña %d phót: %d",
GetTask(self.TASK.DAY),
GetTask(self.TASK.MONTH),
GetTask(self.TASK.YEAR),
GetTask(self.TASK.HOUR),
GetTask(self.TASK.MINUTE),
GetTask(self.TASK.SECOND),
GetTask(self.TASK.BCH),
GetTask(self.TASK.MIN_UT),
GetTask(self.TASK.EXP))
if (GetLevel() < 50) then Talk(1,"","§¼ng cÊp cña c¸c h¹ kh«ng ®ñ ®Ó tham gia chøc n¨ng ñy th¸c. Yªu cÇu ®¼ng cÊp 50 trë lªn.") return end
if (GetTask(self.TASK.TIME) == 0) then
SayNew(Str,getn(Option),Option)
else
if (GetTask(self.TASK.ONOFF) == 1) then -- on
SayNew(StrOn,getn(OptionOn),OptionOn)
return
end
SayNew(StrOff,getn(OptionOff),OptionOff)
end
end
Cancel = function()
end
UyThac = function(nsel)
local Sec = nsel + 1
if (Sec == 1) then tbUyThac:Online() return end
if (Sec == 2) then tbUyThac:Offline() return end
if (Sec == 3) then return end
end
function tbUyThac:Online()
if (GetTask(self.TASK.BCH) == 0) then Talk(1,"","Yªu cÇu b¹n ph¶i sö dông B¹ch CÇu Hoµn") return end
local Hour,Minute,Second = tonumber(date("%H")),tonumber(date("%M")),tonumber (date("%S"))
local nDate,month,year = tonumber(date("%d")),tonumber(date("%m")),tonumber (date("%y"))
local StartTime = nDate*24*3600 + Hour *3600 + Minute*60 + Second
SetTask(self.TASK.TIME,StartTime)
SetTask(self.TASK.DATE,nDate)
SetTask(self.TASK.ONOFF,1)
SetTask(self.TASK.DAY,nDate)
SetTask(self.TASK.MONTH,month)
SetTask(self.TASK.YEAR,year)
SetTask(self.TASK.HOUR,Hour)
SetTask(self.TASK.MINUTE,Minute)
SetTask(self.TASK.SECOND,Second)
tbUyThac:SetAmOrPm(Hour)
SetOffline(1)
SayNew("B¾t ®Çu ñy th¸c Online: <color=fire>"..nDate.."/"..month.."/"..year.." - "..Hour..":"..Minute..":"..Second.." <color><enter>(Chó ý: Di chuyÓn qua c¸c Thµnh ThÞ + C¸c khu vùc train + Logout ra khái game sÏ bÞ mÊt hiÖu lùc)",0)
end
function tbUyThac:Offline()
if (GetTask(self.TASK.BCH) == 0) then Talk(1,"","Yªu cÇu b¹n ph¶i sö dông B¹ch CÇu Hoµn") return end
local Hour,Minute,Second = tonumber(date("%H")),tonumber(date("%M")),tonumber (date("%S"))
local nDate,month,year = tonumber(date("%d")),tonumber(date("%m")),tonumber (date("%y"))
local StartTime = nDate*24*3600 + Hour *3600 + Minute*60 + Second
SetTask(self.TASK.TIME,StartTime)
SetTask(self.TASK.DATE,nDate)
SetTask(self.TASK.DAY,nDate)
SetTask(self.TASK.MONTH,month)
SetTask(self.TASK.YEAR,year)
SetTask(self.TASK.HOUR,Hour)
SetTask(self.TASK.MINUTE,Minute)
SetTask(self.TASK.SECOND,Second)
tbUyThac:SetAmOrPm(Hour)
SetTask(self.TASK.ONOFF,2)
OutGame(1)
end
function tbUyThac:FunctLogOut()
if (GetTask(self.TASK.ONOFF) == 1) then
local Exp = tbUyThac:CalExp()
if (Exp == 0) then tbUyThac:ResetTask() return end
local BCH_LEFT = GetTask(self.TASK.BCH_LEFT)
AddUp_Exp.CongDon(Exp)
SetTask(self.TASK.BCH,BCH_LEFT)
tbUyThac:ResetTask()
WriteLog("dulieu/Activity/uythac/Exp_Uy_Thac.txt",format("Ngµy: %d/%d/%d giê: %d:%d:%d nh©n vËt: %s ®¼ng cÊp %d ®· nhËn ®*îc %d Exp",tonumber(date("%d")),tonumber(date("%m")),ton umber(date("%y")),tonumber(date("%H")),tonumber(da te("%M")),tonumber(date("%S")),GetName(),GetLevel( ),Exp))
end
end
function tbUyThac:IsVisible()
if (GetTask(self.TASK.ONOFF) == 1) then
return 1
elseif (GetTask(self.TASK.ONOFF) == 2) then
return 2
end
end
function tbUyThac:SetAmOrPm(hour)
if hour >= 1 and hour <= 12 then
SetTask(self.TASK.DAYORNIGHT,1)
else
SetTask(self.TASK.DAYORNIGHT,2)
end
end
UyThacOn = function(nsel)
local Sec = nsel + 1
if (Sec == 2) then return end
local Exp = tbUyThac:CalExp()
if (Exp == 0) then Talk(1,"","Thêi gian ñy th¸c kh«ng ®ñ ®Ó ®æi kinh nghiÖm.") tbUyThac:ResetTask() return end
AddUp_Exp.CongDon(Exp)
SetTask(54,GetTask(94))
tbUyThac:ResetTask()
WriteLog("dulieu/Activity/uythac/Exp_Uy_Thac.txt",format("Ngµy: %d/%d/%d giê: %d:%d:%d nh©n vËt: %s ®¼ng cÊp %d ®· nhËn ®*îc %d Exp",tonumber(date("%d")),tonumber(date("%m")),ton umber(date("%y")),tonumber(date("%H")),tonumber(da te("%M")),tonumber(date("%S")),GetName(),GetLevel( ),Exp))
end
UyThacOff = function(nsel)
local Sec = nsel + 1
if (Sec == 2) then return end
local Exp = tbUyThac:CalExp()
if (Exp == 0) then Talk(1,"","Thêi gian ñy th¸c kh«ng ®ñ ®Ó ®æi kinh nghiÖm.") tbUyThac:ResetTask() return end
AddUp_Exp.CongDon(Exp)
SetTask(54,GetTask(94))
tbUyThac:ResetTask()
WriteLog("dulieu/Activity/uythac/Exp_Uy_Thac.txt",format("Ngµy: %d/%d/%d giê: %d:%d:%d nh©n vËt: %s ®¼ng cÊp %d ®· nhËn ®*îc %d Exp",tonumber(date("%d")),tonumber(date("%m")),ton umber(date("%y")),tonumber(date("%H")),tonumber(da te("%M")),tonumber(date("%S")),GetName(),GetLevel( ),Exp))
end
function tbUyThac:CalExp()
local Hour,Minute,Second = tonumber(date("%H")),tonumber(date("%M")),tonumber (date("%S"))
local nDate,month,year = tonumber(date("%d")),tonumber(date("%m")),tonumber (date("%y"))
local CurTime = nDate*24*3600 + Hour *3600 + Minute*60 + Second
local OldTime = GetTask(self.TASK.TIME)
local OldDay = GetTask(self.TASK.DATE)
local Exp_UyThac = tbUyThac:ExpByLevel()
local TotalMinUyThacHave = GetTask(self.TASK.BCH)
local Total_Exp_Get = 0
if (OldDay == nDate) then
if (CurTime > OldTime) then
local GetSecondUyThac = CurTime - OldTime
local GetMinuteUyThac = tbUyThac:ConverSecondToMinute(GetSecondUyThac)
if (OldTime == 0) then GetMinuteUyThac = 0 end
if (GetMinuteUyThac == 0) then return Total_Exp_Get end
SetTask(self.TASK.MIN_UT,GetMinuteUyThac)
Total_Exp_Get = tbUyThac:AwardExpToPlayer(GetMinuteUyThac,TotalMin UyThacHave,Exp_UyThac)
return Total_Exp_Get
end
else
local GetSecondUyThac = CurTime - OldTime
local GetMinuteUyThac = tbUyThac:ConverSecondToMinute(GetSecondUyThac)
if (OldTime == 0) then GetMinuteUyThac = 0 end
if (GetMinuteUyThac == 0) then return Total_Exp_Get end
SetTask(self.TASK.MIN_UT,GetMinuteUyThac)
Total_Exp_Get = tbUyThac:AwardExpToPlayer(GetMinuteUyThac,TotalMin UyThacHave,Exp_UyThac)
return Total_Exp_Get
end
end
function tbUyThac:AwardExpToPlayer(nMin_UyThac,nMin_BCH,nEx p)
local Cal_Exp,Cal_Min_Left = 0,0
local Min = 0
local Min_BCH_Left = 0
if (nMin_UyThac > nMin_BCH) then
Cal_Min_Left = nMin_UyThac - nMin_BCH
Min = nMin_BCH
elseif (nMin_UyThac < nMin_BCH) then
Cal_Min_Left = nMin_BCH - nMin_UyThac
Min_BCH_Left = Cal_Min_Left
else
Cal_Min_Left = 0
end
SetTask(self.TASK.BCH_LEFT,Min_BCH_Left)
if (Cal_Min_Left == 0 or Min > 0) then
Cal_Exp = nMin_BCH*nExp
return Cal_Exp
end
if (Min == 0) then
Cal_Exp = nMin_UyThac*nExp
return Cal_Exp
end
end
function tbUyThac:ResetTask()
SetTask(self.TASK.TIME,0)
SetTask(self.TASK.ONOFF,0)
SetTask(self.TASK.DATE,0)
SetTask(self.TASK.EXP,0)
SetTask(self.TASK.DAY,0)
SetTask(self.TASK.MONTH,0)
SetTask(self.TASK.YEAR,0)
SetTask(self.TASK.HOUR,0)
SetTask(self.TASK.MINUTE,0)
SetTask(self.TASK.SECOND,0)
SetTask(self.TASK.MIN_UT,0)
SetOffline(0)
end
function tbUyThac:ConverSecondToMinute(nSecond)
local nMinute = 0
if (nSecond >= 60) then
nMinute = floor(nSecond/60)
return nMinute
end
return nMinute
end
function tbUyThac:ExpByLevel()
local Level = GetLevel()
if (Level >= 50 and Level < 80) then
return 20*100
elseif (Level >= 80 and Level < 150) then
return 1000
elseif (Level >= 150) then
return 800
end
end
500 hình đây.
<b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b>
<b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b>
<b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b>
nguồn maze-gamevn