PDA

View Full Version : Giúp tui tý



benop001
12-11-10, 02:11 PM
--description: Le Quan
--author: Tien Dat
--date: 18\10\2010
--==============================================
--==============================================
Include("\\script\\Global\\sourcejx49.lua");

KimBangTinh = 177
MocBangTinh = 178
ThuyBangTinh = 179
HoaBangTinh = 180
ThoBangTinh = 181
NguSacBangTinh = 182
HoangTuyetNhan = 183
TuTuyetNhan = 184
LucTuyetNhan = 185

XUEPHoangTuyetNhan = 10
XUEPTuTuyetNhan = 20
XUEPLucTuyetNhan = 30
XUEPNguSacBangTinh = 40

TIENEPHoangTuyetNhan = 1000000
TIENEPTuTuyetNhan = 2000000
TIENEPLucTuyetNhan = 3000000
TIENEPNguSacBangTinh = 4000000

function NewYear_Main()
SayEx({"<color="..colorS()..">Le Quan<color>: Lua chon:",
"Doi vat pham./Doivatpham",
"Ghep vat pham./tiendat1",
"Dung vat pham./tiendat2",
"Thoat./out"});
end;

function tiendat1()
SayEx({"<color="..colorS()..">Le Quan<color>: Dai hiep muon hop thanh vat pham nao ?",
"Ngu Sac Bang Tinh ./ghep1",
"Luc Tuyet Nhan./ghep2",
"Tu Tuyet Nhan./ghep4",
"Hoang Tuyet Nhan./ghep3",
"Thoat./out"});
end;

function ghep1()
if ( GetItemCount(KimBangTinh) >= 1)
and ( GetItemCount(MocBangTinh) >= 1)
and ( GetItemCount(ThuyBangTinh) >= 1)
and ( GetItemCount(HoaBangTinh) >= 1)
and ( GetItemCount(ThoBangTinh) >= 1) then
DelItem = 177
DelItem = 178
DelItem = 179
DelItem = 180
DelItem = 181
AddEventItem(182)
Msg2Player("Nhan duoc Ngu Sac Bang Tinh .")
else
Talk(1,"","Muon ghep <color=green>Ngu Sac Bang Tinh <color> can <color=yellow>1 Kim Bang Tinh/1 Moc Bang Tinh/1 Thuy Bang Tinh/1 Hoa Bang Tinh/1 Tho Bang Tinh<color> .");
end
end;

function ghep2()
if ( GetItemCount(KimBangTinh) >= 2)
and ( GetItemCount(MocBangTinh) >= 2)
and ( GetItemCount(ThuyBangTinh) >= 2)
and ( GetItemCount(HoaBangTinh) >= 2)
and ( GetItemCount(ThoBangTinh) >= 2) then
DelItem = 177
DelItem = 178
DelItem = 179
DelItem = 180
DelItem = 181
AddEventItem(183)
Msg2Player("Nhan duoc Luc Tuyet Nhan.")
else
Talk(1,"","Muon ghep <color=green>Luc Tuyet Nhan<color> can <color=yellow>2 Kim Bang Tinh/2 Moc Bang Tinh/2 Thuy Bang Tinh/2 Hoa Bang Tinh/2 Tho Bang Tinh<color>. ");
end
end;

function ghep3()
if ( GetItemCount(KimBangTinh) >= 3)
and ( GetItemCount(MocBangTinh) >= 3)
and ( GetItemCount(ThuyBangTinh) >= 3)
and ( GetItemCount(HoaBangTinh) >= 3)
and ( GetItemCount(ThoBangTinh) >= 3) then
DelItem = 177
DelItem = 178
DelItem = 179
DelItem = 180
DelItem = 181
AddEventItem(185)
Msg2Player("Nhan duoc Hoang Tuyet Nhan.")
else
Talk(1,"","Muon ghep <color=green>Hoang Tuyet Nhan<color> can <color=yellow>3 Kim Bang Tinh/3 Moc Bang Tinh/3 Thuy Bang Tinh/3 Hoa Bang Tinh/3 Tho Bang Tinh<color>.");
end
end;


function ghep4()
if ( GetItemCount(KimBangTinh) >= 4)
and ( GetItemCount(MocBangTinh) >= 4)
and ( GetItemCount(ThuyBangTinh) >= 4)
and ( GetItemCount(HoaBangTinh) >= 4)
and ( GetItemCount(ThoBangTinh) >= 4) then
DelItem = 177
DelItem = 178
DelItem = 179
DelItem = 180
DelItem = 181
AddEventItem(184)
Msg2Player("Nhan duoc Tu Tuyet Nhan.")
else
Talk(1,"","Muon ghep <color=green>Tu Tuyet Nhan<color> can <color=yellow>4 Kim Bang Tinh/4 Moc Bang Tinh/4 Thuy Bang Tinh/4 Hoa Bang Tinh/4 Tho Bang Tinh<color>.");
end
end;

function Doivatpham()
SayEx({"<color="..colorS()..">Le Quan<color>: Dai hiep muon doi vat pham nao ?",
"5 Kim BT./doi1",
"5 Moc BT./doi2",
"5 Thuy BT./doi3",
"5 Hoa BT./doi4",
"5 Tho BT./doi5",
"Thoat./out"});
end;

function doi1()
if (GetItemCount(KimBangTinh) >= 5) then
AddOwnExp(50000)
Msg2Player("Ban nhan duoc 50.000 diem kinh nghiem.")
DelItem(KimBangTinh)
DelItem(KimBangTinh)
DelItem(KimBangTinh)
DelItem(KimBangTinh)
DelItem(KimBangTinh)
end;
end;

function doi2()
if (GetItemCount(ThuyBangTinh) >= 5) then
AddOwnExp(50000)
Msg2Player("Ban nhan duoc 50.000 diem kinh nghiem.")
DelItem(ThuyBangTinh)
DelItem(ThuyBangTinh)
DelItem(ThuyBangTinh)
DelItem(ThuyBangTinh)
DelItem(ThuyBangTinh)
else
Msg2Player("Khong tim thay 5 ThuyBangTinh trong hanh trang.")
end
end;

function doi3()
if (GetItemCount(ThoBangTinh) >= 5) then
AddOwnExp(50000)
Msg2Player("Ban nhan duoc 50.000 diem kinh nghiem.")
DelItem(ThoBangTinh)
DelItem(ThoBangTinh)
DelItem(ThoBangTinh)
DelItem(ThoBangTinh)
DelItem(ThoBangTinh)
else
Msg2Player("Khong tim thay 5 ThoBangTinh trong hanh trang.")
end
end;

function doi4()
if (GetItemCount(MocBangTinh) >= 5) then
AddOwnExp(50000)
Msg2Player("Ban nhan duoc 50.000 diem kinh nghiem.")
DelItem(MocBangTinh)
DelItem(MocBangTinh)
DelItem(MocBangTinh)
DelItem(MocBangTinh)
DelItem(MocBangTinh)
else
Msg2Player("Khong tim thay 5 MocBangTinh trong hanh trang.")
end
end;

function doi5()
if (GetItemCount(HoaBangTinh) >= 5) then
AddOwnExp(50000)
Msg2Player("Ban nhan duoc 50.000 diem kinh nghiem.")
DelItem(HoaBangTinh)
DelItem(HoaBangTinh)
DelItem(HoaBangTinh)
DelItem(HoaBangTinh)
DelItem(HoaBangTinh)
else
Msg2Player("Khong tim thay 5 HoaBangTinh trong hanh trang.")
end
end;

function tiendat2()
SayEx({"<color="..colorS()..">Le Quan<color>: Nguoi muon su dung loai vat pham nao ?",
"Ngu Sac Bang Tinh ./b1",
"Luc Tuyet Nhan./b2",
"Tu Tuyet Nhan./b3",
"Hoang Tuyet Nhan./b4",
"Thoat./out"});
end;

function b1()
if (HaveItem(NguSacBangTinh) == 1)then
i = random(0,100)
if (i < 80) then
AddOwnExp(10000000)
Msg2Player("Nhan duoc 10 trieu diem kinh nghiem.")
DelItem(NguSacBangTinh)
elseif (i < 50) then
AddOwnExp(15000000)
Msg2Player("Nhan duoc 15 trieu diem kinh nghiem.")
DelItem(NguSacBangTinh)
elseif (i < 20) then
AddOwnExp(20000000)
Msg2Player("Nhan duoc 20 trieu diem kinh nghiem.")
DelItem(NguSacBangTinh)
end
end;
end;

function b2()
if (HaveItem(LucTuyetNhan) == 1)then
i = random(0,100)
if (i < 80) then
for i=1,100 do AddOwnExp(30000000) end
Msg2Player("Nhan duoc 30 trieu diem kinh nghiem.")
DelItem(LucTuyetNhan)
elseif (i < 50) then
for i=1,100 do AddOwnExp(35000000) end
Msg2Player("Nhan duoc 35 trieu diem kinh nghiem.")
DelItem(LucTuyetNhan)
elseif (i < 20) then
for i=1,100 do AddOwnExp(40000000) end
Msg2Player("Nhan duoc 40 trieu diem kinh nghiem.")
DelItem(LucTuyetNhan)
end
end;
end;

function b3()
if (HaveItem(TuTuyetNhan) == 1)then
i = random(0,100)
if (i < 80) then
for i=1,100 do AddOwnExp(50000000) end
Msg2Player("Nhan duoc 50 trieu diem kinh nghiem.")
DelItem(TuTuyetNhan)
elseif (i < 50) then
for i=1,100 do AddOwnExp(55000000) end
Msg2Player("Nhan duoc 55 trieu diem kinh nghiem.")
DelItem(TuTuyetNhan)
elseif (i < 20) then
for i=1,100 do AddOwnExp(60000000) end
Msg2Player("Nhan duoc 60 trieu diem kinh nghiem.")
DelItem(TuTuyetNhan)
end
end;
end;

function b4()
if (HaveItem(HoangTuyetNhan) == 1)then
i = random(0,100)
if (i < 80) then
for i=1,100 do AddOwnExp(80000000) end
Msg2Player("Nhan duoc 80 trieu diem kinh nghiem.")
DelItem(HoangTuyetNhan)
elseif (i < 50) then
for i=1,100 do AddOwnExp(90000000) end
Msg2Player("Nhan duoc 90 trieu diem kinh nghiem.")
DelItem(HoangTuyetNhan)
elseif (i < 20) then
for i=1,100 do AddOwnExp(100000000) end
Msg2Player("Nhan duoc 1 ty diem kinh nghiem.")
DelItem(HoangTuyetNhan)
end
end;
end;

function out()
end;

cái script này tại sao khi nhận đồ nóa không del mấy cái item nhi~ ~_~

benop001
12-11-10, 02:45 PM
uppppppppppppppppppppppppppppppppppppppppppppppppp p

notfile
12-11-10, 04:13 PM
DelItem = 177
DelItem = 178
DelItem = 179
DelItem = 180
DelItem = 181

Cái này là cái gì hả bạn ?? sai ở chỗ này rồi


KimBangTinh = 177
MocBangTinh = 178
ThuyBangTinh = 179
HoaBangTinh = 180
ThoBangTinh = 181
NguSacBangTinh = 182
HoangTuyetNhan = 183
TuTuyetNhan = 184
LucTuyetNhan = 185

Nếu đặt như này thì

DelItem(TuTuyetNhan)

nó sẽ del cái TuTuyetNhan ( ID 184)

Tất Nhiên Phải Xóa tất cả cái đoạn đầu nhé ( lỗi )