[KT] Hỏi về scrip nhận Item
Hello & Welcome to our community. Is this your first visit? Đăng Ký
Follow us on
Follow us on Facebook Follow us on Twitter Linked In Flickr Watch us on YouTube My Space Blogger
 
Kết quả 1 đến 10 của 10
  1. #1
    Thành Viên
    Ngày tham gia
    Feb 2012
    Bài viết
    35
    Thanks
    21
    Thanked 16 Times in 12 Posts

    Hỏi về scrip nhận Item

    Mình muốn hỏi xem cách để viết scrip nhận thưởng trong túi tân thủ sao cho trang bị chỉ được nhận một lần, không thể nhận lại sau đó được. Ai biết giúp mình với!
    Khách viếng thăm hãy cùng knighterrant xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  2. #2
    Thành Viên Tâm Huyết tuidangvui's Avatar
    Ngày tham gia
    Mar 2009
    Bài viết
    715
    Thanks
    114
    Thanked 477 Times in 243 Posts

    Ðề: Hỏi về scrip nhận Item

    Trích dẫn Gửi bởi knighterrant [Only registered and activated users can see links. ]
    Mình muốn hỏi xem cách để viết scrip nhận thưởng trong túi tân thủ sao cho trang bị chỉ được nhận một lần, không thể nhận lại sau đó được. Ai biết giúp mình với!
    Code:
    local tbNkt	= Npc:GetClass("nhatkiemthe");
    
    
    local nLevel1 = 80;
    local nLevel2 = 100;
    local nMoney = 50000000;
    local nDongK = 5000000;
    local nTinhH = 100000;
    local tbCuoi = {1, 12, 10, 4};
    local tbNhht = {18, 1, 244, 2};
    local tbTui24 = {
    	{21, 9, 8, 1},
    	{21, 9, 9, 1},
    	{21, 9, 10, 1},
    };
    local tbAnmax = {1, 16, 13, 2};
    local tbRgVoso = {18, 1, 338, 1};
    local tbMathat = {18, 1, 524, 1};
    local nMathat = 20;
    
    
    local tbBicanh = {18, 1, 251, 1};
    
    
    local TASK_GROUP_ID = 3000;
    local TASK_LEVEL = 1;
    local TASK_MONEY = 2;
    local TASK_DONGK = 3;
    local TASK_TINHH = 4;
    local TASK_TCUOI = 5;
    local TASK_NHHTK = 6;
    local TASK_DNGAY = 7;
    local TASK_TUI24 = 8;
    local TASK_ANMAX = 9;
    local TASK_RVOSO = 10;
    local TASK_MATTH = 11;
    
    
    local TASK_NONNAM = 12;
    
    
    local TASK_BCANH = 13;
    
    
    local TASK_AONAM = 14;
    
    
    local TASK_GM = 15;
    
    
    local TASK_LUNGNAM = 16;
    local TASK_NHANDO = 17;
    
    
    local TASK_TAYNAM = 18;
    local TASK_MTCC = 19;
    
    
    local TASK_GIAYNAM = 20;
    local TASK_GIAYNU = 21;
    
    
    local TASK_LIENNAM = 22;
    local TASK_LIENNU = 23;
    
    
    local TASK_NHANNAM = 24;
    local TASK_NHANNU = 25;
    
    
    local TASK_BOINAM = 26;
    local TASK_BOINU = 27;
    
    
    local TASK_PHUNAM = 28;
    local TASK_PHUNU = 29;
    
    
    local TASK_VUKHI = 30;
    
    
    function tbNkt:OnDialog()
    	local szMsg = "Xin chào, bạn đang tham gia trò chơi Kiếm Thế của NKT.\nĐây là phiên bản không chính thức, Bản quyền trò chơi công ty Kingsoft.\nCông ty Cổ phần VNG phân phối duy nhất tại Việt Nam.";
    	local tbOpt = {};
    	local bLevel = 0;
    	local nNowDate = tonumber(GetLocalDate("%y%m%d"));
    	local nTrangbi = 0;
    	local nYeucau = 10 < me.nLevel;
    
    
    	if (not nYeucau) then
    		szMsg = szMsg.."\nBạn phải trên cấp 10 mới được nhận quà";
    	end
    
    
    	if nYeucau and (nDate ~= nNowDate) then
    		table.insert(tbOpt, {"<color=yellow>Quà tặng hàng ngày (giới hạn theo cấp)<color>", self.KichHoatNgay, self, nNowDate});
    	end
    
    
    	if nYeucau and (nTrangbi < 11) then
    		if (me.nLevel < nLevel2) then
    			table.insert(tbOpt, {"Nhận set đồ 8x 4%", self.TakeSetDo, self, 8});
    		else
    			table.insert(tbOpt, {"Nhận set đồ 10x 4%", self.TakeSetDo, self, 10});
    		end
    	end
    
    
    	if nYeucau and (me.nLevel < nLevel2) then
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_LEVEL) or 0;
    		if (bLevel == 0 or me.nLevel < nLevel1) then
    			table.insert(tbOpt, {"Nhận kinh nghiệm cấp: <color=yellow>"..nLevel1.."<color>", self.TakeLevel, self, nLevel1});
    			table.insert(tbOpt, {"Nhận kinh nghiệm cấp: <color=yellow>"..nLevel2.."<color>", self.TakeLevel, self, nLevel2});
    		elseif (bLevel < nLevel2) then
    			table.insert(tbOpt, {"Nhận kinh nghiệm cấp: <color=yellow>"..nLevel2.."<color>", self.TakeLevel, self, nLevel2});
    		end
    	end
    
    
    	if nYeucau and (me.nLevel >= nLevel1) then
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_MONEY) or 0;
    		if (bLevel == 0) then
    			table.insert(tbOpt, {"Nhận Bạc - Bạc khóa: <color=yellow>"..Lib:FormatMoney(nMoney).."<color>", self.TakeMoney, self});
    		end
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_DONGK) or 0;
    		if (bLevel == 0) then
    			table.insert(tbOpt, {"Nhận Đồng - Đồng khóa: <color=yellow>"..Lib:FormatMoney(nDongK).."<color>", self.TakeDongK, self});
    		end
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_TINHH) or 0;
    		if (bLevel == 0) then
    			table.insert(tbOpt, {"Nhận Tinh - Hoạt lực: <color=yellow>"..nTinhH.."<color>", self.TakeTinhH, self});
    		end
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_TCUOI) or 0;
    		if (bLevel == 0) then
    			table.insert(tbOpt, {"Nhận: <color=yellow>"..KItem.GetNameById(unpack(tbCuoi)).."<color>", self.TakeTcuoi, self});
    		end
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_NHHTK) or 0;
    		if (bLevel == 0) then
    			table.insert(tbOpt, {"Nhận: <color=yellow>Vật phẩm nhiệm vụ skill 11x<color>", self.TakeNhhtK, self});
    		end
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_TUI24) or 0;
    		if (bLevel == 0) then
    			table.insert(tbOpt, {"Nhận: <color=yellow>Túi 24 ô<color>", self.TakeTui24, self});
    		end
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_ANMAX) or 0;
    		if (bLevel == 0) then
    			table.insert(tbOpt, {"Nhận: <color=yellow>"..KItem.GetNameById(unpack(tbAnmax)).."<color>", self.TakeAnmax, self});
    		end
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_MATTH) or 0;
    		if (bLevel == 0) then
    			table.insert(tbOpt, {"Nhận: <color=yellow>"..KItem.GetNameById(unpack(tbMathat)).."<color>", self.TakeMatThat, self});
    		end
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_RVOSO) or 0;
    		if (bLevel == 0) then
    			table.insert(tbOpt, {"Nhận: <color=yellow>"..KItem.GetNameById(unpack(tbRgVoso)).."<color>", self.TakeRgVoso, self});
    		end
    	end
    
    
    	Dialog:Say(szMsg, tbOpt);
    end
    
    
    function tbNkt:TakeSetDo(nCap)
    	if me.nFaction <= 0 then
    		Dialog:Say("Nhật Kiếm Thế mỉm cười: Tên chữ trắng cũng muốn nhận? Hãy gia nhập phái nào đó trước khi đến đây!", {"Tôi biết"});
    		return;
    	end
    
    
    	local tbOpt = {};
    	local bLevel = 0;
    	
    	local tbItemInfo = {};
    	tbItemInfo.nSeries		= Env.SERIES_NONE;
    	tbItemInfo.nEnhTimes	= 0;
    	tbItemInfo.nLucky		= 0;
    	tbItemInfo.tbGenInfo	= nil;
    	tbItemInfo.tbRandomInfo	= nil;
    	tbItemInfo.nVersion		= 0;
    	tbItemInfo.uRandSeed	= 0;
    	tbItemInfo.bForceBind	= 1;
    
    
    	local szMonphai = Player:GetFactionRouteName(me.nFaction, me.nRouteId);
    	local szMsg = "Xin chào, "..szMonphai.." nhận đồ nek";
    
    
    	local nMonphai = me.GetTask(TASK_GROUP_ID, me.nFaction + 30) or 0;
    	bLevel = me.GetTask(TASK_GROUP_ID, TASK_MTCC) or 0;
    	if (nMonphai == 0) then
    		local tbGif = nil;
    		local tbFile = Lib:LoadTabFile("\\setting\\nkt\\mtcc.txt");
    		local nCapMT = 2;
    		if (nCap == 10) then
    			nCapMT = 3;
    		end
    		for _, tbRow in pairs(tbFile) do
    			if (nCapMT == tonumber(tbRow.Level) and me.nFaction == tonumber(tbRow.Series) and me.nRouteId == tonumber(tbRow.ReqProp2Value)) then
    				tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType), tonumber(tbRow.Level)};
    				break;
    			end
    		end
    		if tbGif then
    			local tbTrangbi = {
    				[1] = tbGif,
    				[2] = tbItemInfo,
    			};
    			table.insert(tbOpt, {"Nhận MTCC: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, me.nFaction + 30});
    		end
    	end
    
    
    	bLevel = me.GetTask(TASK_GROUP_ID, TASK_VUKHI) or 0;
    	if (bLevel == 0) then
    		local tbGif = nil;
    		local tbFile = Lib:LoadTabFile("\\setting\\nkt\\vukhi.txt");
    		for _, tbRow in pairs(tbFile) do
    			me.Msg(szMonphai.." - "..me.nFaction.." - "..me.nRouteId);
    			if (nCap == tonumber(tbRow.Level) and me.nFaction == tonumber(tbRow.Series) and me.nRouteId == tonumber(tbRow.ReqProp2Value)) then
    				me.Msg(szMonphai.." - "..me.nFaction.." - "..me.nRouteId);
    				tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType), tonumber(tbRow.Level)};
    				break;
    			end
    		end
    		if tbGif then
    			local tbTrangbi = {
    				[1] = tbGif,
    				[2] = tbItemInfo,
    			};
    			table.insert(tbOpt, {"VK: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_VUKHI});
    		end
    	end
    
    
    	bLevel = me.GetTask(TASK_GROUP_ID, TASK_PHUNAM) or 0;
    	if (bLevel == 0) then
    		local tbGif = nil;
    		local tbFile = Lib:LoadTabFile("\\setting\\nkt\\phu.txt");
    		for _, tbRow in pairs(tbFile) do
    			if (nCap == tonumber(tbRow.Level) and me.nSeries == tonumber(tbRow.Series)) then
    				tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType), tonumber(tbRow.Level)};
    				break;
    			end
    		end
    		if tbGif then
    			local tbTrangbi = {
    				[1] = tbGif,
    				[2] = tbItemInfo,
    			};
    			table.insert(tbOpt, {"Phù: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_PHUNAM});
    		end
    	end
    
    
    	bLevel = me.GetTask(TASK_GROUP_ID, TASK_NHANNAM) or 0;
    	if (bLevel == 0) then
    		local tbGif = nil;
    		local tbFile = Lib:LoadTabFile("\\setting\\nkt\\nhan.txt");
    		for _, tbRow in pairs(tbFile) do
    			if (nCap == tonumber(tbRow.Level) and me.nSeries == tonumber(tbRow.Series)) then
    				tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType), tonumber(tbRow.Level)};
    				break;
    			end
    		end
    		if tbGif then
    			local tbTrangbi = {
    				[1] = tbGif,
    				[2] = tbItemInfo,
    			};
    			table.insert(tbOpt, {"Nhẫn: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_NHANNAM});
    		end
    	end
    
    
    	bLevel = me.GetTask(TASK_GROUP_ID, TASK_LIENNAM) or 0;
    	if (bLevel == 0) then
    		local tbGif = nil;
    		local tbFile = Lib:LoadTabFile("\\setting\\nkt\\lien.txt");
    		for _, tbRow in pairs(tbFile) do
    			if (nCap == tonumber(tbRow.Level) and me.nSeries == tonumber(tbRow.Series)) then
    				tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType), tonumber(tbRow.Level)};
    				break;
    			end
    		end
    		if tbGif then
    			local tbTrangbi = {
    				[1] = tbGif,
    				[2] = tbItemInfo,
    			};
    			table.insert(tbOpt, {"Liên: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_LIENNAM});
    		end
    	end
    
    
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_NONNAM) or 0;
    		if (bLevel == 0) then
    			local tbGif = nil;
    			local tbFile = Lib:LoadTabFile("\\setting\\nkt\\non.txt");
    			for _, tbRow in pairs(tbFile) do
    				if (nCap == tonumber(tbRow.Level) and me.nSex == tonumber(tbRow.ReqProp2Value) and me.nSeries == tonumber(tbRow.Series)) then
    					tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType), tonumber(tbRow.Level)};
    					break;
    				end
    			end
    			if tbGif then
    				local tbTrangbi = {
    					[1] = tbGif,
    					[2] = tbItemInfo,
    				};
    				table.insert(tbOpt, {"Nón: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_NONNAM});
    			end
    		end
    
    
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_AONAM) or 0;
    		if (bLevel == 0) then
    			local tbGif = nil;
    			local tbFile = Lib:LoadTabFile("\\setting\\nkt\\ao.txt");
    			for _, tbRow in pairs(tbFile) do
    				if (nCap == tonumber(tbRow.Level) and me.nSex == tonumber(tbRow.ReqProp2Value) and me.nSeries == tonumber(tbRow.Series)) then
    					tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType), tonumber(tbRow.Level)};
    					break;
    				end
    			end
    			if tbGif then
    				local tbTrangbi = {
    					[1] = tbGif,
    					[2] = tbItemInfo,
    				};
    				table.insert(tbOpt, {"Áo: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_AONAM});
    			end
    		end
    
    
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_LUNGNAM) or 0;
    		if (bLevel == 0) then
    			local tbGif = nil;
    			local tbFile = Lib:LoadTabFile("\\setting\\nkt\\lung.txt");
    			for _, tbRow in pairs(tbFile) do
    				if (nCap == tonumber(tbRow.Level) and me.nSex == tonumber(tbRow.ReqProp2Value) and me.nSeries == tonumber(tbRow.Series)) then
    					tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType), tonumber(tbRow.Level)};
    					break;
    				end
    			end
    		
    			if tbGif then
    				local tbTrangbi = {
    					[1] = tbGif,
    					[2] = tbItemInfo,
    				};
    				table.insert(tbOpt, {"Lưng: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_LUNGNAM});
    			end
    		end
    
    
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_TAYNAM) or 0;
    		if (bLevel == 0) then
    			local tbGif = nil;
    			local tbFile = Lib:LoadTabFile("\\setting\\nkt\\tay.txt");
    			for _, tbRow in pairs(tbFile) do
    				if (nCap == tonumber(tbRow.Level) and me.nSex == tonumber(tbRow.ReqProp2Value) and me.nSeries == tonumber(tbRow.Series)) then
    					tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType), tonumber(tbRow.Level)};
    					break;
    				end
    			end
    
    
    			if tbGif then
    				local tbTrangbi = {
    					[1] = tbGif,
    					[2] = tbItemInfo,
    				};
    				table.insert(tbOpt, {"Tay: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_TAYNAM});
    			end
    		end
    
    
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_GIAYNAM) or 0;
    		if (bLevel == 0) then
    			local tbGif = nil;
    			local tbFile = Lib:LoadTabFile("\\setting\\nkt\\giay.txt");
    			for _, tbRow in pairs(tbFile) do
    				if nCap == tonumber(tbRow.Level) and me.nSex == tonumber(tbRow.ReqProp2Value) and me.nSeries == tonumber(tbRow.Series) then
    					tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType),  tonumber(tbRow.Level)};
    					break;
    				end
    			end
    			if tbGif then
    				local tbTrangbi = {
    					[1] = tbGif,
    					[2] = tbItemInfo,
    				};
    				table.insert(tbOpt, {"Giày: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_GIAYNAM});
    			end
    		end
    
    
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_BOINAM) or 0;
    		if (bLevel == 0) then
    			local tbGif = nil;
    			local tbFile = Lib:LoadTabFile("\\setting\\nkt\\boi.txt");
    			for _, tbRow in pairs(tbFile) do
    				if nCap == tonumber(tbRow.Level) and me.nSex == tonumber(tbRow.ReqProp2Value) and me.nSeries == tonumber(tbRow.Series) then
    					tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType),  tonumber(tbRow.Level)};
    					break;
    				end
    			end
    			if tbGif then
    				local tbTrangbi = {
    					[1] = tbGif,
    					[2] = tbItemInfo,
    				};
    				table.insert(tbOpt, {"Bội: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_BOINAM});
    			end
    		end
    	
    	Dialog:Say(szMsg, tbOpt);
    end
    
    
    function tbNkt:TakeTrangbi(tbItemGif, idTask)
    	if (me.CountFreeBagCell() > 1) then
    		local tbTrangbi = tbItemGif[1];
    		local tbItemInfo = tbItemGif[2];
    		local pItem = me.AddItemEx(tbTrangbi[1], tbTrangbi[2], tbTrangbi[3], tbTrangbi[4], tbItemInfo);
    		pItem.Sync();
    		me.SetTask(TASK_GROUP_ID, idTask, 1);
    		me.Msg("Nhận thưởng thành công");
    	end
    	return 0;
    end
    
    
    function tbNkt:TakeLevel(nLevel)
    	me.AddLevel(nLevel - me.nLevel);
    	me.SetTask(TASK_GROUP_ID, TASK_LEVEL, nLevel);
    	return 0;
    end
    
    
    function tbNkt:KichHoatNgay(nNowDate)
    	local nRate = me.nLevel / 10000;
    	if (me.CountFreeBagCell() > nMathat) then
    		me.SetTask(TASK_GROUP_ID, TASK_DNGAY, nNowDate);
    		me.Earn(nMoney * nRate, 0);
    		me.AddBindMoney(nMoney * nRate);
    		me.AddBindCoin(nDongK * nRate);
    		local pItem = me.AddItem(unpack(tbBicanh));
    		pItem.Bind(1);
    		pItem.Sync();
    		for i = 1, nMathat do
    			local pItem = me.AddItem(unpack(tbMathat));
    			pItem.Bind(1);
    			pItem.Sync();
    		end
    		me.Msg("Nhận thưởng thành công");
    	end
    	return 0;
    end
    
    
    function tbNkt:TakeMatThat()
    	if (me.CountFreeBagCell() > nMathat) then
    		for i = 1, nMathat do
    			local pItem = me.AddItem(unpack(tbMathat));
    			pItem.Bind(1);
    			pItem.Sync();
    		end
    		me.SetTask(TASK_GROUP_ID, TASK_MATTH, 1);
    		me.Msg("Nhận thưởng thành công");
    	end
    	return 0;
    end
    
    
    function tbNkt:TakeRgVoso()
    	if (me.CountFreeBagCell() > 1) then
    		local pItem = me.AddItem(unpack(tbRgVoso));
    		pItem.Bind(1);
    		pItem.Sync();
    		me.SetTask(TASK_GROUP_ID, TASK_RVOSO, 1);
    		me.Msg("Nhận thưởng thành công");
    	end
    	return 0;
    end
    
    
    function tbNkt:TakeMoney()
    	me.Earn(nMoney, 0);
    	me.AddBindMoney(nMoney);
    	me.SetTask(TASK_GROUP_ID, TASK_MONEY, 1);
    	return 0;
    end
    
    
    function tbNkt:TakeDongK()
    	me.AddBindCoin(nDongK);
    	me.SetTask(TASK_GROUP_ID, TASK_DONGK, 1);
    	return 0;
    end
    
    
    function tbNkt:TakeTinhH()
    	me.ChangeCurMakePoint(nTinhH);
    	me.ChangeCurGatherPoint(nTinhH);
    	me.SetTask(TASK_GROUP_ID, TASK_TINHH, 1);
    	return 0;
    end
    
    
    function tbNkt:TakeTcuoi()
    	if (me.CountFreeBagCell() > 1) then
    		local pItem = me.AddItem(unpack(tbCuoi));
    		pItem.Bind(1);
    		pItem.Sync();
    		me.SetTask(TASK_GROUP_ID, TASK_TCUOI, 1);
    		me.Msg("Nhận thưởng thành công");
    	end
    	return 0;
    end
    
    
    function tbNkt:TakeNhhtK()
    	if (me.CountFreeBagCell() > 11) then
    		for i = 1, 5 do
    			local pItem = me.AddItem(18, 1, 200, 1);
    			pItem.Bind(1);
    			pItem.Sync();
    		end
    		for i = 1, 5 do
    			local pItem = me.AddItem(18, 1, 263, 1);
    			pItem.Bind(1);
    			pItem.Sync();
    		end
    		local pItem = me.AddItem(unpack(tbNhht));
    		pItem.Bind(1);
    		pItem.Sync();
    		me.SetTask(TASK_GROUP_ID, TASK_NHHTK, 1);
    		me.Msg("Nhận thưởng thành công");
    	end
    	return 0;
    end
    
    
    function tbNkt:TakeTui24()
    	if (me.CountFreeBagCell() > 3) then
    		for _, tbTui in ipairs(tbTui24) do
    			local pItem = me.AddItem(unpack(tbTui));
    			pItem.Bind(1);
    			pItem.Sync();
    		end
    		me.SetTask(TASK_GROUP_ID, TASK_TUI24, 1);
    		me.Msg("Nhận thưởng thành công");
    	end
    	return 0;
    end
    
    
    function tbNkt:TakeAnmax()
    	if (me.CountFreeBagCell() > 1) then
    		local pItem = me.AddItem(unpack(tbAnmax));
    		pItem.Sync();
    		me.SetTask(TASK_GROUP_ID, TASK_ANMAX, 1);
    		me.Msg("Nhận thưởng thành công");
    	end
    	return 0;
    end
    Khách viếng thăm hãy cùng tuidangvui xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  3. #3
    Moderator vipbk's Avatar
    Ngày tham gia
    May 2012
    Đang ở
    đây
    Bài viết
    5,112
    Thanks
    248
    Thanked 3,006 Times in 1,888 Posts

    Ðề: Hỏi về scrip nhận Item

    Đặt CODE vào thẻ SPOILER bạn nhé
    Khách viếng thăm hãy cùng vipbk xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  4. #4
    Vi phạm quy định VNGameZoneVN's Avatar
    Ngày tham gia
    Mar 2012
    Đang ở
    https://t.me*********
    Bài viết
    427
    Thanks
    202
    Thanked 564 Times in 74 Posts

    Ðề: Hỏi về scrip nhận Item

    Trích dẫn Gửi bởi tuidangvui [Only registered and activated users can see links. ]
    Code:
    local tbNkt	= Npc:GetClass("nhatkiemthe");
    
    
    local nLevel1 = 80;
    local nLevel2 = 100;
    local nMoney = 50000000;
    local nDongK = 5000000;
    local nTinhH = 100000;
    local tbCuoi = {1, 12, 10, 4};
    local tbNhht = {18, 1, 244, 2};
    local tbTui24 = {
    	{21, 9, 8, 1},
    	{21, 9, 9, 1},
    	{21, 9, 10, 1},
    };
    local tbAnmax = {1, 16, 13, 2};
    local tbRgVoso = {18, 1, 338, 1};
    local tbMathat = {18, 1, 524, 1};
    local nMathat = 20;
    
    
    local tbBicanh = {18, 1, 251, 1};
    
    
    local TASK_GROUP_ID = 3000;
    local TASK_LEVEL = 1;
    local TASK_MONEY = 2;
    local TASK_DONGK = 3;
    local TASK_TINHH = 4;
    local TASK_TCUOI = 5;
    local TASK_NHHTK = 6;
    local TASK_DNGAY = 7;
    local TASK_TUI24 = 8;
    local TASK_ANMAX = 9;
    local TASK_RVOSO = 10;
    local TASK_MATTH = 11;
    
    
    local TASK_NONNAM = 12;
    
    
    local TASK_BCANH = 13;
    
    
    local TASK_AONAM = 14;
    
    
    local TASK_GM = 15;
    
    
    local TASK_LUNGNAM = 16;
    local TASK_NHANDO = 17;
    
    
    local TASK_TAYNAM = 18;
    local TASK_MTCC = 19;
    
    
    local TASK_GIAYNAM = 20;
    local TASK_GIAYNU = 21;
    
    
    local TASK_LIENNAM = 22;
    local TASK_LIENNU = 23;
    
    
    local TASK_NHANNAM = 24;
    local TASK_NHANNU = 25;
    
    
    local TASK_BOINAM = 26;
    local TASK_BOINU = 27;
    
    
    local TASK_PHUNAM = 28;
    local TASK_PHUNU = 29;
    
    
    local TASK_VUKHI = 30;
    
    
    function tbNkt:OnDialog()
    	local szMsg = "Xin chào, bạn đang tham gia trò chơi Kiếm Thế của NKT.\nĐây là phiên bản không chính thức, Bản quyền trò chơi công ty Kingsoft.\nCông ty Cổ phần VNG phân phối duy nhất tại Việt Nam.";
    	local tbOpt = {};
    	local bLevel = 0;
    	local nNowDate = tonumber(GetLocalDate("%y%m%d"));
    	local nTrangbi = 0;
    	local nYeucau = 10 < me.nLevel;
    
    
    	if (not nYeucau) then
    		szMsg = szMsg.."\nBạn phải trên cấp 10 mới được nhận quà";
    	end
    
    
    	if nYeucau and (nDate ~= nNowDate) then
    		table.insert(tbOpt, {"<color=yellow>Quà tặng hàng ngày (giới hạn theo cấp)<color>", self.KichHoatNgay, self, nNowDate});
    	end
    
    
    	if nYeucau and (nTrangbi < 11) then
    		if (me.nLevel < nLevel2) then
    			table.insert(tbOpt, {"Nhận set đồ 8x 4%", self.TakeSetDo, self, 8});
    		else
    			table.insert(tbOpt, {"Nhận set đồ 10x 4%", self.TakeSetDo, self, 10});
    		end
    	end
    
    
    	if nYeucau and (me.nLevel < nLevel2) then
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_LEVEL) or 0;
    		if (bLevel == 0 or me.nLevel < nLevel1) then
    			table.insert(tbOpt, {"Nhận kinh nghiệm cấp: <color=yellow>"..nLevel1.."<color>", self.TakeLevel, self, nLevel1});
    			table.insert(tbOpt, {"Nhận kinh nghiệm cấp: <color=yellow>"..nLevel2.."<color>", self.TakeLevel, self, nLevel2});
    		elseif (bLevel < nLevel2) then
    			table.insert(tbOpt, {"Nhận kinh nghiệm cấp: <color=yellow>"..nLevel2.."<color>", self.TakeLevel, self, nLevel2});
    		end
    	end
    
    
    	if nYeucau and (me.nLevel >= nLevel1) then
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_MONEY) or 0;
    		if (bLevel == 0) then
    			table.insert(tbOpt, {"Nhận Bạc - Bạc khóa: <color=yellow>"..Lib:FormatMoney(nMoney).."<color>", self.TakeMoney, self});
    		end
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_DONGK) or 0;
    		if (bLevel == 0) then
    			table.insert(tbOpt, {"Nhận Đồng - Đồng khóa: <color=yellow>"..Lib:FormatMoney(nDongK).."<color>", self.TakeDongK, self});
    		end
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_TINHH) or 0;
    		if (bLevel == 0) then
    			table.insert(tbOpt, {"Nhận Tinh - Hoạt lực: <color=yellow>"..nTinhH.."<color>", self.TakeTinhH, self});
    		end
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_TCUOI) or 0;
    		if (bLevel == 0) then
    			table.insert(tbOpt, {"Nhận: <color=yellow>"..KItem.GetNameById(unpack(tbCuoi)).."<color>", self.TakeTcuoi, self});
    		end
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_NHHTK) or 0;
    		if (bLevel == 0) then
    			table.insert(tbOpt, {"Nhận: <color=yellow>Vật phẩm nhiệm vụ skill 11x<color>", self.TakeNhhtK, self});
    		end
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_TUI24) or 0;
    		if (bLevel == 0) then
    			table.insert(tbOpt, {"Nhận: <color=yellow>Túi 24 ô<color>", self.TakeTui24, self});
    		end
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_ANMAX) or 0;
    		if (bLevel == 0) then
    			table.insert(tbOpt, {"Nhận: <color=yellow>"..KItem.GetNameById(unpack(tbAnmax)).."<color>", self.TakeAnmax, self});
    		end
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_MATTH) or 0;
    		if (bLevel == 0) then
    			table.insert(tbOpt, {"Nhận: <color=yellow>"..KItem.GetNameById(unpack(tbMathat)).."<color>", self.TakeMatThat, self});
    		end
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_RVOSO) or 0;
    		if (bLevel == 0) then
    			table.insert(tbOpt, {"Nhận: <color=yellow>"..KItem.GetNameById(unpack(tbRgVoso)).."<color>", self.TakeRgVoso, self});
    		end
    	end
    
    
    	Dialog:Say(szMsg, tbOpt);
    end
    
    
    function tbNkt:TakeSetDo(nCap)
    	if me.nFaction <= 0 then
    		Dialog:Say("Nhật Kiếm Thế mỉm cười: Tên chữ trắng cũng muốn nhận? Hãy gia nhập phái nào đó trước khi đến đây!", {"Tôi biết"});
    		return;
    	end
    
    
    	local tbOpt = {};
    	local bLevel = 0;
    	
    	local tbItemInfo = {};
    	tbItemInfo.nSeries		= Env.SERIES_NONE;
    	tbItemInfo.nEnhTimes	= 0;
    	tbItemInfo.nLucky		= 0;
    	tbItemInfo.tbGenInfo	= nil;
    	tbItemInfo.tbRandomInfo	= nil;
    	tbItemInfo.nVersion		= 0;
    	tbItemInfo.uRandSeed	= 0;
    	tbItemInfo.bForceBind	= 1;
    
    
    	local szMonphai = Player:GetFactionRouteName(me.nFaction, me.nRouteId);
    	local szMsg = "Xin chào, "..szMonphai.." nhận đồ nek";
    
    
    	local nMonphai = me.GetTask(TASK_GROUP_ID, me.nFaction + 30) or 0;
    	bLevel = me.GetTask(TASK_GROUP_ID, TASK_MTCC) or 0;
    	if (nMonphai == 0) then
    		local tbGif = nil;
    		local tbFile = Lib:LoadTabFile("\\setting\\nkt\\mtcc.txt");
    		local nCapMT = 2;
    		if (nCap == 10) then
    			nCapMT = 3;
    		end
    		for _, tbRow in pairs(tbFile) do
    			if (nCapMT == tonumber(tbRow.Level) and me.nFaction == tonumber(tbRow.Series) and me.nRouteId == tonumber(tbRow.ReqProp2Value)) then
    				tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType), tonumber(tbRow.Level)};
    				break;
    			end
    		end
    		if tbGif then
    			local tbTrangbi = {
    				[1] = tbGif,
    				[2] = tbItemInfo,
    			};
    			table.insert(tbOpt, {"Nhận MTCC: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, me.nFaction + 30});
    		end
    	end
    
    
    	bLevel = me.GetTask(TASK_GROUP_ID, TASK_VUKHI) or 0;
    	if (bLevel == 0) then
    		local tbGif = nil;
    		local tbFile = Lib:LoadTabFile("\\setting\\nkt\\vukhi.txt");
    		for _, tbRow in pairs(tbFile) do
    			me.Msg(szMonphai.." - "..me.nFaction.." - "..me.nRouteId);
    			if (nCap == tonumber(tbRow.Level) and me.nFaction == tonumber(tbRow.Series) and me.nRouteId == tonumber(tbRow.ReqProp2Value)) then
    				me.Msg(szMonphai.." - "..me.nFaction.." - "..me.nRouteId);
    				tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType), tonumber(tbRow.Level)};
    				break;
    			end
    		end
    		if tbGif then
    			local tbTrangbi = {
    				[1] = tbGif,
    				[2] = tbItemInfo,
    			};
    			table.insert(tbOpt, {"VK: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_VUKHI});
    		end
    	end
    
    
    	bLevel = me.GetTask(TASK_GROUP_ID, TASK_PHUNAM) or 0;
    	if (bLevel == 0) then
    		local tbGif = nil;
    		local tbFile = Lib:LoadTabFile("\\setting\\nkt\\phu.txt");
    		for _, tbRow in pairs(tbFile) do
    			if (nCap == tonumber(tbRow.Level) and me.nSeries == tonumber(tbRow.Series)) then
    				tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType), tonumber(tbRow.Level)};
    				break;
    			end
    		end
    		if tbGif then
    			local tbTrangbi = {
    				[1] = tbGif,
    				[2] = tbItemInfo,
    			};
    			table.insert(tbOpt, {"Phù: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_PHUNAM});
    		end
    	end
    
    
    	bLevel = me.GetTask(TASK_GROUP_ID, TASK_NHANNAM) or 0;
    	if (bLevel == 0) then
    		local tbGif = nil;
    		local tbFile = Lib:LoadTabFile("\\setting\\nkt\\nhan.txt");
    		for _, tbRow in pairs(tbFile) do
    			if (nCap == tonumber(tbRow.Level) and me.nSeries == tonumber(tbRow.Series)) then
    				tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType), tonumber(tbRow.Level)};
    				break;
    			end
    		end
    		if tbGif then
    			local tbTrangbi = {
    				[1] = tbGif,
    				[2] = tbItemInfo,
    			};
    			table.insert(tbOpt, {"Nhẫn: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_NHANNAM});
    		end
    	end
    
    
    	bLevel = me.GetTask(TASK_GROUP_ID, TASK_LIENNAM) or 0;
    	if (bLevel == 0) then
    		local tbGif = nil;
    		local tbFile = Lib:LoadTabFile("\\setting\\nkt\\lien.txt");
    		for _, tbRow in pairs(tbFile) do
    			if (nCap == tonumber(tbRow.Level) and me.nSeries == tonumber(tbRow.Series)) then
    				tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType), tonumber(tbRow.Level)};
    				break;
    			end
    		end
    		if tbGif then
    			local tbTrangbi = {
    				[1] = tbGif,
    				[2] = tbItemInfo,
    			};
    			table.insert(tbOpt, {"Liên: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_LIENNAM});
    		end
    	end
    
    
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_NONNAM) or 0;
    		if (bLevel == 0) then
    			local tbGif = nil;
    			local tbFile = Lib:LoadTabFile("\\setting\\nkt\\non.txt");
    			for _, tbRow in pairs(tbFile) do
    				if (nCap == tonumber(tbRow.Level) and me.nSex == tonumber(tbRow.ReqProp2Value) and me.nSeries == tonumber(tbRow.Series)) then
    					tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType), tonumber(tbRow.Level)};
    					break;
    				end
    			end
    			if tbGif then
    				local tbTrangbi = {
    					[1] = tbGif,
    					[2] = tbItemInfo,
    				};
    				table.insert(tbOpt, {"Nón: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_NONNAM});
    			end
    		end
    
    
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_AONAM) or 0;
    		if (bLevel == 0) then
    			local tbGif = nil;
    			local tbFile = Lib:LoadTabFile("\\setting\\nkt\\ao.txt");
    			for _, tbRow in pairs(tbFile) do
    				if (nCap == tonumber(tbRow.Level) and me.nSex == tonumber(tbRow.ReqProp2Value) and me.nSeries == tonumber(tbRow.Series)) then
    					tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType), tonumber(tbRow.Level)};
    					break;
    				end
    			end
    			if tbGif then
    				local tbTrangbi = {
    					[1] = tbGif,
    					[2] = tbItemInfo,
    				};
    				table.insert(tbOpt, {"Áo: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_AONAM});
    			end
    		end
    
    
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_LUNGNAM) or 0;
    		if (bLevel == 0) then
    			local tbGif = nil;
    			local tbFile = Lib:LoadTabFile("\\setting\\nkt\\lung.txt");
    			for _, tbRow in pairs(tbFile) do
    				if (nCap == tonumber(tbRow.Level) and me.nSex == tonumber(tbRow.ReqProp2Value) and me.nSeries == tonumber(tbRow.Series)) then
    					tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType), tonumber(tbRow.Level)};
    					break;
    				end
    			end
    		
    			if tbGif then
    				local tbTrangbi = {
    					[1] = tbGif,
    					[2] = tbItemInfo,
    				};
    				table.insert(tbOpt, {"Lưng: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_LUNGNAM});
    			end
    		end
    
    
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_TAYNAM) or 0;
    		if (bLevel == 0) then
    			local tbGif = nil;
    			local tbFile = Lib:LoadTabFile("\\setting\\nkt\\tay.txt");
    			for _, tbRow in pairs(tbFile) do
    				if (nCap == tonumber(tbRow.Level) and me.nSex == tonumber(tbRow.ReqProp2Value) and me.nSeries == tonumber(tbRow.Series)) then
    					tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType), tonumber(tbRow.Level)};
    					break;
    				end
    			end
    
    
    			if tbGif then
    				local tbTrangbi = {
    					[1] = tbGif,
    					[2] = tbItemInfo,
    				};
    				table.insert(tbOpt, {"Tay: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_TAYNAM});
    			end
    		end
    
    
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_GIAYNAM) or 0;
    		if (bLevel == 0) then
    			local tbGif = nil;
    			local tbFile = Lib:LoadTabFile("\\setting\\nkt\\giay.txt");
    			for _, tbRow in pairs(tbFile) do
    				if nCap == tonumber(tbRow.Level) and me.nSex == tonumber(tbRow.ReqProp2Value) and me.nSeries == tonumber(tbRow.Series) then
    					tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType),  tonumber(tbRow.Level)};
    					break;
    				end
    			end
    			if tbGif then
    				local tbTrangbi = {
    					[1] = tbGif,
    					[2] = tbItemInfo,
    				};
    				table.insert(tbOpt, {"Giày: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_GIAYNAM});
    			end
    		end
    
    
    		bLevel = me.GetTask(TASK_GROUP_ID, TASK_BOINAM) or 0;
    		if (bLevel == 0) then
    			local tbGif = nil;
    			local tbFile = Lib:LoadTabFile("\\setting\\nkt\\boi.txt");
    			for _, tbRow in pairs(tbFile) do
    				if nCap == tonumber(tbRow.Level) and me.nSex == tonumber(tbRow.ReqProp2Value) and me.nSeries == tonumber(tbRow.Series) then
    					tbGif = {tonumber(tbRow.Genre), tonumber(tbRow.DetailType),tonumber(tbRow.ParticularType),  tonumber(tbRow.Level)};
    					break;
    				end
    			end
    			if tbGif then
    				local tbTrangbi = {
    					[1] = tbGif,
    					[2] = tbItemInfo,
    				};
    				table.insert(tbOpt, {"Bội: <color=yellow>"..KItem.GetNameById(unpack(tbGif)).."<color>", self.TakeTrangbi, self, tbTrangbi, TASK_BOINAM});
    			end
    		end
    	
    	Dialog:Say(szMsg, tbOpt);
    end
    
    
    function tbNkt:TakeTrangbi(tbItemGif, idTask)
    	if (me.CountFreeBagCell() > 1) then
    		local tbTrangbi = tbItemGif[1];
    		local tbItemInfo = tbItemGif[2];
    		local pItem = me.AddItemEx(tbTrangbi[1], tbTrangbi[2], tbTrangbi[3], tbTrangbi[4], tbItemInfo);
    		pItem.Sync();
    		me.SetTask(TASK_GROUP_ID, idTask, 1);
    		me.Msg("Nhận thưởng thành công");
    	end
    	return 0;
    end
    
    
    function tbNkt:TakeLevel(nLevel)
    	me.AddLevel(nLevel - me.nLevel);
    	me.SetTask(TASK_GROUP_ID, TASK_LEVEL, nLevel);
    	return 0;
    end
    
    
    function tbNkt:KichHoatNgay(nNowDate)
    	local nRate = me.nLevel / 10000;
    	if (me.CountFreeBagCell() > nMathat) then
    		me.SetTask(TASK_GROUP_ID, TASK_DNGAY, nNowDate);
    		me.Earn(nMoney * nRate, 0);
    		me.AddBindMoney(nMoney * nRate);
    		me.AddBindCoin(nDongK * nRate);
    		local pItem = me.AddItem(unpack(tbBicanh));
    		pItem.Bind(1);
    		pItem.Sync();
    		for i = 1, nMathat do
    			local pItem = me.AddItem(unpack(tbMathat));
    			pItem.Bind(1);
    			pItem.Sync();
    		end
    		me.Msg("Nhận thưởng thành công");
    	end
    	return 0;
    end
    
    
    function tbNkt:TakeMatThat()
    	if (me.CountFreeBagCell() > nMathat) then
    		for i = 1, nMathat do
    			local pItem = me.AddItem(unpack(tbMathat));
    			pItem.Bind(1);
    			pItem.Sync();
    		end
    		me.SetTask(TASK_GROUP_ID, TASK_MATTH, 1);
    		me.Msg("Nhận thưởng thành công");
    	end
    	return 0;
    end
    
    
    function tbNkt:TakeRgVoso()
    	if (me.CountFreeBagCell() > 1) then
    		local pItem = me.AddItem(unpack(tbRgVoso));
    		pItem.Bind(1);
    		pItem.Sync();
    		me.SetTask(TASK_GROUP_ID, TASK_RVOSO, 1);
    		me.Msg("Nhận thưởng thành công");
    	end
    	return 0;
    end
    
    
    function tbNkt:TakeMoney()
    	me.Earn(nMoney, 0);
    	me.AddBindMoney(nMoney);
    	me.SetTask(TASK_GROUP_ID, TASK_MONEY, 1);
    	return 0;
    end
    
    
    function tbNkt:TakeDongK()
    	me.AddBindCoin(nDongK);
    	me.SetTask(TASK_GROUP_ID, TASK_DONGK, 1);
    	return 0;
    end
    
    
    function tbNkt:TakeTinhH()
    	me.ChangeCurMakePoint(nTinhH);
    	me.ChangeCurGatherPoint(nTinhH);
    	me.SetTask(TASK_GROUP_ID, TASK_TINHH, 1);
    	return 0;
    end
    
    
    function tbNkt:TakeTcuoi()
    	if (me.CountFreeBagCell() > 1) then
    		local pItem = me.AddItem(unpack(tbCuoi));
    		pItem.Bind(1);
    		pItem.Sync();
    		me.SetTask(TASK_GROUP_ID, TASK_TCUOI, 1);
    		me.Msg("Nhận thưởng thành công");
    	end
    	return 0;
    end
    
    
    function tbNkt:TakeNhhtK()
    	if (me.CountFreeBagCell() > 11) then
    		for i = 1, 5 do
    			local pItem = me.AddItem(18, 1, 200, 1);
    			pItem.Bind(1);
    			pItem.Sync();
    		end
    		for i = 1, 5 do
    			local pItem = me.AddItem(18, 1, 263, 1);
    			pItem.Bind(1);
    			pItem.Sync();
    		end
    		local pItem = me.AddItem(unpack(tbNhht));
    		pItem.Bind(1);
    		pItem.Sync();
    		me.SetTask(TASK_GROUP_ID, TASK_NHHTK, 1);
    		me.Msg("Nhận thưởng thành công");
    	end
    	return 0;
    end
    
    
    function tbNkt:TakeTui24()
    	if (me.CountFreeBagCell() > 3) then
    		for _, tbTui in ipairs(tbTui24) do
    			local pItem = me.AddItem(unpack(tbTui));
    			pItem.Bind(1);
    			pItem.Sync();
    		end
    		me.SetTask(TASK_GROUP_ID, TASK_TUI24, 1);
    		me.Msg("Nhận thưởng thành công");
    	end
    	return 0;
    end
    
    
    function tbNkt:TakeAnmax()
    	if (me.CountFreeBagCell() > 1) then
    		local pItem = me.AddItem(unpack(tbAnmax));
    		pItem.Sync();
    		me.SetTask(TASK_GROUP_ID, TASK_ANMAX, 1);
    		me.Msg("Nhận thưởng thành công");
    	end
    	return 0;
    end
    cái này phải khai báo task mới nữa. nhưng chưa hiểu cách dùng. ông nói rõ hơn đi
    Khách viếng thăm hãy cùng VNGameZoneVN xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  5. #5
    Thành Viên Tâm Huyết tuidangvui's Avatar
    Ngày tham gia
    Mar 2009
    Bài viết
    715
    Thanks
    114
    Thanked 477 Times in 243 Posts

    Ðề: Hỏi về scrip nhận Item

    Trích dẫn Gửi bởi VNGameZoneVN [Only registered and activated users can see links. ]
    cái này phải khai báo task mới nữa. nhưng chưa hiểu cách dùng. ông nói rõ hơn đi
    them vào \gameserver\setting\player\task_def.txt
    3000 1 50 Hỗ trợ tân thủ 0 0
    Khách viếng thăm hãy cùng tuidangvui xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  6. #6
    Thành Viên
    Ngày tham gia
    Jan 2012
    Bài viết
    275
    Thanks
    47
    Thanked 52 Times in 40 Posts

    Ðề: Hỏi về scrip nhận Item

    Trích dẫn Gửi bởi tuidangvui [Only registered and activated users can see links. ]
    them vào \gameserver\setting\player\task_def.txt
    đưa thiếu file rồi sư phụ ơi sao ng ta làm dc
    Khách viếng thăm hãy cùng nh0kk3n2310 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  7. #7
    Vi phạm quy định VNGameZoneVN's Avatar
    Ngày tham gia
    Mar 2012
    Đang ở
    https://t.me*********
    Bài viết
    427
    Thanks
    202
    Thanked 564 Times in 74 Posts

    Ðề: Hỏi về scrip nhận Item

    Trích dẫn Gửi bởi nh0kk3n2310 [Only registered and activated users can see links. ]
    đưa thiếu file rồi sư phụ ơi sao ng ta làm dc
    file gì nữa hả người bạn. bạn giúp mình nữa nha
    Khách viếng thăm hãy cùng VNGameZoneVN xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  8. #8
    Thành Viên GameZone
    Ngày tham gia
    Jul 2012
    Đang ở
    TP HCM - Quận Bình Tân
    Bài viết
    96
    Thanks
    28
    Thanked 12 Times in 11 Posts

    Ðề: Hỏi về scrip nhận Item

    Trích dẫn Gửi bởi vipbk [Only registered and activated users can see links. ]
    Đặt CODE vào thẻ SPOILER bạn nhé
    thẻ SPOILER là gì vậy bạn, bạn có thể hướng dẫn mình cách sử dụng và 1 chút hình ảnh minh họa đc ko bạn
    Khách viếng thăm hãy cùng neverbackdown xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  9. #9
    Moderator vipbk's Avatar
    Ngày tham gia
    May 2012
    Đang ở
    đây
    Bài viết
    5,112
    Thanks
    248
    Thanked 3,006 Times in 1,888 Posts

    Ðề: Hỏi về scrip nhận Item

    Trích dẫn Gửi bởi neverbackdown [Only registered and activated users can see links. ]
    thẻ SPOILER là gì vậy bạn, bạn có thể hướng dẫn mình cách sử dụng và 1 chút hình ảnh minh họa đc ko bạn
    đây: [Only registered and activated users can see links. ]
    Khách viếng thăm hãy cùng vipbk xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  10. #10
    Thành Viên GameZone
    Ngày tham gia
    Jul 2012
    Đang ở
    TP HCM - Quận Bình Tân
    Bài viết
    96
    Thanks
    28
    Thanked 12 Times in 11 Posts

    Ðề: Hỏi về scrip nhận Item

    Trích dẫn Gửi bởi vipbk [Only registered and activated users can see links. ]
    đây: [Only registered and activated users can see links. ]
    Bạn cho mình hỏi nếu muốn nhận thưởng 1 lần duy nhất trong túi tân thủ thì phải làm sao - bạn nói add thẻ poiler là cách làm sao
    Khách viếng thăm hãy cùng neverbackdown xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

 

 

Các Chủ đề tương tự

  1. [KT] Xin Việt hóa Scrip Tẩy Tủy Đảo
    Bởi Lãng Tử Sầu trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 6
    Bài viết cuối: 26-06-12, 11:15 AM
  2. [KT] Giúp em lỗi Scrip
    Bởi luumin trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 1
    Bài viết cuối: 01-05-12, 11:44 AM
  3. Cho mình xin Scrip của thằng Cường Hóa
    Bởi sunday2288 trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 1
    Bài viết cuối: 09-07-11, 09:25 PM
  4. Giúp em về đoạn scrip này với!!!
    Bởi mrr77641176 trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 7
    Bài viết cuối: 07-07-11, 11:17 PM
  5. Xin Scrip NPC nhận KNB
    Bởi luandaik trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 1
    Bài viết cuối: 14-02-11, 10:59 AM

Quyền viết bài

  • Bạn Không thể gửi Chủ đề mới
  • Bạn Không thể Gửi trả lời
  • Bạn Không thể Gửi file đính kèm
  • Bạn Không thể Sửa bài viết của mình
  •  
Múi giờ GMT +7. Bây giờ là 06:44 PM.
vBulletin®, Copyright ©2000-2011, Jelsoft Enterprises Ltd.
CLBGamesVN không chịu trách nhiệm về Luật Bản Quyền của các tài liệu, bài viết v.v...được đăng tải trên diễn đàn này.
Diễn đàn phát triển dưới sự đóng góp của tất cả thành viên. BQT chỉ là những người thành lập ra sân chơi, quản lý và duy trì về mặt kỹ thuật, nội dung khi hợp lệ.