leloi550
17-11-10, 07:31 PM
cái script đây anh coi chỉnh dùm em với...
Include("\\Script\\global\\sourcejx49.lua (file://\\Script\\global\\sourcejx49.lua)");
LANDOFDIE = 1 --Tat/mo Dao Tu Vong
LEVELJOINLAND = 120 --Level de tham gia Dao Tu Vong
NAMETICKET = "Than Bi Do Chi"
IDTICKET = 175 --ID cua ve
CASHJOINLAND = 50000 --Tien vao Dao Tu Vong
XPONELIFE = 2000000
MISLAND = 4
danhsach_player1 = {}
function main()
if LANDOFDIE == 1 then
SayEx({"<color=cyan>Quan vien Dao Tu Vong<color>: Nguoi co muon tham gia Dao Thu Vong hay khong ?","Dung vay./thamgia","Huong Dan./huongdan","Thoat./Exit"})
elseif LANDOFDIE == 0 then
SayEx({"<color=cyan>Quan vien Dao Tu Vong<color>: Keo Ho Lo day kinh moi quy khach....","Thoat./Exit"})
end
end;
function huongdan()
SayEx({"<color=red>Thap Tu Vong<color>: De tham gia can co 1 "..NAMETICKET.." Tien: "..CASHJOINLAND.." luong.\nCach Thuc Choi: khi vao duoc Dao Tu Vong thi gap duoc ai thi giet nguoi do.\nKhi giet duoc doi phuong ban nhan duoc tien va diem kinh nghiem...","Thoat./Exit"})
end;
function thamgia()
if GetItemCount(IDTICKET) == 1 then
if GetCash() >= CASHJOINLAND then
kiemtravongloai()
else
MsgEx("<color=cyan>Quan vien Dao Tu Vong<color>: Nguoi can co du "..CASHJOINLAND.." luong de tham gia.",1)
end
else
MsgEx("<color=cyan>Quan vien Dao Tu Vong<color>: Nguoi khong co "..NAMETICKET.." de tham gia Dao Tu Vong.",1)
end;
end;
function kiemtravongloai()
if GetGlbMissionV(MISLAND) == 0 then
MsgEx("<color=cyan>Quan vien Dao Tu Vong<color>: Dao Tu Vong van chua mo cua khong the tham gia...",1)
elseif GetGlbMissionV(MISLAND) == 1 then
GoLand()
elseif GetGlbMissionV(MISLAND) == 2 then
MsgEx("<color=cyan>Quan vien Dao Tu Vong<color>: Dao Tu Vong da mo cua roi bay gio ban khong the vao nua...",1)
end;
end;
function GoLand()
Pay(CASHJOINLAND)
DelItem(IDTICKET)
danhsach_player1[getn(danhsach_player1)+1] = {GetName(),GetLevel(),GetTask(TASKLANDOFDIE),GetFa ction()}
LeaveTeam()
SetCurCamp(4)
SetPunish(0)
SetTempRevPos(886,floor((212 + 3/10)*8*32),floor((182 + 0/10)*16*32))
SetCreateTeam(0)
SetDeathScript("")
SetTask(savePK,GetPK())
SetTask(TASKLANDOFDIE,0)
SetTask(TASKLANDOFDIE2,0)
SetPK(0)
MsgEx("Khi vao trong Dao chi co mot loi thoat duy nhat la Thuyen Phu.")
MsgEx("Khong the su dung Tho Dia Phu khi trong Dao.")
MsgEx("Giet nguoi cang nhieu cang duoc nhieu Kinh Nghiem.")
MsgEx("Ngoi Yen ! chung ta den Dao Tu Vong.")
MoveLandONE()
end;
function MoveLandONE()
z = random(1,16)
if z == 1 then
MoveNPC(886,203,196,8,1,0,0);
elseif z == 2 then
MoveNPC(886,211,194,2,8,0,0);
elseif z == 3 then
MoveNPC(886,213,185,6,3,0,0);
elseif z == 4 then
MoveNPC(886,219,182,7,4,0,0);
elseif z == 5 then
MoveNPC(886,217,178,6,5,0,0);
elseif z == 6 then
MoveNPC(886,216,173,8,1,0,0);
elseif z == 7 then
MoveNPC(886,204,173,5,1,0,0);
elseif z == 8 then
MoveNPC(886,209,173,3,1,0,0);
elseif z == 9 then
MoveNPC(886,200,176,9,7,0,0);
elseif z == 10 then
MoveNPC(886,203,180,8,4,0,0);
elseif z == 11 then
MoveNPC(886,217,188,2,7,0,0);
elseif z == 12 then
MoveNPC(886,224,190,0,6,0,0);
elseif z == 13 then
MoveNPC(886,214,195,9,9,0,0);
elseif z == 14 then
MoveNPC(886,216,193,3,0,0,0);
elseif z == 15 then
MoveNPC(886,204,187,2,0,0,0);
elseif z == 16 then
MoveNPC(886,203,173,8,5,0,0);
end
end;
function MoveLand()
z = random(1,16)
if z == 1 then
MoveNPC(886,203,196,8,1,0,1);
elseif z == 2 then
MoveNPC(886,211,194,2,8,0,1);
elseif z == 3 then
MoveNPC(886,213,185,6,3,0,1);
elseif z == 4 then
MoveNPC(886,219,182,7,4,0,1);
elseif z == 5 then
MoveNPC(886,217,178,6,5,0,1);
elseif z == 6 then
MoveNPC(886,216,173,8,1,0,1);
elseif z == 7 then
MoveNPC(886,204,173,5,1,0,1);
elseif z == 8 then
MoveNPC(886,209,173,3,1,0,1);
elseif z == 9 then
MoveNPC(886,200,176,9,7,0,1);
elseif z == 10 then
MoveNPC(886,203,180,8,4,0,1);
elseif z == 11 then
MoveNPC(886,217,188,2,7,0,1);
elseif z == 12 then
MoveNPC(886,224,190,0,6,0,1);
elseif z == 13 then
MoveNPC(886,214,195,9,9,0,1);
elseif z == 14 then
MoveNPC(886,216,193,3,0,0,1);
elseif z == 15 then
MoveNPC(886,204,187,2,0,0,1);
elseif z == 16 then
MoveNPC(886,203,173,8,5,0,1);
end
end;
function GioChoi()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
times = {6,8,10,14,16,18,20}
for i = 1, getn(times) do
if gio == times[i] then
if phut < 10 then
ThongBaoDiemDanh()
break
elseif phut >= 10 then
TatThongBaoKhoaDangKy()
break
elseif phut == 55 then
KetThucTroChoi()
end
end
end
return 0
end;
function ThongBaoDiemDanh()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
conlai = 10 - phut
Msg2SubWorld("Thoi gian bao danh vao Dao Tu Vong con "..conlai.." phut nua.")
SetGlbMissionV(MISLAND,1)
end;
function TatThongBaoKhoaDangKy()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
SetGlbMissionV(MISLAND,2)
ChuyenDoiPlayer(1)
if phut == 10 then
Msg2SubWorld("Su kien Dao Tu Vong da dien ra. Hay quay lai vao luc khac...")
CHAYGAME()
end
end;
function ChuyenDoiPlayer(id)
W,X,Y = GetWorldPos()
for i=1,GetPlayerCount() do
PlayerIndex = i
if W == 886 then
SetFightState(id)
--Msg2Player("...Su kien Quang Truong Mau da bat dau...")
end
end
end;
function KetThucTroChoi()
danhsach_player1 = {}
BangXepHang()
SetGlbMissionV(MISLAND,0)
Msg2SubWorld("Su kien Quang Truong Mau da ket thuc...")
ReWarExp()
VeLang()
end;
function CHAYGAME()
for i =1,400 do
PlayerIndex = i
W,X,Y = GetWorldPos()
if W == 886 then
SetFightState(1)
MsgEx("Bat dau chien dau nao!!! giet cang nhieu cang tot...")
end
end;
end;
function VeLang()
W,X,Y = GetWorldPos()
for i=1,GetPlayerCount() do
PlayerIndex = i
if W == 886 then
SetTask(TASKLANDOFDIE,0)
SetTask(TASKLANDOFDIE2,0)
SetPK(GetTask(savePK))
SetTask(savePK,0)
SetCreateTeam(1)
SetDeathScript("")
a = GetCamp()
SetCurCamp(a)
SetPunish(0)
MoveNPC(53,197,202,6,4,0,0);
end
end
end;
function ReWarExp()
W,X,Y = GetWorldPos()
for i=1,GetPlayerCount() do
PlayerIndex = i
if W == 886 then
z = GetTask(TASKLANDOFDIE) - GetTask(TASKLANDOFDIE2)
if z > 0 then
xp = z * 25000
AddOwnExp(xp)
x = floor(z/10)
SetTask(TaskTienDong,GetTask(TaskTienDong)+x)
MsgEx("Ban nhan duoc "..x.." Tien Dong.")
Msg2Player("Phan Thuong Dao Tu Vong :\nBan nhan duoc "..xp.." diem kinh nghiem.")
end
end
end
end;
function BangXepHang()
W,X,Y = GetWorldPos()
if getn(danhsach_player1) < 2 then
Msg2Player("Do qua it nguoi choi nen khong can bang xep hang.")
return
end;
bangxephang = {}
for k = 1,15 do
danhsach3 = {}
danhsach2 = {}
danhsach = {}
diemlonnhat = 0
lvnhonhat = 0
for i = 1,getn(danhsach_player1) do
if danhsach_player1[i][3] > diemlonnhat and TimKiem(bangxephang,danhsach_player1[i][1]) == nil then
danhsach = {danhsach_player1[i][1]}
diemlonnhat = danhsach_player1[i][3]
elseif danhsach_player1[i][3] == diemlonnhat and TimKiem(bangxephang,danhsach_player1[i][1]) == nil then
danhsach[getn(danhsach)+1] = danhsach_player1[i][1]
end
end
danhsach2 = {danhsach[1]}
for i = 1,getn(danhsach) - 1 do
if Level_NV(danhsach[i]) < lvnhonhat and TimKiem(bangxephang,danhsach[i]) == nil then
danhsach2 = {danhsach[i+1][1]}
lvnhonhat = Level_NV(danhsach[i])
elseif Level_NV(danhsach[i]) == lvnhonhat and TimKiem(bangxephang,danhsach[i]) == nil then
danhsach2[getn(danhsach2)+1] = danhsach[i+1][1]
end
end
if danhsach2[1] ~= nil then
bangxephang[getn(bangxephang)+1] = danhsach2
end
end
if getn(bangxephang) == 0 then
return
end
for i = 1,getn(bangxephang) do
for k = 1, getn(bangxephang[i]) do
str = "<<"..bangxephang[i][k]..">>\nSo Nguoi Giet Duoc "..MonterKill(bangxephang[i][k]).."."
end
str = "Hang "..i.." :\n"..str
for i =1,GetPlayerCount() do
PlayerIndex = i
if W == 464 then
Msg2Player(str)
end
end
str = ""
end
end;
function MonterKill(tennhanvat)
for i = 1,getn(danhsach_player1) do
if danhsach_player1[i][1] == tennhanvat then
return danhsach_player1[i][3]
end
end
end
function Level_NV(tennhanvat)
for i = 1,getn(danhsach_player1) do
if danhsach_player1[i][1] == tennhanvat then
return danhsach_player1[i][2]
end
end
return "khong co du lieu"
end
function TimKiem(tenbang,tukhoa)
if getn(tenbang) == 0 then
return nil
end
for i= 1,getn(tenbang) do
for k = 1,getn(tenbang[i]) do
if tenbang[i][k] == tukhoa then
return 1
end
end
end
end
Powered by vBulletin® Version 4.2.0 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.