keraotinh
21-06-12, 08:32 PM
File script timerserver.lua ko chạy bất cứ event cũng như bất cứ dòng thông báo nào .
Include("\\Script\\source\\sourcejx49.lua")
Include("\\script\\lien_dau\\liendau_head.lua")
Include("\\script\\phonglangdo\\thoigianpld.lua")
npcadd={0,0,0,0,0}
function OnTimer()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
SubWorld = SubWorldID2Idx(53)
phonglangdo()
vuotai()
thoigianbosshk()
print("So luong gamer dang online: "..GetPlayerCount().."");
if (gio == 12) or (gio == 18) then
if phut == 0 then
hat_huy_hoang()
Msg2SubWorld("Th«ng b¸o: H¹t huy hoµng ®· xuÊt hiÖn t¹i ba l¨ng huyÖn (194/204)")
elseif phut == 10 then
del_hat_hh()
qua_huy_hoang()
Msg2SubWorld("Th«ng b¸o: Qu¶ huy hoµng ®· xuÊt hiÖn t¹i ba l¨ng huyÖn (194/204)")
elseif phut == 15 then
del_qua_hh()
end
end
if phut == 6 or phut == 16 or phut == 26 or phut == 36 or phut == 43 then
AddGlobalCountNews("Nh¾c nhë: ch¬i game ®iÒu ®é, v¨n ho¸, gi÷ g×n søc khoÎ...",1)
elseif phut == 8 or phut == 18 or phut == 28 or phut == 38 then
AddGlobalCountNews("Nh¾c nhë: h·y ®Æt kho¸ r¬ng ®Ó b¶o vÖ tµi s¶n c¸ nh©n !",1)
end
if ((gio == 10) or (gio == 12) or (gio == 14) or (gio == 16) or (gio == 18) or (gio == 20) or (gio == 22)) and (phut >= 45) then
phutcl = 60 - phut
AddGlobalCountNews("Tèng kim ®ang trong thêi gian b¸o danh, cßn "..phutcl.." phót...",1)
if (phut == 59) then
SetGlbMissionV(81,0)
SetGlbMissionV(82,0)
SetGlbMissionV(83,0)
SetGlbMissionV(84,0)
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
DelNpc(npcadd[1])
DelNpc(npcadd[2])
return
end
end
end
elseif (gio == 11) or (gio == 13) or (gio == 15) or (gio == 17) or (gio == 19) or (gio == 21) or (gio == 23) then
if (phut == 0) then
AddGlobalCountNews("Tèng kim ®¹i chiÕn chÝnh thøc b¾t ®Çu !",1)
elseif (phut == 5) or (phut == 10) then
AddGlobalCountNews("Tèng kim tÝch lòy hiÖn t¹i lµ Tèng : Kim "..GetGlbMissionV(81).." : "..GetGlbMissionV(82),1)
elseif (phut == 20) then
if (GetGlbMissionV(81) > GetGlbMissionV(82)) then
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
idnpc = random(894,898)
tongkim = SubWorldID2Idx(51)
npcadd[2] = AddNpc(idnpc,99,tongkim,1968*32,2700*32)
IsBoss(npcadd[2],2)
SetNpcScript(npcadd[2], "\\script\\tongkim\\nguyensoai.lua");
AddGlobalCountNews("Tèng kim : Nguyªn so¸i phe kim ®· xuÊt hiÖn, h·y cè g¾ng lËp c«ng",1)
return
end
end
elseif (GetGlbMissionV(81) < GetGlbMissionV(82)) then
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
idnpc = random(889,893)
tongkim = SubWorldID2Idx(51)
npcadd[1] = AddNpc(idnpc,99,tongkim,1722*32,3044*32)
IsBoss(npcadd[1],2)
SetNpcScript(npcadd[1], "\\script\\tongkim\\nguyensoai.lua");
AddGlobalCountNews("Tèng kim : Nguyªn so¸i phe tèng ®· xuÊt hiÖn, h·y cè g¾ng lËp c«ng",1)
return
end
end
elseif (GetGlbMissionV(81) == GetGlbMissionV(82)) then
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
tongkim = SubWorldID2Idx(51)
idnpc = random(889,893)
npcadd[1] = AddNpc(idnpc,99,tongkim,1722*32,3044*32)
SetNpcScript(npcadd[1], "\\script\\tongkim\\nguyensoai.lua");
idnpc = random(894,898)
npcadd[2] = AddNpc(idnpc,99,tongkim,1968*32,2700*32)
SetNpcScript(npcadd[2], "\\script\\tongkim\\nguyensoai.lua");
AddGlobalCountNews("Tèng kim : Nguyªn so¸i phe kim vµ tèng ®· xuÊt hiÖn",1)
return
end
end
end
elseif (phut == 30) then
if (GetGlbMissionV(81) > GetGlbMissionV(82)) then
AddGlobalCountNews("Tèng kim ®¹i chiÕn kÕt thóc, phÇn th¾ng thuéc vÒ phe tèng !")
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
if (GetTask(23) == 2) then
for i=1,10 do
AddEventItem(137)
end
SetTask(21,GetTask(21) + 500)
AddRepute(50)
Msg2Player("Tèng kim kÕt thóc, nhËn ®îc 10 Tói Nguyªn LiÖu, 50 danh väng, 500 ®iÓm tÝch lòy")
SetTask(24,0)
SetTask(25,0)
SetTask(26,0)
toadox = 2047
toadoy = 2594
NewWorld(51, toadox, toadoy);
SetFightState(0)
elseif (GetTask(23) == 1) then
for i=1,20 do
AddEventItem(137)
end
SetTask(21,GetTask(21) + 1000)
AddRepute(100)
Msg2Player("Tèng kim kÕt thóc, nhËn ®îc 20 Tói Nguyªn LiÖu, 100 danh väng, 1000 ®iÓm tÝch lòy")
SetTask(24,0)
SetTask(25,0)
SetTask(26,0)
toadox = 1640
toadoy = 3153
NewWorld(51,toadox,toadoy) -- tong
SetFightState(0)
end
end
end
elseif (GetGlbMissionV(81) < GetGlbMissionV(82)) then
AddGlobalCountNews("Tèng kim ®¹i chiÕn kÕt thóc, phÇn th¾ng thuéc vÒ phe kim !")
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
if (GetTask(23) == 1) then
for i=1,10 do
AddEventItem(137)
end
SetTask(21,GetTask(21) + 500)
AddRepute(50)
Msg2Player("Tèng kim kÕt thóc, nhËn ®îc 10 Tói Nguyªn LiÖu, 50 danh väng, 500 ®iÓm tÝch lòy")
SetTask(24,0)
SetTask(25,0)
SetTask(26,0)
toadox = 1640
toadoy = 3153
NewWorld(51,toadox,toadoy) -- tong
SetFightState(0)
elseif (GetTask(23) == 2) then
for i=1,10 do
AddEventItem(137)
end
SetTask(21,GetTask(21) + 1000)
AddRepute(100)
Msg2Player("Tèng kim kÕt thóc, nhËn ®îc 20 Tói Nguyªn LiÖu, 100 danh väng,1000 ®iÓm tÝch lòy")
SetTask(24,0)
SetTask(25,0)
SetTask(26,0)
toadox = 2047
toadoy = 2594
NewWorld(51, toadox, toadoy);
SetFightState(0)
end
end
end
else
AddGlobalCountNews("Tèng kim kÕt thóc, 2 bªn hßa nhau !")
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
if (GetTask(23) == 1) then
for i=1,10 do
AddEventItem(137)
end
SetTask(21,GetTask(21) + 750)
AddRepute(75)
Msg2Player("Tèng kim kÕt thóc, nhËn ®îc 10 Tói Nguyªn LiÖu, 75 danh väng, 750 ®iÓm tÝch lòy")
SetTask(24,0)
SetTask(25,0)
SetTask(26,0)
toadox = 1640
toadoy = 3153
NewWorld(51,toadox,toadoy) -- tong
SetFightState(0)
elseif (GetTask(23) == 2) then
for i=1,10 do
AddEventItem(137)
end
SetTask(21,GetTask(21) + 750)
AddRepute(75)
Msg2Player("Tèng kim kÕt thóc, nhËn ®îc 10 Tói Nguyªn LiÖu, 750 danh väng,750 ®iÓm tÝch lòy")
SetTask(24,0)
SetTask(25,0)
SetTask(26,0)
toadox = 2047
toadoy = 2594
NewWorld(51, toadox, toadoy);
SetFightState(0)
end
end
end
end
SetGlbMissionV(81,0)
SetGlbMissionV(82,0)
SetGlbMissionV(83,0)
SetGlbMissionV(84,0)
end
end
--if (gio == 8) or (gio == 14) or (gio == 18) or (gio == 21) then
--if (phut == 0) or (phut == 10) or (phut == 20) or (phut == 30) or (phut == 40) or (phut == 50) then
--AddGlobalCountNews("Liªn ®Êu ®ang trong giai ®o¹n b¸o danh, h·y nhanh ®Õn b¸o danh !",1)
--end
--else
--for i=1,GetPlayerCount() do
--PlayerIndex = i
--w,x,y = GetWorldPos()
-- if w == 42 or w == 43 then
-- NewWorld(53, 1603, 3210);
-- SetFightState(0)
-- end
--end
--end
end
function thoigianbosshk()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
if gio >= 7 and gio <= 9 then
if phut == 0 then
--if GetGlbMissionV(90) == 0 then
map = SubWorldID2Idx(53)
bosstieu1 = AddNpc(509,80,map,1513*32,3306*32)
SetNpcSeries(bosstieu1,random(0,4))
IsBoss(bosstieu1,2)
Msg2SubWorld("LiÔu Thanh Thanh ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn(188/206)")
----
bosstieu2 = AddNpc(510,80,map,1761*32,3206*32)
SetNpcSeries(bosstieu2,random(0,4))
IsBoss(bosstieu2,2)
Msg2SubWorld("DiÖu Nh ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn(220/200)")
----
bosstieu3 = AddNpc(511,80,map,1637*32,3057*32)
SetNpcSeries(bosstieu3,random(0,4))
IsBoss(bosstieu3,2)
Msg2SubWorld("Tr¬ng T«ng ChÝnh ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn(204/190)")
AddGlobalCountNews("Boss hoµng kim tiÓu ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn, c¸c nh©n sü h·y cÈn thËn",1)
--SetGlbMissionV(90,1)
--else
--Msg2SubWorld("LiÔu Thanh Thanh ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn(188/206)")
--Msg2SubWorld("DiÖu Nh ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn(220/200)")
--Msg2SubWorld("Tr¬ng T«ng ChÝnh ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn(204/190)")
--end
end
else
--SetGlbMissionV(90,0)
DelNpc(bosstieu1)
DelNpc(bosstieu2)
DelNpc(bosstieu3)
end
if gio >= 19 and gio <= 23 then
if phut == 0 then
--if GetGlbMissionV(90) == 0 then
map = SubWorldID2Idx(9)
bossdai1 = AddNpc(500,100,map,1721*32,3239*32)
SetNpcSeries(bossdai1,random(0,4))
IsBoss(bossdai1,2)
Msg2SubWorld("Gia LuËt TÞ Li ®· xuÊt hiÖn t¹i Sa M¹c II(215/201)")
map = SubWorldID2Idx(8)
bossdai2 = AddNpc(502,100,map,1569*32,3294*32)
SetNpcSeries(bossdai2,random(0,4))
IsBoss(bossdai2,2)
Msg2SubWorld("Cæ B¸ch ®· xuÊt hiÖn t¹i Sa M¹c I (195/205)")
bossdai3 = AddNpc(504,100,map,1398*32,3268*32)
SetNpcSeries(bossdai3,random(0,4))
IsBoss(bossdai3,2)
Msg2SubWorld("YÕn HiÓu Trai ®· xuÊt hiÖn t¹i Sa M¹c I (174/204)")
map = SubWorldID2Idx(8)
bossdai4 = AddNpc(503,100,map,1817*32,2813*32)
SetNpcSeries(bossdai4,random(0,4))
IsBoss(bossdai4,2)
Msg2SubWorld("TuyÒn C« Tö ®· xuÊt hiÖn t¹i M¹c Cao QuËt(226/175)")
map = SubWorldID2Idx(37)
bossdai5 = AddNpc(499,100,map,1399*32,3052*32)
SetNpcSeries(bossdai5,random(0,4))
IsBoss(bossdai5,2)
Msg2SubWorld("§¹o Th¹ch Ch©n Nh©n ®· xuÊt hiÖn t¹i T¬ng D¬ng(174/190)")
bossdai6 = AddNpc(501,100,map,1700*32,3355*32)
SetNpcSeries(bossdai6,random(0,4))
IsBoss(bossdai6,2)
Msg2SubWorld("Hµ Nh©n Ng· ®· xuÊt hiÖn t¹i T¬ng D¬ng(212/209)")
--map = SubWorldID2Idx(38)
--bossdai7 = AddNpc(506,100,map,1601*32,2819*32)
--SetNpcSeries(bossdai7,random(0,4))
--IsBoss(bossdai7,2)
--Msg2SubWorld("B¹ch Doanh Doanh ®· xuÊt hiÖn t¹i BiÖn Kinh(200/176)")
map = SubWorldID2Idx(36)
bossdai8 = AddNpc(507,100,map,1420*32,3270*32)
SetNpcSeries(bossdai8,random(0,4))
IsBoss(bossdai8,2)
Msg2SubWorld("Hµ Linh Phiªu ®· xuÊt hiÖn t¹i Phîng Têng(177/204)")
--map = SubWorldID2Idx(39)
-- bossdai9 = AddNpc(505,100,map,1550*32,3365*32)
-- SetNpcSeries(bossdai9,random(0,4))
-- IsBoss(bossdai9,2)
-- Msg2SubWorld("HuyÒn Gi¸c ®· xuÊt hiÖn t¹i D¬ng Ch©u(193/210)")
--SetGlbMissionV(90,1)
--else
---Msg2SubWorld("Gia Luat Ti Li tai Sa Mac II (215/201)")
--Msg2SubWorld("Co Bach da tai Sa Mac I (195/205)")
--Msg2SubWorld("Yen Hieu Trai tai Sa Mac I (174/204)")
--Msg2SubWorld("Tuyen Co Tu tai Mac Cao Quat (226/175)")
--Msg2SubWorld("Dao Thanh Chan Nhan tai Tuong Duong (174/190)")
-- Msg2SubWorld("Ha Nhan Nga tai Tuong Duong (212/209)")
--Msg2SubWorld("Bach Doanh Doanh tai Bien Kinh (200/176)")
-- Msg2SubWorld("Ha Linh Phieu tai Phuong Tuong (177/204)")
-- Msg2SubWorld("Huyen Giac Dai Su tai Duong Chau (193/210)")
--end
end
else
--SetGlbMissionV(90,0)
DelNpc(bossdai1)
DelNpc(bossdai2)
DelNpc(bossdai3)
DelNpc(bossdai4)
DelNpc(bossdai5)
DelNpc(bossdai6)
--DelNpc(bossdai7)
DelNpc(bossdai8)
--DelNpc(bossdai9)
end
end
function vuotai()
ngay = tonumber(date("%d"))
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
giay = tonumber(date("%S"))
if gio == 1 or gio == 3 or gio == 7 or gio == 9 or gio == 11 or gio == 13 or gio == 15 or gio == 17 or gio == 19 or gio == 21 or gio == 23 then
if phut > 45 then
thongbaova()
elseif phut < 45 and phut > 40 then
tgva = 45-phut
AddGlobalCountNews("Sù kiÖn vît ¶i b¾t ®Çu sau "..tgva.." phót n÷a",1)
elseif phut == 45 then
AddGlobalCountNews("Thêi gian b¸o danh vît ¶i b¾t ®Çu !!!",1)
end
else
if phut == 0 then
chiendauva()
elseif phut == 46 then
vuotaitime()
AddGlobalCountNews("Sù kiÖn vît ¶i kÕt thóc !!!!!!",1)
end
end
if gio == 11 or gio == 17 then
if phut >= 55 then
thoigian = 60-phut
AddGlobalCountNews("Sù kiÖn hoa ®¨ng sÏ b¾t ®Çu sau: "..thoigian.." phót n÷a !",1)
end
end
end
function thongbaova()
w,x,y = GetWorldPos();
a = 60 - phut
for o=1,1000 do
PlayerIndex = o
if GetTaskTemp(25) == 1 or GetTaskTemp(26) == 1 then
Msg2Player("Sù kiÖn vuît ¶i cßn: "..a.." phót n÷a sÏ b¾t ®Çu !")
end
end
end
function chiendauva()
w,x,y = GetWorldPos();
for u = 1,1000 do
PlayerIndex = u
if GetTaskTemp(25) == 1 or GetTaskTemp(26) == 1 then
SetFightState(1)
Msg2Player("Sù kiÖn Vît ¶i b¾t ®Çu. Nhãm cña b¹n cã 45 phót ®Ó vît qua !")
end
end
end
function vuotaitime()
phut = tonumber(date("%M"))
gio = tonumber(date("%H"))
SetGlbMissionV(38,0)
SetGlbMissionV(34,0)
for q = 1,1000 do
PlayerIndex = q
if GetTaskTemp(25) == 1 or GetTaskTemp(26) == 1 then
NewWorld(53, 200*8, 200*16);
SetTaskTemp(25,0)
SetDeathScript("");
SetFightState(0);
SetPunish(0)
Msg2Player("Sù kiÖn Vît ¶i kÕt thóc, B¹n ®· qu¸ 45 phót nhng vÉn toµn m¹ng. Tuy nhiªn, vÉn kh«ng ®ñ ®Ó chiÕn th¾ng !")
end
end
end
function vuotai1()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
w,x,y = GetWorldPos()
if gio == 7 or gio == 9 or gio == 11 or gio == 13 or gio == 15 then
if phut >= 55 and phut < 60 then
thoigian = 60 - phut
AddGlobalCountNews("Vît ¶i ®ang trong giai ®o¹n b¸o danh, cßn "..thoigian.." phót n÷a sÏ b¾t ®Çu",1)
SetGlbMissionV(87,1)
end
elseif gio == 8 or gio == 10 or gio == 12 or gio == 14 or gio == 16 then
if phut == 0 then
AddGlobalCountNews("Vît ¶i chÝnh thøc b¾t ®Çu, thêi gian cßn l¹i ®Ó qua ¶i lµ 30 phót",1)
SetGlbMissionV(87,2)
for i = 1,100 do
PlayerIndex = i
if (w == 25) then
Msg2Player("Vît ¶i chÝnh thøc b¾t ®Çu, thêi gian cßn l¹i ®Ó qua ¶i lµ 30 phót")
SetFightState(1)
end
end
elseif phut == 30 then
AddGlobalCountNews("Ho¹t ®éng vît ¶i ®· kÕt thóc !!",1)
SetGlbMissionV(88,0)
SetGlbMissionV(89,0)
SetGlbMissionV(87,0)
end
end
end
function qua_huy_hoang()
qua1 = AddNPCEx(294,1,53,194,203, 3,9,"\\script\\demhuyhoang\\quahuyhoang.lua",5) -- Map : Ba Lang Huyen
qua2 = AddNPCEx(294,1,53,193,204, 7,2,"\\script\\demhuyhoang\\quahuyhoang.lua",5) -- Map : Ba Lang Huyen
qua3 = AddNPCEx(294,1,53,194,204, 5,5,"\\script\\demhuyhoang\\quahuyhoang.lua",5) -- Map : Ba Lang Huyen
qua4 = AddNPCEx(294,1,53,194,203, 10,10,"\\script\\demhuyhoang\\quahuyhoang.lua",5) -- Map : Ba Lang Huyen
end
function hat_huy_hoang()
hat1 = AddNPCEx(295,1,53,194,203, 3,9,"\\script\\demhuyhoang\\hathuyhoang.lua",5) -- Map : Ba Lang Huyen
hat2 = AddNPCEx(295,1,53,193,204, 7,2,"\\script\\demhuyhoang\\hathuyhoang.lua",5) -- Map : Ba Lang Huyen
hat3 = AddNPCEx(295,1,53,194,204, 5,5,"\\script\\demhuyhoang\\hathuyhoang.lua",5) -- Map : Ba Lang Huyen
hat4 = AddNPCEx(295,1,53,194,203, 10,10,"\\script\\demhuyhoang\\hathuyhoang.lua",5) -- Map : Ba Lang Huyen
end
function del_hat_hh()
DelNpc(hat1)
DelNpc(hat2)
DelNpc(hat3)
DelNpc(hat4)
end
function del_qua_hh()
DelNpc(qua1)
DelNpc(qua2)
DelNpc(qua3)
DelNpc(qua4)
end
function phonglangdo()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
w,x,y = GetWorldPos()
if (gio == 7) or (gio == 19) then
if (phut >= 55) then
AddGlobalCountNews("ThuyÒn ®i Phong L¨ng §é s¾p khëi hµnh, nhanh ch©n ®Õn ThuyÒn Phu ®Ó ®¨ng ký",1)
end
elseif (gio == 8) or (gio == 20) then
if (phut >= 0) and (phut < 15) then
batdaupld()
elseif (phut == 15) then
denbopld()
end
end
end
function batdaupld()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
w,x,y = GetWorldPos()
phut1 = 15 - phut
for g=1,100 do
PlayerIndex = g
if (w == 45) then
SetFightState(1)
Msg2Player("ThuyÒn ®· rêi bÕn, cßn "..phut1.." phót n÷a sÏ cÊp bÕn Phong L¨ng §é")
end
end
end
function denbopld()
w,x,y = GetWorldPos()
for u=1,100 do
PlayerIndex = u
if (w == 45) then
NewWorld(46,1331,2861)
SetFightState(1)
Msg2Player("ThuyÒn ®· ®Õn bê B¾c Phong L¨ng §é")
end
end
end
Include("\\Script\\source\\sourcejx49.lua")
Include("\\script\\lien_dau\\liendau_head.lua")
Include("\\script\\phonglangdo\\thoigianpld.lua")
npcadd={0,0,0,0,0}
function OnTimer()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
SubWorld = SubWorldID2Idx(53)
phonglangdo()
vuotai()
thoigianbosshk()
print("So luong gamer dang online: "..GetPlayerCount().."");
if (gio == 12) or (gio == 18) then
if phut == 0 then
hat_huy_hoang()
Msg2SubWorld("Th«ng b¸o: H¹t huy hoµng ®· xuÊt hiÖn t¹i ba l¨ng huyÖn (194/204)")
elseif phut == 10 then
del_hat_hh()
qua_huy_hoang()
Msg2SubWorld("Th«ng b¸o: Qu¶ huy hoµng ®· xuÊt hiÖn t¹i ba l¨ng huyÖn (194/204)")
elseif phut == 15 then
del_qua_hh()
end
end
if phut == 6 or phut == 16 or phut == 26 or phut == 36 or phut == 43 then
AddGlobalCountNews("Nh¾c nhë: ch¬i game ®iÒu ®é, v¨n ho¸, gi÷ g×n søc khoÎ...",1)
elseif phut == 8 or phut == 18 or phut == 28 or phut == 38 then
AddGlobalCountNews("Nh¾c nhë: h·y ®Æt kho¸ r¬ng ®Ó b¶o vÖ tµi s¶n c¸ nh©n !",1)
end
if ((gio == 10) or (gio == 12) or (gio == 14) or (gio == 16) or (gio == 18) or (gio == 20) or (gio == 22)) and (phut >= 45) then
phutcl = 60 - phut
AddGlobalCountNews("Tèng kim ®ang trong thêi gian b¸o danh, cßn "..phutcl.." phót...",1)
if (phut == 59) then
SetGlbMissionV(81,0)
SetGlbMissionV(82,0)
SetGlbMissionV(83,0)
SetGlbMissionV(84,0)
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
DelNpc(npcadd[1])
DelNpc(npcadd[2])
return
end
end
end
elseif (gio == 11) or (gio == 13) or (gio == 15) or (gio == 17) or (gio == 19) or (gio == 21) or (gio == 23) then
if (phut == 0) then
AddGlobalCountNews("Tèng kim ®¹i chiÕn chÝnh thøc b¾t ®Çu !",1)
elseif (phut == 5) or (phut == 10) then
AddGlobalCountNews("Tèng kim tÝch lòy hiÖn t¹i lµ Tèng : Kim "..GetGlbMissionV(81).." : "..GetGlbMissionV(82),1)
elseif (phut == 20) then
if (GetGlbMissionV(81) > GetGlbMissionV(82)) then
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
idnpc = random(894,898)
tongkim = SubWorldID2Idx(51)
npcadd[2] = AddNpc(idnpc,99,tongkim,1968*32,2700*32)
IsBoss(npcadd[2],2)
SetNpcScript(npcadd[2], "\\script\\tongkim\\nguyensoai.lua");
AddGlobalCountNews("Tèng kim : Nguyªn so¸i phe kim ®· xuÊt hiÖn, h·y cè g¾ng lËp c«ng",1)
return
end
end
elseif (GetGlbMissionV(81) < GetGlbMissionV(82)) then
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
idnpc = random(889,893)
tongkim = SubWorldID2Idx(51)
npcadd[1] = AddNpc(idnpc,99,tongkim,1722*32,3044*32)
IsBoss(npcadd[1],2)
SetNpcScript(npcadd[1], "\\script\\tongkim\\nguyensoai.lua");
AddGlobalCountNews("Tèng kim : Nguyªn so¸i phe tèng ®· xuÊt hiÖn, h·y cè g¾ng lËp c«ng",1)
return
end
end
elseif (GetGlbMissionV(81) == GetGlbMissionV(82)) then
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
tongkim = SubWorldID2Idx(51)
idnpc = random(889,893)
npcadd[1] = AddNpc(idnpc,99,tongkim,1722*32,3044*32)
SetNpcScript(npcadd[1], "\\script\\tongkim\\nguyensoai.lua");
idnpc = random(894,898)
npcadd[2] = AddNpc(idnpc,99,tongkim,1968*32,2700*32)
SetNpcScript(npcadd[2], "\\script\\tongkim\\nguyensoai.lua");
AddGlobalCountNews("Tèng kim : Nguyªn so¸i phe kim vµ tèng ®· xuÊt hiÖn",1)
return
end
end
end
elseif (phut == 30) then
if (GetGlbMissionV(81) > GetGlbMissionV(82)) then
AddGlobalCountNews("Tèng kim ®¹i chiÕn kÕt thóc, phÇn th¾ng thuéc vÒ phe tèng !")
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
if (GetTask(23) == 2) then
for i=1,10 do
AddEventItem(137)
end
SetTask(21,GetTask(21) + 500)
AddRepute(50)
Msg2Player("Tèng kim kÕt thóc, nhËn ®îc 10 Tói Nguyªn LiÖu, 50 danh väng, 500 ®iÓm tÝch lòy")
SetTask(24,0)
SetTask(25,0)
SetTask(26,0)
toadox = 2047
toadoy = 2594
NewWorld(51, toadox, toadoy);
SetFightState(0)
elseif (GetTask(23) == 1) then
for i=1,20 do
AddEventItem(137)
end
SetTask(21,GetTask(21) + 1000)
AddRepute(100)
Msg2Player("Tèng kim kÕt thóc, nhËn ®îc 20 Tói Nguyªn LiÖu, 100 danh väng, 1000 ®iÓm tÝch lòy")
SetTask(24,0)
SetTask(25,0)
SetTask(26,0)
toadox = 1640
toadoy = 3153
NewWorld(51,toadox,toadoy) -- tong
SetFightState(0)
end
end
end
elseif (GetGlbMissionV(81) < GetGlbMissionV(82)) then
AddGlobalCountNews("Tèng kim ®¹i chiÕn kÕt thóc, phÇn th¾ng thuéc vÒ phe kim !")
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
if (GetTask(23) == 1) then
for i=1,10 do
AddEventItem(137)
end
SetTask(21,GetTask(21) + 500)
AddRepute(50)
Msg2Player("Tèng kim kÕt thóc, nhËn ®îc 10 Tói Nguyªn LiÖu, 50 danh väng, 500 ®iÓm tÝch lòy")
SetTask(24,0)
SetTask(25,0)
SetTask(26,0)
toadox = 1640
toadoy = 3153
NewWorld(51,toadox,toadoy) -- tong
SetFightState(0)
elseif (GetTask(23) == 2) then
for i=1,10 do
AddEventItem(137)
end
SetTask(21,GetTask(21) + 1000)
AddRepute(100)
Msg2Player("Tèng kim kÕt thóc, nhËn ®îc 20 Tói Nguyªn LiÖu, 100 danh väng,1000 ®iÓm tÝch lòy")
SetTask(24,0)
SetTask(25,0)
SetTask(26,0)
toadox = 2047
toadoy = 2594
NewWorld(51, toadox, toadoy);
SetFightState(0)
end
end
end
else
AddGlobalCountNews("Tèng kim kÕt thóc, 2 bªn hßa nhau !")
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
if (GetTask(23) == 1) then
for i=1,10 do
AddEventItem(137)
end
SetTask(21,GetTask(21) + 750)
AddRepute(75)
Msg2Player("Tèng kim kÕt thóc, nhËn ®îc 10 Tói Nguyªn LiÖu, 75 danh väng, 750 ®iÓm tÝch lòy")
SetTask(24,0)
SetTask(25,0)
SetTask(26,0)
toadox = 1640
toadoy = 3153
NewWorld(51,toadox,toadoy) -- tong
SetFightState(0)
elseif (GetTask(23) == 2) then
for i=1,10 do
AddEventItem(137)
end
SetTask(21,GetTask(21) + 750)
AddRepute(75)
Msg2Player("Tèng kim kÕt thóc, nhËn ®îc 10 Tói Nguyªn LiÖu, 750 danh väng,750 ®iÓm tÝch lòy")
SetTask(24,0)
SetTask(25,0)
SetTask(26,0)
toadox = 2047
toadoy = 2594
NewWorld(51, toadox, toadoy);
SetFightState(0)
end
end
end
end
SetGlbMissionV(81,0)
SetGlbMissionV(82,0)
SetGlbMissionV(83,0)
SetGlbMissionV(84,0)
end
end
--if (gio == 8) or (gio == 14) or (gio == 18) or (gio == 21) then
--if (phut == 0) or (phut == 10) or (phut == 20) or (phut == 30) or (phut == 40) or (phut == 50) then
--AddGlobalCountNews("Liªn ®Êu ®ang trong giai ®o¹n b¸o danh, h·y nhanh ®Õn b¸o danh !",1)
--end
--else
--for i=1,GetPlayerCount() do
--PlayerIndex = i
--w,x,y = GetWorldPos()
-- if w == 42 or w == 43 then
-- NewWorld(53, 1603, 3210);
-- SetFightState(0)
-- end
--end
--end
end
function thoigianbosshk()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
if gio >= 7 and gio <= 9 then
if phut == 0 then
--if GetGlbMissionV(90) == 0 then
map = SubWorldID2Idx(53)
bosstieu1 = AddNpc(509,80,map,1513*32,3306*32)
SetNpcSeries(bosstieu1,random(0,4))
IsBoss(bosstieu1,2)
Msg2SubWorld("LiÔu Thanh Thanh ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn(188/206)")
----
bosstieu2 = AddNpc(510,80,map,1761*32,3206*32)
SetNpcSeries(bosstieu2,random(0,4))
IsBoss(bosstieu2,2)
Msg2SubWorld("DiÖu Nh ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn(220/200)")
----
bosstieu3 = AddNpc(511,80,map,1637*32,3057*32)
SetNpcSeries(bosstieu3,random(0,4))
IsBoss(bosstieu3,2)
Msg2SubWorld("Tr¬ng T«ng ChÝnh ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn(204/190)")
AddGlobalCountNews("Boss hoµng kim tiÓu ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn, c¸c nh©n sü h·y cÈn thËn",1)
--SetGlbMissionV(90,1)
--else
--Msg2SubWorld("LiÔu Thanh Thanh ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn(188/206)")
--Msg2SubWorld("DiÖu Nh ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn(220/200)")
--Msg2SubWorld("Tr¬ng T«ng ChÝnh ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn(204/190)")
--end
end
else
--SetGlbMissionV(90,0)
DelNpc(bosstieu1)
DelNpc(bosstieu2)
DelNpc(bosstieu3)
end
if gio >= 19 and gio <= 23 then
if phut == 0 then
--if GetGlbMissionV(90) == 0 then
map = SubWorldID2Idx(9)
bossdai1 = AddNpc(500,100,map,1721*32,3239*32)
SetNpcSeries(bossdai1,random(0,4))
IsBoss(bossdai1,2)
Msg2SubWorld("Gia LuËt TÞ Li ®· xuÊt hiÖn t¹i Sa M¹c II(215/201)")
map = SubWorldID2Idx(8)
bossdai2 = AddNpc(502,100,map,1569*32,3294*32)
SetNpcSeries(bossdai2,random(0,4))
IsBoss(bossdai2,2)
Msg2SubWorld("Cæ B¸ch ®· xuÊt hiÖn t¹i Sa M¹c I (195/205)")
bossdai3 = AddNpc(504,100,map,1398*32,3268*32)
SetNpcSeries(bossdai3,random(0,4))
IsBoss(bossdai3,2)
Msg2SubWorld("YÕn HiÓu Trai ®· xuÊt hiÖn t¹i Sa M¹c I (174/204)")
map = SubWorldID2Idx(8)
bossdai4 = AddNpc(503,100,map,1817*32,2813*32)
SetNpcSeries(bossdai4,random(0,4))
IsBoss(bossdai4,2)
Msg2SubWorld("TuyÒn C« Tö ®· xuÊt hiÖn t¹i M¹c Cao QuËt(226/175)")
map = SubWorldID2Idx(37)
bossdai5 = AddNpc(499,100,map,1399*32,3052*32)
SetNpcSeries(bossdai5,random(0,4))
IsBoss(bossdai5,2)
Msg2SubWorld("§¹o Th¹ch Ch©n Nh©n ®· xuÊt hiÖn t¹i T¬ng D¬ng(174/190)")
bossdai6 = AddNpc(501,100,map,1700*32,3355*32)
SetNpcSeries(bossdai6,random(0,4))
IsBoss(bossdai6,2)
Msg2SubWorld("Hµ Nh©n Ng· ®· xuÊt hiÖn t¹i T¬ng D¬ng(212/209)")
--map = SubWorldID2Idx(38)
--bossdai7 = AddNpc(506,100,map,1601*32,2819*32)
--SetNpcSeries(bossdai7,random(0,4))
--IsBoss(bossdai7,2)
--Msg2SubWorld("B¹ch Doanh Doanh ®· xuÊt hiÖn t¹i BiÖn Kinh(200/176)")
map = SubWorldID2Idx(36)
bossdai8 = AddNpc(507,100,map,1420*32,3270*32)
SetNpcSeries(bossdai8,random(0,4))
IsBoss(bossdai8,2)
Msg2SubWorld("Hµ Linh Phiªu ®· xuÊt hiÖn t¹i Phîng Têng(177/204)")
--map = SubWorldID2Idx(39)
-- bossdai9 = AddNpc(505,100,map,1550*32,3365*32)
-- SetNpcSeries(bossdai9,random(0,4))
-- IsBoss(bossdai9,2)
-- Msg2SubWorld("HuyÒn Gi¸c ®· xuÊt hiÖn t¹i D¬ng Ch©u(193/210)")
--SetGlbMissionV(90,1)
--else
---Msg2SubWorld("Gia Luat Ti Li tai Sa Mac II (215/201)")
--Msg2SubWorld("Co Bach da tai Sa Mac I (195/205)")
--Msg2SubWorld("Yen Hieu Trai tai Sa Mac I (174/204)")
--Msg2SubWorld("Tuyen Co Tu tai Mac Cao Quat (226/175)")
--Msg2SubWorld("Dao Thanh Chan Nhan tai Tuong Duong (174/190)")
-- Msg2SubWorld("Ha Nhan Nga tai Tuong Duong (212/209)")
--Msg2SubWorld("Bach Doanh Doanh tai Bien Kinh (200/176)")
-- Msg2SubWorld("Ha Linh Phieu tai Phuong Tuong (177/204)")
-- Msg2SubWorld("Huyen Giac Dai Su tai Duong Chau (193/210)")
--end
end
else
--SetGlbMissionV(90,0)
DelNpc(bossdai1)
DelNpc(bossdai2)
DelNpc(bossdai3)
DelNpc(bossdai4)
DelNpc(bossdai5)
DelNpc(bossdai6)
--DelNpc(bossdai7)
DelNpc(bossdai8)
--DelNpc(bossdai9)
end
end
function vuotai()
ngay = tonumber(date("%d"))
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
giay = tonumber(date("%S"))
if gio == 1 or gio == 3 or gio == 7 or gio == 9 or gio == 11 or gio == 13 or gio == 15 or gio == 17 or gio == 19 or gio == 21 or gio == 23 then
if phut > 45 then
thongbaova()
elseif phut < 45 and phut > 40 then
tgva = 45-phut
AddGlobalCountNews("Sù kiÖn vît ¶i b¾t ®Çu sau "..tgva.." phót n÷a",1)
elseif phut == 45 then
AddGlobalCountNews("Thêi gian b¸o danh vît ¶i b¾t ®Çu !!!",1)
end
else
if phut == 0 then
chiendauva()
elseif phut == 46 then
vuotaitime()
AddGlobalCountNews("Sù kiÖn vît ¶i kÕt thóc !!!!!!",1)
end
end
if gio == 11 or gio == 17 then
if phut >= 55 then
thoigian = 60-phut
AddGlobalCountNews("Sù kiÖn hoa ®¨ng sÏ b¾t ®Çu sau: "..thoigian.." phót n÷a !",1)
end
end
end
function thongbaova()
w,x,y = GetWorldPos();
a = 60 - phut
for o=1,1000 do
PlayerIndex = o
if GetTaskTemp(25) == 1 or GetTaskTemp(26) == 1 then
Msg2Player("Sù kiÖn vuît ¶i cßn: "..a.." phót n÷a sÏ b¾t ®Çu !")
end
end
end
function chiendauva()
w,x,y = GetWorldPos();
for u = 1,1000 do
PlayerIndex = u
if GetTaskTemp(25) == 1 or GetTaskTemp(26) == 1 then
SetFightState(1)
Msg2Player("Sù kiÖn Vît ¶i b¾t ®Çu. Nhãm cña b¹n cã 45 phót ®Ó vît qua !")
end
end
end
function vuotaitime()
phut = tonumber(date("%M"))
gio = tonumber(date("%H"))
SetGlbMissionV(38,0)
SetGlbMissionV(34,0)
for q = 1,1000 do
PlayerIndex = q
if GetTaskTemp(25) == 1 or GetTaskTemp(26) == 1 then
NewWorld(53, 200*8, 200*16);
SetTaskTemp(25,0)
SetDeathScript("");
SetFightState(0);
SetPunish(0)
Msg2Player("Sù kiÖn Vît ¶i kÕt thóc, B¹n ®· qu¸ 45 phót nhng vÉn toµn m¹ng. Tuy nhiªn, vÉn kh«ng ®ñ ®Ó chiÕn th¾ng !")
end
end
end
function vuotai1()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
w,x,y = GetWorldPos()
if gio == 7 or gio == 9 or gio == 11 or gio == 13 or gio == 15 then
if phut >= 55 and phut < 60 then
thoigian = 60 - phut
AddGlobalCountNews("Vît ¶i ®ang trong giai ®o¹n b¸o danh, cßn "..thoigian.." phót n÷a sÏ b¾t ®Çu",1)
SetGlbMissionV(87,1)
end
elseif gio == 8 or gio == 10 or gio == 12 or gio == 14 or gio == 16 then
if phut == 0 then
AddGlobalCountNews("Vît ¶i chÝnh thøc b¾t ®Çu, thêi gian cßn l¹i ®Ó qua ¶i lµ 30 phót",1)
SetGlbMissionV(87,2)
for i = 1,100 do
PlayerIndex = i
if (w == 25) then
Msg2Player("Vît ¶i chÝnh thøc b¾t ®Çu, thêi gian cßn l¹i ®Ó qua ¶i lµ 30 phót")
SetFightState(1)
end
end
elseif phut == 30 then
AddGlobalCountNews("Ho¹t ®éng vît ¶i ®· kÕt thóc !!",1)
SetGlbMissionV(88,0)
SetGlbMissionV(89,0)
SetGlbMissionV(87,0)
end
end
end
function qua_huy_hoang()
qua1 = AddNPCEx(294,1,53,194,203, 3,9,"\\script\\demhuyhoang\\quahuyhoang.lua",5) -- Map : Ba Lang Huyen
qua2 = AddNPCEx(294,1,53,193,204, 7,2,"\\script\\demhuyhoang\\quahuyhoang.lua",5) -- Map : Ba Lang Huyen
qua3 = AddNPCEx(294,1,53,194,204, 5,5,"\\script\\demhuyhoang\\quahuyhoang.lua",5) -- Map : Ba Lang Huyen
qua4 = AddNPCEx(294,1,53,194,203, 10,10,"\\script\\demhuyhoang\\quahuyhoang.lua",5) -- Map : Ba Lang Huyen
end
function hat_huy_hoang()
hat1 = AddNPCEx(295,1,53,194,203, 3,9,"\\script\\demhuyhoang\\hathuyhoang.lua",5) -- Map : Ba Lang Huyen
hat2 = AddNPCEx(295,1,53,193,204, 7,2,"\\script\\demhuyhoang\\hathuyhoang.lua",5) -- Map : Ba Lang Huyen
hat3 = AddNPCEx(295,1,53,194,204, 5,5,"\\script\\demhuyhoang\\hathuyhoang.lua",5) -- Map : Ba Lang Huyen
hat4 = AddNPCEx(295,1,53,194,203, 10,10,"\\script\\demhuyhoang\\hathuyhoang.lua",5) -- Map : Ba Lang Huyen
end
function del_hat_hh()
DelNpc(hat1)
DelNpc(hat2)
DelNpc(hat3)
DelNpc(hat4)
end
function del_qua_hh()
DelNpc(qua1)
DelNpc(qua2)
DelNpc(qua3)
DelNpc(qua4)
end
function phonglangdo()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
w,x,y = GetWorldPos()
if (gio == 7) or (gio == 19) then
if (phut >= 55) then
AddGlobalCountNews("ThuyÒn ®i Phong L¨ng §é s¾p khëi hµnh, nhanh ch©n ®Õn ThuyÒn Phu ®Ó ®¨ng ký",1)
end
elseif (gio == 8) or (gio == 20) then
if (phut >= 0) and (phut < 15) then
batdaupld()
elseif (phut == 15) then
denbopld()
end
end
end
function batdaupld()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
w,x,y = GetWorldPos()
phut1 = 15 - phut
for g=1,100 do
PlayerIndex = g
if (w == 45) then
SetFightState(1)
Msg2Player("ThuyÒn ®· rêi bÕn, cßn "..phut1.." phót n÷a sÏ cÊp bÕn Phong L¨ng §é")
end
end
end
function denbopld()
w,x,y = GetWorldPos()
for u=1,100 do
PlayerIndex = u
if (w == 45) then
NewWorld(46,1331,2861)
SetFightState(1)
Msg2Player("ThuyÒn ®· ®Õn bê B¾c Phong L¨ng §é")
end
end
end