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 ?
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 ?