PDA

View Full Version : Event Thiên Sơn Và Dã Tẩu Kiểu Mới By Kiệt Pê Đê



[S]ocola[S]an
06-11-10, 09:14 PM
Coder : - Kinkina2009
Vì CLbgamesvn cần copy đoạn gỳ đó vào host mà achơi máy net bị CMS chặn nên ko vào được Forum nên mình share dùm anh ấy ^^
Copy vào server để đâu tùy ý ko quan tâm ^^
Phần 1 : Dã Tẩu Kiểu Mới
datau.lua

Include("\\script\\Global\\sourcejx49.lua")
Include("\\script\\Global\\da_tau\\listmangdatau.lua")


TASKNHANNHIEMVU = 250 --/XAC DINH NHAN NHIEM VU HAY CHUA
TASKMISSION = 249 --/XAC DINH NHIEM VU 1 2 3 4 5 .... N
TASKSOQUAI = 248 --/SO QUAI VAT DANH DUOC
TASKHOANTHANH = 247 --/SO LAN HOAN THANH NHIEM VU
TASKHUYBO = 246 --/SO CO HOI HUY BO NHIEM VU
TASKCHECKPOINT = 245
SONHAXATAC = 244

PHUCDUYENDAI = 5
PHUCDUYENTRUNG = 4
PHUCDUYENTIEU = 3
IDTINHHONG = 11
IDTUTHUYTINH = 9
IDLUCTHUYTINH = 10
IDLAMTHUYTINH = 8


function main()
if GetTask(TASKNHANNHIEMVU) == 0 then
SetTask(TASKMISSION,0)
SetTask(TASKSOQUAI,0)

Talk(1,"gomission","<color=fire>Da Tau<color>: Hien Tai Vi Dai Hiep Chua Nhan Nhiem Vu")
else
SayEx({"<color=fire>Da Tau<color>: Thong Tin cua "..GetName()..":\nSo Lan Hoan Thanh: "..GetTask(TASKHOANTHANH).."\nCo Hoi Huy Bo: "..GetTask(TASKHUYBO).."",
"Hoan Thanh Nhiem Vu./finish",
"Huy Bo Nhiem Vu./close",
"Thoat./no"})
end
end;


function no()
end;
----------------------======================================Huy Bo============================
function close()
if GetTask(TASKHUYBO) >= 1 then
SayEx({"<color=fire>Da Tau:<color>: Hien tai Dai Hiep dang co "..GetTask(TASKHUYBO).." co hoi huy bo\nNeu huy thi se bi tru di 1 <color=red>Co Hoi Huy Bo<color>\nBan co chac khong?",
"Dung Co Hoi Huy Bo Nhiem Vu./closefinish",
"Quay Tro Lai Trang Truoc./main",
"Thoat./no"})
else
SayEx({"<color=fire>Da Tau:<color>: Hien tai Dai Hiep dang co "..GetTask(TASKHUYBO).." co hoi huy bo\nNeu huy thi se mat het <color=red>Tich Luy <color>\nBan co chac khong?",
"Ta Dong Y Huy Tat Ca./closeforever",
"Quay Tro Lai Trang Truoc./main",
"Thoat./no"})
end
end;

function closefinish()
SetTask(TASKHUYBO,GetTask(TASKHUYBO) - 1)
SetTask(TASKNHANNHIEMVU,0)
SetTask(TASKMISSION,0)
SetTask(TASKSOQUAI,0)
SayEx({"<color=fire>Da Tau <color>: Dai Hiep da <color=red>Huy Bo Nhiem Vu Thanh Cong<color> co the tiep tuc lam lai",
"Ket Thuc Doi Ngoai./no"})
end

function closeforever()
SetTask(TASKHUYBO,0)
SetTask(TASKNHANNHIEMVU,0)
SetTask(TASKMISSION,0)
SetTask(TASKSOQUAI,0)
SetTask(TASKHOANTHANH,0)
SayEx({"<color=fire>Da Tau <color>: Dai Hiep da <color=red>Huy Bo Nhiem Vu Thanh Cong<color> co the tiep tuc lam lai",
"Ket Thuc Doi Ngoai./no"})
end
--================================================== ================================================== ============================
--===============================================NHA N NHIEM VU NE ================================================== ==
function gomission()
SayEx({"<color=fire>Da Tau:<color>: Day la Nhiem Vu thu "..GetTask(TASKHOANTHANH).." cua nguoi co muon lam tiep khong",
"Ta Muon Nhan Nhiem Vu Da Tau./go",
"Ket Thuc Doi Ngoai./no"})
end




function go()
level = GetLevel()
a = random(1,6)
SetTask(TASKNHANNHIEMVU,1)
if a == 1 then
k = random(1,7)
if k == 1 then
SetTask(TASKMISSION,1)
SayEx({"<color=fire>Da Tau<color>: Hay Mang Den Cho Ta 1 Binh <color=yellow>Phuc Duyen Dai<color> de Boi Duong Sinh Luc",
"Ket Thuc Doi Ngoai./no"})
elseif k == 2 then
SetTask(TASKMISSION,2)
SayEx({"<color=fire>Da Tau<color>: Hay Mang Den Cho Ta 1 Binh <color=blue>Phuc Duyen Trung<color> de Boi Duong Sinh Luc",
"Ket Thuc Doi Ngoai./no"})
elseif k == 3 then
SetTask(TASKMISSION,3)
SayEx({"<color=fire>Da Tau<color>: Hay Mang Den Cho Ta 1 Binh <color=red>Phuc Duyen Tieu<color> de Boi Duong Sinh Luc",
"Ket Thuc Doi Ngoai./no"})
elseif k == 4 then
SetTask(TASKMISSION,4)
SayEx({"<color=fire>Da Tau<color>: Hay Mang Den Cho Ta 1 vien <color=cycan>Tinh Hong Bao Thach<color> de luyen cong",
"Ket Thuc Doi Ngoai./no"})
elseif k == 5 then
SetTask(TASKMISSION,5)
SayEx({"<color=fire>Da Tau<color>: Hay Mang Den Cho Ta 1 vien <color=pink>Tu Thuy Tinh<color> de luyen cong",
"Ket Thuc Doi Ngoai./no"})
elseif k == 6 then
SetTask(TASKMISSION,6)
SayEx({"<color=fire>Da Tau<color>: Hay Mang Den Cho Ta 1 vien <color=green>Luc Thuy Tinh<color> de luyen cong",
"Ket Thuc Doi Ngoai./no"})
elseif k == 7 then
SetTask(TASKMISSION,7)
SayEx({"<color=fire>Da Tau<color>: Hay Mang Den Cho Ta 1 vien <color=blue>Lam Thuy Tinh<color> de luyen cong",
"Ket Thuc Doi Ngoai./no"})
end
end

if a == 2 then
lv = GetLevel()
h = random(1,3)
if h == 1 then
for i=1,getn(NhiemVu) do
if lv >= NhiemVu[i][3] and lv <= NhiemVu[i][4] then
maps = NhiemVu[i][1]
end
end
SetTask(TASKMISSION,8)
SayEx({"<color=fire>Da Tau<color>: Hay den <color=pink>"..maps.."<color> thu thap cho ta <color=fire>15 cuon <color=yellow>Dia Do Chi",
"Ket Thuc Doi Ngoai./no"})
elseif h == 2 then
for i=1,getn(NhiemVu) do
if lv >= NhiemVu[i][3] and lv <= NhiemVu[i][4] then
maps = NhiemVu[i][1]
end
end
SetTask(TASKMISSION,9)
SayEx({"<color=fire>Da Tau <color>: Hay den <color=pink>"..maps.."<color> thu thap cho ta <color=fire>3<color> quyen <color=yellow>Mat Chi",
"Ket Thuc Doi Ngoai./no"})
elseif h == 3 then
for i=1,getn(NhiemVu) do
if lv >= NhiemVu[i][3] and lv <= NhiemVu[i][4] then
maps = NhiemVu[i][1]
quai = NhiemVu[i][2]
end
end
SetTask(TASKMISSION,10)
SayEx({"<color=fire>Da Tau <color>: Hay den <color=pink>"..maps.."<color> tieu diet <color=pink>"..quai.."<color> Thu Linh",
"Ket Thuc Doi Ngoai./no"})
end
end

if a == 3 then
lv = GetLevel()
for i=1,getn(Point) do
if lv >= Point[i][5] and lv <= Point[i][6] then
pk = Point[i][1]
end
end
SetTask(TASKMISSION,11)
SayEx({"<color=fire>Da Tau<color>: Hay di nang cap cho ta <color=fire>"..pk.."<color> diem PK\nRoi ve day gap ta",
"Ket Thuc Doi Ngoai./no"})
end

if a == 4 then
lv = GetLevel()
for i=1,getn(Point) do
if lv >= Point[i][5] and lv <= Point[i][6] then
dv = Point[i][2]
end
end
SetTask(TASKMISSION,12)
SetTask(TASKCHECKPOINT,GetRepute())
SayEx({"<color=fire>Da Tau<color>: Hay di nang cap cho ta <color=fire>"..dv.."<color> diem Danh Vong\nRoi ve day gap ta",
"Ket Thuc Doi Ngoai./no"})
end
if a == 5 then
lv = GetLevel()
for i=1,getn(Point) do
if lv >= Point[i][5] and lv <= Point[i][6] then
pd = Point[i][3]
end
end
SetTask(TASKMISSION,13)
SetTask(TASKCHECKPOINT,GetTask(TaskPhucDuyen))
SayEx({"<color=fire>Da Tau<color>: Hay di nang cap cho ta <color=fire>"..pd.."<color> diem Phuc Duyen\nRoi ve day gap ta",
"Ket Thuc Doi Ngoai./no"})
end
if a == 6 then
lv = GetLevel()
for i=1,getn(Point) do
if lv >= Point[i][5] and lv <= Point[i][6] then
tk = Point[i][4]
end
end
SetTask(TASKMISSION,14)
SetTask(TASKCHECKPOINT,GetTask(TaskTongKim))
SayEx({"<color=fire>Da Tau<color>: Hay di nang cap cho ta <color=fire>"..tk.."<color> diem Tong Kim\nRoi ve day gap ta",
"Ket Thuc Doi Ngoai./no"})
end


end




--================================================== =====Hoan Thanh Su Mang ================================================== =

function finish()
if GetTask(TASKMISSION) == 1 then
if GetItemCount(PHUCDUYENDAI) >= 1 then
DelItem(PHUCDUYENDAI)
CheckMission()
else
Talk(1,"no","<color=fire>Da Tau<color>: Xin Loi , Trong Nguoi cua Dai Hiep khong co 1 <color=yellow> Phuc Duyen Dai<color>")
end
elseif GetTask(TASKMISSION) == 2 then
if GetItemCount(PHUCDUYENTRUNG) >= 1 then
DelItem(PHUCDUYENTRUNG)
CheckMission()
else
Talk(1,"no","<color=fire>Da Tau<color>: Xin Loi , Trong Nguoi cua Dai Hiep khong co 1 <color=blue> Phuc Duyen Trung<color>")
end
elseif GetTask(TASKMISSION) == 3 then
if GetItemCount(PHUCDUYENTIEU) >= 1 then
DelItem(PHUCDUYENTIEU)
CheckMission()
else
Talk(1,"no","<color=fire>Da Tau<color>: Xin Loi , Trong Nguoi cua Dai Hiep khong co 1 <color=blue> Phuc Duyen Tieu<color>")
end
elseif GetTask(TASKMISSION) == 4 then
if GetItemCount(IDTINHHONG) >= 1 then
DelItem(IDTINHHONG)
CheckMission()
else
Talk(1,"no","<color=fire>Da Tau<color>: Xin Loi , Trong Nguoi cua Dai Hiep khong co 1 <color=blue> Tinh Hong Bao Thach<color>")
end

elseif GetTask(TASKMISSION) == 5 then
if GetItemCount(IDTUTHUYTINH) >= 1 then
DelItem(IDTUTHUYTINH)
CheckMission()
else
Talk(1,"no","<color=fire>Da Tau<color>: Xin Loi , Trong Nguoi cua Dai Hiep khong co 1 <color=pink>Tu Thuy Tinh<color>")
end

elseif GetTask(TASKMISSION) == 6 then
if GetItemCount(IDLUCTHUYTINH) >= 1 then
DelItem(IDLUCTHUYTINH)
CheckMission()
else
Talk(1,"no","<color=fire>Da Tau<color>: Xin Loi , Trong Nguoi cua Dai Hiep khong co 1 <color=green>Luc Thuy Tinh<color>")
end
elseif GetTask(TASKMISSION) == 7 then
if GetItemCount(IDLAMTHUYTINH) >= 1 then
DelItem(IDLAMTHUYTINH)
CheckMission()
else
Talk(1,"no","<color=fire>Da Tau<color>: Xin Loi , Trong Nguoi cua Dai Hiep khong co 1 <color=blue>Lam Thuy Tinh<color>")
end

elseif GetTask(TASKMISSION) == 8 then
if GetTask(TASKSOQUAI) >= 15 then
SetTask(TASKSOQUAI,0)
CheckMission()
else
Talk(1,"no","<color=fire>Da Tau<color>: Xin Loi . So Dia Do Chi Cua Ban La "..GetTask(TASKSOQUAI).." Khong The Hoan Thanh Nhiem Vu")
end
elseif GetTask(TASKMISSION) == 9 then
if GetTask(TASKSOQUAI) >= 3 then
SetTask(TASKSOQUAI,0)
CheckMission()
else
Talk(1,"no","<color=fire>Da Tau<color>: Xin Loi . So Mat Chi Cua Ban La "..GetTask(TASKSOQUAI).." Khong The Hoan Thanh Nhiem Vu")
end
elseif GetTask(TASKMISSION) == 10 then
lv = GetLevel()
for i=1,getn(NhiemVu) do
if lv >= NhiemVu[i][3] and lv <= NhiemVu[i][4] then
SoQuai = NhiemVu[i][2]
end
end
if GetTask(TASKSOQUAI) >= SoQuai then
SetTask(TASKSOQUAI,0)
CheckMission()
else
Talk(1,"no","<color=fire>Da Tau<color>: So quai : <color=fire>"..GetTask(TASKSOQUAI).."/"..SoQuai.."<color=fire>\nKhong The Hoan Thanh Nhiem Vu")
end
elseif GetTask(TASKMISSION) == 11 then
lv = GetLevel()
for i=1,getn(Point) do
if lv >= Point[i][5] and lv <= Point[i][6] then
pk = Point[i][1]
end
end
if GetPK() >= pk then
SetPK(0)
CheckMission()
else
Talk(1,"no","<color=fire>Da Tau<color>: Diem PK hien tai la "..GetPK().."/"..pk.." khong the hoan thanh")
end
elseif GetTask(TASKMISSION) == 12 then
lv = GetLevel()
for i=1,getn(Point) do
if lv >= Point[i][5] and lv <= Point[i][6] then
dv = Point[i][2]
end
end
pointdau = GetTask(TASKCHECKPOINT)
pointcan = pointdau + dv
pointnow = GetRepute()
pointnang = pointnow - pointdau
if pointnow >= pointcan then
CheckMission()
SetTask(TASKCHECKPOINT,0)
else
Talk(1,"no","<color=fire>Da Tau<color>: Ban da nang <color=fire>"..pointnang.."<color> Danh Vong khong the hoan thanh")
end
elseif GetTask(TASKMISSION) == 13 then
lv = GetLevel()
for i=1,getn(Point) do
if lv >= Point[i][5] and lv <= Point[i][6] then
pd = Point[i][3]
end
end
pointdau = GetTask(TASKCHECKPOINT)
pointcan = pointdau + pd
pointnow = GetTask(TaskPhucDuyen)
pointnang = pointnow - pointdau
if pointnow >= pointcan then
CheckMission()
SetTask(TASKCHECKPOINT,0)
else
Talk(1,"no","<color=fire>Da Tau<color>: Ban da nang <color=fire>"..pointnang.."<color> Phuc Duyen khong the hoan thanh")
end

elseif GetTask(TASKMISSION) == 14 then
lv = GetLevel()
for i=1,getn(Point) do
if lv >= Point[i][5] and lv <= Point[i][6] then
tk = Point[i][4]
end
end
pointdau = GetTask(TASKCHECKPOINT)
pointcan = pointdau + tk
pointnow = GetTask(TaskTongKim)
pointnang = pointnow - pointdau
if pointnow >= pointcan then
CheckMission()
SetTask(TASKCHECKPOINT,0)
else
Talk(1,"no","<color=fire>Da Tau<color>: Ban da nang <color=fire>"..pointnang.."<color> Tong Kim khong the hoan thanh")
end
else
Msg2Player("Bug Da Tau. Moi Mission deu bi xoa")
SetTask(TASKMISSION,0)
SetTask(TASKSOQUAI,0)
SetTask(TASKNHANNHIEMVU,0)
end
end;
--================================================== =PHAN THUONG============================================ ==========
function CheckMission()
SetTask(TASKMISSION,0)
SetTask(TASKSOQUAI,0)
SetTask(TASKNHANNHIEMVU,0)
SetTask(TASKHOANTHANH,GetTask(TASKHOANTHANH)+1)
SayEx({"<color=fire>Da Tau<color>: Ban da hoan thanh Da Tau\nSo Lan Hoan Thanh : "..GetTask(TASKHOANTHANH).."\nCo Hoi Huy Bo: "..GetTask(TASKHUYBO).."",
"Nhan Phan Thuong ./phanthuong",
"Ket Thuc./no"})

end;




function phanthuong()
x = random(1,6)
if x == 1 then
SayEx({"<color=fire>Da Tau<color>: Nguoi da hoan thanh nhiem vu Da Tau\nCo muon nhan chut Phan Thuong Khong",
"Kinh Nghiem./kinhnghiemmin",
"Mat Tich Vo Cong/mattich",
"Thuy Tinh./thuytinh"})
elseif x == 2 then
SayEx({"<color=fire>Da Tau<color>: Nguoi da hoan thanh nhiem vu Da Tau\nCo muon nhan chut Phan Thuong Khong",
"Kinh Nghiem./kinhnghiemmin",
"Co Hoi Huy Bo/mattich",
"Thuy Tinh/thuytinh"})
elseif x == 3 then
SayEx({"<color=fire>Da Tau<color>: Nguoi da hoan thanh nhiem vu Da Tau\nCo muon nhan chut Phan Thuong Khong",
"Kinh Nghiem./kinhnghiez",
"Mat Tich Vo Cong/mattich",
"Thuy Tinh./thuytinh"})
elseif x == 4 then
SayEx({"<color=fire>Da Tau<color>: Nguoi da hoan thanh nhiem vu Da Tau\nCo muon nhan chut Phan Thuong Khong",
"Kinh Nghiem./kinhnghiemmin",
"Tinh Hong Bao Thach/tinhhong",
"Tang 1 lan Tich Luy./tichluy"})
elseif x == 5 then
SayEx({"<color=fire>Da Tau<color>: Nguoi da hoan thanh nhiem vu Da Tau\nCo muon nhan chut Phan Thuong Khong",
"Co Hoi Huy Bo/cohoi",
"Ngan Luong/nganluong",
"Thuy Tinh./thuytinh"})
elseif x == 6 then
SayEx({"<color=fire>Da Tau<color>: Nguoi da hoan thanh nhiem vu Da Tau\nCo muon nhan chut Phan Thuong Khong",
"Kinh Nghiem./kinhnghiemmin",
"Mat Tich Vo Cong/mattich",
"Thuy Tinh./thuytinh"})
end
end;

function kinhnghiemmin()
exp = random(500000,10000000)
AddOwnExp(exp)
Msg2Player("Ban nhan duoc "..exp.." diem Kinh Nghiem")
end;

function mattich()
k = random(86,113)
AddEventItem(k)
Msg2Player("Ban nhan duoc 1 cuon Bi Kiep mon phai")
end;

function thuytinh()
s = random(1,3)
if s == 1 then
AddEventItem(IDLAMTHUYTINH)
Msg2Player("Ban nhan duoc 1 Lam Thuy Tinh")
elseif s == 2 then
AddEventItem(IDLUCTHUYTINH)
Msg2Player("Ban nhan duoc 1 Luc Thuy Tinh")
elseif s == 3 then
AddEventItem(IDTUTHUYTINH)
Msg2Player("Ban nhan duoc 1 Lam Thuy Tinh")
end
end

function kinhnghiemz()
exp = random(1000000,30000000)
AddOwnExp(exp)
Msg2Player("Ban nhan duoc "..exp.." diem Kinh Nghiem")
end

function nganluong()
tien = random(200000,450000)
Earn(tien)
Msg2Player("Ban nhan duoc "..tien.." van luong")
end

function tinhhong()
AddEventItem(IDTINHHONG)
Msg2Player("Ban nhan duoc 1 vien Tinh Hong Bao THach")
end

function tichluy()
SetTask(TASKHOANTHANH,GetTask(TASKHOANTHANH)+1)
Msg2Player("Ban nhan duoc 1 Tich Luy da tau")
end

function cohoi()
SetTask(TASKHUYBO,GetTask(TASKHUYBO)+1)
Msg2Player("Ban nhan duoc 1 Co Hoi Huy Bo Nhiem Vu")
end

listmangdatau.lua

-- //
--Script Da Tau theo kieu moi // //
--=====================================//





--Ten Map,sO qUAI KILL,lv thap nhat nhan nv,lv cao nhat nhan nv


NhiemVu = {
{"Hoa Son",100,1,10}, -- 1x
{"Tuyet Dinh Hoa Son",100,11,20}, --2x
{"Tan Lang",100,21,30}, --3x
{"Kiem Cac Tay Bac",100,31,40}, --4x
{"Dao Hoa Nguyen",100,41,50}, --5x
{"Dai Tu Dong",100,51,60}, --6x
{"Lam Du Quan",100,61,70}, --7x
{"Chan Nui Truong Bach",100,71,80}, --8x
{"Truong Bach Son Nam",250,81,100}, --10x
{"Truong Bach Son Bac",250,101,120}, --12x
{"Sa Mac Dia Bieu",250,121,130}, --13x
{"Mac Cao Quat",250,131,150}, --15x
{"Tay Son Dao",250,151,200} --17x

}

-- PK , Danh Vong, Phuc Duyen , Tich Luy Tong Kim , Level Thap Nhat Nhan NV , Level Cao Nhat ...
Point = {
{1,20,50,0,1,10}, -- 1x
{2,30,50,0,11,20}, --2x
{3,40,50,0,21,30}, --3x
{4,50,50,0,31,40}, --4x
{5,50,50,0,41,50}, --5x
{6,60,60,0,51,60}, --6x
{7,70,70,0,61,70}, --7x
{8,80,80,0,71,80}, --8x
{9,100,150,5000,81,100}, --10x
{10,200,200,10000,101,120}, --12x
{10,200,200,15000,121,130}, --13x
{10,200,200,20000,131,150}, --15x
{10,250,250,30000,151,200} --17x

}



MapMission = {

{"Hoa Son",2}, -- 1x
{"Tuyet Dinh Hoa Son",212}, --2x
{"Tan Lang",7}, --3x
{"Kiem Cac Tay Bac",9}, --4x
{"Dao Hoa Nguyen",55}, --5x
{"Dai Tu Dong",72}, --6x
{"Lam Du Quan",1}, --7x
{"Chan Nui Truong Bach",4}, --8x
{"Truong Bach Son Nam",13}, --10x
{"Truong Bach Son Bac",14}, --12x
{"Sa Mac Dia Bieu",5}, --13x
{"Mac Cao Quat",3}, --15x
{"Tay Son Dao",15} --17x

}
npcdie.lua

--Author : KingMax
--SCript datau theo Phien Ban moi

Include("\\script\\Global\\da_tau\\datau_.lua")
Include("\\script\\Global\\da_tau\\listmangdatau.lua")



function CheckDaTau()
lv = GetLevel()
W,X,Y = GetWorldPos()
if GetTask(TASKMISSION) == 8 then
for i=1,getn(MapMission) do
if lv >= NhiemVu[i][3] and lv <= NhiemVu[i][4] then
if W == MapMission[i][2] then
z = random(1,40)
maps = NhiemVu[i][1]
if z == 7 then
SetTask(TASKSOQUAI,GetTask(TASKSOQUAI)+1)
Msg2Player("Ban nhan duoc 1 cuon 【"..maps.."】《Dia Do Chi》.Hien tai ban co "..GetTask(TASKSOQUAI).." cuon")
elseif z == 12 then
SetTask(TASKSOQUAI,GetTask(TASKSOQUAI)+1)
Msg2Player("Ban nhan duoc 1 cuon 【"..maps.."】《Dia Do Chi》.Hien tai ban co "..GetTask(TASKSOQUAI).." cuon")
SetTask(TASKSOQUAI,GetTask(TASKSOQUAI)+1)
Msg2Player("Ban nhan duoc 1 cuon "..maps.." Dia Do Chi! Hien tai ban co "..GetTask(TASKSOQUAI).." cuon")
end
end
end
end
elseif GetTask(TASKMISSION) == 9 then
for i=1,getn(MapMission) do
if lv >= NhiemVu[i][3] and lv <= NhiemVu[i][4] then
if W == MapMission[i][2] then
z = random(1,100)
maps = NhiemVu[i][1]
if z == 7 then
SetTask(TASKSOQUAI,GetTask(TASKSOQUAI)+1)
Msg2Player("Ban nhan duoc 1 cuon 【"..maps.."】《Mat Chi》. Hien tai ban co "..GetTask(TASKSOQUAI).." cuon")
elseif z == 12 then
SetTask(TASKSOQUAI,GetTask(TASKSOQUAI)+1)
Msg2Player("Ban nhan duoc 1 cuon 【"..maps.."】《Mat Chi》.Hien tai ban co "..GetTask(TASKSOQUAI).." cuon")
SetTask(TASKSOQUAI,GetTask(TASKSOQUAI)+1)
Msg2Player("Ban nhan duoc 1 cuon 【"..maps.."】《Mat Chi》. Hien tai ban co "..GetTask(TASKSOQUAI).." cuon")
end
end
end
end
elseif GetTask(TASKMISSION) == 10 then
for i=1,getn(MapMission) do
if lv >= NhiemVu[i][3] and lv <= NhiemVu[i][4] then
quai = NhiemVu[i][2]
if W == MapMission[i][2] then
SetTask(TASKSOQUAI,GetTask(TASKSOQUAI)+1)
Msg2Player("Ban tieu diet 1 ten Thu Linh. So Quai : "..GetTask(TASKSOQUAI).."/"..quai.." ten")
end
end
end
else
z = random(1,200)
if z == 56 then
SetTask(SONHAXATAC,GetTask(SONHAXATAC) + 1)
Msg2Player("Ban nhan duoc 1 tam【Son Ha Xa Tac】. Hien tai ban dang co "..GetTask(SONHAXATAC).." tam")
elseif z == 50 then
SetTask(SONHAXATAC,GetTask(SONHAXATAC) + 1)
Msg2Player("Ban nhan duoc 1 tam 【Son Ha Xa Tac】. Hien tai ban dang co "..GetTask(SONHAXATAC).." tam")
SetTask(SONHAXATAC,GetTask(SONHAXATAC)+1)
Msg2Player("Ban nhan duoc 1 tam 【Son Ha Xa Tac】. Hien tai ban dang co "..GetTask(SONHAXATAC).." tam")
end
end

end









Một Điều Nữa
Work Tốt Nhất Trên Tình Huynh Đệ Server

[S]ocola[S]an
06-11-10, 09:21 PM
Phần 2 : Thiên Sơn Sự Kiện
sukien.lua

--exp_table = {}
DANH_SACH={}
Include("\\script\\moilam\\uplevel\\list.lua")
Include("\\script\\thuvien\\congdon.lua")


TASKBAODANH = 115
THIENSONTUYETLIEN = 161
THIENSONNGANNAM = 162
TASKTHIENSONNGANNAM =116
LINHCHI = 163
function main(sel)
Say("<color=blue>Le Quan<color>: He thong dua top cua Server bat dau hoat dong",5,
"Dang Ky tham gia Event[ LV 10-80,Chua CS ]/nhapdulieu",
"Nhan Phan Thuong [ Level 150,CS 0 + 1000 van ]/pt",
"Nang Cap Thien Son Tuyet Lien Ngan Nam/nctstl",
"Su Dung Thien Son Tuyet Lien/sdtstl",
"Thong Tin Nhan Vat/ttnv",
"Ket Thuc./no")
end

function no()
end

function nctstl()
tl = GetItemCount(THIENSONTUYETLIEN)
tl1 = GetItemCount(LINHCHI)
if (tl >= 1) and (tl1 >= 1) then
DelItem(THIENSONTUYETLIEN)
DelItem(LINHCHI)
if (GetItemCount(THIENSONTUYETLIEN) == (tl-1)) and (GetItemCount(LINHCHI) == (tl1 -1)) then
AddEventItem(THIENSONNGANNAM)
Msg2Player("Ban nhan duoc 1 Thien Son Ngan Nam")
else
Talk(1,"no","Hack a cung yeu")
end
else
Talk(1,"no","<color=blue>Le Quan<color>: Ban can 1 Thien Son Tuyet Lien , 1 Linh chi de hop thanh")
end
end

function nhapdulieu122()
Talk(1,"no","<color=blue>Le Quan<color>: Ban Chua Chuyen Sinh ")
end;

function nhapdulieu()
--ten = GetName()
--if ten ~= nil then

if GetTask(TASKBAODANH) == 1 then
Say("<color=blue>Le Quan<color>: Vi dai hiep nay da bao danh vao NPC , khong the bao danh nua,hay co gang dat tu luyen 150 dang cap de nhan phan thuong dang gia",1,"Thoat./no")
else

if (GetLevel() >= 10) and (GetLevel() <= 80) then
if GetTask(197) == 0 then
if GetTask(TASKBAODANH) == 0 then
SetTask(TASKBAODANH,1)
Talk(1,"kick","<color=blue>Le Quan<color>: Sau khi nhap du lieu, thong tin cua ban se duoc luu lai, su kien dien ra mung dai le <color=fire>1000 Nam Thang Long Ha Noi<color>")
else
Talk(1,"no","<color=blue>Le Quan<color>: Ban da hoan thanh su kien,khong the tiep tuc nhan")
end
else
Talk(1,"no","<color=blue>Le Quan<color>: Ban da chuyen sinh , khong the tiep tuc nhan")
end
else
Talk(1,"no","<color=blue>Le Quan<color>: Dang cap yeu cau bao danh la tu 10 den 80, dieu kien cua nguoi khong the tham gia")
end
end
--end
end;

function kick()
KickOutSelf()
end

function ttnv()
if timkiem(GetName()) == 1 then
for i = 1,getn(DANH_SACH) do
if DANH_SACH[i][1] == GetName() then
ngay = DANH_SACH[i][3]
thang = DANH_SACH[i][4]
nam = DANH_SACH[i][5]
gio = DANH_SACH[i][6]
phut = DANH_SACH[i][7]
giay = DANH_SACH[i][8]
Say("<color=blue>Le Quan<color>: Thong Tin Nhan Vat:\nTen: <color=red>"..GetName().."<color>\t\t\tDang Cap: <color=fire>"..GetLevel().."<color>\nThong Tin Dang Ky:\nDang Ky luc: ["..ngay.."/"..thang.."/"..nam.."]\t-\t["..gio..":"..phut..":"..giay.."]",1,
"Thoat./no")
end
end
else
Talk(1,"no","Khong tim thay du lieu cua nhan vat")
end
end


function pt(sel)
--if (timkiem(GetName()) == 1) then
if GetTask(TASKBAODANH) == 1 then
if (GetLevel() >= 150) and (GetCash() >= 10000000) then
AddEventItem(THIENSONTUYETLIEN)
Pay(10000000)
Msg2Player("Ban nhan duoc 1 bong hoa Thien Son Tuyet Lien")
SetTask(TASKBAODANH,2)
--xoaso()
Talk(1,"kick","<color=blue>Le Quan<color>: Ban da hoan thanh mission hay nhan lay phan thuong la 1 bong hoa ngan nam <color=green>Thien Son Tuyet Lien<color>")
else
Talk(1,"no","<color=blue>Le Quan<color>: Dang cap can dat la Level 150 va co 1000v trong hanh trang, hien tai nguoi chua du")
end
else
SetTask(TASKBAODANH,3)
Talk(1,"no","<color=blue>Le Quan<color>: Ban chua dang ky hoac da nhan thuong!")
end
--else
--Talk(1,"no","<color=blue>Le Quan<color>: Khong tim thay du lieu nhan vat")
--end
end




function sdtstl(sel)
Say("<color=blue>Le Quan<color>: Ta co the giup nguoi su dung 2 loai:<color=green>Thien Son Tuyet Lien<color>: tang 2 trung sinh,<color=fire>Thien Son Ngan Nam<color>: 1ty2 kinh nghiem",4,
"Su dung Thien Son Tuyet Lien./sdtstl1",
"Su dung Thien Son Ngan Nam./sdtsnn",
"Tim hieu chi tiet./thct",
"Thoat./no")
end

function thct()
Talk(3,"no","<color=blue>Le Quan<color>: trong qua trinh hoat dong, ta da tim ra 1 phuong thuc bi truyen co the nang cap Thien Son Tuyet Lien de su dung cho cac nhan vat dang cap cao, da trung sinh.",
"<color=blue>Le Quan<color>: Neu nguoi mang den cho ta 1 Linh Chi + 1 Thien Son Tuyet Lien ta se giup nguoi hop thanh",
"<color=blue>Le Quan<color>: tuy nhien moi nhan vat chi co the lanh hoi 1 <color=fire>Thien Son Ngan Nam<color> boi vi loai than duoc nay rat doc hai, lanh hoi thanh cong se nhan duoc 1 ty 2 kinh nghiem")
end

function sdtstl1()
item = GetItemCount(THIENSONTUYETLIEN)
if (item >= 1) then
if GetTask(197) == 0 then
DelItem(THIENSONTUYETLIEN)
if (GetItemCount(THIENSONTUYETLIEN) == (item-1)) then
SetTask(197,GetTask(197)+2)
Talk(1,"KickOutSelf","<color=blue>Le Quan<color>: Ban su dung thanh cong <color=fire>Thien Son Tuyet Lien<color>:\n+Tang 2 lan trung sinh\n+Giu nguyen dang cap")
else
Talk(1,"no","Hack a cung yeu")
end
else
Talk(1,"no","Hien tai <color=green>Thien Son Tuyet Lien<color> chi ap dung doi voi nhan vat chua Trung Sinh")
end
else
Talk(1,"no","<color=blue>Le Quan<color>: Ban can co 1 <color=green>Thien Son Tuyet Lien<color> de su dung")
end
end

function sdtsnn()
tl = GetItemCount(THIENSONNGANNAM)
if (tl >= 1) then
if GetTask(197) >= 3 then
if GetTask(TASKTHIENSONNGANNAM) == 0 then
DelItem(THIENSONNGANNAM)
if (GetItemCount(THIENSONNGANNAM) == (tl-1)) then
AddOwnExp(1200000000)
--chik_AddExp(1200000000) dang li ra cho nay la Ham cong don nhung khong the share :)
SetTask(TASKTHIENSONNGANNAM,1)
Msg2Player("Ban nhan duoc 1 ty 2 kinh nghiem tu Thien Son Ngan Nam")
Talk(1,"KickOutSelf","<color=blue>Le Quan<color>: Su dung thanh cong <color=fire>Thien Son Ngan Nam<color> kinh nghiem gia tang 1.200.000.000")
else
Talk(1,"no","Hack a cung yeu")
end
else
Talk(1,"no","<color=blue>Le Quan<color>: Moi nhan vat chi co the su dung duoc 1 <color=fire>Thien Son Ngan Nam")
end

else
Talk(1,"no","<color=blue>Le Quan<color>: Hien tai <color=green>Thien Son Ngan Nam<color> chi ap dung doi voi nhan vat Trung sinh tu 3 lan tro len!")
end
else
Talk(1,"no","<color=blue>Le Quan<color>: Ban can co 1 <color=green>Thien Son Ngan Nam<color> de su dung")
end
end






function timkiem(ten)
gt = 0
for i = 1,getn(DANH_SACH) do
if DANH_SACH[i] ~= nil then
if DANH_SACH[i][1] == ten then
gt = 1
end
end
end
return gt
end;

function timkiemid(id)
gt = 0
for i = 1,getn(DANH_SACH) do
if DANH_SACH[i] ~= nil then
if DANH_SACH[i][3] == id then
gt = 1
end
end
end
return gt
end;

function xoaso()
for i = 1,getn(DANH_SACH) do
if DANH_SACH[i][1] == GetName() then
filetong = "script/moilam/uplevel/list.lua"
DANH_SACH[i] = nil
danhsachmain = TaoBang(DANH_SACH,"DANH_SACH","")
SaveData(filetong,danhsachmain)
else
Talk(1,"no","Khong tim thay du lieu")
end
end
end


function TaoBang(tTable, sTableName, sTab) --include cua manh tuyen
sTab = sTab or "";
sTmp = ""
sTmp = sTmp..sTab..sTableName.."={"

local tStart = 0
for key, value in tTable do

if tStart == 1 then
sTmp = sTmp..",\r\n"

else
sTmp = sTmp.."\r\n"
tStart = 1
end
local sKey = (type(key) == "string") and format("[%q]",key) or format("[%d]",key);
if(type(value) == "table") then
sTmp = sTmp..TaoBang(value, sKey, sTab.."\t");
else
local sValue = (type(value) == "string") and format("%q",value) or tostring(value);
sTmp = sTmp..sTab.."\t"..sKey.." = "..sValue
end

end
sTmp = sTmp.."\r\n"..sTab.."}"
return sTmp

end

function SaveData(file, string) ---Tuy ngan nhung wan trong nhat >''<
file_op = openfile( file, "w+" ) --- a+ la vit them hem xoa file dau -- w+ -- la che do doc ghi xoa file dau
write(file_op,string)
closefile(file_op)
end


list.lua




DANH_SACH = {
}
Work Tốt Nhất Trên
TÌNH HUYNH ĐỆ Server

jxvietnam
06-11-10, 09:28 PM
thank KIng nhiều nhé:D
thank sandaru luôn vì có công post ^^

quangphong0904
24-11-10, 07:34 PM
củng hay, học hỏi tí chút chơi. :D
mà cái P/S cuối cùng nhìn hơi hơi...........:))

Sir.THÀNH™
13-01-11, 01:45 AM
thiên sơn sự kiện hoạt động ntn vậy