[KT] Share code add đồng cho nhân vật? - Trang 3
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
 
Trang 3 của 6 Đầu tiênĐầu tiên 1 2 3 4 5 ... CuốiCuối
Kết quả 21 đến 30 của 53
  1. #21
    Thành Viên
    Ngày tham gia
    Feb 2012
    Đang ở
    hcm
    Bài viết
    304
    Thanks
    199
    Thanked 312 Times in 91 Posts

    Ðề: Share code add đồng cho nhân vật?

    tiếp tục cho thêm 1 hàm nhập số lượng tương tự với nhập tên nhân vật nữa. bước thứ 3 mới cho thực thi lệnh add đông. vậy là có thể add được số lượng đồng bất kỳ cho 1 nhân vật bất kỳ chung SUB. với cách này, dài hơn 1 chút sẽ là nhập 1 items bất kỳ cho 1 nhân vật bất kỳ. Lưu ý chổ định dạng kiểu dữ liệu. an toàn nhất cho phần nhập số lượng đồng là bao quát nó bằng tonumber(ham số lượng đồng); để chắc chắn dữ liệu nhập vào được ép kiểu sang dạng số. nhập số lượng đồng mà chơi string ABC vào là nó đá cho banh xác nhé
    Khách viếng thăm hãy cùng nguyenhophuc87 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  2. #22
    Thành Viên nguyendung2011's Avatar
    Ngày tham gia
    Apr 2012
    Bài viết
    202
    Thanks
    78
    Thanked 57 Times in 33 Posts

    Ðề: Share code add đồng cho nhân vật?

    bác nào có cái file này đã add vào npc không cho mình thử cái với, ko rành nên copy code của toại share nhưng nó báo lỗi "end" ko biết sửa thế nào , tks nhìu
    Khách viếng thăm hãy cùng nguyendung2011 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  3. #23
    Thành Viên
    Ngày tham gia
    Feb 2012
    Bài viết
    63
    Thanks
    11
    Thanked 6 Times in 6 Posts

    Ðề: Share code add đồng cho nhân vật?

    Trích dẫn Gửi bởi nguyendung2011 [Only registered and activated users can see links. ]
    bác nào có cái file này đã add vào npc không cho mình thử cái với, ko rành nên copy code của toại share nhưng nó báo lỗi "end" ko biết sửa thế nào , tks nhìu
    lỗi end ở chỗ hàm ngay đầu đó thiếu end ở cuối cho thêm end vào là đc
    Khách viếng thăm hãy cùng microlab1994 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  4. Các thành viên gởi lời cảm ơn đến microlab1994 vì bài viết này !

    nguyendung2011 (08-07-12)

  5. #24
    Thành Viên nguyendung2011's Avatar
    Ngày tham gia
    Apr 2012
    Bài viết
    202
    Thanks
    78
    Thanked 57 Times in 33 Posts

    Ðề: Share code add đồng cho nhân vật?

    code viết đúng NPC mới hiện , thêm 2 end
    local tbtest3 = Npc:GetClass("test3");


    function tbtest3:OnDialog()
    local szMsg = "Ta có Thể Giúp Gì ?";
    local tbOpt = {
    {"Ta Muốn Nạp Đồng", self.Adminmoinapdc, self},
    {"Để Ta Suy Nghỉ"},
    };
    Dialog:Say(szMsg, tbOpt);
    end
    -------------
    ------------
    function tbtest3:Adminmoinapdc()


    local szMsg = "Ta có thể giúp gì cho nguoi";
    local tbOpt = {};
    if (me.szName == "administrator" ) or (me.szName == "BốMày" ) or (me.szName == "MộngNhư" ) then
    table.insert(tbOpt, {"Chức năng Admin" , self.AskRoleName, self});
    end
    table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
    Dialog:Say(szMsg, tbOpt);
    end

    function tbtest3:AskRoleName()
    Dialog:AskString("Tên nhân vật", 16, self.OnInputRoleName, self);
    end
    function tbtest3:OnInputRoleName(szRoleName)
    local nPlayerId = KGCPlayer.GetPlayerIdByName(szRoleName);
    if (not nPlayerId) then
    Dialog:Say("Tên này không tồn tại!", {"Nhập lại", self.AskRoleName, self}, {"Kết thúc đối thoại"});
    return;
    end
    self:ViewPlayer(nPlayerId);
    end

    --------------
    function tbtest3:ViewPlayer(nPlayerId)
    local szMsg = "Ta có thể giúp gì cho ngươi";
    local tbOpt = {
    {"Nạp Đồng Ngay", self.Napdong, self, nPlayerId },
    {"Kết thúc đối thoại"},
    };
    Dialog:Say(szMsg, tbOpt);
    end

    function tbtest3:Napdong(nPlayerId)
    Dialog:AskNumber("Nhập số đồng .", 2000000000, self.ConSo, self,nPlayerId);--Nhập số đồng muốn nạp cho người chơi

    end

    function tbtest3:ConSo(nPlayerId,szSoDong)
    local pPlayer = KPlayer.GetPlayerObjById(nPlayerId);
    pPlayer.AddJbCoin(szSoDong);
    end
    Khách viếng thăm hãy cùng nguyendung2011 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  6. #25
    Em Là Gà :( Mr.QuangHuy's Avatar
    Ngày tham gia
    Aug 2008
    Bài viết
    197
    Thanks
    30
    Thanked 197 Times in 31 Posts

    Ðề: Share code add đồng cho nhân vật?

    Liệu có thể sửa thành AddItem cho nhân vật không nhỉ
    Khách viếng thăm hãy cùng Mr.QuangHuy xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  7. #26
    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

    Ðề: Share code add đồng cho nhân vật?

    Trích dẫn Gửi bởi Mr.QuangHuy [Only registered and activated users can see links. ]
    Liệu có thể sửa thành AddItem cho nhân vật không nhỉ
    được bạn ah. hàm này mình add Item cho nhân vật dc bạn ah
    bạn muốn add Item gì cũng dc hết.

    code

    Code:
    --NPC Test1
    
    
    local tbTest1 = Npc:GetClass("test1");
    
    
    function tbTest1:OnDialog()
    local szMsg = "Chức Năng KT <color=yellow>Tam Thanh<color>";
    local tbOpt = { 
    
    {"<color=yellow>các loại shop",self.cacloaishop,self},
    {"Ta Muốn Nhận Thưởng Hằng Ngày", self.nhanthuong, self},
    {"Ta Muốn Nhận Thưởng cấp 35", self.nhanqua, self},
    {"Nhận túi tân thủ", self.tuitanthu, self},
    {"Admin Nạp Đồng Cho member", self.Adminmoinapdc, self},
    {"Để Ta Suy Nghỉ"},
    };
    Dialog:Say(szMsg, tbOpt);
    end
    
    function tbTest1:tuitanthu()
    		local nCount = me.GetItemCountInBags(18,1,351,1);
    		if (nCount == 0) then
    			local tbNewPlayerGiftItem = { 18, 1, 351, 1 }
    			local tbBaseProp = KItem.GetItemBaseProp(unpack(tbNewPlayerGiftItem));
    			if not tbBaseProp then
    				return;
    			end
    			
    			local tbItem =
    			{
    				nGenre		= tbNewPlayerGiftItem[1],
    				nDetail		= tbNewPlayerGiftItem[2],
    				nParticular	= tbNewPlayerGiftItem[3],
    				nLevel		= tbNewPlayerGiftItem[4],
    				nSeries		= (tbBaseProp.nSeries > 0) and tbBaseProp.nSeries or 0,
    				bBind		= KItem.IsItemBindByBindType(tbBaseProp.nBindType),
    				nCount 		= 1;
    			};
    		
    			if (0 == me.CanAddItemIntoBag(tbItem)) then
    				me.Msg("Hành trang đầy");
    				return;
    			end	
    		
    			tbNewPlayerGiftItem[5] = tbItem.nSeries;
    			me.AddItem(unpack(tbNewPlayerGiftItem));
    			me.Msg("Nhận được Túi tân thủ !");			
    		else
    			Dialog:Say("<color=red> Bạn đã có Túi tân thủ <color>");
    		end	
    end
    ---------------------------------------------
    --------------------------------
    --function tbTest1:Tuitanthu()
    --me.AddItem(18,1,351,1);
    --end
    ----------------------------------
    ----------------------------------
    
    
    
    	
    
    
    ---------------
    ---hàm admin nap đồng + Item  + cấp cho member
    function tbTest1:Adminmoinapdc()
    
    
    	local szMsg = "Ta có thể giúp gì cho nguoi";
    	local tbOpt = {};
    	if (me.szName == "BáVương" ) or (me.szName == "MộngNhư" ) then
    	table.insert(tbOpt, {"Chức năng Admin" , self.AskRoleName, self});
    	end
    	table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
    	Dialog:Say(szMsg, tbOpt);
    end
    
    function tbTest1:AskRoleName()
     Dialog:AskString("Tên nhân vật", 16, self.OnInputRoleName, self);
    end
    function tbTest1:OnInputRoleName(szRoleName)
     local nPlayerId = KGCPlayer.GetPlayerIdByName(szRoleName);
     if (not nPlayerId) then
      Dialog:Say("Tên này không tồn tại!", {"Nhập lại", self.AskRoleName, self}, {"Kết thúc đối thoại"});
      return;
     end
     
     self:ViewPlayer(nPlayerId);
    end
    
    --------------
    function tbTest1:ViewPlayer(nPlayerId)
    
    local szMsg = "Ta có thể giúp gì cho ngươi";
    local tbOpt = {
    {"Nạp Đồng Ngay", self.Napdong, self, nPlayerId },
    {"Cho Lên Cấp", self.Lencapchomem, self, nPlayerId },
    {"Cho Nhận Đồ", self.Chomemnhando, self, nPlayerId },
    {"Kết thúc đối thoại"},
    };
    Dialog:Say(szMsg, tbOpt);
    end
    -----------------------------
    ------------------------------
    
    
    ------------------------
    -------------------------
    function tbTest1:Napdong(nPlayerId)
        Dialog:AskNumber("Nhập số đồng .", 2000000000, self.ConSo, self,nPlayerId);--Nhập số đồng muốn nạp cho người chơi
    
    end
    function tbTest1:ConSo(nPlayerId,szSoDong)
        local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    pPlayer.AddJbCoin(szSoDong);
    end
    ------------
    function tbTest1:Lencapchomem(nPlayerId)
    	local szMsg = "Ta có thể giúp gì cho ngươi";
    	local tbOpt = { 		
    		{"Nhận Kinh Nghiệm Cấp 10<color>",self.LenLevel110,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 20<color>",self.LenLevel120,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 30<color>",self.LenLevel130,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 40<color>",self.LenLevel140,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 50<color>",self.LenLevel150,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 60<color>",self.LenLevel160,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 70<color>",self.LenLevel170,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 80<color>",self.LenLevel180,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 90<color>",self.LenLevel190,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 100<color>",self.LenLevel1100,self,nPlayerId},
    		{"Trang Sau >>>",self.lsDiemKinhNghiem12,self,nPlayerId},
    	{"Ta Chỉ Xem Qua Thôi..."},
    	};
    	Dialog:Say(szMsg, tbOpt);
    end
    
    
    function tbTest1:lsDiemKinhNghiem12(nPlayerId)
    local szMsg = "Ta có thể giúp gì cho ngươi";
    	local tbOpt = { 		
    		{"Nhận Kinh Nghiệm Cấp 110<color>",self.LenLevel1110,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 120<color>",self.LenLevel1120,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 130<color>",self.LenLevel1130,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 140<color>",self.LenLevel1140,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 150<color>",self.LenLevel1150,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 180<color>",self.LenLevel1180,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 200<color>",self.LenLevel1200,self,nPlayerId},
    		--{"Nhận 100 Triệu Điểm Kinh Nghiệm",self.DiemKinhNghiem,self},
    		--{"Bánh Ít Thịt Heo (10c)",self.BanhItThitHeo,self},
    		{"<<< Trang Trước",self.Lencapchomem,self,nPlayerId},
    	{"Ta Chỉ Xem Qua Thôi..."},
    	};
    	Dialog:Say(szMsg, tbOpt);
    end
    -------------
    function tbTest1:Chomemnhando(nPlayerId)
    local szMsg = "Ta có thể giúp gì cho ngươi";
    local tbOpt = {
    {"<color=yellow>Nhận Đồ set +16<color>",self.DoCuoi12,self,nPlayerId},
    {"Kết thúc đối thoại"},
    };
    Dialog:Say(szMsg, tbOpt);
    end
    -------------
    ---------------
    ------------------
    
    -- đồ cuối 12 cho mem 
    function tbTest1:DoCuoi12(nPlayerId)
    local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    local nSeries = pPlayer.nSeries;
     local szMsg = "Hay chon";
     local tbOpt = {
      {"Đồ Ngoại Công",self.Dongoai,self,nPlayerId},
      {"Đồ Nội Công",self.Donoi,self,nPlayerId},
      {"Kết thúc đối thoại"},
     }
     Dialog:Say(szMsg,tbOpt);
    end
    function tbTest1:Dongoai(nPlayerId)
    local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    local nSex = pPlayer.nSex;
      local nSeries = pPlayer.nSeries;
     if (nSeries == 0) then
      Dialog:Say("Bạn hãy gia nhập phái");
      return;
     end
     
     if (1 == nSeries) then
     
      if (0 == nSex) then --male
      pPlayer.AddGreenEquip(8,519,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,537,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(10,20211,10,5,16); --Th?y Hoàng H?ng Hoang Uy?n
     pPlayer.AddGreenEquip(4,20161,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20065,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20105,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20085,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,353,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,487,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20045,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20000,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     else   --female
    pPlayer.AddGreenEquip(8,520,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,538,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(10,20212,10,5,16);
     pPlayer.AddGreenEquip(4,20161,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20066,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20106,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
     pPlayer.AddGreenEquip(5,20085,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,354,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,488,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20050,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20000,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     end
     elseif (2 == nSeries) then
     
      if (0 == nSex) then --male
      pPlayer.AddGreenEquip(8,523,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,541,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(10,20215,10,5,16);
     pPlayer.AddGreenEquip(4,20163,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20067,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20107,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20087,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,373,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,489,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20046,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20001,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     else   --female
     pPlayer.AddGreenEquip(8,524,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,542,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(10,20216,10,5,16);
     pPlayer.AddGreenEquip(4,20163,10,5,16); --V? Uy C? Tinh Gi?i
    pPlayer.AddGreenEquip(7,20068,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20108,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
    pPlayer.AddGreenEquip(5,20087,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,374,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,490,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20051,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20001,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     end
     elseif (3 == nSeries) then
     
      if (0 == nSex) then --male
      pPlayer.AddGreenEquip(8,527,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,545,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(10,20219,10,5,16);
     pPlayer.AddGreenEquip(4,20165,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20069,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20109,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20089,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,393,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,491,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20047,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20002,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     --Chua bo trang bi vao******************************
     else   --female
     pPlayer.AddGreenEquip(8,528,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,546,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(10,20220,10,5,16);
     pPlayer.AddGreenEquip(4,20165,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20070,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20110,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
     pPlayer.AddGreenEquip(5,20089,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,394,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,492,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20052,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20002,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     --Chua bo trang bi vao******************************
     end
     elseif (4 == nSeries) then
     
      if (0 == nSex) then --male
      pPlayer.AddGreenEquip(8,531,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,549,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(10,20223,10,5,16);
     pPlayer.AddGreenEquip(4,20167,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20071,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20111,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20091,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,413,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,493,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20048,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20003,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     else   --female
     pPlayer.AddGreenEquip(8,532,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,550,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(10,20224,10,5,16);
     pPlayer.AddGreenEquip(4,20167,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20072,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20112,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
     pPlayer.AddGreenEquip(5,20091,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,414,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,494,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20053,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20003,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     end
     elseif (5 == nSeries) then
     
      if (0 == nSex) then --male
      pPlayer.AddGreenEquip(8,535,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,553,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(10,20227,10,5,16);
     pPlayer.AddGreenEquip(4,20169,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20073,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20113,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20093,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,433,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,495,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20049,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20004,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     else   --female
     pPlayer.AddGreenEquip(8,536,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,554,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(10,20228,10,5,16);
     pPlayer.AddGreenEquip(4,20169,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20074,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20114,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
     pPlayer.AddGreenEquip(5,20093,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,434,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,496,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20054,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20004,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     --Chua bo trang bi vao******************************
     end
     else
      Dbg:WriteLogEx(Dbg.LOG_INFO, "Quan Lãnh Thổ", me.szName, "Bạn chưa gia nhập phái", nSeries);
     end
     ---local szMsg = "Hay chon";
     --local tbOpt = {
     -- {"He Kim",self.HeKim,self},
     -- {"He Moc",self.HeMoc,self},
     -- {"He Thuy",self.HeThuy,self},
     -- {"He Hoa",self.HeHoa,self},
     -- {"He Tho",self.HeTho,self},
     --}
     --Dialog:Say(szMsg,tbOpt);
    end
    function tbTest1:Donoi(nPlayerId) 
    local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    local nSex = pPlayer.nSex;
      local nSeries = pPlayer.nSeries;
     if (nSeries == 0) then
      Dialog:Say("Bạn hãy gia nhập phái");
      return;
     end
     
     if (1 == nSeries) then
      if (0 == nSex) then --male
     pPlayer.AddGreenEquip(8,519,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,537,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(10,20213,10,5,16);
     pPlayer.AddGreenEquip(4,20162,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20065,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20105,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20086,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,353,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,487,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20045,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20000,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     else   --female
     pPlayer.AddGreenEquip(8,520,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,538,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     
      pPlayer.AddGreenEquip(10,20214,10,5,16);
     pPlayer.AddGreenEquip(4,20162,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20066,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20106,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
     pPlayer.AddGreenEquip(5,20086,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,354,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,488,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20050,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20000,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     end
     elseif (2 == nSeries) then
     
      if (0 == nSex) then --male
     pPlayer.AddGreenEquip(8,523,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,541,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     
      pPlayer.AddGreenEquip(10,20217,10,5,16);
     pPlayer.AddGreenEquip(4,20164,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20067,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20107,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20088,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,373,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,489,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20046,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20001,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     else   --female
    pPlayer.AddGreenEquip(8,524,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,542,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
        pPlayer.AddGreenEquip(10,20218,10,5,16);
     pPlayer.AddGreenEquip(4,20164,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20068,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20108,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
     pPlayer.AddGreenEquip(5,20088,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,374,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,490,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20051,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20001,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     --Chua bo trang bi vao******************************
     end
     elseif (3 == nSeries) then
     
      if (0 == nSex) then --male
     pPlayer.AddGreenEquip(8,527,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,545,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     
       pPlayer.AddGreenEquip(10,20221,10,5,16);
     pPlayer.AddGreenEquip(4,20166,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20069,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20109,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20090,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,393,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,491,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20047,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20002,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     --Chua bo trang bi vao******************************
     else   --female
     pPlayer.AddGreenEquip(8,528,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,546,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(10,20222,10,5,16);
     pPlayer.AddGreenEquip(4,20166,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20070,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20110,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
     pPlayer.AddGreenEquip(5,20090,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,394,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,492,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20052,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20002,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     --Chua bo trang bi vao******************************
     end
     elseif (4 == nSeries) then
     
      if (0 == nSex) then --male
     pPlayer.AddGreenEquip(8,531,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,549,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     
       pPlayer.AddGreenEquip(10,20225,10,5,16);
     pPlayer.AddGreenEquip(4,20168,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20071,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20111,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20092,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,413,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,493,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20048,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20003,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     --Chua bo trang bi vao******************************
     else   --female
     pPlayer.AddGreenEquip(8,532,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,550,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
       pPlayer.AddGreenEquip(10,20226,10,5,16);
     pPlayer.AddGreenEquip(4,20168,10,5,16);--V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20072,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20112,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
     pPlayer.AddGreenEquip(5,20092,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,414,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,494,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20053,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20003,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     --Chua bo trang bi vao******************************
     end
     elseif (5 == nSeries) then
     
      if (0 == nSex) then --male
      pPlayer.AddGreenEquip(8,535,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,553,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
       pPlayer.AddGreenEquip(10,20229,10,5,16);
     pPlayer.AddGreenEquip(4,20170,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20073,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20113,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20094,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,433,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,495,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20049,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20004,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     --Chua bo trang bi vao******************************
     else   --female
      pPlayer.AddGreenEquip(10,20230,10,5,16);
    pPlayer.AddGreenEquip(8,536,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,554,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     
     pPlayer.AddGreenEquip(4,20170,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20074,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20114,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
     pPlayer.AddGreenEquip(5,20094,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,434,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,496,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20054,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20004,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     end
     else
      Dbg:WriteLogEx(Dbg.LOG_INFO, "Quan Lãnh Thổ", me.szName, "Bạn chưa gia nhập phái", nSeries);
     end
     
    end
    ------------------
    ---------------------
    ---------------------
    -----------------
    ------------------
    function tbTest1:LenLevel110(nPlayerId)
        local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(10 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel120(nPlayerId)
        local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(20 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel130(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(30 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel140(nPlayerId)
    	pPlayer.AddLevel(40 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel150(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(50 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel160(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(60 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel170(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(70 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel180(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(80 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel190(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(90 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel1100(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(100 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel1110(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(110 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel1120(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(120 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel1130(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(130 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel1140(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(140 - pPlayer.nLevel);
    end
    function tbTest1:LenLevel1150(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(150 - pPlayer.nLevel);
    end
    function tbTest1:LenLevel1180(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(180 - pPlayer.nLevel);
    end
    function tbTest1:LenLevel1200(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(200 - pPlayer.nLevel);
    end
    ---------------------
    -- kết thúc hàm admin nap đồng và đồ + cấp cho member
    
    
    
    ----------------
    --------------
    ----------------
    
    
    function tbTest1:cacloaishop()
    local szMsg = "Ta có thể giúp gì cho ngươi";
    local tbOpt = {
    		
    	{"Shop Thủy Hoàng vũ khí",  self.ShopThuyhoang, self},
    	--{"Nhiệm vụ 110",  self.Nhiemvu110, self},
    	{"Shop Tiêu Dao cốc",  self.Tdc, self},
    	{"Shop Liên Đấu",  self.ShopLiendau, self},
    	{"Shop Tranh Đoạt Lãnh Thổ",  self.Shoptranhdoat, self},
    	{"Shop Chúc Phúc",  self.Shopchucphuc, self},
    	{"Shop Thắt lưng thịnh hạ",  self.Shopthinhha, self},
    	{"Shop Luyện hóa đồ Tần lăng",  self.Shopluyenhoatanlang, self},
    	{"Shop Quan Hàm",  self.ShopQuanham, self},
    		
    	{"Ta chỉ ghé ngang qua"},
    	};
    	Dialog:Say(szMsg, tbOpt);
    
    end
    
    
    function tbTest1:ShopQuanham()
    	local nSeries = me.nSeries;
    	if (nSeries == 0) then
    		Dialog:Say("Bạn hãy gia nhập phái");
    		return;
    	end
    	
    	if (1 == nSeries) then
    		me.OpenShop(149, 1);
    	elseif (2 == nSeries) then
    		me.OpenShop(150, 1);
    	elseif (3 == nSeries) then
    		me.OpenShop(151, 1);
    	elseif (4 == nSeries) then
    		me.OpenShop(152, 1);
    	elseif (5 == nSeries) then
    		me.OpenShop(153, 1);
    	else
    		Dbg:WriteLogEx(Dbg.LOG_INFO, "Hỗ Trợ tân thủ", me.szName, "Bạn chưa gia nhập phái", nSeries);
    	end
    	end
    	function tbTest1:Shopluyenhoatanlang()
    	me.OpenShop(155,1)
    	end
    	function tbTest1:Shoptranhdoat()
    	me.OpenShop(147,1)
    	end
    	function tbTest1:Shopthinhha()
    	me.OpenShop(128,1)
    	end
    	function tbTest1:Shopchucphuc()
    	me.OpenShop(133,1)
    	end
    	function tbTest1:Tdc()
    	me.OpenShop(132,1)
    	end
    	function tbTest1:ShopLiendau()
    	me.OpenShop(134,1)
    	end
    		
    		
    
    function tbTest1:ShopThuyhoang()
    local nSeries = me.nSeries;
    	if (nSeries == 0) then
    		Dialog:Say("Bạn hãy gia nhập phái");
    		return;
    	end
    	
    	if (1 == nSeries) then
    		me.OpenShop(156, 1);
    	elseif (2 == nSeries) then
    		me.OpenShop(157, 1);
    	elseif (3 == nSeries) then
    		me.OpenShop(158, 1);
    	elseif (4 == nSeries) then
    		me.OpenShop(159, 1);
    	elseif (5 == nSeries) then
    		me.OpenShop(160, 1);
    	else
    		Dbg:WriteLogEx(Dbg.LOG_INFO, "Hỗ Trợ tân thủ", me.szName, "Bạn chưa gia nhập phái", nSeries);
    	end
    end
    
    
    
    
    function tbTest1:nhanqua()
    if (me.nLevel==35) then
    --me.AddItem(18, 1, 400, 1);
    me.AddExp(1000000000);
    me.AddBindCoin(100000);
    me.AddBindMoney(5000000);
    --local szMsg = "Ta có thể giúp gì cho ngươi";
    	--local tbOpt = {
    		
    		--{"<color=yellow>Nhận thưởng ngay<color>",nhanquacap11,self},
    		
    	 
    		
    	--{"Ta chỉ ghé ngang qua"},
    	--};
    	--Dialog:Say(szMsg, tbOpt);
    
    else
    	local szMsg = "Cấp của bạn không thể nhận thưởng";
    	local tbOpt = {};
    	Dialog:Say(szMsg, tbOpt);
    end
    end
    
    -----------------------------------
    ------------------------------------
    -------------------------------------
    --------------------------------------
    -------------------------------------
    --------------------------------------
    tbTest1.TaskGourp = 3000; --task mới phải add vào gameserver\setting\player\task_def.txt
    tbTest1.TaskId_Day = 1; --task lưu ngày
    tbTest1.TaskId_Count = 2; --task lưu lần nhận
    tbTest1.TaskId_Last = 3; --task lưu thời gian nhận
    tbTest1.Relay_Time = 30*60; --thời gian giữa 2 lần nhận mình để 30p 1 lần
    tbTest1.Use_Max =5; --số lần nhận tối đa
    
    function tbTest1:nhanthuong()
    	local nDate = tonumber(GetLocalDate("%Y%m%d"));
    	if me.GetTask(self.TaskGourp, self.TaskId_Day) < nDate then
    		me.SetTask(self.TaskGourp, self.TaskId_Day, nDate);
    		me.SetTask(self.TaskGourp, self.TaskId_Count, 0);
    		me.SetTask(self.TaskGourp, self.TaskId_Last, 0);
    	end 
    	local nCount = me.GetTask(self.TaskGourp, self.TaskId_Count);
    	local szMsg = "";
    	szMsg = string.format("Mỗi <color=yellow>30 phút online<color> hàng ngày có thể nhận thưởng, tối đa <color=yellow>%d<color> lần.\n\n",self.Use_Max);
    	local szColor = "<color=Gray>"
    	local szColorx = "<color>"
    	szMsg = szMsg.."\n<color=yellow>Lần 1:<color> "..((nCount >= 1 and szColor) or "").."5 túi phúc hoàng kim<color>";
    	szMsg = szMsg.."\n<color=yellow>Lần 2:<color> "..((nCount >= 2 and szColor) or "").."50 vạn bạc khóa-5v đồng khóa-HT 7-8-9-10-11-12-Tinh Lục Họat lực.<color>";
    	szMsg = szMsg.."\n<color=yellow>Lần 3:<color> "..((nCount >= 3 and szColor) or "").."3 vạn đồng-3 van bạc.<color>";
    	szMsg = szMsg.."\n<color=yellow>Lần 4:<color> "..((nCount >= 4 and szColor) or "").."mặt nạ hàn long phục hổ - 10 rương Ngũ hành hồn thạch(1000).<color>";
    	szMsg = szMsg.."\n<color=yellow>Lần 5:<color> "..((nCount >= 5 and szColor) or "").."1 mặt nạ víp.<color>";
    	szMsg = szMsg..string.format("\n\n<color=yellow>Hôm nay bạn đã nhận "..((nCount >= self.Use_Max and "đủ") or nCount).." phần thưởng.<color>");
    	local tbOpt = {};
    	if (nCount<self.Use_Max) then
    		table.insert(tbOpt , {"Nhận thưởng ngay",  self.nhanthuong1, self});
    	end
    	table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
    	Dialog:Say(szMsg, tbOpt);
    end
    
    function tbTest1:nhanthuong1()
    	local nCount = me.GetTask(self.TaskGourp, self.TaskId_Count);
        if nCount >= self.Use_Max then
            Dialog:Say(string.format("Hôm nay bạn đã nhận đủ phần thưởng."));
            return 0; 
        end    
    	local nLast = me.GetTask(self.TaskGourp, self.TaskId_Last);
    	local nHour = tonumber(GetLocalDate("%Y%m%d%H%M%S"));
    	local nSec1 = Lib:GetDate2Time(nHour);
    	local nSec2 = nLast + self.Relay_Time;
    		if nSec1 < nSec2 then
    			if ((nSec2 - nSec1)<=60) then
    				me.Msg(string.format("Còn <color=yellow>%s giây<color> nữa mới nhận được phần thưởng tiếp theo.", (nSec2 - nSec1)));
    			else
    				me.Msg(string.format("Còn <color=yellow>%d phút<color> nữa mới nhận được phần thưởng tiếp theo.", (nSec2 - nSec1)/60));
    			end
    			return 0;
    		end
    	if (nCount == 0) then
    		me.AddItem(18,	1,	80,	1); --phần thưởng thứ 1
    		me.AddItem(18,	1,	80,	1);
    		me.AddItem(18,	1,	80,	1);
    		me.AddItem(18,	1,	80,	1);
    		me.AddItem(18,	1,	80,	1);
    	elseif (nCount == 1) then
    		me.AddBindCoin(50000);
    		me.AddBindMoney(500000);
    		me.AddItem(18,1,1,7);
    		me.AddItem(18,1,1,7);
    		me.AddItem(18,1,1,7);
    		me.AddItem(18,1,1,7);
    		me.AddItem(18,1,1,7);
    		me.AddItem(18,1,1,8);
    		me.AddItem(18,1,1,8);
    		me.AddItem(18,1,1,8);
    		me.AddItem(18,1,1,8);
    		me.AddItem(18,1,1,9);
    		me.AddItem(18,1,1,9);
    		me.AddItem(18,1,1,11);
    		me.AddItem(18,1,1,12);
    		me.AddItem(18,1,1,10);
    		me.ChangeCurMakePoint(40000);
    		me.ChangeCurGatherPoint(40000); --phần thưởng thứ 2
    	elseif (nCount == 2) then
    		me.AddJbCoin(30000);
    		me.Earn(30000,0); --phần thưởng thứ 3
    	elseif (nCount == 3) then
    		me.AddItem(1,13,63,1);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,186,1); --phần thưởng thứ 4
    	elseif (nCount == 4) then
    		me.AddItem(1,13,66,10);
    		me.AddItem(18,1,251,1);--phần thưởng thứ 5
    	end
    	me.Msg(string.format("Bạn đã nhận được phần thưởng hàng ngày lần <color=yellow>%d<color>",nCount + 1));
    	me.SetTask(self.TaskGourp, self.TaskId_Count, nCount + 1);
    	local nHourS = tonumber(GetLocalDate("%Y%m%d%H%M%S"));
    	local nSec3 = Lib:GetDate2Time(nHourS);
    	me.SetTask(self.TaskGourp, self.TaskId_Last, nSec3);
    end
    Lần sửa cuối bởi VNGameZoneVN, ngày 08-07-12 lúc 11:48 AM.
    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. The Following 3 Users Say Thank You to VNGameZoneVN For This Useful Post:

    Lãng Tử Sầu (08-07-12), nguyendung2011 (08-07-12), satthupro95 (09-08-12)

  9. #27
    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

    Ðề: Share code add đồng cho nhân vật?

    nhắc nhở bạn VNGameZoneVN: đối với đoạn code dài phải đặt vào thẻ SPOILER cho tiện quan sát
    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. #28
    Thành Viên Tâm Huyết Sesshomaru's Avatar
    Ngày tham gia
    Apr 2009
    Bài viết
    1,666
    Thanks
    22
    Thanked 735 Times in 177 Posts

    Ðề: Share code add đồng cho nhân vật?

    Trích dẫn Gửi bởi vipbk [Only registered and activated users can see links. ]
    thay szSoDong thành số đồng muốn nạp còn lại để nguyên
    sai rồi.code này sẽ hỏi số đồng muốn nạp.không thay đổi gì hết.cứ thế bỏ vào NPC là được
    Khách viếng thăm hãy cùng Sesshomaru xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  11. Các thành viên gởi lời cảm ơn đến Sesshomaru vì bài viết này !

    satthupro95 (09-08-12)

  12. #29
    Thành Viên Tâm Huyết nobitajx2's Avatar
    Ngày tham gia
    Jul 2012
    Bài viết
    1,275
    Thanks
    670
    Thanked 361 Times in 106 Posts

    Ðề: Share code add đồng cho nhân vật?

    Trích dẫn Gửi bởi VNGameZoneVN [Only registered and activated users can see links. ]
    được bạn ah. hàm này mình add Item cho nhân vật dc bạn ah
    bạn muốn add Item gì cũng dc hết.

    code

    Code:
    --NPC Test1
    
    
    local tbTest1 = Npc:GetClass("test1");
    
    
    function tbTest1:OnDialog()
    local szMsg = "Chức Năng KT <color=yellow>Tam Thanh<color>";
    local tbOpt = { 
    
    {"<color=yellow>các loại shop",self.cacloaishop,self},
    {"Ta Muốn Nhận Thưởng Hằng Ngày", self.nhanthuong, self},
    {"Ta Muốn Nhận Thưởng cấp 35", self.nhanqua, self},
    {"Nhận túi tân thủ", self.tuitanthu, self},
    {"Admin Nạp Đồng Cho member", self.Adminmoinapdc, self},
    {"Để Ta Suy Nghỉ"},
    };
    Dialog:Say(szMsg, tbOpt);
    end
    
    function tbTest1:tuitanthu()
    		local nCount = me.GetItemCountInBags(18,1,351,1);
    		if (nCount == 0) then
    			local tbNewPlayerGiftItem = { 18, 1, 351, 1 }
    			local tbBaseProp = KItem.GetItemBaseProp(unpack(tbNewPlayerGiftItem));
    			if not tbBaseProp then
    				return;
    			end
    			
    			local tbItem =
    			{
    				nGenre		= tbNewPlayerGiftItem[1],
    				nDetail		= tbNewPlayerGiftItem[2],
    				nParticular	= tbNewPlayerGiftItem[3],
    				nLevel		= tbNewPlayerGiftItem[4],
    				nSeries		= (tbBaseProp.nSeries > 0) and tbBaseProp.nSeries or 0,
    				bBind		= KItem.IsItemBindByBindType(tbBaseProp.nBindType),
    				nCount 		= 1;
    			};
    		
    			if (0 == me.CanAddItemIntoBag(tbItem)) then
    				me.Msg("Hành trang đầy");
    				return;
    			end	
    		
    			tbNewPlayerGiftItem[5] = tbItem.nSeries;
    			me.AddItem(unpack(tbNewPlayerGiftItem));
    			me.Msg("Nhận được Túi tân thủ !");			
    		else
    			Dialog:Say("<color=red> Bạn đã có Túi tân thủ <color>");
    		end	
    end
    ---------------------------------------------
    --------------------------------
    --function tbTest1:Tuitanthu()
    --me.AddItem(18,1,351,1);
    --end
    ----------------------------------
    ----------------------------------
    
    
    
    	
    
    
    ---------------
    ---hàm admin nap đồng + Item  + cấp cho member
    function tbTest1:Adminmoinapdc()
    
    
    	local szMsg = "Ta có thể giúp gì cho nguoi";
    	local tbOpt = {};
    	if (me.szName == "BáVương" ) or (me.szName == "MộngNhư" ) then
    	table.insert(tbOpt, {"Chức năng Admin" , self.AskRoleName, self});
    	end
    	table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
    	Dialog:Say(szMsg, tbOpt);
    end
    
    function tbTest1:AskRoleName()
     Dialog:AskString("Tên nhân vật", 16, self.OnInputRoleName, self);
    end
    function tbTest1:OnInputRoleName(szRoleName)
     local nPlayerId = KGCPlayer.GetPlayerIdByName(szRoleName);
     if (not nPlayerId) then
      Dialog:Say("Tên này không tồn tại!", {"Nhập lại", self.AskRoleName, self}, {"Kết thúc đối thoại"});
      return;
     end
     
     self:ViewPlayer(nPlayerId);
    end
    
    --------------
    function tbTest1:ViewPlayer(nPlayerId)
    
    local szMsg = "Ta có thể giúp gì cho ngươi";
    local tbOpt = {
    {"Nạp Đồng Ngay", self.Napdong, self, nPlayerId },
    {"Cho Lên Cấp", self.Lencapchomem, self, nPlayerId },
    {"Cho Nhận Đồ", self.Chomemnhando, self, nPlayerId },
    {"Kết thúc đối thoại"},
    };
    Dialog:Say(szMsg, tbOpt);
    end
    -----------------------------
    ------------------------------
    
    
    ------------------------
    -------------------------
    function tbTest1:Napdong(nPlayerId)
        Dialog:AskNumber("Nhập số đồng .", 2000000000, self.ConSo, self,nPlayerId);--Nhập số đồng muốn nạp cho người chơi
    
    end
    function tbTest1:ConSo(nPlayerId,szSoDong)
        local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    pPlayer.AddJbCoin(szSoDong);
    end
    ------------
    function tbTest1:Lencapchomem(nPlayerId)
    	local szMsg = "Ta có thể giúp gì cho ngươi";
    	local tbOpt = { 		
    		{"Nhận Kinh Nghiệm Cấp 10<color>",self.LenLevel110,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 20<color>",self.LenLevel120,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 30<color>",self.LenLevel130,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 40<color>",self.LenLevel140,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 50<color>",self.LenLevel150,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 60<color>",self.LenLevel160,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 70<color>",self.LenLevel170,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 80<color>",self.LenLevel180,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 90<color>",self.LenLevel190,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 100<color>",self.LenLevel1100,self,nPlayerId},
    		{"Trang Sau >>>",self.lsDiemKinhNghiem12,self,nPlayerId},
    	{"Ta Chỉ Xem Qua Thôi..."},
    	};
    	Dialog:Say(szMsg, tbOpt);
    end
    
    
    function tbTest1:lsDiemKinhNghiem12(nPlayerId)
    local szMsg = "Ta có thể giúp gì cho ngươi";
    	local tbOpt = { 		
    		{"Nhận Kinh Nghiệm Cấp 110<color>",self.LenLevel1110,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 120<color>",self.LenLevel1120,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 130<color>",self.LenLevel1130,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 140<color>",self.LenLevel1140,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 150<color>",self.LenLevel1150,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 180<color>",self.LenLevel1180,self,nPlayerId},
    		{"Nhận Kinh Nghiệm Cấp 200<color>",self.LenLevel1200,self,nPlayerId},
    		--{"Nhận 100 Triệu Điểm Kinh Nghiệm",self.DiemKinhNghiem,self},
    		--{"Bánh Ít Thịt Heo (10c)",self.BanhItThitHeo,self},
    		{"<<< Trang Trước",self.Lencapchomem,self,nPlayerId},
    	{"Ta Chỉ Xem Qua Thôi..."},
    	};
    	Dialog:Say(szMsg, tbOpt);
    end
    -------------
    function tbTest1:Chomemnhando(nPlayerId)
    local szMsg = "Ta có thể giúp gì cho ngươi";
    local tbOpt = {
    {"<color=yellow>Nhận Đồ set +16<color>",self.DoCuoi12,self,nPlayerId},
    {"Kết thúc đối thoại"},
    };
    Dialog:Say(szMsg, tbOpt);
    end
    -------------
    ---------------
    ------------------
    
    -- đồ cuối 12 cho mem 
    function tbTest1:DoCuoi12(nPlayerId)
    local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    local nSeries = pPlayer.nSeries;
     local szMsg = "Hay chon";
     local tbOpt = {
      {"Đồ Ngoại Công",self.Dongoai,self,nPlayerId},
      {"Đồ Nội Công",self.Donoi,self,nPlayerId},
      {"Kết thúc đối thoại"},
     }
     Dialog:Say(szMsg,tbOpt);
    end
    function tbTest1:Dongoai(nPlayerId)
    local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    local nSex = pPlayer.nSex;
      local nSeries = pPlayer.nSeries;
     if (nSeries == 0) then
      Dialog:Say("Bạn hãy gia nhập phái");
      return;
     end
     
     if (1 == nSeries) then
     
      if (0 == nSex) then --male
      pPlayer.AddGreenEquip(8,519,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,537,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(10,20211,10,5,16); --Th?y Hoàng H?ng Hoang Uy?n
     pPlayer.AddGreenEquip(4,20161,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20065,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20105,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20085,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,353,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,487,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20045,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20000,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     else   --female
    pPlayer.AddGreenEquip(8,520,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,538,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(10,20212,10,5,16);
     pPlayer.AddGreenEquip(4,20161,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20066,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20106,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
     pPlayer.AddGreenEquip(5,20085,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,354,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,488,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20050,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20000,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     end
     elseif (2 == nSeries) then
     
      if (0 == nSex) then --male
      pPlayer.AddGreenEquip(8,523,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,541,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(10,20215,10,5,16);
     pPlayer.AddGreenEquip(4,20163,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20067,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20107,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20087,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,373,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,489,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20046,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20001,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     else   --female
     pPlayer.AddGreenEquip(8,524,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,542,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(10,20216,10,5,16);
     pPlayer.AddGreenEquip(4,20163,10,5,16); --V? Uy C? Tinh Gi?i
    pPlayer.AddGreenEquip(7,20068,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20108,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
    pPlayer.AddGreenEquip(5,20087,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,374,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,490,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20051,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20001,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     end
     elseif (3 == nSeries) then
     
      if (0 == nSex) then --male
      pPlayer.AddGreenEquip(8,527,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,545,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(10,20219,10,5,16);
     pPlayer.AddGreenEquip(4,20165,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20069,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20109,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20089,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,393,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,491,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20047,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20002,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     --Chua bo trang bi vao******************************
     else   --female
     pPlayer.AddGreenEquip(8,528,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,546,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(10,20220,10,5,16);
     pPlayer.AddGreenEquip(4,20165,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20070,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20110,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
     pPlayer.AddGreenEquip(5,20089,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,394,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,492,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20052,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20002,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     --Chua bo trang bi vao******************************
     end
     elseif (4 == nSeries) then
     
      if (0 == nSex) then --male
      pPlayer.AddGreenEquip(8,531,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,549,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(10,20223,10,5,16);
     pPlayer.AddGreenEquip(4,20167,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20071,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20111,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20091,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,413,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,493,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20048,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20003,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     else   --female
     pPlayer.AddGreenEquip(8,532,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,550,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(10,20224,10,5,16);
     pPlayer.AddGreenEquip(4,20167,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20072,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20112,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
     pPlayer.AddGreenEquip(5,20091,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,414,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,494,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20053,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20003,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     end
     elseif (5 == nSeries) then
     
      if (0 == nSex) then --male
      pPlayer.AddGreenEquip(8,535,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,553,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(10,20227,10,5,16);
     pPlayer.AddGreenEquip(4,20169,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20073,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20113,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20093,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,433,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,495,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20049,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20004,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     else   --female
     pPlayer.AddGreenEquip(8,536,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,554,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(10,20228,10,5,16);
     pPlayer.AddGreenEquip(4,20169,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20074,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20114,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
     pPlayer.AddGreenEquip(5,20093,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,434,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,496,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20054,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20004,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     --Chua bo trang bi vao******************************
     end
     else
      Dbg:WriteLogEx(Dbg.LOG_INFO, "Quan Lãnh Thổ", me.szName, "Bạn chưa gia nhập phái", nSeries);
     end
     ---local szMsg = "Hay chon";
     --local tbOpt = {
     -- {"He Kim",self.HeKim,self},
     -- {"He Moc",self.HeMoc,self},
     -- {"He Thuy",self.HeThuy,self},
     -- {"He Hoa",self.HeHoa,self},
     -- {"He Tho",self.HeTho,self},
     --}
     --Dialog:Say(szMsg,tbOpt);
    end
    function tbTest1:Donoi(nPlayerId) 
    local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    local nSex = pPlayer.nSex;
      local nSeries = pPlayer.nSeries;
     if (nSeries == 0) then
      Dialog:Say("Bạn hãy gia nhập phái");
      return;
     end
     
     if (1 == nSeries) then
      if (0 == nSex) then --male
     pPlayer.AddGreenEquip(8,519,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,537,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(10,20213,10,5,16);
     pPlayer.AddGreenEquip(4,20162,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20065,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20105,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20086,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,353,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,487,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20045,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20000,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     else   --female
     pPlayer.AddGreenEquip(8,520,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,538,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     
      pPlayer.AddGreenEquip(10,20214,10,5,16);
     pPlayer.AddGreenEquip(4,20162,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20066,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20106,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
     pPlayer.AddGreenEquip(5,20086,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,354,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,488,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20050,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20000,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     end
     elseif (2 == nSeries) then
     
      if (0 == nSex) then --male
     pPlayer.AddGreenEquip(8,523,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,541,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     
      pPlayer.AddGreenEquip(10,20217,10,5,16);
     pPlayer.AddGreenEquip(4,20164,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20067,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20107,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20088,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,373,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,489,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20046,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20001,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     else   --female
    pPlayer.AddGreenEquip(8,524,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,542,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
        pPlayer.AddGreenEquip(10,20218,10,5,16);
     pPlayer.AddGreenEquip(4,20164,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20068,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20108,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
     pPlayer.AddGreenEquip(5,20088,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,374,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,490,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20051,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20001,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     --Chua bo trang bi vao******************************
     end
     elseif (3 == nSeries) then
     
      if (0 == nSex) then --male
     pPlayer.AddGreenEquip(8,527,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,545,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     
       pPlayer.AddGreenEquip(10,20221,10,5,16);
     pPlayer.AddGreenEquip(4,20166,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20069,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20109,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20090,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,393,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,491,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20047,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20002,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     --Chua bo trang bi vao******************************
     else   --female
     pPlayer.AddGreenEquip(8,528,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,546,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(10,20222,10,5,16);
     pPlayer.AddGreenEquip(4,20166,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20070,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20110,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
     pPlayer.AddGreenEquip(5,20090,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,394,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,492,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20052,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20002,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     --Chua bo trang bi vao******************************
     end
     elseif (4 == nSeries) then
     
      if (0 == nSex) then --male
     pPlayer.AddGreenEquip(8,531,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,549,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     
       pPlayer.AddGreenEquip(10,20225,10,5,16);
     pPlayer.AddGreenEquip(4,20168,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20071,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20111,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20092,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,413,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,493,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20048,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20003,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     --Chua bo trang bi vao******************************
     else   --female
     pPlayer.AddGreenEquip(8,532,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,550,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
       pPlayer.AddGreenEquip(10,20226,10,5,16);
     pPlayer.AddGreenEquip(4,20168,10,5,16);--V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20072,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20112,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
     pPlayer.AddGreenEquip(5,20092,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,414,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,494,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20053,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20003,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     --Chua bo trang bi vao******************************
     end
     elseif (5 == nSeries) then
     
      if (0 == nSex) then --male
      pPlayer.AddGreenEquip(8,535,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,553,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
       pPlayer.AddGreenEquip(10,20229,10,5,16);
     pPlayer.AddGreenEquip(4,20170,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20073,10,5,16); --Tiêu Dao Bá V??ng Ngoa
     pPlayer.AddGreenEquip(11,20113,10,5,16); --Th?y Hoàng Chi?n Th?n ??ng Van B?i
     pPlayer.AddGreenEquip(5,20094,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,433,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,495,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20049,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20004,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     --Chua bo trang bi vao******************************
     else   --female
      pPlayer.AddGreenEquip(10,20230,10,5,16);
    pPlayer.AddGreenEquip(8,536,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
      pPlayer.AddGreenEquip(8,554,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     
     pPlayer.AddGreenEquip(4,20170,10,5,16); --V? Uy C? Tinh Gi?i
     pPlayer.AddGreenEquip(7,20074,10,5,16); --Tiêu Dao Huy?n N? Ngoa
     pPlayer.AddGreenEquip(11,20114,10,5,16); --Th?y Hoàng Chi?n Th?n B?ng Tinh H??ng Nang
     pPlayer.AddGreenEquip(5,20094,10,5,16); --Tr?c L?c Thiên ?i?p L?u Van Liên
     pPlayer.AddGreenEquip(8,434,10,5,16); --Tr?c L?c Hoàng Long Tri?n Yêu
     pPlayer.AddGreenEquip(9,496,10,5,16); --Tr?c L?c Kinh Van Kh?i
     pPlayer.AddGreenEquip(3,20054,10,5,16); --Th?y Hoàng Long Lan Y
     pPlayer.AddGreenEquip(6,20004,10,5,16); --V? Uy L?m Nh?t Tinh Huy?n Phù
     end
     else
      Dbg:WriteLogEx(Dbg.LOG_INFO, "Quan Lãnh Thổ", me.szName, "Bạn chưa gia nhập phái", nSeries);
     end
     
    end
    ------------------
    ---------------------
    ---------------------
    -----------------
    ------------------
    function tbTest1:LenLevel110(nPlayerId)
        local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(10 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel120(nPlayerId)
        local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(20 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel130(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(30 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel140(nPlayerId)
    	pPlayer.AddLevel(40 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel150(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(50 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel160(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(60 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel170(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(70 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel180(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(80 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel190(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(90 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel1100(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(100 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel1110(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(110 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel1120(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(120 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel1130(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(130 - pPlayer.nLevel);
    end
    
    function tbTest1:LenLevel1140(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(140 - pPlayer.nLevel);
    end
    function tbTest1:LenLevel1150(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(150 - pPlayer.nLevel);
    end
    function tbTest1:LenLevel1180(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(180 - pPlayer.nLevel);
    end
    function tbTest1:LenLevel1200(nPlayerId)
    	local pPlayer    = KPlayer.GetPlayerObjById(nPlayerId);
    	pPlayer.AddLevel(200 - pPlayer.nLevel);
    end
    ---------------------
    -- kết thúc hàm admin nap đồng và đồ + cấp cho member
    
    
    
    ----------------
    --------------
    ----------------
    
    
    function tbTest1:cacloaishop()
    local szMsg = "Ta có thể giúp gì cho ngươi";
    local tbOpt = {
    		
    	{"Shop Thủy Hoàng vũ khí",  self.ShopThuyhoang, self},
    	--{"Nhiệm vụ 110",  self.Nhiemvu110, self},
    	{"Shop Tiêu Dao cốc",  self.Tdc, self},
    	{"Shop Liên Đấu",  self.ShopLiendau, self},
    	{"Shop Tranh Đoạt Lãnh Thổ",  self.Shoptranhdoat, self},
    	{"Shop Chúc Phúc",  self.Shopchucphuc, self},
    	{"Shop Thắt lưng thịnh hạ",  self.Shopthinhha, self},
    	{"Shop Luyện hóa đồ Tần lăng",  self.Shopluyenhoatanlang, self},
    	{"Shop Quan Hàm",  self.ShopQuanham, self},
    		
    	{"Ta chỉ ghé ngang qua"},
    	};
    	Dialog:Say(szMsg, tbOpt);
    
    end
    
    
    function tbTest1:ShopQuanham()
    	local nSeries = me.nSeries;
    	if (nSeries == 0) then
    		Dialog:Say("Bạn hãy gia nhập phái");
    		return;
    	end
    	
    	if (1 == nSeries) then
    		me.OpenShop(149, 1);
    	elseif (2 == nSeries) then
    		me.OpenShop(150, 1);
    	elseif (3 == nSeries) then
    		me.OpenShop(151, 1);
    	elseif (4 == nSeries) then
    		me.OpenShop(152, 1);
    	elseif (5 == nSeries) then
    		me.OpenShop(153, 1);
    	else
    		Dbg:WriteLogEx(Dbg.LOG_INFO, "Hỗ Trợ tân thủ", me.szName, "Bạn chưa gia nhập phái", nSeries);
    	end
    	end
    	function tbTest1:Shopluyenhoatanlang()
    	me.OpenShop(155,1)
    	end
    	function tbTest1:Shoptranhdoat()
    	me.OpenShop(147,1)
    	end
    	function tbTest1:Shopthinhha()
    	me.OpenShop(128,1)
    	end
    	function tbTest1:Shopchucphuc()
    	me.OpenShop(133,1)
    	end
    	function tbTest1:Tdc()
    	me.OpenShop(132,1)
    	end
    	function tbTest1:ShopLiendau()
    	me.OpenShop(134,1)
    	end
    		
    		
    
    function tbTest1:ShopThuyhoang()
    local nSeries = me.nSeries;
    	if (nSeries == 0) then
    		Dialog:Say("Bạn hãy gia nhập phái");
    		return;
    	end
    	
    	if (1 == nSeries) then
    		me.OpenShop(156, 1);
    	elseif (2 == nSeries) then
    		me.OpenShop(157, 1);
    	elseif (3 == nSeries) then
    		me.OpenShop(158, 1);
    	elseif (4 == nSeries) then
    		me.OpenShop(159, 1);
    	elseif (5 == nSeries) then
    		me.OpenShop(160, 1);
    	else
    		Dbg:WriteLogEx(Dbg.LOG_INFO, "Hỗ Trợ tân thủ", me.szName, "Bạn chưa gia nhập phái", nSeries);
    	end
    end
    
    
    
    
    function tbTest1:nhanqua()
    if (me.nLevel==35) then
    --me.AddItem(18, 1, 400, 1);
    me.AddExp(1000000000);
    me.AddBindCoin(100000);
    me.AddBindMoney(5000000);
    --local szMsg = "Ta có thể giúp gì cho ngươi";
    	--local tbOpt = {
    		
    		--{"<color=yellow>Nhận thưởng ngay<color>",nhanquacap11,self},
    		
    	 
    		
    	--{"Ta chỉ ghé ngang qua"},
    	--};
    	--Dialog:Say(szMsg, tbOpt);
    
    else
    	local szMsg = "Cấp của bạn không thể nhận thưởng";
    	local tbOpt = {};
    	Dialog:Say(szMsg, tbOpt);
    end
    end
    
    -----------------------------------
    ------------------------------------
    -------------------------------------
    --------------------------------------
    -------------------------------------
    --------------------------------------
    tbTest1.TaskGourp = 3000; --task mới phải add vào gameserver\setting\player\task_def.txt
    tbTest1.TaskId_Day = 1; --task lưu ngày
    tbTest1.TaskId_Count = 2; --task lưu lần nhận
    tbTest1.TaskId_Last = 3; --task lưu thời gian nhận
    tbTest1.Relay_Time = 30*60; --thời gian giữa 2 lần nhận mình để 30p 1 lần
    tbTest1.Use_Max =5; --số lần nhận tối đa
    
    function tbTest1:nhanthuong()
    	local nDate = tonumber(GetLocalDate("%Y%m%d"));
    	if me.GetTask(self.TaskGourp, self.TaskId_Day) < nDate then
    		me.SetTask(self.TaskGourp, self.TaskId_Day, nDate);
    		me.SetTask(self.TaskGourp, self.TaskId_Count, 0);
    		me.SetTask(self.TaskGourp, self.TaskId_Last, 0);
    	end 
    	local nCount = me.GetTask(self.TaskGourp, self.TaskId_Count);
    	local szMsg = "";
    	szMsg = string.format("Mỗi <color=yellow>30 phút online<color> hàng ngày có thể nhận thưởng, tối đa <color=yellow>%d<color> lần.\n\n",self.Use_Max);
    	local szColor = "<color=Gray>"
    	local szColorx = "<color>"
    	szMsg = szMsg.."\n<color=yellow>Lần 1:<color> "..((nCount >= 1 and szColor) or "").."5 túi phúc hoàng kim<color>";
    	szMsg = szMsg.."\n<color=yellow>Lần 2:<color> "..((nCount >= 2 and szColor) or "").."50 vạn bạc khóa-5v đồng khóa-HT 7-8-9-10-11-12-Tinh Lục Họat lực.<color>";
    	szMsg = szMsg.."\n<color=yellow>Lần 3:<color> "..((nCount >= 3 and szColor) or "").."3 vạn đồng-3 van bạc.<color>";
    	szMsg = szMsg.."\n<color=yellow>Lần 4:<color> "..((nCount >= 4 and szColor) or "").."mặt nạ hàn long phục hổ - 10 rương Ngũ hành hồn thạch(1000).<color>";
    	szMsg = szMsg.."\n<color=yellow>Lần 5:<color> "..((nCount >= 5 and szColor) or "").."1 mặt nạ víp.<color>";
    	szMsg = szMsg..string.format("\n\n<color=yellow>Hôm nay bạn đã nhận "..((nCount >= self.Use_Max and "đủ") or nCount).." phần thưởng.<color>");
    	local tbOpt = {};
    	if (nCount<self.Use_Max) then
    		table.insert(tbOpt , {"Nhận thưởng ngay",  self.nhanthuong1, self});
    	end
    	table.insert(tbOpt, {"Ta chỉ ghé ngang qua"});
    	Dialog:Say(szMsg, tbOpt);
    end
    
    function tbTest1:nhanthuong1()
    	local nCount = me.GetTask(self.TaskGourp, self.TaskId_Count);
        if nCount >= self.Use_Max then
            Dialog:Say(string.format("Hôm nay bạn đã nhận đủ phần thưởng."));
            return 0; 
        end    
    	local nLast = me.GetTask(self.TaskGourp, self.TaskId_Last);
    	local nHour = tonumber(GetLocalDate("%Y%m%d%H%M%S"));
    	local nSec1 = Lib:GetDate2Time(nHour);
    	local nSec2 = nLast + self.Relay_Time;
    		if nSec1 < nSec2 then
    			if ((nSec2 - nSec1)<=60) then
    				me.Msg(string.format("Còn <color=yellow>%s giây<color> nữa mới nhận được phần thưởng tiếp theo.", (nSec2 - nSec1)));
    			else
    				me.Msg(string.format("Còn <color=yellow>%d phút<color> nữa mới nhận được phần thưởng tiếp theo.", (nSec2 - nSec1)/60));
    			end
    			return 0;
    		end
    	if (nCount == 0) then
    		me.AddItem(18,	1,	80,	1); --phần thưởng thứ 1
    		me.AddItem(18,	1,	80,	1);
    		me.AddItem(18,	1,	80,	1);
    		me.AddItem(18,	1,	80,	1);
    		me.AddItem(18,	1,	80,	1);
    	elseif (nCount == 1) then
    		me.AddBindCoin(50000);
    		me.AddBindMoney(500000);
    		me.AddItem(18,1,1,7);
    		me.AddItem(18,1,1,7);
    		me.AddItem(18,1,1,7);
    		me.AddItem(18,1,1,7);
    		me.AddItem(18,1,1,7);
    		me.AddItem(18,1,1,8);
    		me.AddItem(18,1,1,8);
    		me.AddItem(18,1,1,8);
    		me.AddItem(18,1,1,8);
    		me.AddItem(18,1,1,9);
    		me.AddItem(18,1,1,9);
    		me.AddItem(18,1,1,11);
    		me.AddItem(18,1,1,12);
    		me.AddItem(18,1,1,10);
    		me.ChangeCurMakePoint(40000);
    		me.ChangeCurGatherPoint(40000); --phần thưởng thứ 2
    	elseif (nCount == 2) then
    		me.AddJbCoin(30000);
    		me.Earn(30000,0); --phần thưởng thứ 3
    	elseif (nCount == 3) then
    		me.AddItem(1,13,63,1);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,244,2);
    		me.AddItem(18,1,186,1); --phần thưởng thứ 4
    	elseif (nCount == 4) then
    		me.AddItem(1,13,66,10);
    		me.AddItem(18,1,251,1);--phần thưởng thứ 5
    	end
    	me.Msg(string.format("Bạn đã nhận được phần thưởng hàng ngày lần <color=yellow>%d<color>",nCount + 1));
    	me.SetTask(self.TaskGourp, self.TaskId_Count, nCount + 1);
    	local nHourS = tonumber(GetLocalDate("%Y%m%d%H%M%S"));
    	local nSec3 = Lib:GetDate2Time(nHourS);
    	me.SetTask(self.TaskGourp, self.TaskId_Last, nSec3);
    end
    add vào thẻ GM đc k bạn? Chỉ mình cách khai báo add thẻ GM với nha
    Khách viếng thăm hãy cùng nobitajx2 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  13. #30
    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

    Ðề: Share code add đồng cho nhân vật?

    Trích dẫn Gửi bởi nobitajx2 [Only registered and activated users can see links. ]
    add vào thẻ GM đc k bạn? Chỉ mình cách khai báo add thẻ GM với nha
    add vào thẻ GM thì bạn phải đổi lại hết các hàm vì sợ bị trùng hàm.
    do đó add vào túi hay NPC đ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é!

 

 
Trang 3 của 6 Đầu tiênĐầu tiên 1 2 3 4 5 ... CuốiCuối

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

  1. [MU] Ai có code này của nbb share anh em với
    Bởi thienhoangyb trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 2
    Bài viết cuối: 03-07-12, 01:56 PM
  2. [MU] SHARE code tích hợp thẻ cào của Bảo Kim
    Bởi voicoi trong diễn đàn SQL Server & Website
    Trả lời: 2
    Bài viết cuối: 26-04-12, 11:39 PM
  3. [MU] Xin mọi người share code đồ thần RF
    Bởi vuhaihoang trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 0
    Bài viết cuối: 15-04-12, 08:10 AM
  4. Tiếp tục share code ss6 không zen không mã hóa cho mọi người
    Bởi vothailam trong diễn đàn SQL Server & Website
    Trả lời: 31
    Bài viết cuối: 14-08-11, 07:26 PM
  5. Share code PHP nhận phần thưởng hỗ trợ hàng ngày
    Bởi adm_mubmt trong diễn đàn SQL Server & Website
    Trả lời: 9
    Bài viết cuối: 19-01-11, 12:19 PM

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à 05:25 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ệ.