PDA

View Full Version : [KT] Nhận set đồ +12



tkv003
29-05-13, 11:19 AM
Đoạn code dưới đây chỉ cho nhận set đồ chưa cường hóa :

tbGift.tbSetItem = { -- Trang bi +12
{{2,6,161,10}},{2,6,171,10}},{2,6,181,10}},{2,6,19 1,10}},{2,6,201,10}},{2,6,161,10}},{2,6,171,10}},{ 2,6,181,10}},{2,6,191,10}},{2,6,201,10}},},--phu
{{2,7,312,10}},{2,7,332,10}},{2,7,352,10}},{2,7,37 2,10}},{2,7,492,10}},{2,7,322,10}},{2,7,342,10}},{ 2,7,362,10}},{2,7,382,10}},{2,7,402,10}},},--giay
{{2,10,628,10}},{2,10,332,10}},{2,10,652,10}},{2,1 0,372,10}},{2,10,392,10}},{2,10,322,10}},{2,10,342 ,10},{ 2,10,362,10},{2,10,382,10},{2,10,502,10},},--bao tay
{{2,5,160,10},{2,5,170,10},{2,5,180,10},{2,5,190,1 0},{2,5,200,10},{2,5,160,10},{2,5,170,10},{2,5,180 ,10},{2,5,190,10},{2,5,200,10},},--lien
{{2,11,310,10},{2,11,330,10},{2,11,350,10},{2,11,3 70,10},{2,11,390,10},{2,11,320,10},{2,11,340,10},{ 2,11,360,10},{2,11,380,10},{2,11,400,10},},--ngoc boi
{{2,4,160,10},{2,4,170,10},{2,4,180,10},{2,4,190,1 0},{2,4,250,10},{2,4,160,10},{2,4,170,10},{2,4,180 ,10},{2,11,190,10},{2,4,200,10},},--gioi chi
{{2,8,310,10},{2,8,330,10},{2,8,350,10},{2,8,470,1 0},{2,8,390,10},{2,8,320,10},{2,8,340,10},{2,8,360 ,10},{2,8,380,10},{2,8,400,10},},--dai
{{2,3,612,10},{2,3,652,10},{2,3,692,10},{2,3,732,1 0},{2,3,772,10},{2,3,622,10},{2,3,662,10},{2,3,702 ,10},{2,3,742,10},{2,3,802,10},},--ao
{{2,9,610,10},{2,9,650,10},{2,9,690,10},{2,9,730,1 0},{2,9,770,10},{2,9,620,10},{2,9,660,10},{2,9,700 ,10},{2,9,760,10},{2,9,800,10},},--mu
{{2,1,551,10},{2,1,591,10},{2,1,611,10},{2,1,651,1 0},{2,1,691,10},{2,1,551,10},{2,1,591,10},{2,1,611 ,10},{2,1,651,10},{2,1,691,10},},
{{2,1,561,10},{2,1,601,10},{2,1,621,10},{2,1,661,1 0},{2,1,701,10},{2,1,561,10},{2,1,601,10},{2,1,621 ,10},{2,1,661,10},{2,1,701,10},},
{{2,1,571,10},{2,1,981,10},{2,1,631,10},{2,1,671,1 0},{2,1,711,10},{2,1,571,10},{2,1,981,10},{2,1,631 ,10},{2,1,671,10},{2,1,711,10},},
{{2,1,581,10},{2,2,100,10},{2,1,641,10},{2,1,681,1 0},{2,1,721,10},{2,1,581,10},{2,2,100,10},{2,1,641 ,10},{2,1,681,10},{2,1,721,10},},
{{2,1,1172,10},{2,2,90,10},{2,1,811,10},{2,1,851,1 0},{2,1,891,10},{2,1,1172,10},{2,2,90,10},{2,1,811 ,10},{2,1,851,10},{2,1,891,10},},
{{2,1,1145,10},{2,1,911,10},{2,1,1183,10},{2,1,120 8,10},{2,1,1211,10},{2,1,1145,10},{2,1,911,10},{2, 1,1183,10},{2,1,1208,10},{2,1,1211,10},},
}
-------------------------------
function tbGift:TrangBi100(nFlag, nSeries)
local nCount = me.GetTask(self.TASK_GROUP_ID6, self.TaskId_Count);
if nCount >= self.Use_Max then
local szMsg = "<color=yellow>Phần thưởng chỉ nhận được 1 lần :<color>";
local tbOpt = {
{"Bạn đã nhận phần thưởng này rồi..."};
};
Dialog:Say(szMsg, tbOpt);
return 0;
end
if (nCount == 0) then
if not nFlag then
local szMsg = "Nhận trang bị hệ nào?";
local tbOpt = {
{"Hệ Kim",self.TrangBi100,self,1,1},
{"Hệ Mộc",self.TrangBi100,self,1,2},
{"Hệ Thủy",self.TrangBi100,self,1,3},
{"Hệ Hỏa",self.TrangBi100,self,1,4},
{"Hệ Thổ",self.TrangBi100,self,1,5},
}
Dialog:Say(szMsg,tbOpt);
elseif nFlag == 1 then
local szMsg = "Nam hay nữ?";
local tbOpt = {
{"Nam",self.TrangBi100,self,2,nSeries},
{"Nữ",self.TrangBi100,self,2,nSeries+5},
}
Dialog:Say(szMsg,tbOpt);
else
local tbItems = self.tbSetItem;
for i = 1, 15 do
me.AddItem(unpack(tbItems[i][nSeries])).Bind(1);
me.SetTask(self.TASK_GROUP_ID6, self.TaskId_Count, nCount + 1);
end
end
end
end

Nếu mình muốn sửa để nhận set đồ cường hóa + 12, hay +14 thì phải sửa như thế nào ?

satthupro95
29-05-13, 11:23 AM
<b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b>
#7 nha :3

tkv003
29-05-13, 01:38 PM
<b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b>
#7 nha :3

làm y như vậy nhưng có nhận được gì đâu,



tbGift.tbSetItem = { -- Trang bi +12
{{2,6,161,10,nil,12}},{2,6,171,10,nil,12}},{2,6,18 1,10,nil,12}},{2,6,191,10,nil,12}},{2,6,201,10,nil ,12}},{2,6,161,10,nil,12}},{2,6,171,10,nil,12}},{2 ,6,181,10,nil,12}},{2,6,191,10,nil,12}},{2,6,201,1 0,nil,12}},},--phu
{{2,7,312,10,nil,12}},{2,7,332,10,nil,12}},{2,7,35 2,10,nil,12}},{2,7,372,10,nil,12}},{2,7,492,10,nil ,12}},{2,7,322,10,nil,12}},{2,7,342,10,nil,12}},{2 ,7,362,10,nil,12}},{2,7,382,10,nil,12}},{2,7,402,1 0,nil,12}},},--giay
{{2,10,628,10,nil,12}},{2,10,332,10,nil,12}},{2,10 ,652,10,nil,12}},{2,10,372,10,nil,12}},{2,10,392,1 0,nil,12}},{2,10,322,10,nil,12}},{2,10,342,10,nil, 12},{ 2,10,362,10,nil,12},{2,10,382,10,nil,12},{2,10,502 ,10,nil,12},},--bao tay
{{2,5,160,10,nil,12},{2,5,170,10,nil,12},{2,5,180, 10,nil,12},{2,5,190,10,nil,12},{2,5,200,10,nil,12} ,{2,5,160,10,nil,12},{2,5,170,10,nil,12},{2,5,180 ,10,nil,12},{2,5,190,10,nil,12},{2,5,200,10,nil,12 },},--lien
{{2,11,310,10,nil,12},{2,11,330,10,nil,12},{2,11,3 50,10,nil,12},{2,11,370,10,nil,12},{2,11,390,10,ni l,12},{2,11,320,10,nil,12},{2,11,340,10,nil,12},{ 2,11,360,10,nil,12},{2,11,380,10,nil,12},{2,11,400 ,10,nil,12},},--ngoc boi
{{2,4,160,10,nil,12},{2,4,170,10,nil,12},{2,4,180, 10,nil,12},{2,4,190,10,nil,12},{2,4,250,10,nil,12} ,{2,4,160,10,nil,12},{2,4,170,10,nil,12},{2,4,180 ,10,nil,12},{2,11,190,10,nil,12},{2,4,200,10,nil,1 2},},--gioi chi
{{2,8,310,10,nil,12},{2,8,330,10,nil,12},{2,8,350, 10,nil,12},{2,8,470,10,nil,12},{2,8,390,10,nil,12} ,{2,8,320,10,nil,12},{2,8,340,10,nil,12},{2,8,360 ,10,nil,12},{2,8,380,10,nil,12},{2,8,400,10,nil,12 },},--dai
{{2,3,612,10,nil,12},{2,3,652,10,nil,12},{2,3,692, 10,nil,12},{2,3,732,10,nil,12},{2,3,772,10,nil,12} ,{2,3,622,10,nil,12},{2,3,662,10,nil,12},{2,3,702 ,10,nil,12},{2,3,742,10,nil,12},{2,3,802,10,nil,12 },},--ao
{{2,9,610,10,nil,12},{2,9,650,10,nil,12},{2,9,690, 10,nil,12},{2,9,730,10,nil,12},{2,9,770,10,nil,12} ,{2,9,620,10,nil,12},{2,9,660,10,nil,12},{2,9,700 ,10,nil,12},{2,9,760,10,nil,12},{2,9,800,10,nil,12 },},--mu
{{2,1,551,10,nil,12},{2,1,591,10,nil,12},{2,1,611, 10,nil,12},{2,1,651,10,nil,12},{2,1,691,10,nil,12} ,{2,1,551,10,nil,12},{2,1,591,10,nil,12},{2,1,611 ,10,nil,12},{2,1,651,10,nil,12},{2,1,691,10,nil,12 },},
{{2,1,561,10,nil,12},{2,1,601,10,nil,12},{2,1,621, 10,nil,12},{2,1,661,10,nil,12},{2,1,701,10,nil,12} ,{2,1,561,10,nil,12},{2,1,601,10,nil,12},{2,1,621 ,10,nil,12},{2,1,661,10,nil,12},{2,1,701,10,nil,12 },},
{{2,1,571,10,nil,12},{2,1,981,10,nil,12},{2,1,631, 10,nil,12},{2,1,671,10,nil,12},{2,1,711,10,nil,12} ,{2,1,571,10,nil,12},{2,1,981,10,nil,12},{2,1,631 ,10,nil,12},{2,1,671,10,nil,12},{2,1,711,10,nil,12 },},
{{2,1,581,10,nil,12},{2,2,100,10,nil,12},{2,1,641, 10,nil,12},{2,1,681,10,nil,12},{2,1,721,10,nil,12} ,{2,1,581,10,nil,12},{2,2,100,10,nil,12},{2,1,641 ,10,nil,12},{2,1,681,10,nil,12},{2,1,721,10,nil,12 },},
{{2,1,1172,10,nil,12},{2,2,90,10,nil,12},{2,1,811, 10,nil,12},{2,1,851,10,nil,12},{2,1,891,10,nil,12} ,{2,1,1172,10,nil,12},{2,2,90,10,nil,12},{2,1,811 ,10,nil,12},{2,1,851,10,nil,12},{2,1,891,10,nil,12 },},
{{2,1,1145,10,nil,12},{2,1,911,10,nil,12},{2,1,118 3,10,nil,12},{2,1,1208,10,nil,12},{2,1,1211,10,nil ,12},{2,1,1145,10,nil,12},{2,1,911,10,nil,12},{2, 1,1183,10,nil,12},{2,1,1208,10,nil,12},{2,1,1211,1 0,nil,12},},
}


Cái vòng lặp này không hiểu nó có thêm thông số gì vào item hay không



for i = 1, 15 do
me.AddItem(unpack(tbItems[i][nSeries])).Bind(1);
me.SetTask(self.TASK_GROUP_ID6, self.TaskId_Count, nCount + 1);
end

vipbk
29-05-13, 08:32 PM
để ý vị trí thứ 3 (particular) có quy luật, dựa vào đó viết code sẽ đơn giản, đỡ dài dòng
161 - 171 - 181 ...

thanhdinh10
02-06-13, 10:14 AM
mình làm như thế này ko biết có đúng ko: mình tạo thêm 1 file tmpnpc.lua rồi dùng chức năng GM để nhận đồ random theo hệ phái. Đồ gì thì chỉnh trong file tmpnpc.lua ấy và cho hàm check nhận 1 lần. Rồi tạo 1 hàm để nhận đồ này trong túi tân thủ
8-} ko biết nghịch nên làm lung tung. hehe