ketom77
19-11-18, 12:40 AM
Tình hình là e củng tập tành vọc Jx củng biết sơ tí
Nay e muốn nâng cao bản năng newbie lên 1 tí nửa
Nội dung:
E muốn đỗi item thành 1 vật phẩm nào đó
Ví dụ: 
1 hành hiệp lệnh+20 xu+ 20 vạn = 1 rương Hkmp
Nhưng làm sao để đặt nó vào ô bằng hàm Give  gì đó e k rành nửa
Bác nào pro làm ơn cho e xin mẫu code e tự dựa vào rồi làm theo được không ạ
E cám ơn nhiều!
killer20099
19-11-18, 06:35 PM
Tình hình là e củng tập tành vọc Jx củng biết sơ tí
Nay e muốn nâng cao bản năng newbie lên 1 tí nửa
Nội dung:
E muốn đỗi item thành 1 vật phẩm nào đó
Ví dụ: 
1 hành hiệp lệnh+20 xu+ 20 vạn = 1 rương Hkmp
Nhưng làm sao để đặt nó vào ô bằng hàm Give  gì đó e k rành nửa
Bác nào pro làm ơn cho e xin mẫu code e tự dựa vào rồi làm theo được không ạ
E cám ơn nhiều!
30 cha ca bo vien.,.............
function GhepEvent1(num)
	EVENT = {
	{59,"KÑo chiƠc gËy"},
	{58,"Qu¶ t¸o ®á"},
	{61,"Hép Quµ Êm ¸p"}}
	KiemTraNL1 = GetItemCount(EVENT[1][1],5);KiemTraNL2 = GetItemCount(EVENT[2][1],5)
	KeoYC = num*4;TaoYC = num*3
	TienYC = num*30000
	if (num < 1 or num > 50) then Talk(1,"","Mçi lÇn ®æi chØ ®îc <color=yelow>50 vËt phÈm<color> mµ th«i.") return end
	if (KiemTraNL1 < KeoYC) then Talk(1,"","Kh«ng ®ñ nguyªn liÖu, b¹n ®ang că <color=red>"..KiemTraNL1.."/"..KeoYC.."<color> <color=pink>"..EVENT[1][2].."<color>, vui lßng kiÓm tra l¹i.") return end
	if (KiemTraNL2 < TaoYC) then Talk(1,"","Kh«ng ®ñ nguyªn liÖu, b¹n ®ang că <color=red>"..KiemTraNL2.."/"..TaoYC.."<color> <color=pink>"..EVENT[2][2].."<color>, vui lßng kiÓm tra l¹i.") return end
	if (GetCash() < TienYC) then Talk(1,"","B¹n kh«ng ®ñ <color=red>"..TienYC.." lîng<color>, vui lßng kiÓm tra l¹i.") return end
		if(CheckRoom(1,1) == 0) then Talk(1,"","Vui lßng chơa Ưt nhÊt 1 « trèng.") return end
		local Item = ItemSetAdd(0,5,EVENT[3][1],0,0,5,num,0);
		SetItemDate(Item,ENAM,ETHANG,ENGAY,0,0);
		AddItemID(Item);
		Pay(TienYC)
		DelItem(EVENT[1][1],5,KeoYC)
		DelItem(EVENT[2][1],5,TaoYC)
		local nCurTime = GetTimeMin();
		SetTask(TASK_THOIGIAN5,nCurTime);
		Msg2Player("B¹n ®æi thµnh c«ng "..num.." <color=yellow>"..EVENT[3][2].."<color>.")
end
ketom77
26-11-18, 10:45 PM
30 cha ca bo vien.,.............
cái này linux xài đc k bác ơi e k rành
Tình hình là e củng tập tành vọc Jx củng biết sơ tí
Nay e muốn nâng cao bản năng newbie lên 1 tí nửa
Nội dung:
E muốn đỗi item thành 1 vật phẩm nào đó
Ví dụ: 
1 hành hiệp lệnh+20 xu+ 20 vạn = 1 rương Hkmp
Nhưng làm sao để đặt nó vào ô bằng hàm Give  gì đó e k rành nửa
Bác nào pro làm ơn cho e xin mẫu code e tự dựa vào rồi làm theo được không ạ
E cám ơn nhiều!
Của Bạn Đây
EVENT_FF_UP = 
{
	{szName = "R¬ng Hoµng Kim M«n Ph¸i",	tbProp = {6,1,IDItemRuonghoangKim,1,1,0,0},	tbMaterial_Index = {1,2},	tbAmount = {20,20},	nCash = 50000,	nCashValue = 20},
}
Nang_cap_phi_phong	= 
{
	{szName = "Hµnh HiÖp LÖnh",tbProp = {6,1,2566,1,1,0,0}}, --------so 1
	{szName = "TiÒn §ång",tbProp = {4,417,1,1,0,0,0}}, --------so 2
}
function tao_nguoi_tuyet()
	local tbOpt = {};
		tinsert(tbOpt,"<dec><npc>C¸c h¹ muèn R¬ng Hoµng Kim M«n Ph¸i Sao ?");
		for k=1,getn(EVENT_FF_UP) do 
			tinsert(tbOpt,format("T¹o %s/#nang_cap_ff(%d)",EVENT_FF_UP[k].szName,k));
		end
	tinsert(tbOpt,"L¸t n÷a chÕ t¹o sau/no");
	CreateTaskSay(tbOpt);
end
function no()
end
function nang_cap_ff(nType)
	local szUiphiphong = format("ChÕ t¹o %s",EVENT_FF_UP[nType].szName);
	SetTaskTemp(100,nType);
	local szNote = "Nh÷ng nguyªn liÖu cÇn cã:\n";
	local tb = EVENT_FF_UP[nType];
	for k=1,getn(tb.tbMaterial_Index) do 
		szNote = szNote..format("<+> %d %s\n",tb.tbAmount[k],Nang_cap_phi_phong[tb.tbMaterial_Index[k]].szName);
	end
	if tb.nCash > 0 then 
		szNote = szNote..format("<+> %d v¹n",EVENT_FF_UP[nType].nCashValue);
	end
	GiveItemUI(szUiphiphong,szNote,"NguyenLieuNangCap_FF");
end
function NguyenLieuNangCap_FF(nItemCount)
	local CpIdx = GetTaskTemp(100);
	SetTaskTemp(100,0);
	local tbCompound = {};
	local item = EVENT_FF_UP[CpIdx].tbMaterial_Index;
	local item1 =  EVENT_FF_UP[CpIdx].tbAmount;
	local material = Nang_cap_phi_phong;
	local count_material_compound = 0 ;
	local count = getn(item);
	for k=1,nItemCount do 
		local IsMaterialReq = 0;
		local idxtab = 0;
		local itemidx = GetGiveItemUnit(k);
		local szItemName = GetItemName(itemidx);
		local nPar,nType,nID = GetItemProp(itemidx);
		local nCountStack = GetItemStackCount(itemidx) or 1;
		for n=1,getn(item) do 
			if material[item[n]].tbProp[1] == nPar and material[item[n]].tbProp[2] == nType and material[item[n]].tbProp[3] == nID then 
				IsMaterialReq = 1;
				idxtab = n;
				break;
			end
		end
		
		if IsMaterialReq == 1 then 
			if not tbCompound[nID] then 
				tbCompound[nID] = {tbProp = {},nStackCount = 0,nReqAmount = 0,nAmountCompound = 0,nItemIdx = {}}
			end
			
			if tbCompound[nID].nStackCount == 0 then 
				tbCompound[nID].tbProp = {nPar,nType,nID,1,1,0,0};
				tbCompound[nID].nStackCount = nCountStack;
				tbCompound[nID].nReqAmount = item1[idxtab];
				tinsert(tbCompound[nID].nItemIdx,{itemidx,nCountStack});
			else
				tbCompound[nID].nStackCount = tbCompound[nID].nStackCount + nCountStack;
				tinsert(tbCompound[nID].nItemIdx,{itemidx,nCountStack});
			end
		else --wrong material.
			Say("VÞ thiÕu hiÖp ¾t h¼n cã sù nhÇm lÉn, xin h·y kiÓm tra l¹i vËt phÈm ®Æt vµo.",0)
			return
		end
	end
	--check material
	for k=1,getn(item) do 
		local ItemID = material[item[k]].tbProp[3];
		if not tbCompound[ItemID] then 
			local tb = EVENT_FF_UP[CpIdx];	
			local szNote = format("<color=green>Nh÷ng nguyªn liÖu cÇn ®Ó lµm %s<color>:<enter><enter>",tb.szName);	
			for k=1,getn(tb.tbMaterial_Index) do 
				szNote = szNote..format("<+> <color=fire>%d<color> <color=yellow>%s<color>\n",tb.tbAmount[k],Nang_cap_phi_phong[tb.tbMaterial_Index[k]].szName);
			end
			if tb.nCash > 0 then 
				szNote = szNote..format("<+> <color=fire>%d<color> <color=yellow>v¹n",EVENT_FF_UP[CpIdx].nCashValue);
			end
			Say(szNote,0);
			return
		end
	end
	--ktra sè lîng cã thÓ Ðp
	local tbSort = {}
	for k=1,getn(item)  do 
		local ItemID = material[item[k]].tbProp[3];
		local tbItem = tbCompound[ItemID];
		if tbItem.nStackCount < tbItem.nReqAmount then 
			Say(format("B¹n cÇn ph¶i cã Ýt nhÊt: %d %s",tbItem.nReqAmount,Nang_cap_phi_phong[item[k]].szName),0);
			return 
		else
			tbItem.nAmountCompound = floor(tbItem.nStackCount/tbItem.nReqAmount);
		end
		tinsert(tbSort,tbItem.nAmountCompound);
	end
	sort(tbSort,sort_list)
	local CompleteCompound = tbSort[1];
	local ftab = {};
	
	if CalcFreeItemCellCount() <= 30 then
		Talk(1,"","Hµnh trang kh«ng ®ñ 30 « trèng.");
		return
	end
	
	if EVENT_FF_UP[CpIdx].nCash > 0 then 
		if GetCash() < EVENT_FF_UP[CpIdx].nCash*CompleteCompound then 
			Say("B¹n cÇn ph¶i cã <color=fire>"..(EVENT_FF_UP[CpIdx].nCashValue*CompleteCompound).." v¹n<color> ®Ó thùc hiÖn Ðp <color=red>"..CompleteCompound.." c¸i b¸nh<color>",0);
			return 
		end
		Pay(EVENT_FF_UP[CpIdx].nCash*CompleteCompound)
	end
	
	for k,v in tbCompound do 
		local t = tbCompound[k];
		local _totalcompound = CompleteCompound * t.nReqAmount; --100
		local count_1 = getn(t.nItemIdx);
		if count_1 >= 2 then  
			for d =1,count_1 do 
				_ITEMIDX = t.nItemIdx[d][1];
				_ITEMCOUNT = t.nItemIdx[d][2];
				nLeft = _totalcompound - _ITEMCOUNT;
	
				if _totalcompound > 0 then 	
					if nLeft < 0 then 
						nLeft = nLeft * (-1);
						SetItemStackCount(_ITEMIDX ,nLeft);
						_totalcompound = 0;
					elseif nLeft == 0 then 
						SetItemStackCount(_ITEMIDX ,0);
						_totalcompound = 0;
					else
						SetItemStackCount(_ITEMIDX ,0);
						_totalcompound = nLeft
					end
				end
			end			
		else
			_ITEMIDX = t.nItemIdx[1][1];
			_ITEMCOUNT = t.nItemIdx[1][2];
			nLeft = _ITEMCOUNT - _totalcompound ;
			SetItemStackCount(_ITEMIDX ,nLeft);
		end
	end
		
	for i=1,CompleteCompound do AddItem(unpack(EVENT_FF_UP[CpIdx].tbProp)); 
	end
	Msg2Player("B¹n ®· ChÕ T¹o thµnh c«ng <color=green>"..CompleteCompound.." "..EVENT_FF_UP[CpIdx].szName.." ");
end
function sort_list(value1,value2)
	return value1 < value2;
end
ketom77
29-11-18, 07:48 AM
Bác ơi bác co bán script không, nếu có thì cho e xin link fb nhé
Bác ơi bác co bán script không, nếu có thì cho e xin link fb nhé
Mình Ko sài FB mình sài Skype Và zalo Nhé 
Skype :+84 163 791 7310
Zalo : 0946 541 141
FB : thì có page thôi , Vì Face mình đang bị Người Khác Report :( 
FB.com/volamtinhhong
Powered by vBulletin® Version 4.2.0 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.