PDA

View Full Version : [JX] Share Ủy Thác Sử Dụng Bạch Cầu Hoàn FULL Linux.



hoangcungclub
25-02-16, 05:40 PM
Include("\\script\\global\\baijuwanhead.lua")
Include("\\script\\global\\judgeoffline_limit.lua");
Include("\\script\\item\\ib\\zimudai.lua");
Include("\\script\\lib\\player.lua")
Include("\\script\\trip\\define.lua")
Include("\\script\\shop\\shop_checkmap.lua")

arraymap =
{
["1"] = "Ph­îng T­êng",
["11"] = "Thµnh §«",
["37"] = "BiÖn Kinh",
["80"] = "D­¬ng Ch©u",
["78"] = "T­¬ng D­¬ng",
["162"] = "§¹i Lý",
["176"] = "L©m An",
["20"] = "Giang T©n Th«n",
["53"] = "Ba L¨ng HuyÖn",
["54"] = "Nam Nh¹c TrÊn",
["99"] = "VÜnh L¹c trÊn",
["100"] = "Chu Tiªu TrÊn",
["101"] = "§¹o H­¬ng Th«n",
["121"] = "Long M«n TrÊn",
["153"] = "Th¹ch Cæ TrÊm",
["174"] = "Long TuyÒn Th«n",
["13"] = "Nga Mi",
["25"] = "§­êng M«n",
["49"] = "Thiªn NhÉn",
["59"] = "Thiªn V­¬ng",
["81"] = "Vâ §ang",
["103"] = "ThiÕu L©m",
["115"] = "C¸i Bang",
["131"] = "C«n L«n",
["154"] = "Thóy Y6en",
["183"] = "Ngò §éc",
["208"] = "§¹i lao",
};

function judgeoffline(player_count, offline_count)
judgecontion()
return 0
end;

function judgecontion()
local nExpSpareTime = GetTask(AEXP_SMALL_TIME_TASKID);
local nExpSpareTime_Hours, nExpSpareTime_Minutes = getFrame2MinAndSec(nExpSpareTime);

local nSkillExpSpareTime = GetTask(AEXP_SMALL_SKILL_TASKID);
local nSkillExpSpareTime_Hours, nSkillExpSpareTime_Minutes = getFrame2MinAndSec(nSkillExpSpareTime);

local nSpecialExpSpareTime = GetTask(AEXP_SPECIAL_TIME_TASKID);
local nSpecialExpSpareTime_Hours, nSpecialExpSpareTime_Minutes = getFrame2MinAndSec(nSpecialExpSpareTime);

local nSpecialSkillSpareTime = GetTask(AEXP_SPECIAL_SKILL_TASKID);
local nSpecialSkillSpareTime_Hours, nSpecialSkillSpareTime_Minutes = getFrame2MinAndSec(nSpecialSkillSpareTime);

if (nExpSpareTime >= FRAME2TIME * 60 or nSkillExpSpareTime >= FRAME2TIME * 60 or nSpecialExpSpareTime >= FRAME2TIME * 60 or nSpecialSkillSpareTime >= FRAME2TIME) then
local nSkillExpID = GetTask(AEXP_SKILL_ID_TASKID);
local szSkillExpName = "";
if (nSkillExpID ~= 0) then
szSkillExpName = "<color=yellow>"..GetSkillName(nSkillExpID).."<color>";
else
szSkillExpName = "<color=blue>Ch­a chän kû n¨ng<color>";
end;
local szmsg = format("<link=image:\\spr\\item\\script\\chuanjiadaoshu_YN. spr><color>Thêi gian sö dông :<color=Yellow>B¹ch CÇu Hoµn §Æc BiÖt <color><enter>Cßn l¹i lµ <color=red>"..nSpecialExpSpareTime_Hours.."<color> Giê <color=red>"..nSpecialExpSpareTime_Minutes.."<color> Phót "..
"<enter>Thêi gian sö dông :<color=Yellow>B¹ch CÇu Hoµn<color><enter>Cßn l¹i lµ <color=red>"..nExpSpareTime_Hours.."<color> Giê <color=red>"..nExpSpareTime_Minutes.."<color> Phót "..
"<enter>§é thuÇn thùc cña kû n¨ng ("..szSkillExpName..")<enter><color=Yellow>B¹ch CÇu Hoµn Kû N¨ng §Æc BiÖt <color><color=red>"..nSpecialSkillSpareTime_Hours.." <color>Giê <color=red>" ..nSpecialSkillSpareTime_Minutes.."<color> Phót "..
"<enter><color=Yellow>B¹ch CÇu Hoµn Kû N¨ng <color><color=red>"..nSkillExpSpareTime_Hours.."<color> Giê <color=red>"..nSkillExpSpareTime_Minutes.."<color> Phót "..
"<enter>ñy th¸c nÕu nh­ cã <color=red>B¹ch CÇu Hoµn §Æc BiÖt<color><enter>SÏ ®­îc ­u tiªn h¬n")
local szSay =
{"B¾t ®Çu ñy th¸c/beginoffline",
"Lùa chän kû n¨ng ñy th¸c/#selectofflineskill('judgecontion')",
"Ta suy nghÜ mét chót!/donothing"
};
Describe(szmsg, getn(szSay), szSay[1], szSay[2], szSay[3], szSay[4]);
else
beginoffline();
end
end

function beginoffline()
local bRet = check_if_can_offline()
if bRet then
return bRet
end

mapid = SubWorldIdx2ID(SubWorld);
strmapid = ""..mapid.."";
if (arraymap[strmapid] == nil) then
Say("<#>B¹n kh«ng thÓ ñy th¸c n¬i nµy. Vui lßng ®Õn thÊt ®¹i thµnh thÞ, th«n lµng hoÆc c¸c m«n ph¸i ®Ó tiÒn hµnh ñy th¸c!", 0);
return 1
end

if (GetFightState() ~= 0) then
Say("<#>HiÖn tr¹ng th¸i cña b¹n kh«ng thÓ ñy th¸c. Vui lßng ®Õn thÊt ®¹i thµnh thÞ, th«n lµng hoÆc c¸c m«n ph¸i ®Ó tiÒn hµnh ñy th¸c! ", 0);
return 2
end

sparetime = getsparetime();
if (sparetime <= 0) then
Say("<#>Thêi gian ñy th¸c cña b¹n cßn l¹i lµ 0 Phót. Xin vui lßng sö B¹ch CÇu hoµn ®Ó ñy th¸c!", 0);
return 3
end

player_count = GetPlayerCount();
if (player_count > AEXP_OFFLINE_PLAYERCOUNT_LIMIT) then
Say("<#>Xin ®¹i hiÖp l­îng thø kh«ng thÓ sö dông t×nh n¨ng ñy th¸c t¹i server c«ng céng",0);

return 4
end

OfflineLive(PlayerIndex);
end

function donothing()

end

function getsparetime()
local nSpecialExpTime = GetTask(AEXP_SPECIAL_TIME_TASKID);
local nSpecialSkillTime = GetTask(AEXP_SPECIAL_SKILL_TASKID);
if (nSpecialExpTime > nSpecialSkillTime) then
return nSpecialExpTime;
else
return nSpecialSkillTime
end
local nSpareTime_Exp = GetTask(AEXP_SMALL_TIME_TASKID);
local nSpareTime_SkillExp = GetTask(AEXP_SMALL_SKILL_TASKID);
if (nSpareTime_Exp > nSpareTime_SkillExp) then
return nSpareTime_Exp;
else
return nSpareTime_SkillExp;
end
end

function selectofflineskill()
local aryExpSkill = getexpskill();
local nExpSkillCount = getn(aryExpSkill);
local szSayCmd = 'Say("Xin mêi lùa chän kû n¨ng cÇn ñy th¸c",'
szSayCmd = szSayCmd..(1 + nExpSkillCount)..',';
for i = 1, nExpSkillCount do
szSayCmd = szSayCmd..'"'..aryExpSkill[i][2]..'/#onSetUpgradeSkill('..aryExpSkill[i][1]..')",';
end
szSayCmd = szSayCmd..'"Trë vÒ/judgecontion")';
dostring(szSayCmd);
end

function onSetUpgradeSkill(nUpgradeSkillID)
SetTask(AEXP_SKILL_ID_TASKID, nUpgradeSkillID);
judgecontion();
end


function check_if_can_offline()
mapid = SubWorldIdx2MapCopy(SubWorld);
strmapid = ""..mapid.."";
if (arraymap[strmapid] == nil) then
Say("<#>B¹n kh«ng thÓ ñy th¸c n¬i nµy. Vui lßng ®Õn thÊt ®¹i thµnh thÞ, th«ng lµng hoÆc c¸c m«n ph¸i ®Ó tiÒn hµnh ñy th¸c!", 0);
return 1
end

if offlineCheckPermitRegion()~=1 then
Say("<#>B¹n kh«ng thÓ ñy th¸c n¬i nµy. Vui lßng ®Õn thÊt ®¹i thµnh thÞ, th«n lµng hoÆc c¸c m«n ph¸i ®Ó tiÒn hµnh ñy th¸c!", 0);
return 1;
end;

if (GetFightState() ~= 0) then
Say("<#>HiÖn tr¹ng th¸i cña b¹n kh«ng thÓ ñy th¸c. Vui lßng ®Õn thÊt ®¹i thµnh thÞ, th«n lµng hoÆc c¸c m«n ph¸i ®Ó tiÒn hµnh ñy th¸c! ", 0);
return 2
end

local sparetime = getsparetime();
if (sparetime <= 0) then
Say("<#>Thêi gian ñy th¸c cña b¹n cßn l¹i lµ 0 Phót. Xin vui lßng sö B¹ch CÇu hoµn ®Ó ñy th¸c!", 0);
return 3
end

player_count = GetPlayerCount();
local nmax_count_limit = AEXP_OFFLINE_PLAYERCOUNT_LIMIT;
if (mapid >= 835 and mapid <= 840) then
nmax_count_limit = AEXP_OFFLINE_PLAYERCOUNT_SPECIAL;
end;
if (player_count > nmax_count_limit) then
Say("<#>Xin ®¹i hiÖp l­îng thø kh«ng thÓ sö dông t×nh n¨ng ñy th¸c t¹i server c«ng céng!",0);

return 4
end
end

Coppy về thay thế life ủy thác hiện tại nhé.