[KT] cho hỏi cái script chuyển sinh
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 2 của 2
  1. #1
    Thành Viên
    Ngày tham gia
    Jul 2012
    Bài viết
    317
    Thanks
    105
    Thanked 54 Times in 38 Posts

    cho hỏi cái script chuyển sinh

    sao cs tới lần thứ 10 thì không cs dc nua ai biết giúp em
    Code:
    function tbLiGuan:chuyensinh()
     local tbNpc = Npc:GetClass("chuyensinh");
     tbNpc:OnDialog();
    end  
    
    local tbLiGuan = Npc:GetClass("chuyensinh");
    
    local REQUIRECS_ITEM = 
    		{ 
    			[0] = 
    			{
    				{
    					{
    						string.format("%s,%s,%s,%s", 18, 1, 205, 1),
    					}, 
    					100000
    				},
    			},
    			[1] = 
    			{
    				{
    					{
    						string.format("%s,%s,%s,%s", 18, 1, 205, 1),
    					}, 
    					100000
    				},
    			},
    			[2] = 
    			{
    				{
    					{
    						string.format("%s,%s,%s,%s", 18, 1, 205, 1),
    					}, 
    					100000
    				},
    			},
    			[3] = 
    			{
    				{
    					{
    						string.format("%s,%s,%s,%s", 18, 1, 205, 1),
    					}, 
    					100000
    				},
    			},
    			[4] = 
    			{
    				{
    					{
    						string.format("%s,%s,%s,%s", 18, 1, 205, 1),
    					}, 
    					100000
    				},
    			},
    			[5] = 
    			{
    				{
    					{
    						string.format("%s,%s,%s,%s", 18, 1, 205, 1),
    					}, 
    					100000
    				},
    			},
    			[6] = 
    			{
    				{
    					{
    						string.format("%s,%s,%s,%s", 18, 1, 205, 1),
    					}, 
    					100000
    				},
    			},
    			[7] = 
    			{
    				{
    					{
    						string.format("%s,%s,%s,%s", 18, 1, 205, 1),
    					}, 
    					100000
    				},
    			},
    			[8] = 
    			{
    				{
    					{
    						string.format("%s,%s,%s,%s", 18, 1, 205, 1),
    					}, 
    					100000
    				},
    			},
    			[9] = 
    			{
    				{
    					{
    						string.format("%s,%s,%s,%s", 18, 1, 205, 1),
    					}, 
    					100000
    				},
    			},
    		};
    
    tbLiGuan.TaskGourp_CS = 3004;
    tbLiGuan.TaskId_Count_CS = 1;
    function tbLiGuan:OnDialog()
      local tbOpt = {
        		{"<color=yellow>Ta Muốn Tìm hiểu thêm về Chuyển Sinh.<color>", self.OnDialog_3, self},--
      			{"<color=Red>Ta Muốn Chuyển Sinh.<color>", self.DoItemCs, self},--
    			{"Kết thúc đối thoại"},
    		}
    	if me.nLevel <= 90 and me.GetTask(3004,1) >0 then
    		table.insert(tbOpt, 3, {"<color=red>Hỗ Trợ sau Chuyển Sinh<color>", self.HoTroChuyenSinh, self});
    	end
    
    	local szMsg = "Ta Sẽ Giúp nhà ngươi chuyển sinh.Sẵn sàng chưa?";
    
    Dialog:Say(szMsg, tbOpt);
    end;
    function tbLiGuan:OnDialog_3()
       
      local tbOpt = {};
      tbOpt = Lib:MergeTable( tbOpt,{
    			{"Trở về",  self.OnDialog, self},
    			{"Đóng"},
    	});
       
      Dialog:Say(
      	"   Tối đa nhà ngươi chỉ có thể chuyển sinh <color=Red>20 lần<color>,phí chuyển sinh là <color=gold>10 vạn Ngũ Hành Hồn Thạch<color>,mỗi lần sẽ tính theo quy tắc sau:\n"..
      	"   Lần 1: Yêu cầu <color=Red>150 cấp<color>,sau chuyển sinh Nhà ngươi nhận được <color=gold><color=red>100<color> điểm tiềm năng<color> và <color=gold><color=red>10<color> điểm kĩ năng<color>\n"..
      	"   Lần 2: Yêu cầu <color=Red>145 cấp<color>,sau chuyển sinh Nhà ngươi nhận được <color=gold><color=red>110<color> điểm tiềm năng<color> và <color=gold><color=red>2<color> điểm kĩ năng<color>,được <color=red>Cộng dồn<color> với số điểm lần 1\n"..
       	"   Các lần kế tiếp cần <color=red>140 cấp<color>,sau chuyển sinh Nhà ngươi nhận được <color=gold><color=red>100 + (số lần chuyển sinh - 1) x10<color> điểm tiềm năng<color> và <color=gold><color=red>số lần chuyển sinh<color> điểm kĩ năng<color>,được <color=red>Cộng dồn<color> với tất cả các lần trước đó."
     ,tbOpt);
      	     
      return 0;
    end;
    function tbLiGuan:DoItemCs(nValue)
    	local nValue = me.GetTask(tbLiGuan.TaskGourp_CS,tbLiGuan.TaskId_Count_CS);
    		local szMsg = "Chuyển sinh Nhân Vật";
    			if (nValue == 0) then
    				if me.nLevel < 150 then
    					me.Msg("Cấp độ dưới 150 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 1) then
    				if me.nLevel < 145 then
    					me.Msg("Cấp độ dưới 145 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 2) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 3) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 4) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 5) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 6) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 7) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 8) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 9) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 10) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 11) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 12) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    		    if (nValue == 13) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 14) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 15) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 16) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 17) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 18) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 19) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue == 20) then
    				if me.nLevel < 140 then
    					me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
    				return 0;
    				end
    				szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
    			end;
    			if (nValue > 20) then
    				me.Msg("Bạn Đã chuyển sinh 20 lần,không thể chuyển sinh nữa.Chờ đợt event kế tiếp !");
    				return 0;
    			end;
    	
    	Dialog:OpenGift(szMsg, nil, {self.OnCsOpenGiftOk, self, nValue});
    end;
    
    function tbLiGuan:OnCsOpenGiftOk(nValue, tbItemObj)
    	local tbItemList	= {};
    		
    	for _, pItem in pairs(tbItemObj) do
    		if (self:CheckCSItem(pItem, REQUIRECS_ITEM[nValue], tbItemList) ~= 1) then
    			me.Msg("Không có vật phẩm yêu cầu!");
    			return 0;
    		end;
    	end
    
    	local bResult 	= false;
    	for i = 1, #REQUIRECS_ITEM[nValue] do
    		if (REQUIRECS_ITEM[nValue][i][2] ~= tbItemList[i]) then
    			bResult = true;
    		end;
    	end;
    	
    	if (bResult) then
    		me.Msg("Số lượng vật phẩm không chính xác!");
    		return 0;
    	end;
    	
    	for _, pItem in pairs(tbItemObj) do
    		if me.DelItem(pItem[1]) ~= 1 then
    			return 0;
    		end
    	end
    	local szMsg = string.format("Chúc mừng người chơi <color=cyan>%s<color> Chuyển Sinh lần thứ <color=cyan>%s<color>", me.szName, nValue+1 );
    	KDialog.NewsMsg(1, Env.NEWSMSG_COUNT, szMsg);
    	KDialog.MsgToGlobal(szMsg);			
    	me.SendMsgToFriend("Hảo hữu của bạn [<color=yellow>" .. me.szName 
    		.. "<color>] Chuyển Sinh lần thứ  <color=cyan>"
    	.. nValue+1 .."<color>");                              
    
    	if (nValue == 0) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug	
            me.AddTitle(6,30,2,9); -- add danh hieu		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(100); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    	if (nValue == 1) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug	
    		me.AddTitle(6,30,2,9); -- add danh hieu		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(120); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    	if (nValue == 2) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug		
    		me.AddTitle(6,30,2,9); -- add danh hieu		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(140); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    	if (nValue == 3) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug		
    		me.AddTitle(6,30,2,9); -- add danh hieu		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(160); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    	if (nValue == 4) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug	
    		me.AddTitle(6,30,2,9); -- add danh hieu		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(180); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    	if (nValue == 5) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug
    		me.AddTitle(6,30,2,9); -- add danh hieu		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(200); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    	if (nValue == 6) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug	
            me.AddTitle(6,31,2,9);		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(220); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    	if (nValue == 7) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug
            me.AddTitle(6,31,2,9);		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(240); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    	if (nValue == 8) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug
            me.AddTitle(6,31,2,9);		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(260); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    	if (nValue == 9) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug
            me.AddTitle(6,31,2,9);		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(280); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    	if (nValue == 10) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug
            me.AddTitle(6,31,2,9);		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(300); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    	if (nValue == 11) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug
            me.AddTitle(6,31,2,9);		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(320); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    	if (nValue == 12) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug
            me.AddTitle(6,31,2,9);		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(340); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    	if (nValue == 13) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug
            me.AddTitle(6,31,2,9);		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(360); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    	if (nValue == 14) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug
            me.AddTitle(6,31,2,9);		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(380); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    	if (nValue == 15) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug
            me.AddTitle(6,32,2,9);		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(400); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    if (nValue == 16) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug
    		me.AddTitle(6,32,2,9);
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(420); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    if (nValue == 17) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug	
            me.AddTitle(6,32,2,9);		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(440); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    	if (nValue == 18) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug	
            me.AddTitle(6,32,2,9);		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(480); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    if (nValue == 19) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug
            me.AddTitle(6,32,2,9);		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(500); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    	if (nValue == 20) then
    		
    		me.ResetFightSkillPoint();	-- Reset diem tien nang		
    		me.UnAssignPotential();		-- Reset diem mon phai
    		me.AddLevel(10 - me.nLevel);	-- Reset cap do tro ve 10
    		me.AddExp(me.GetUpLevelExp());		-- up max kinh nghiem chong bug
            me.AddTitle(6,32,2,9);		
    		me.AddFightSkillPoint(5); -- add diem skill mon phai
    		me.AddPotential(520); -- add diem tiem nang
    		Player:SetFree(me.szName);
    		me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
    	end;
    	
    end;
    
    
    
    function tbLiGuan:CheckCSItem(pItem, tbItemList, tbCountList)
    	if (not pItem) then
    		return 0;
    	end;
    	local szItem		= string.format("%s,%s,%s,%s",pItem[1].nGenre, pItem[1].nDetail, pItem[1].nParticular, pItem[1].nLevel);
    	
    	for i = 1, #tbItemList do
    		local tbI = tbItemList[i];
    		for j = 1, #tbI[1] do
    			if (szItem == tbI[1][j]) then
    				tbCountList[i] = (tbCountList[i] or 0) + pItem[1].nCount;
    				return 1;
    			end;
    		end;
    	end;
    
    	return 0;
    end;
    function tbLiGuan:HoTroChuyenSinh()
    	if (me.GetTask(tbLiGuan.TaskGourp_CS,tbLiGuan.TaskId_Count_CS) == 0 ) then
    			Dialog:Say("Nhà ngươi chưa chuyển sinh lần nào mà hỗ trợ cái gì???.Tính lừa ta à");
    			return 0;
    	else
    		if me.nLevel < 90 then
    			me.AddLevel(90 - me.nLevel);
    			Player:SetFree(me.szName);
    		else
    			Dialog:Say("Nhà ngươi đã Trưởng thành rồi,ta không thể giúp gì nhà ngươi nữa.");
    			return 0;
    		end
    	end
    end
    Khách viếng thăm hãy cùng linhpl2001 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  2. #2
    Vi phạm quy định
    Ngày tham gia
    Apr 2008
    Bài viết
    608
    Thanks
    31
    Thanked 37 Times in 22 Posts

    Ðề: cho hỏi cái script chuyển sinh

    Trích dẫn Gửi bởi linhpl2001 [Only registered and activated users can see links. ]
    sao cs tới lần thứ 10 thì không cs dc nua ai biết giúp em
    Code:
    function tbLiGuan:chuyensinh()
     local tbNpc = Npc:GetClass("chuyensinh");
     tbNpc:OnDialog();
    end  
    
    local tbLiGuan = Npc:GetClass("chuyensinh");
    
    local REQUIRECS_ITEM = 
            { 
                [0] = 
                {
                    {
                        {
                            string.format("%s,%s,%s,%s", 18, 1, 205, 1),
                        }, 
                        100000
                    },
                },
                [1] = 
                {
                    {
                        {
                            string.format("%s,%s,%s,%s", 18, 1, 205, 1),
                        }, 
                        100000
                    },
                },
                [2] = 
                {
                    {
                        {
                            string.format("%s,%s,%s,%s", 18, 1, 205, 1),
                        }, 
                        100000
                    },
                },
                [3] = 
                {
                    {
                        {
                            string.format("%s,%s,%s,%s", 18, 1, 205, 1),
                        }, 
                        100000
                    },
                },
                [4] = 
                {
                    {
                        {
                            string.format("%s,%s,%s,%s", 18, 1, 205, 1),
                        }, 
                        100000
                    },
                },
                [5] = 
                {
                    {
                        {
                            string.format("%s,%s,%s,%s", 18, 1, 205, 1),
                        }, 
                        100000
                    },
                },
                [6] = 
                {
                    {
                        {
                            string.format("%s,%s,%s,%s", 18, 1, 205, 1),
                        }, 
                        100000
                    },
                },
                [7] = 
                {
                    {
                        {
                            string.format("%s,%s,%s,%s", 18, 1, 205, 1),
                        }, 
                        100000
                    },
                },
                [8] = 
                {
                    {
                        {
                            string.format("%s,%s,%s,%s", 18, 1, 205, 1),
                        }, 
                        100000
                    },
                },
                [9] = 
                {
                    {
                        {
                            string.format("%s,%s,%s,%s", 18, 1, 205, 1),
                        }, 
                        100000
                    },
                },
            };
    
    tbLiGuan.TaskGourp_CS = 3004;
    tbLiGuan.TaskId_Count_CS = 1;
    function tbLiGuan:OnDialog()
      local tbOpt = {
                {"<color=yellow>Ta Muốn Tìm hiểu thêm về Chuyển Sinh.<color>", self.OnDialog_3, self},--
                  {"<color=Red>Ta Muốn Chuyển Sinh.<color>", self.DoItemCs, self},--
                {"Kết thúc đối thoại"},
            }
        if me.nLevel <= 90 and me.GetTask(3004,1) >0 then
            table.insert(tbOpt, 3, {"<color=red>Hỗ Trợ sau Chuyển Sinh<color>", self.HoTroChuyenSinh, self});
        end
    
        local szMsg = "Ta Sẽ Giúp nhà ngươi chuyển sinh.Sẵn sàng chưa?";
    
    Dialog:Say(szMsg, tbOpt);
    end;
    function tbLiGuan:OnDialog_3()
       
      local tbOpt = {};
      tbOpt = Lib:MergeTable( tbOpt,{
                {"Trở về",  self.OnDialog, self},
                {"Đóng"},
        });
       
      Dialog:Say(
          "   Tối đa nhà ngươi chỉ có thể chuyển sinh <color=Red>20 lần<color>,phí chuyển sinh là <color=gold>10 vạn Ngũ Hành Hồn Thạch<color>,mỗi lần sẽ tính theo quy tắc sau:\n"..
          "   Lần 1: Yêu cầu <color=Red>150 cấp<color>,sau chuyển sinh Nhà ngươi nhận được <color=gold><color=red>100<color> điểm tiềm năng<color> và <color=gold><color=red>10<color> điểm kĩ năng<color>\n"..
          "   Lần 2: Yêu cầu <color=Red>145 cấp<color>,sau chuyển sinh Nhà ngươi nhận được <color=gold><color=red>110<color> điểm tiềm năng<color> và <color=gold><color=red>2<color> điểm kĩ năng<color>,được <color=red>Cộng dồn<color> với số điểm lần 1\n"..
           "   Các lần kế tiếp cần <color=red>140 cấp<color>,sau chuyển sinh Nhà ngươi nhận được <color=gold><color=red>100 + (số lần chuyển sinh - 1) x10<color> điểm tiềm năng<color> và <color=gold><color=red>số lần chuyển sinh<color> điểm kĩ năng<color>,được <color=red>Cộng dồn<color> với tất cả các lần trước đó."
     ,tbOpt);
               
      return 0;
    end;
    function tbLiGuan:DoItemCs(nValue)
        local nValue = me.GetTask(tbLiGuan.TaskGourp_CS,tbLiGuan.TaskId_Count_CS);
            local szMsg = "Chuyển sinh Nhân Vật";
                if (nValue == 0) then
                    if me.nLevel < 150 then
                        me.Msg("Cấp độ dưới 150 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 1) then
                    if me.nLevel < 145 then
                        me.Msg("Cấp độ dưới 145 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 2) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 3) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 4) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 5) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 6) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 7) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 8) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 9) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 10) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 11) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 12) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 13) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 14) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 15) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 16) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 17) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 18) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 19) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue == 20) then
                    if me.nLevel < 140 then
                        me.Msg("Cấp độ dưới 140 không thể chuyển sinh !");
                    return 0;
                    end
                    szMsg = "Để thực hiện việc chuyển sinh bạn cần nộp 10 vạn Ngũ Hành Hồn Thạch.";
                end;
                if (nValue > 20) then
                    me.Msg("Bạn Đã chuyển sinh 20 lần,không thể chuyển sinh nữa.Chờ đợt event kế tiếp !");
                    return 0;
                end;
        
        Dialog:OpenGift(szMsg, nil, {self.OnCsOpenGiftOk, self, nValue});
    end;
    
    function tbLiGuan:OnCsOpenGiftOk(nValue, tbItemObj)
        local tbItemList    = {};
            
        for _, pItem in pairs(tbItemObj) do
            if (self:CheckCSItem(pItem, REQUIRECS_ITEM[nValue], tbItemList) ~= 1) then
                me.Msg("Không có vật phẩm yêu cầu!");
                return 0;
            end;
        end
    
        local bResult     = false;
        for i = 1, #REQUIRECS_ITEM[nValue] do
            if (REQUIRECS_ITEM[nValue][i][2] ~= tbItemList[i]) then
                bResult = true;
            end;
        end;
        
        if (bResult) then
            me.Msg("Số lượng vật phẩm không chính xác!");
            return 0;
        end;
        
        for _, pItem in pairs(tbItemObj) do
            if me.DelItem(pItem[1]) ~= 1 then
                return 0;
            end
        end
        local szMsg = string.format("Chúc mừng người chơi <color=cyan>%s<color> Chuyển Sinh lần thứ <color=cyan>%s<color>", me.szName, nValue+1 );
        KDialog.NewsMsg(1, Env.NEWSMSG_COUNT, szMsg);
        KDialog.MsgToGlobal(szMsg);            
        me.SendMsgToFriend("Hảo hữu của bạn [<color=yellow>" .. me.szName 
            .. "<color>] Chuyển Sinh lần thứ  <color=cyan>"
        .. nValue+1 .."<color>");                              
    
        if (nValue == 0) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug    
            me.AddTitle(6,30,2,9); -- add danh hieu        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(100); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
        if (nValue == 1) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug    
            me.AddTitle(6,30,2,9); -- add danh hieu        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(120); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
        if (nValue == 2) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug        
            me.AddTitle(6,30,2,9); -- add danh hieu        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(140); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
        if (nValue == 3) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug        
            me.AddTitle(6,30,2,9); -- add danh hieu        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(160); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
        if (nValue == 4) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug    
            me.AddTitle(6,30,2,9); -- add danh hieu        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(180); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
        if (nValue == 5) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug
            me.AddTitle(6,30,2,9); -- add danh hieu        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(200); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
        if (nValue == 6) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug    
            me.AddTitle(6,31,2,9);        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(220); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
        if (nValue == 7) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug
            me.AddTitle(6,31,2,9);        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(240); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
        if (nValue == 8) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug
            me.AddTitle(6,31,2,9);        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(260); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
        if (nValue == 9) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug
            me.AddTitle(6,31,2,9);        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(280); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
        if (nValue == 10) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug
            me.AddTitle(6,31,2,9);        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(300); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
        if (nValue == 11) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug
            me.AddTitle(6,31,2,9);        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(320); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
        if (nValue == 12) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug
            me.AddTitle(6,31,2,9);        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(340); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
        if (nValue == 13) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug
            me.AddTitle(6,31,2,9);        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(360); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
        if (nValue == 14) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug
            me.AddTitle(6,31,2,9);        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(380); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
        if (nValue == 15) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug
            me.AddTitle(6,32,2,9);        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(400); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
    if (nValue == 16) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug
            me.AddTitle(6,32,2,9);
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(420); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
    if (nValue == 17) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug    
            me.AddTitle(6,32,2,9);        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(440); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
        if (nValue == 18) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug    
            me.AddTitle(6,32,2,9);        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(480); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
    if (nValue == 19) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug
            me.AddTitle(6,32,2,9);        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(500); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
        if (nValue == 20) then
            
            me.ResetFightSkillPoint();    -- Reset diem tien nang        
            me.UnAssignPotential();        -- Reset diem mon phai
            me.AddLevel(10 - me.nLevel);    -- Reset cap do tro ve 10
            me.AddExp(me.GetUpLevelExp());        -- up max kinh nghiem chong bug
            me.AddTitle(6,32,2,9);        
            me.AddFightSkillPoint(5); -- add diem skill mon phai
            me.AddPotential(520); -- add diem tiem nang
            Player:SetFree(me.szName);
            me.SetTask(tbLiGuan.TaskGourp_CS, tbLiGuan.TaskId_Count_CS, nValue + 1);
        end;
        
    end;
    
    
    
    function tbLiGuan:CheckCSItem(pItem, tbItemList, tbCountList)
        if (not pItem) then
            return 0;
        end;
        local szItem        = string.format("%s,%s,%s,%s",pItem[1].nGenre, pItem[1].nDetail, pItem[1].nParticular, pItem[1].nLevel);
        
        for i = 1, #tbItemList do
            local tbI = tbItemList[i];
            for j = 1, #tbI[1] do
                if (szItem == tbI[1][j]) then
                    tbCountList[i] = (tbCountList[i] or 0) + pItem[1].nCount;
                    return 1;
                end;
            end;
        end;
    
        return 0;
    end;
    function tbLiGuan:HoTroChuyenSinh()
        if (me.GetTask(tbLiGuan.TaskGourp_CS,tbLiGuan.TaskId_Count_CS) == 0 ) then
                Dialog:Say("Nhà ngươi chưa chuyển sinh lần nào mà hỗ trợ cái gì???.Tính lừa ta à");
                return 0;
        else
            if me.nLevel < 90 then
                me.AddLevel(90 - me.nLevel);
                Player:SetFree(me.szName);
            else
                Dialog:Say("Nhà ngươi đã Trưởng thành rồi,ta không thể giúp gì nhà ngươi nữa.");
                return 0;
            end
        end
    end
    Them vào số lần CS thôi cái này bt mà
    Khách viếng thăm hãy cùng sitachi xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

 

 

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

  1. [KT] Script chuyển sinh nhân vật
    Bởi toan7a42002 trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 0
    Bài viết cuối: 06-07-12, 05:03 PM
  2. [JX] Cho em xin script chuyển sinh !
    Bởi duongbaho trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 0
    Bài viết cuối: 16-06-12, 10:49 AM
  3. xin script VH npc chuyển sinh!!!
    Bởi jametaylor trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 1
    Bài viết cuối: 05-08-11, 09:41 PM
  4. Xin Script 1 ngày chỉ được chuyển sinh 1 lần duy nhất.
    Bởi TND.VN trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 0
    Bài viết cuối: 25-06-11, 10:53 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à 03: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ệ.