doanlephuvinh9
06-02-15, 11:25 AM
Bácc nào cho mình hỏi sao mình add thêm shoplist lại không được,chỉ add được button của shoplist thôi,nhưng lại không mở được shop ...
yuanbaoShop.lua trong sever,
--еÄÔª±¦É̵ê
x888902_g_scriptId = 888902
--Ôª±¦É̵êÁбí ÒªÓë¿Í»§¶Ë½çÃæ¶ÔÓ¦
x888902_g_shoplist = {}
x888902_g_shoplist[1] = {217, 242, 244, 244, 211, 213, 214, 149} --´óÂô³¡
x888902_g_shoplist[2] = {178, 193, 188, 198, 193} --±¦Ê¯É̳Ç,Ìí¼Ó"´óÀí±¦Ê¯Õ«--149",czf,2009.07.21
x888902_g_shoplist[3] = {194, 135, 152, 195} --ÕäÊÞÉ̳Ç
x888902_g_shoplist[4] = {136, 137, 144} --Äϱ±ÔÓ»õ
x888902_g_shoplist[5] = {120, 181, 145, 182, 134} --ÐÎÏó¹ã³¡
x888902_g_shoplist[6] = {133, 133, 133, 133} --»¨ÎèÈ˼ä
x888902_g_shoplist[7] = {146, 244, 271, 245} --Î书Ãؼ®
x888902_g_shoplist[8] = {156, 157, 158, 159, 160, 161, 162, 163} --´òÔìͼ
--x888902_g_shoplist[9] = {217,217, 217, 217, 217, 217} --ÎÒÒª¸üÇ¿´ó
--x888902_g_shoplist[10] = {217, 217, 217, 217, 217} --ÎÒÒª¸üÓÐ÷ÈÁ¦
--x888902_g_shoplist[11] = {217,217, 217, 217, 217} --ÎÒÒª´òÔ켫Ʒװ±¸
--x888902_g_shoplist[12] = {217, 217, 217, 217} --ÎÒÒª´òÔ켫ƷÕäÊÞ
--x888902_g_shoplist[13] = {217, 144} --ÎÒÒªÒƶ¯µÄ¸ü¿ì
--x888902_g_shoplist[14] = {217, 217, 217, 217, 217} --ÎÒÒªÏò±ðÈ˱í°×
--x888902_g_shoplist[15] = {217, 217, 217} --ÎÒҪѧϰм¼ÄÜ
--**********************************
-- ¼ì²é´ËËæÉíNPCµÄ¹¦ÄÜ
-- opÊÇÇëÇóÀà±ð£¬±ÈÈç1´ú±íÔª±� �Ïà¹ØµÄËæÉí²Ù×÷¡¡
--**********************************
function x888902_OpenYuanbaoShop( sceneId, selfId, targetId , shopA ,shopB )
local bCheck = x888902_YuanbaoShopCheckOp(sceneId,selfId);
if bCheck > 0 then
if shopA > 0 and shopA < 16 and x888902_g_shoplist[shopA][shopB] ~= nil then
--PrintStr(x888902_g_shoplist[shopA][shopB])
if targetId == -1 then
DispatchYuanbaoShopItem( sceneId, selfId, x888902_g_shoplist[shopA][shopB])
else
DispatchNpcYuanbaoShopItem( sceneId, selfId, targetId , x888902_g_shoplist[shopA][shopB])
end
end
end
end
function x888902_YuanbaoShopCheckOp(sceneId,selfId)
--µØ¸®
if sceneId == 77 then
<b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b>
return 0
end
--ÉúËÀÀÞ̨
if sceneId == 410 then
<b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b>
return 0
end
--ÉÙÊÒɽ
if sceneId == 530 then
<b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b>
return 0
end
--×é¶Ó¸úËæ
local selfHasTeamFlag = LuaFnHasTeam(sceneId, selfId);
if selfHasTeamFlag and selfHasTeamFlag == 1 then
local teamFollowFlag = IsTeamFollow(sceneId,selfId);
local teamLeaderFlag = LuaFnIsTeamLeader(sceneId,selfId);
if not teamLeaderFlag or not teamFollowFlag then
return 0
end
if teamFollowFlag ~= 0 and teamLeaderFlag ~= 1 then
return 0
end
end
--Ë«ÈËÆï³Ë
local selfHasDRideFlag = LuaFnGetDRideFlag(sceneId, selfId);
if selfHasDRideFlag and selfHasDRideFlag == 1 then
local selfIsDRideMountOwner = LuaFnIsDRideMountOwner(sceneId, selfId);
if not selfIsDRideMountOwner or selfIsDRideMountOwner ~= 1 then
--´¦ÓÚË«ÈËÆï³Ë״̬£¬ÇÒÊDZ»¶ ¯µÄ£¬½»¸øÖ÷¶¯·½À´´¦Àí
return 0
end
end
--10¼¶ÒÔÉÏ
local level = GetLevel(sceneId,selfId);
if nil == level or level < 10 then
<b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b>
return 0
else
return 1
end
return 0
end
YuanBaoShop.lua trong client ..
local GOODS_BUTTONS_NUM = 18;
local GOODS_BUTTONS = {};
local GOODS_DESCS = {};
local GOOD_BAD = {};
local CU_MONEY = 1 -- Ç®
local CU_GOODBAD = 2 -- ÉƶñÖµ
local CU_MORALPOINT = 3 -- ʦµÂµã
local CU_TICKET = 4 -- ¹ÙƱǮ
local CU_YUANBAO = 5 -- Ôª±¦
local CU_ZENGDIAN = 6 -- Ôùµã
local CU_MENPAI_POINT = 7 -- ÃÅÅɹ±Ï׶È
local CU_MONEYJZ = 8 -- ½»×Ó
--±êÇ©Ò³Ë÷ÒýÖµ
local ShopTabIdx = {
YuanBao = 0, --Ôª±¦É̵ê
Bind = 1, --°ó¶¨Ôª±¦É̵ê
GiftToken = 2, --·µÈ¯É̵ê
}
local SHOP_LIST_A = {};
local SHOP_LIST_B = {};
local SHOP_SEARCH_LIST ={};
local SHOP_LIST_A_BIND = {};
local SHOP_LIST_B_BIND = {};
local SHOP_SEARCH_LIST_BIND ={};
local SHOP_LIST_A_GIFTTOKEN = {}; --»õ±ÒÀàÐÍϵÄÒ»¼¶²Ëµ¥ Èç ´óÂô³¡ ±¦Ê¯É̳ǵÈ
local SHOP_LIST_B_GIFTTOKEN = {}; --»õ±ÒÀàÐÍϵĶþ¼¶²Ëµ¥ Èç ÐÂÆ·ÉÏ¼Ü µÈ
local SHOP_SEARCH_LIST_GIFTTOKEN ={}; --ËÑË÷²Ëµ¥
local nPageNum = 1;
local maxPage = 1;
local objCared = -1;
local lastA = 0
local lastB = 0
local lastA_Bind = 0
local lastB_Bind = 0
local lastSelect = 0
local lastSelect_Bind = 0
local lastA_GiftToken = 0
local lastB_GiftToken = 0
local lastSelect_GiftToken = 0
local maxChildShop = 8
local isCareObj = 0
--´æ´¢Ëæ»úÅÅÐòµÄË÷ÒýÖµ
local g_tOrderPool = {};
--µ±Ç°É̵êµÄÉÌÆ·ÊýÁ¿
local g_nTotalNum = 0;
local g_changeTabFlag = 0;
local g_tabIndex = 0; -- 0±íʾԪ±¦ --1±íʾ°ó¶¨Ôª±¦
local g_YuanbaoShop_Frame_UnifiedXPosition;
local g_YuanbaoShop_Frame_UnifiedYPosition;
function YuanbaoShop_PreLoad()
this:RegisterEvent("OPEN_YUANBAOSHOP");
this:RegisterEvent("PLAYER_ENTERING_WORLD");
this:RegisterEvent("UPDATE_BOOTH");
this:RegisterEvent("OBJECT_CARED_EVENT");
this:RegisterEvent("CLOSE_BOOTH");
this:RegisterEvent("PLAYER_LEAVE_WORLD");
this:RegisterEvent("TOGGLE_YUANBAOSHOP");
this:RegisterEvent("UPDATE_YUANBAO");
this:RegisterEvent("UPDATE_BIND_YUANBAO");
this:RegisterEvent("UPDATE_GIFTTOKEN");
this:RegisterEvent("UI_COMMAND");
this:RegisterEvent("ADJEST_UI_POS")
this:RegisterEvent("VIEW_RESOLUTION_CHANGED")
end
function YuanbaoShop_OnLoad()
GOODS_BUTTONS[1] = YuanbaoShop_Item1;
GOODS_BUTTONS[2] = YuanbaoShop_Item2;
GOODS_BUTTONS[3] = YuanbaoShop_Item3;
GOODS_BUTTONS[4] = YuanbaoShop_Item4;
GOODS_BUTTONS[5] = YuanbaoShop_Item5;
GOODS_BUTTONS[6] = YuanbaoShop_Item6;
GOODS_BUTTONS[7] = YuanbaoShop_Item7;
GOODS_BUTTONS[8] = YuanbaoShop_Item8;
GOODS_BUTTONS[9] = YuanbaoShop_Item9;
GOODS_BUTTONS[10]= YuanbaoShop_Item10;
GOODS_BUTTONS[11]= YuanbaoShop_Item11;
GOODS_BUTTONS[12]= YuanbaoShop_Item12;
GOODS_BUTTONS[13]= YuanbaoShop_Item13;
GOODS_BUTTONS[14]= YuanbaoShop_Item14;
GOODS_BUTTONS[15]= YuanbaoShop_Item15;
GOODS_BUTTONS[16]= YuanbaoShop_Item16;
GOODS_BUTTONS[17]= YuanbaoShop_Item17;
GOODS_BUTTONS[18]= YuanbaoShop_Item18;
GOODS_DESCS[1] = YuanbaoShop_ItemInfo1_Text;
GOODS_DESCS[2] = YuanbaoShop_ItemInfo2_Text;
GOODS_DESCS[3] = YuanbaoShop_ItemInfo3_Text;
GOODS_DESCS[4] = YuanbaoShop_ItemInfo4_Text;
GOODS_DESCS[5] = YuanbaoShop_ItemInfo5_Text;
GOODS_DESCS[6] = YuanbaoShop_ItemInfo6_Text;
GOODS_DESCS[7] = YuanbaoShop_ItemInfo7_Text;
GOODS_DESCS[8] = YuanbaoShop_ItemInfo8_Text;
GOODS_DESCS[9] = YuanbaoShop_ItemInfo9_Text;
GOODS_DESCS[10]= YuanbaoShop_ItemInfo10_Text;
GOODS_DESCS[11]= YuanbaoShop_ItemInfo11_Text;
GOODS_DESCS[12]= YuanbaoShop_ItemInfo12_Text;
GOODS_DESCS[13]= YuanbaoShop_ItemInfo13_Text;
GOODS_DESCS[14]= YuanbaoShop_ItemInfo14_Text;
GOODS_DESCS[15]= YuanbaoShop_ItemInfo15_Text;
GOODS_DESCS[16]= YuanbaoShop_ItemInfo16_Text;
GOODS_DESCS[17]= YuanbaoShop_ItemInfo17_Text;
GOODS_DESCS[18]= YuanbaoShop_ItemInfo18_Text;
GOOD_BAD[1] = YuanbaoShop_ItemInfo1_GB;
GOOD_BAD[2] = YuanbaoShop_ItemInfo2_GB;
GOOD_BAD[3] = YuanbaoShop_ItemInfo3_GB;
GOOD_BAD[4] = YuanbaoShop_ItemInfo4_GB;
GOOD_BAD[5] = YuanbaoShop_ItemInfo5_GB;
GOOD_BAD[6] = YuanbaoShop_ItemInfo6_GB;
GOOD_BAD[7] = YuanbaoShop_ItemInfo7_GB;
GOOD_BAD[8] = YuanbaoShop_ItemInfo8_GB;
GOOD_BAD[9] = YuanbaoShop_ItemInfo9_GB;
GOOD_BAD[10] = YuanbaoShop_ItemInfo10_GB;
GOOD_BAD[11] = YuanbaoShop_ItemInfo11_GB;
GOOD_BAD[12] = YuanbaoShop_ItemInfo12_GB;
GOOD_BAD[13] = YuanbaoShop_ItemInfo13_GB;
GOOD_BAD[14] = YuanbaoShop_ItemInfo14_GB;
GOOD_BAD[15] = YuanbaoShop_ItemInfo15_GB;
GOOD_BAD[16] = YuanbaoShop_ItemInfo16_GB;
GOOD_BAD[17] = YuanbaoShop_ItemInfo17_GB;
GOOD_BAD[18] = YuanbaoShop_ItemInfo18_GB;
--´óÂô³¡
SHOP_LIST_A[1] = {btn = YuanbaoShop_Button1 , shoplist = {}}
SHOP_LIST_A[1].shoplist[1] = "#GNhi®t MÕi Thß½ng Ph¦m" -- "Nhiet mai thuong pham";
SHOP_LIST_A[1].shoplist[2] = "#YV§t Ph¦m H² Trþ" -- "Gianni Versace";
SHOP_LIST_A[1].shoplist[3] = "#GRa M¡t V§t Ph¦m M¾i" -- "Bau vat";
SHOP_LIST_A[1].shoplist[4] = "#cFF0000Th¥n Khí Thiên Höa" -- "Th¥n Khí;
SHOP_LIST_A[1].shoplist[5] = "#GNguyên Li®u Cao C¤p" -- "Nguyên Li®u";
SHOP_LIST_A[1].shoplist[6] = "#GYªu Quyªt 35 Môn Phái" -- "YQ 35";
--SHOP_LIST_A[1].shoplist[7] = "Bách hóa t±ng hþp 1" -- "Bach hoa tong hop 1";
--SHOP_LIST_A[1].shoplist[8] = "Bách hóa t±ng hþp 2" -- "Bach hoa tong hop 2";
--±¦Ê¯É̳Ç
SHOP_LIST_A[2] = {btn = YuanbaoShop_Button2 , shoplist = {}}
SHOP_LIST_A[2].shoplist[1] = "#{YBSD_081225_025}" -- "Tiem bao thach tinh hoa";
SHOP_LIST_A[2].shoplist[2] = "#{YBSD_081225_022}" -- "Phong bao thach Dai Ly";
SHOP_LIST_A[2].shoplist[3] = "#{YBSD_081225_024}" -- "Phong bao thach Lac Duong";
SHOP_LIST_A[2].shoplist[4] = "#{YBSD_081225_023}" -- "Phong bao thach To Chau";
--SHOP_LIST_A[2].shoplist[5] = "Phòng bäo thÕch Lâu Lan" -- "Phong bao thach Lau Lan";
--SHOP_LIST_A[2].shoplist[6] = "#{YBSD_081225_026}" -- "Phong gia cong bao thach";
--SHOP_LIST_A[2].shoplist[7] = "Phòng gia công bäo thÕch 2" -- "Phong gia cong bao thach 2";
--SHOP_LIST_A[2].shoplist[8] = "TÕp hóa" -- "Tap hoa";
--ÕäÊÞÉ̳Ç
SHOP_LIST_A[3] = {btn = YuanbaoShop_Button3 , shoplist = {}}
SHOP_LIST_A[3].shoplist[1] = "#GThß½ng Ti®m Trân Thú" --"Tiem tran thu hiem";
SHOP_LIST_A[3].shoplist[2] = "KÛ Nång Bình Thß¾ng" --"Sieu tran thu";
SHOP_LIST_A[3].shoplist[3] = "#GSiêu C¤p KÛ Nång" --"Ky nang binh thuong";
SHOP_LIST_A[3].shoplist[4] = "Trân Thú Bách Väo Rß½ng" --"Ky nang cao cap";
--SHOP_LIST_A[3].shoplist[5] = "#{YBSD_081225_030}" --"Tran thu bach bao ruong";
--SHOP_LIST_A[3].shoplist[6] = "Trân thú døng ph¦m 1" --"Tran thu dung pham 1";
--SHOP_LIST_A[3].shoplist[7] = "Trân thú døng ph¦m 2" --"Tran thu dung pham 2";
--SHOP_LIST_A[3].shoplist[8] = "Trân thú døng ph¦m 3" --"Tran thu dung pham 3";
--Äϱ±ÔÓ»õ
SHOP_LIST_A[4] = {btn = YuanbaoShop_Button4 , shoplist = {}}
SHOP_LIST_A[4].shoplist[1] = "#{YBSD_081225_091}" --"Tien dan linh duoc";
SHOP_LIST_A[4].shoplist[2] = "#{YBSD_081225_031}" --"Ki tran di bao";
SHOP_LIST_A[4].shoplist[3] = "#{YBSD_081225_032}" --"Tam thanh than phu";
--SHOP_LIST_A[4].shoplist[4] = "TÕp hóa 1" --"Tap hoa 1";
--SHOP_LIST_A[4].shoplist[5] = "TÕp hóa 2" --"Tap hoa 2";
--SHOP_LIST_A[4].shoplist[6] = "TÕp hóa 3" --"Tap hoa 3";
--SHOP_LIST_A[4].shoplist[7] = "TÕp hóa 4" --"Tap hoa 4";
--SHOP_LIST_A[4].shoplist[8] = "TÕp hóa 5" --"Tap hoa 5";
--ÐÎÏó¹ã³¡
SHOP_LIST_A[5] = {btn = YuanbaoShop_Button5 , shoplist = {}}
SHOP_LIST_A[5].shoplist[1] = "#{YBSD_081225_033}" --"Me Lan thoi trang diem";
SHOP_LIST_A[5].shoplist[2] = "#{YBSD_081225_034}" --"Nhu y bien than trai";
SHOP_LIST_A[5].shoplist[3] = "#{YBSD_081225_035}" --"Thien Duong phat nghe quan";
SHOP_LIST_A[5].shoplist[4] = "#{YBSD_081225_036}" --"Lan Vu mo dung phuong";
SHOP_LIST_A[5].shoplist[5] = "#{YBSD_081225_037}" --"Thien cung ngu ma giam";
--SHOP_LIST_A[5].shoplist[6] = "Th¶i trang môn phái" --"Thoi trang mon phai";
--SHOP_LIST_A[5].shoplist[7] = "Chþ ve chai 1" --"Cho ve chai 1";
--SHOP_LIST_A[5].shoplist[8] = "Chþ ve chai 2" --"Cho ve chai 2";
--»¨ÎèÈ˼ä
SHOP_LIST_A[6] = {btn = YuanbaoShop_Button6 , shoplist = {}}
SHOP_LIST_A[6].shoplist[1] = "#{YBSD_081225_038}" --"Phao hoa truyen thong";
SHOP_LIST_A[6].shoplist[2] = "#{YBSD_081225_039}" --"Phao hoa ca tinh";
SHOP_LIST_A[6].shoplist[3] = "#{YBSD_081225_040}" --"Phao hoa toan canh";
SHOP_LIST_A[6].shoplist[4] = "#{YBSD_081225_041}" --"Xuan thanh bach hoa";
--Î书Ãؼ®
SHOP_LIST_A[7] = {btn = YuanbaoShop_Button7 , shoplist = {}}
SHOP_LIST_A[7].shoplist[1] = "#{YBSD_081225_042}" --"Hoang thi thuy cac";
SHOP_LIST_A[7].shoplist[2] = "Bí t¸ch - Yªu quyªt" --"Bi tich & yeu quyet";
SHOP_LIST_A[7].shoplist[3] = "V§t ph¦m ðµc môn" --"Vat pham doc mon";
SHOP_LIST_A[7].shoplist[3] = "#GYªu Quyªt 35 Môn Phái" --"YQ 35";
--´òÔìͼ
SHOP_LIST_A[8] = {btn = YuanbaoShop_Button8 , shoplist = {}}
SHOP_LIST_A[8].shoplist[1] = "#{YBSD_081225_043}" --"Dao phu & thuong bong";
SHOP_LIST_A[8].shoplist[2] = "#{YBSD_081225_044}" --"Don doan & song doan";
SHOP_LIST_A[8].shoplist[3] = "#{YBSD_081225_045}" --"Phien & hoan";
SHOP_LIST_A[8].shoplist[4] = "#{YBSD_081225_096}" --"Mao & y phuc";
SHOP_LIST_A[8].shoplist[5] = "#{YBSD_081225_046}" --"Thu sao & hai";
SHOP_LIST_A[8].shoplist[6] = "#{YBSD_081225_047}" --"Ho uyen & ho kien";
SHOP_LIST_A[8].shoplist[7] = "#{YBSD_081225_048}" --"Yeu dai & hang lien";
SHOP_LIST_A[8].shoplist[8] = "#{YBSD_081225_049}" --"Gioi chi & ho phu";
--¶þ¼¶É̵ê
SHOP_LIST_B[1] = YuanbaoShop_Button01
SHOP_LIST_B[2] = YuanbaoShop_Button02
SHOP_LIST_B[3] = YuanbaoShop_Button03
SHOP_LIST_B[4] = YuanbaoShop_Button04
SHOP_LIST_B[5] = YuanbaoShop_Button05
SHOP_LIST_B[6] = YuanbaoShop_Button06
SHOP_LIST_B[7] = YuanbaoShop_Button07
SHOP_LIST_B[8] = YuanbaoShop_Button08
if lastA ~= nil and lastA > 0 and lastA < 9 then
SHOP_LIST_A[lastA].btn:SetCheck(1)
end
if lastB ~= nil and lastB > 0 and lastB < 9 then
SHOP_LIST_B[lastB]:SetCheck(1)
end
for i =1 ,8 do
SHOP_LIST_B[i]:Hide()
end
--ÎÒÒª¸üÇ¿´ó
SHOP_SEARCH_LIST[1] = {}
SHOP_SEARCH_LIST[1][1] = "#{YBSD_081225_022}" --Ìí¼Ó"´óÀí±¦Ê¯Õ«",czf,2009.07.21
SHOP_SEARCH_LIST[1][2] = "#{YBSD_081225_023}" --"ËÕÖݱ¦Ê¯Õ«";
SHOP_SEARCH_LIST[1][3] = "#{YBSD_081225_024}" --"ÂåÑô±¦Ê¯Õ«";
SHOP_SEARCH_LIST[1][4] = "#{YBSD_081225_025}" --"±¦Ê¯¾«»ªµê";
SHOP_SEARCH_LIST[1][5] = "#{YBSD_081225_027}" --"Ï¡ÓÐÕäÊÞ¹Ý";
SHOP_SEARCH_LIST[1][6] = "#{YBSD_081225_091}" --"Ïɵ¤ÁéÒ©";
--ÎÒÒª¸üÓÐ÷ÈÁ¦
SHOP_SEARCH_LIST[2] = {}
SHOP_SEARCH_LIST[2][1] = "#{YBSD_081225_037}" --"×øÆïÉ̳Ç";
SHOP_SEARCH_LIST[2][2] = "#{YBSD_081225_033}" --"Ã×À¼Ê±×°µê";
SHOP_SEARCH_LIST[2][3] = "#{YBSD_081225_034}" --"ÈçÒâ±äÉíÕ«";
SHOP_SEARCH_LIST[2][4] = "#{YBSD_081225_035}" --"ÌìÑï·¢ÒÕ¹Ý";
SHOP_SEARCH_LIST[2][5] = "#{YBSD_081225_036}" --"À¼ÓêÃÀÈÝ·»";
--ÎÒÒª´òÔ켫Ʒװ±¸
SHOP_SEARCH_LIST[3] = {}
SHOP_SEARCH_LIST[3][1] = "#{YBSD_081225_022}" --Ìí¼Ó"´óÀí±¦Ê¯Õ«",czf,2009.07.21
SHOP_SEARCH_LIST[3][2] = "#{YBSD_081225_023}" --"ËÕÖݱ¦Ê¯Õ«";
SHOP_SEARCH_LIST[3][3] = "#{YBSD_081225_024}" --"ÂåÑô±¦Ê¯Õ«";
SHOP_SEARCH_LIST[3][4] = "#{YBSD_081225_026}" --"±¦Ê¯¼Ó¹¤·»";
SHOP_SEARCH_LIST[3][5] = "#{YBSD_081225_031}" --"ÆæÕäÒ챦";
--ÎÒÒª´òÔ켫ƷÕäÊÞ
SHOP_SEARCH_LIST[4] = {}
SHOP_SEARCH_LIST[4][1] = "#{YBSD_081225_027}" --"Ï¡ÓÐÕäÊÞ¹Ý";
SHOP_SEARCH_LIST[4][2] = "#{YBSD_081225_028}" --"ÆÕͨ¼¼ÄܹÝ";
SHOP_SEARCH_LIST[4][3] = "#{YBSD_081225_029}" --"¸ß¼¶¼¼ÄܹÝ";
SHOP_SEARCH_LIST[4][4] = "#{YBSD_081225_030}" --"ÕäÊÞÁéÒ©·»";
--ÎÒÒªÒƶ¯µÄ¸ü¿ì
SHOP_SEARCH_LIST[5] = {}
SHOP_SEARCH_LIST[5][1] = "#{YBSD_081225_037}" --"×øÆïÉ̳Ç";
SHOP_SEARCH_LIST[5][2] = "#{YBSD_081225_032}" --"ÈýÇåÉñ·û";
--ÎÒÒªÏò±ðÈ˱í°×
SHOP_SEARCH_LIST[6] = {}
SHOP_SEARCH_LIST[6][1] = "#{YBSD_081225_039}" --"¸öÐÔÑÌ»¨";
SHOP_SEARCH_LIST[6][2] = "#{YBSD_081225_040}" --"È«³¡¾°ÑÌ»¨";
SHOP_SEARCH_LIST[6][3] = "#{YBSD_081225_041}" --"ÏÊ»¨";
SHOP_SEARCH_LIST[6][4] = "#{YBSD_081225_033}" --"Ã×À¼Ê±×°µê";
SHOP_SEARCH_LIST[6][5] = "#{YBSD_081225_037}" --"×øÆïÉ̳Ç";
--ÎÒҪѧϰм¼ÄÜ
SHOP_SEARCH_LIST[7] = {}
SHOP_SEARCH_LIST[7][1] = "#{YBSD_081225_042}" --"»¹Ê©Ë®¸ó";
SHOP_SEARCH_LIST[7][2] = "#{YBSD_081225_028}" --"ÆÕͨ¼¼ÄܹÝ";
SHOP_SEARCH_LIST[7][3] = "#{YBSD_081225_029}" --"¸ß¼¶¼¼ÄܹÝ";
YuanbaoShop_SearchMode:AddTextItem("#{YBSD_081225_055}" ,1) --ÎÒÒª¸üÇ¿´ó
YuanbaoShop_SearchMode:AddTextItem("#{YBSD_081225_056}" ,2) --"ÎÒÒª¸üÓÐ÷ÈÁ¦"
YuanbaoShop_SearchMode:AddTextItem("#{YBSD_081225_057}" ,3) --"ÎÒÒª´òÔ켫Ʒװ±¸"
YuanbaoShop_SearchMode:AddTextItem("#{YBSD_081225_058}",4) --"ÎÒÒª´òÔ켫ƷÕäÊÞ"
YuanbaoShop_SearchMode:AddTextItem("#{YBSD_081225_059}",5) --"ÎÒÒªÒƶ¯µÄ¸ü¿ì"
YuanbaoShop_SearchMode:AddTextItem("#{YBSD_081225_060}",6) --"ÎÒÒªÏò±ðÈ˱í°×"
YuanbaoShop_SearchMode:AddTextItem("#{YBSD_081225_061}",7) --"ÎÒҪѧϰм¼ÄÜ"
-- °ó¶¨Ôª±¦begin
SHOP_LIST_A_BIND[1] = {btn = YuanbaoShop_Button1_Bind , shoplist = {}}
SHOP_LIST_A_BIND[1].shoplist[1] = "#{YBSD_081225_019}" --"";
--SHOP_LIST_A_BIND[1].shoplist[1] = "#{YBSD_081225_020}" --"";
--SHOP_LIST_A_BIND[1].shoplist[3] = "#{YBSD_081225_021}" --"";
--
SHOP_LIST_A_BIND[2] = {btn = YuanbaoShop_Button2_Bind , shoplist = {}}
--SHOP_LIST_A_BIND[2].shoplist[1] = "#{YBSD_081225_022}" --"";
--SHOP_LIST_A_BIND[2].shoplist[1] = "#{YBSD_081225_023}" --"";
--SHOP_LIST_A_BIND[2].shoplist[2] = "#{YBSD_081225_024}" --"";
--SHOP_LIST_A_BIND[2].shoplist[3] = "#{YBSD_081225_025}" --"";
SHOP_LIST_A_BIND[2].shoplist[1] = "#{YBSD_081225_026}" --"";
--
SHOP_LIST_A_BIND[3] = {btn = YuanbaoShop_Button3_Bind , shoplist = {}}
--SHOP_LIST_A_BIND[3].shoplist[1] = "#{YBSD_081225_027}" --"";
--SHOP_LIST_A_BIND[3].shoplist[2] = "#{YBSD_081225_028}" --"";
--SHOP_LIST_A_BIND[3].shoplist[3] = "#{YBSD_081225_029}" --"";
SHOP_LIST_A_BIND[3].shoplist[1] = "#{YBSD_081225_030}" --"";
--
SHOP_LIST_A_BIND[4] = {btn = YuanbaoShop_Button4_Bind , shoplist = {}}
SHOP_LIST_A_BIND[4].shoplist[1] = "#{YBSD_081225_091}" --"";
SHOP_LIST_A_BIND[4].shoplist[2] = "#{YBSD_081225_031}" --"";
SHOP_LIST_A_BIND[4].shoplist[3] = "#{YBSD_101110_01}" --"";
--
SHOP_LIST_A_BIND[5] = {btn = YuanbaoShop_Button5_Bind , shoplist = {}}
SHOP_LIST_A_BIND[5].shoplist[1] = "#{YBSD_081225_033}" --"";
SHOP_LIST_A_BIND[5].shoplist[2] = "#{YBSD_081225_034}" --"";
SHOP_LIST_A_BIND[5].shoplist[3] = "#{YBSD_081225_035}" --"";
SHOP_LIST_A_BIND[5].shoplist[4] = "#{YBSD_081225_036}" --"";
SHOP_LIST_A_BIND[5].shoplist[5] = "#{YBSD_081225_037}" --"";
SHOP_LIST_A_BIND[5].shoplist[6] = "#{YBSD_90624_1}" --"";
--
SHOP_LIST_A_BIND[6] = {btn = YuanbaoShop_Button6_Bind , shoplist = {}}
SHOP_LIST_A_BIND[6].shoplist[1] = "#{YBSD_081225_038}" --"";
SHOP_LIST_A_BIND[6].shoplist[2] = "#{YBSD_081225_039}" --"";
SHOP_LIST_A_BIND[6].shoplist[3] = "#{YBSD_081225_040}" --"";
SHOP_LIST_A_BIND[6].shoplist[4] = "#{YBSD_081225_041}" --"";
--
SHOP_LIST_A_BIND[7] = {btn = YuanbaoShop_Button7_Bind , shoplist = {}}
SHOP_LIST_A_BIND[7].shoplist[1] = "#{YBSD_081225_042}" --"";
--
SHOP_LIST_A_BIND[8] = {btn = YuanbaoShop_Button8_Bind , shoplist = {}}
SHOP_LIST_A_BIND[8].shoplist[1] = "#{YBSD_081225_043}" --"";
SHOP_LIST_A_BIND[8].shoplist[2] = "#{YBSD_081225_044}" --"";
SHOP_LIST_A_BIND[8].shoplist[3] = "#{YBSD_081225_045}" --"";
SHOP_LIST_A_BIND[8].shoplist[4] = "#{YBSD_081225_096}" --"";
SHOP_LIST_A_BIND[8].shoplist[5] = "#{YBSD_081225_046}" --"";
SHOP_LIST_A_BIND[8].shoplist[6] = "#{YBSD_081225_047}" --"";
SHOP_LIST_A_BIND[8].shoplist[7] = "#{YBSD_081225_048}" --"";
SHOP_LIST_A_BIND[8].shoplist[8] = "#{YBSD_081225_049}" --"";
--¶þ¼¶É̵ê
SHOP_LIST_B_BIND[1] = YuanbaoShop_Button01_Bind
SHOP_LIST_B_BIND[2] = YuanbaoShop_Button02_Bind
SHOP_LIST_B_BIND[3] = YuanbaoShop_Button03_Bind
SHOP_LIST_B_BIND[4] = YuanbaoShop_Button04_Bind
SHOP_LIST_B_BIND[5] = YuanbaoShop_Button05_Bind
SHOP_LIST_B_BIND[6] = YuanbaoShop_Button06_Bind
SHOP_LIST_B_BIND[7] = YuanbaoShop_Button07_Bind
SHOP_LIST_B_BIND[8] = YuanbaoShop_Button08_Bind
if lastA_Bind ~= nil and lastA_Bind > 0 and lastA_Bind < 9 then
SHOP_LIST_A_BIND[ lastA_Bind ].btn : SetCheck(1)
end
if lastB_Bind ~= nil and lastB_Bind > 0 and lastB_Bind < 9 then
SHOP_LIST_B_BIND[ lastB_Bind ] : SetCheck(1)
end
for i =1 ,8 do
SHOP_LIST_B_BIND[i]:Hide()
end
--
SHOP_SEARCH_LIST_BIND[1] = {}
SHOP_SEARCH_LIST_BIND[1][1] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[1][2] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[1][3] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[1][4] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[1][5] = "BindSearch1" --"";
--
SHOP_SEARCH_LIST_BIND[2] = {}
SHOP_SEARCH_LIST_BIND[2][1] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[2][2] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[2][3] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[2][4] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[2][5] = "BindSearch1" --"";
--
SHOP_SEARCH_LIST_BIND[3] = {}
SHOP_SEARCH_LIST_BIND[3][1] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[3][2] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[3][3] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[3][4] = "BindSearch1" --"";
--
SHOP_SEARCH_LIST_BIND[4] = {}
SHOP_SEARCH_LIST_BIND[4][1] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[4][2] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[4][3] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[4][4] = "BindSearch1" --"";
--
SHOP_SEARCH_LIST_BIND[5] = {}
SHOP_SEARCH_LIST_BIND[5][1] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[5][2] = "BindSearch1" --"";
--
SHOP_SEARCH_LIST_BIND[6] = {}
SHOP_SEARCH_LIST_BIND[6][1] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[6][2] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[6][3] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[6][4] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[6][5] = "BindSearch1" --"";
--
SHOP_SEARCH_LIST_BIND[7] = {}
SHOP_SEARCH_LIST_BIND[7][1] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[7][2] = "BindSearch1" --"";
SHOP_SEARCH_LIST_BIND[7][3] = "BindSearch1" --"";
YuanbaoShop_SearchMode_Bind:AddTextItem("BindSearch1}" ,1) --
YuanbaoShop_SearchMode_Bind:AddTextItem("BindSearch2}" ,2) --""
YuanbaoShop_SearchMode_Bind:AddTextItem("BindSearch3}" ,3) --""
YuanbaoShop_SearchMode_Bind:AddTextItem("BindSearch4}",4) --""
YuanbaoShop_SearchMode_Bind:AddTextItem("BindSearch5}",5) --""
YuanbaoShop_SearchMode_Bind:AddTextItem("BindSearch6}",6) --""
YuanbaoShop_SearchMode_Bind:AddTextItem("BindSearch7}",7) --""
YuanbaoShop_Bk1_Bind : Hide();
YuanbaoShop_Bk2_Bind : Hide();
YuanbaoShop_SearchMode_Bind : Hide();
YuanbaoShop_Text2_Bind : Hide();
YuanbaoShop_Bk4 : Hide();
-- °ó¶¨Ôª±¦end
------------------------------------------ ·µÈ¯É̵ê -------------------------------------------------------
--·µÈ¯É̵êBegin
YuanbaoShop_Fanquan:Disable(); --¹Ø±Õ·µÈ¯É̵ê
YuanbaoShop_Fanquan:Hide();
--´óÂô³¡
SHOP_LIST_A_GIFTTOKEN[1] = {btn = YuanbaoShop_Button1 , shoplist = {}}
--SHOP_LIST_A_GIFTTOKEN[1].shoplist[1] = "#{YBSD_081225_019}" --"ÐÂÆ·ÉϼÜ";
--µÚ¶þ¼ä
SHOP_LIST_A_GIFTTOKEN[2] = {btn = YuanbaoShop_Button2 , shoplist = {}}
--µÚÈý¼ä
SHOP_LIST_A_GIFTTOKEN[3] = {btn = YuanbaoShop_Button3 , shoplist = {}}
--µÚËļä
SHOP_LIST_A_GIFTTOKEN[4] = {btn = YuanbaoShop_Button4 , shoplist = {}}
--µÚÎå¼ä
SHOP_LIST_A_GIFTTOKEN[5] = {btn = YuanbaoShop_Button5 , shoplist = {}}
--µÚÁù¼ä
SHOP_LIST_A_GIFTTOKEN[6] = {btn = YuanbaoShop_Button6 , shoplist = {}}
--µÚÆß¼ä
SHOP_LIST_A_GIFTTOKEN[7] = {btn = YuanbaoShop_Button7 , shoplist = {}}
--µÚ°Ë¼ä
SHOP_LIST_A_GIFTTOKEN[8] = {btn = YuanbaoShop_Button8 , shoplist = {}}
--¶þ¼¶É̵ê
SHOP_LIST_B_GIFTTOKEN[1] = YuanbaoShop_Button01
SHOP_LIST_B_GIFTTOKEN[2] = YuanbaoShop_Button02
SHOP_LIST_B_GIFTTOKEN[3] = YuanbaoShop_Button03
SHOP_LIST_B_GIFTTOKEN[4] = YuanbaoShop_Button04
SHOP_LIST_B_GIFTTOKEN[5] = YuanbaoShop_Button05
SHOP_LIST_B_GIFTTOKEN[6] = YuanbaoShop_Button06
SHOP_LIST_B_GIFTTOKEN[7] = YuanbaoShop_Button07
SHOP_LIST_B_GIFTTOKEN[8] = YuanbaoShop_Button08
if lastA ~= nil and lastA > 0 and lastA < table.getn(SHOP_LIST_B_GIFTTOKEN)+1 then
SHOP_LIST_A_GIFTTOKEN[lastA].btn:SetCheck(1)
end
if lastB ~= nil and lastB > 0 and lastB < table.getn(SHOP_LIST_B_GIFTTOKEN)+1 then
SHOP_LIST_B_GIFTTOKEN[lastB]:SetCheck(1)
end
for i =1 ,table.getn(SHOP_LIST_B_GIFTTOKEN) do
SHOP_LIST_B_GIFTTOKEN[i]:Hide()
end
--ËÑË÷Ñ¡ÔñÏî
SHOP_SEARCH_LIST_GIFTTOKEN[1] = {}
YuanbaoShop_FanquanRateInfo : Hide();
--·µÈ¯É̵êEnd
g_YuanbaoShop_Frame_UnifiedXPosition = YuanbaoShop_Frame:GetProperty("UnifiedXPosition");
g_YuanbaoShop_Frame_UnifiedYPosition = YuanbaoShop_Frame:GetProperty("UnifiedYPosition");
end
function YuanbaoShop_OnEvent(event)
if ( event == "PLAYER_ENTERING_WORLD" or event == "PLAYER_LEAVE_WORLD") then
YuanbaoShop_Close()
end
if event == "OPEN_YUANBAOSHOP" then
g_nTotalNum = 0;
local check = tonumber(NpcShop:GetBuyDirectly());
if(check>=1)then
YuanbaoShop_querengoumai:SetCheck(0);
else
YuanbaoShop_querengoumai:SetCheck(1);
end
if( this:IsVisible() == false ) then
YubanbaoShop_ADRandom()
if (IsWindowShow("YbMarket")) then
CloseWindow("YbMarket", true);
end
this:Show();
OpenWindow("Packet")
-- ÔÚÏÈ´ò¿ªNPCÉ̵꣬ºó´ò¿ªÔª±� �É̵êµÄʱºò£¬´æÔÚÒ»¸öÎÊÌâ
-- Ôª±¦É̵êÔÚ´ò¿ªÊ±»á¹Ø±ÕÒѾ ´ò¿ªµÄNPCÉ̵꣬¶ø¹Ø±ÕÕâ¸ö� �Ù×÷»á½«ÊÇ·ñ´ò¿ªÉ̵êÕâ¸ö×� �ֻ̬Ϊ¼Ù£¬´Ó¶øµ¼Ö¹ºÂòÏà� �صÄÂß¼³öÏÖ´íÎó
-- Ä¿Ç°µÄ½â¾ö°ì·¨ÊÇÔÚShowµÄµØ· ½£¬ÉèÖÃÊÇ·ñ´ò¿ªÉ̵êµÄ״̬ ΪÕæ¡£
OpenBooth();
end
--¹ØÐÄÉÌÈËObj
objCared = NpcShop:GetNpcId();
this:CareObject(objCared, 1, "YuanbaoShop");
NpcShop:CloseConfirm();
YuanbaoShop_UpdatePage(1);
if(IsWindowShow("Shop_Fitting")) then
RestoreShopFitting();
CloseWindow("Shop_Fitting", true);
end
SetDefaultMouse();
elseif ( event == "TOGGLE_YUANBAOSHOP") then
if( this:IsVisible() ) then
YuanbaoShop_Close();
else
lastA = 1;
lastB = 1;
YuanbaoShop_Show()
end
elseif ( event == "UPDATE_BOOTH" ) then
YuanbaoShop_UpdatePage(nPageNum);
elseif (event == "CLOSE_BOOTH") then
YuanbaoShop_Close()
elseif (event == "UPDATE_YUANBAO" and this:IsVisible()) then
YuanbaoShop_Text2:SetText("#{YBSD_081225_068}"..tostring(Player:GetData("YUANBAO")))
elseif (event == "UI_COMMAND" and tonumber( arg0 ) == 888902) then
ObjCared = Get_XParam_INT( 0 )
if Get_XParam_INT( 1 ) ~= 0 and Get_XParam_INT( 2 ) ~= 0 then
lastA = Get_XParam_INT( 1 )
lastB = Get_XParam_INT( 2 )
end
YuanbaoShop_Show()
end
end
--==================
--´ò¿ªÉ̵ê
function YuanbaoShop_Show()
if lastA < 1 or lastA > maxChildShop then
lastA = 1;
lastB = 1;
end
if lastB < 1 or lastB > maxChildShop then
lastB = 1;
end
lastSelect = 0;
for i = 1 ,maxChildShop do
SHOP_LIST_B[i]:Hide()
if SHOP_LIST_A[lastA].shoplist[i] ~= nil then
SHOP_LIST_B[i]:SetText(SHOP_LIST_A[lastA].shoplist[i])
SHOP_LIST_B[i]:Show()
end
end
SHOP_LIST_A[lastA].btn:SetCheck(1)
SHOP_LIST_B[lastB]:SetCheck(1)
lastA_Bind = 1;
lastB_Bind = 1;
lastSelect_Bind = 0;
for i = 1 ,maxChildShop do
SHOP_LIST_B_BIND[i]:Hide()
if SHOP_LIST_A_BIND[lastA_Bind].shoplist[i] ~= nil then
SHOP_LIST_B_BIND[i]:SetText(SHOP_LIST_A_BIND[lastA_Bind].shoplist[i])
SHOP_LIST_B_BIND[i]:Show()
end
end
SHOP_LIST_A_BIND[lastA_Bind].btn:SetCheck(1)
SHOP_LIST_B_BIND[lastB_Bind]:SetCheck(1)
SHOP_LIST_A_BIND[1].btn : SetCheck(1)
if ( 0 == g_tabIndex ) then
UpdateShopItem( lastA , lastB )
else
YuanbaoShop_Yuanbao : SetCheck(1)
YuanbaoShop_Gongzi : SetCheck(0)
--´ò¿ªÊ±Ä¬ÈÏÇл»µ½ÆÕͨԪ±¦µ ê
YuanbaoShop_ChangeTabIndex( 0 )
end
end
--===============================
--Ë¢ÐÂÒ»Ò³
function YuanbaoShop_UpdatePage(thePage)
YuanbaoShop_Text2:SetText ("#{YBSD_081225_068}"..tostring(Player:GetData("MENPAIPOINT")))
for i=1, GOODS_BUTTONS_NUM do
GOOD_BAD[i]:Show()
end
local i = 1;
if g_nTotalNum == 0 or g_nTotalNum ~= GetActionNum("boothitem") then
g_nTotalNum = GetActionNum("boothitem");
YuanbaoShop_Order();
end
-- ¼ÆËã×ÜÒ³Êý
local nTotalPage;
if( g_nTotalNum < 1 ) then
nTotalPage = 1;
else
nTotalPage = math.floor((g_nTotalNum-1)/GOODS_BUTTONS_NUM)+1;
end
maxPage = nTotalPage;
if(thePage < 1 or thePage > nTotalPage) then
return;
end
--HEQUIP_DRESS =16, //ʱװ
--HEQUIP_RIDER =8, //Æï³Ë
local bHaveRide=0;
nPageNum = thePage;
local nStartIndex = (thePage-1)*GOODS_BUTTONS_NUM;
local nActIndex = nStartIndex;
i = 1;
while i <= GOODS_BUTTONS_NUM do
local idx = g_tOrderPool[nActIndex+1];
if idx == nil then
idx = -1;
end
local theAction = EnumAction(idx, "boothitem");
if theAction:GetID() ~= 0 then
local nEquipPoint = theAction:GetEquipPoint();
if nEquipPoint == 16 or nEquipPoint == 8 then
bHaveRide = 1;
end
GOODS_BUTTONS[i]:SetActionItem(theAction:GetID());
if(theAction:GetItemColorInShop()~="") then
GOODS_DESCS[i]:SetText( theAction:GetItemColorInShop()..theAction:GetName( ) );
else
GOODS_DESCS[i]:SetText( theAction:GetName() );
end
local nPrice = NpcShop:EnumItemPrice( idx )
local nUnit = NpcShop:GetShopType("unit");
if( nUnit == CU_GOODBAD ) then
GOOD_BAD[i]:SetText("Giá tr¸ thi®n ác: " .. tostring(nPrice) .. " Ði¬m")
elseif( nUnit == CU_MORALPOINT ) then
GOOD_BAD[i]:SetText("Ði¬m Sß ÐÑc: " .. tostring(nPrice) .. " Ði¬m")
elseif( nUnit == CU_YUANBAO ) then
GOOD_BAD[i]:SetText("Nguyên bäo: " .. tostring(nPrice))
--GOOD_BAD[i]:SetText("#{YBSD_081225_101}" .. tostring(nPrice)) Nguyen bao
elseif( nUnit == CU_ZENGDIAN ) then
GOOD_BAD[i]:SetText("Ði¬m t£ng: " .. tostring(nPrice))
elseif( nUnit == CU_MENPAI_POINT ) then
GOOD_BAD[i]:SetText("Ði¬m môn phái: " .. tostring(nPrice))
elseif( nUnit == CU_MONEYJZ ) then
--GOODS_PRICE[i]:SetProperty("GoldIcon", "set:Button6 image:Lace_JiaoziJin")
--GOODS_PRICE[i]:SetProperty("SilverIcon", "set:Button6 image:Lace_JiaoziYin")
--GOODS_PRICE[i]:SetProperty("CopperIcon", "set:Button6 image:Lace_JiaoziTong")
-- GOODS_PRICE[i]:SetProperty("MoneyNumber", tostring(nPrice))
else --Ç®£¬¹ÙƱǮ
--GOODS_PRICE[i]:SetProperty("GoldIcon", "set:Button2 image:Icon_GoldCoin")
--GOODS_PRICE[i]:SetProperty("SilverIcon", "set:Button2 image:Icon_SilverCoin")
--GOODS_PRICE[i]:SetProperty("CopperIcon", "set:Button2 image:Icon_CopperCoin")
--GOODS_PRICE[i]:SetProperty("MoneyNumber", tostring(nPrice))
end
i = i+1;
else
GOODS_BUTTONS[i]:SetActionItem(-1);
GOODS_DESCS[i]:SetText("");
GOOD_BAD[i]:SetText("");
i = i+1;
end
nActIndex = nActIndex+1;
end
if bHaveRide >= 1 then
YuanbaoShop_Try:Show();
else
YuanbaoShop_Try:Hide();
end
if( nTotalPage == 1 ) then
YuanbaoShop_UpPage:Hide();
YuanbaoShop_DownPage:Hide();
YuanbaoShop_CurrentlyPage:Hide();
else
YuanbaoShop_UpPage:Show();
YuanbaoShop_DownPage:Show();
YuanbaoShop_CurrentlyPage:Show();
YuanbaoShop_UpPage:Enable();
YuanbaoShop_DownPage:Enable();
if ( nPageNum == nTotalPage ) then
YuanbaoShop_DownPage:Disable();
end
if ( nPageNum == 1 ) then
YuanbaoShop_UpPage:Disable()
end
YuanbaoShop_CurrentlyPage:SetText(tostring(nPageNu m) .. "/" .. tostring(nTotalPage) );
end
end
--µã»÷Ò»¼¶±êÇ©
function YuanbaoShop_UpdateList(nIndex)
if g_tabIndex == ShopTabIdx.GiftToken then
YuanbaoShop_UpdateList_GiftToken(nIndex)
return
end
--PushDebugMessage("YuanbaoShop_UpdateList:"..nIndex);
if nIndex <1 or nIndex > 8 or ( nIndex == lastA and g_changeTabFlag == 0 ) then
return
end
for i = 1 ,maxChildShop do
SHOP_LIST_B[i]:Hide()
if SHOP_LIST_A[nIndex].shoplist[i] ~= nil then
SHOP_LIST_B[i]:SetText(SHOP_LIST_A[nIndex].shoplist[i])
SHOP_LIST_B[i]:Show()
end
end
SHOP_LIST_B[1]:SetCheck(1)
lastB = 1
lastA = nIndex
lastSelect = 0
UpdateShopItem( lastA ,lastB )
end
--µã»÷µêÆÌ
function YuanbaoShop_UpdateShop(nIndex)
if nIndex <1 or nIndex > maxChildShop or nIndex == lastB then
return
end
lastB = nIndex
if lastSelect > 0 and lastSelect < 8 then
UpdateShopItem( lastSelect+8 , lastB )
elseif lastA > 0 and lastA < 9 then
UpdateShopItem( lastA , lastB )
else
UpdateShopItem( 1 , 1)
end
--PushDebugMessage(nIndex);
end
--²éÕÒ
function YuanbaoShop_BeginSearch()
if ( YuanbaoShop_SearchMode_Bind : IsVisible( ) ) then
YuanbaoShop_BeginSearch_Bind();
return;
end
local str , nIndex = YuanbaoShop_SearchMode:GetCurrentSelect()
if nIndex <1 or nIndex > table.getn(SHOP_SEARCH_LIST) then
return
end
for i = 1 ,maxChildShop do
SHOP_LIST_B[i]:Hide()
if SHOP_SEARCH_LIST[nIndex][i] ~= nil then
SHOP_LIST_B[i]:SetText(SHOP_SEARCH_LIST[nIndex][i])
SHOP_LIST_B[i]:Show()
end
end
SHOP_LIST_B[1]:SetCheck(1)
lastB = 1
lastA = 0
lastSelect = nIndex
for i = 1 ,8 do
SHOP_LIST_A[i].btn:SetCheck(0)
end
UpdateShopItem( nIndex+8 , 1 )
end
-- °ó¶¨Ôª±¦ begin
--µã»÷Ò»¼¶±êÇ©
function YuanbaoShop_UpdateList_Bind(nIndex)
--PushDebugMessage("YuanbaoShop_UpdateList_Bind:"..nIndex);
if nIndex < 1 or nIndex > 8 or ( nIndex == lastA_Bind and g_changeTabFlag == 0 ) then
return
end
for i = 1 , maxChildShop do
SHOP_LIST_B_BIND[i]:Hide()
if SHOP_LIST_A_BIND[nIndex].shoplist[i] ~= nil then
SHOP_LIST_B_BIND[i]:SetText(SHOP_LIST_A_BIND[nIndex].shoplist[i])
SHOP_LIST_B_BIND[i]:Show()
end
end
SHOP_LIST_B_BIND[1]:SetCheck(1)
lastB_Bind = 1
lastA_Bind = nIndex
lastSelect_Bind = 0
UpdateShopItem( lastA_Bind + 100 ,lastB_Bind )
end
--µã»÷µêÆÌ
function YuanbaoShop_UpdateShop_Bind(nIndex)
--PushDebugMessage("YuanbaoShop_UpdateShop_Bind:"..nIndex..",lastB_Bind:"..lastB_Bind..",g_changeTabFlag:"..g_changeTabFlag );
if nIndex <1 or nIndex > maxChildShop or ( nIndex == lastB_Bind and g_changeTabFlag == 0 ) then
return
end
lastB_Bind = nIndex
if lastSelect_Bind > 0 and lastSelect_Bind < 8 then
UpdateShopItem( lastSelect_Bind + 108 , lastB_Bind )
elseif lastA_Bind > 0 and lastA_Bind < 9 then
UpdateShopItem( lastA_Bind + 100 , lastB_Bind )
else
UpdateShopItem( 1 , 1)
end
end
--²éÕÒ
function YuanbaoShop_BeginSearch_Bind()
local str , nIndex = YuanbaoShop_SearchMode_Bind:GetCurrentSelect()
if nIndex <1 or nIndex > 7 then
return
end
for i = 1 ,maxChildShop do
SHOP_LIST_B_BIND[i]:Hide()
if SHOP_SEARCH_LIST_BIND[nIndex][i] ~= nil then
SHOP_LIST_B_BIND[i]:SetText(SHOP_SEARCH_LIST_BIND[nIndex][i])
SHOP_LIST_B_BIND[i]:Show()
end
end
SHOP_LIST_B_BIND[1]:SetCheck(1)
lastB_Bind = 1
lastA_Bind = 0
lastSelect_Bind = nIndex
for i = 1 ,8 do
SHOP_LIST_A_BIND[i].btn:SetCheck(0)
end
UpdateShopItem( nIndex + 108 , 1 )
end
---------------------------------------- ·µÈ¯É̵ê -------------------------------------------
--µã»÷Ò»¼¶±êÇ©
function YuanbaoShop_UpdateList_GiftToken(nIndex)
--PushDebugMessage("YuanbaoShop_UpdateList:"..nIndex);
if nIndex <1 or nIndex > 8 or ( nIndex == lastA_GiftToken and g_changeTabFlag == 0 ) then
return
end
for i = 1 ,maxChildShop do
SHOP_LIST_B_GIFTTOKEN[i]:Hide()
if SHOP_LIST_A_GIFTTOKEN[nIndex].shoplist[i] ~= nil then
SHOP_LIST_B_GIFTTOKEN[i]:SetText(SHOP_LIST_A_GIFTTOKEN[nIndex].shoplist[i])
SHOP_LIST_B_GIFTTOKEN[i]:Show()
end
end
SHOP_LIST_B_GIFTTOKEN[1]:SetCheck(1)
lastB_GiftToken = 1
lastA_GiftToken = nIndex
lastSelec_GiftTokent = 0
UpdateShopItem( lastA_GiftToken + 200, lastB_GiftToken )
end
--µã»÷µêÆÌ
function YuanbaoShop_UpdateShop_GiftToken(nIndex)
--PushDebugMessage("YuanbaoShop_UpdateShop:"..nIndex);
if nIndex <1 or nIndex > maxChildShop or ( nIndex == lastB_GiftToken and g_changeTabFlag == 0 ) then
return
end
lastB_GiftToken = nIndex
if lastSelect_GiftToken > 0 and lastSelect_GiftToken <= table.getn(SHOP_SEARCH_LIST_GIFTTOKEN) then
UpdateShopItem( lastSelect_GiftToken+208 , lastB_GiftToken )
elseif lastA_GiftToken > 0 and lastA_GiftToken < table.getn(SHOP_LIST_A_GIFTTOKEN) then
UpdateShopItem( lastA_GiftToken + 200, lastB_GiftToken )
else
UpdateShopItem(201 , 1)
end
end
--²éÕÒ
function YuanbaoShop_BeginSearch_GiftToken()
lastB_GiftToken = 1
lastA_GiftToken = 0
lastSelect_GiftToken = 0
end
---------------------------------------- ·µÈ¯ÉÌµê ½áÊø -------------------------------------------
--ÉèÖò˵¥µÄÏÔʾÊôÐÔ
function YuanbaoShop_UpdateVisiableProperty(shopAList, shopBList, searchList, lastA, lastB, lastSelect)
if (shopAList == nil or shopBList == nil or searchList == nil) then
return
end
local findA = 0
for i=1, table.getn(shopAList) do
if (table.getn(shopAList[i].shoplist) > 0) then
shopAList[i].btn : Show()
if (i == lastA) then
findA = i
end
else
shopAList[i].btn : Hide()
end
end
if (findA > 0) then
shopAList[lastA].btn : SetCheck(1)
for j = 1, table.getn(shopBList) do
shopBList[j] : Hide()
if shopAList[lastA].shoplist[j] ~= nil then
shopBList[j] : SetText(shopAList[lastA].shoplist[j])
shopBList[j] : Show()
if j == lastB then
shopBList[j] : SetCheck(1)
end
end
end
elseif lastSelect > 0 and lastSelect <= table.getn(searchList) then
for i = 1 ,table.getn(shopAList) do
shopAList[i].btn:SetCheck(0)
end
for i = 1 ,table.getn(shopBList) do
shopBList[i]:Hide()
if searchList[lastSelect][i] ~= nil then
shopBList[i]:SetText(searchList[lastSelect][i])
shopBList[i]:Show()
end
end
shopBList[lastB]:SetCheck(1)
end
end
function YuanbaoShop_ChangeTabIndex( nIndex )
if (nIndex == ShopTabIdx.GiftToken) then --¹Ø±Õ·µÈ¯É̵ê
return
end
if ( nIndex == g_tabIndex ) then
return
end
g_changeTabFlag = 1
g_tabIndex = nIndex
YuanbaoShop_Bk1_Bind : Hide();
YuanbaoShop_Bk2_Bind : Hide();
YuanbaoShop_SearchMode_Bind : Hide();
YuanbaoShop_Bk1 : Hide();
YuanbaoShop_Bk2 : Hide();
YuanbaoShop_SearchMode : Hide();
YuanbaoShop_Text1 : Hide();
YuanbaoShop_Begin : Hide();
YuanbaoShop_Text2 : Hide();
YuanbaoShop_Text2_Bind : Hide();
YuanbaoShop_Bk3 : Hide();
YuanbaoShop_Bk4 : Hide();
YuanbaoShop_Dis : Hide();
YuanbaoShop_Dis3 : Hide();
YuanbaoShop_FanquanRateInfo : Hide();
if( nIndex == ShopTabIdx.YuanBao ) then
YuanbaoShop_Bk1 : Show();
YuanbaoShop_Bk2 : Show();
YuanbaoShop_SearchMode : Show();
YuanbaoShop_Text1 : Show();
YuanbaoShop_Begin : Show();
YuanbaoShop_Text2 : Show();
YuanbaoShop_Dis : Show();
--YuanbaoShop_Dis3 : Show();
YuanbaoShop_UpdateVisiableProperty(SHOP_LIST_A, SHOP_LIST_B, SHOP_SEARCH_LIST, lastA, lastB, lastSelect)
YuanbaoShop_Bk3 : Show();
local check = tonumber(NpcShop:GetBuyDirectly());
if(check>=1)then
YuanbaoShop_querengoumai:SetCheck(0);
else
YuanbaoShop_querengoumai:SetCheck(1);
end
YuanbaoShop_UpdateShop( lastB );
elseif( nIndex == ShopTabIdx.Bind ) then
YuanbaoShop_Bk1_Bind : Show();
YuanbaoShop_Bk2_Bind : Show();
YuanbaoShop_Text2_Bind : Show();
YuanbaoShop_Bk4 : Show();
local check = tonumber(NpcShop:GetBuyDirectly());
if(check>=1)then
YuanbaoShop_querengoumaiBind:SetCheck(0);
else
YuanbaoShop_querengoumaiBind:SetCheck(1);
end
check = tonumber(NpcShop:GetUseYBForBind());
if(check>=1)then
YuanbaoShop_querenzhifuBind:SetCheck(0);
else
YuanbaoShop_querenzhifuBind:SetCheck(1);
end
-- YuanbaoShop_SearchMode_Bind : Show();
if ( lastB_Bind == 0 ) then
YuanbaoShop_UpdateList_Bind( 1 );
else
YuanbaoShop_UpdateShop_Bind( lastB_Bind );
end
elseif( nIndex == ShopTabIdx.GiftToken ) then
YuanbaoShop_Bk1 : Show();
YuanbaoShop_Bk2 : Show();
YuanbaoShop_Text2 : Show();
YuanbaoShop_FanquanRateInfo : Show();
YuanbaoShop_Bk3 : Show();
local check = tonumber(NpcShop:GetBuyDirectly());
if(check>=1)then
YuanbaoShop_querengoumai:SetCheck(0);
else
YuanbaoShop_querengoumai:SetCheck(1);
end
-- YuanbaoShop_SearchMode_Bind : Show();
if ( lastB_GiftToken == 0 ) then
YuanbaoShop_UpdateVisiableProperty(SHOP_LIST_A_GIF TTOKEN, SHOP_LIST_B_GIFTTOKEN, SHOP_SEARCH_LIST_GIFTTOKEN, 1, 1, 0)
YuanbaoShop_UpdateList_GiftToken( 1 );
else
YuanbaoShop_UpdateVisiableProperty(SHOP_LIST_A_GIF TTOKEN, SHOP_LIST_B_GIFTTOKEN, SHOP_SEARCH_LIST_GIFTTOKEN, lastA_GiftToken, lastB_GiftToken, lastSelect_GiftToken)
YuanbaoShop_UpdateShop_GiftToken( lastB_GiftToken );
end
end
end
-- °ó¶¨Ôª±¦ end
--ÊÔ´©
function YuanbaoShop_OpenFitting()
if IsIdleLogic() ~= 1 then
SetNotifyTip("#{YBSD_081225_100}");
return 0;
end
if(IsWindowShow("Shop_Fitting")) then
CloseWindow("Shop_Fitting", true);
end
RestoreShopFitting();
this:Show();
MouseCmd_ShopFittingSet();
SetNotifyTip("#{YBSD_081225_099}");
end
--ÇëÇóÉ̵êÐÅÏ¢
function UpdateShopItem( shopA , shopB)
Clear_XSCRIPT();
Set_XSCRIPT_Function_Name("OpenYuanbaoShop");
Set_XSCRIPT_ScriptID(888902);
Set_XSCRIPT_Parameter(0,ObjCared);
Set_XSCRIPT_Parameter(1,shopA);
Set_XSCRIPT_Parameter(2,shopB);
Set_XSCRIPT_ParamCount(3);
Send_XSCRIPT();
end
--===============================================
-- Button_Clicked
--===============================================
function YuanbaoShop_GoodButton_Clicked(nIndex)
if(nIndex < 1 or nIndex > 18) then
return;
end
GOODS_BUTTONS[nIndex]:DoAction();
end
--===============================================
-- PageUp
--===============================================
function YuanbaoShop_PageUp()
curPage = nPageNum - 1;
if ( curPage >= maxPage ) then
curPage = maxPage;
end
NpcShop:CloseConfirm();
YuanbaoShop_UpdatePage( curPage );
end
--===============================================
-- PageDown
--===============================================
function YuanbaoShop_PageDown()
curPage = nPageNum + 1;
if ( curPage < 0 ) then
curPage = 0;
end
NpcShop:CloseConfirm();
YuanbaoShop_UpdatePage( curPage );
end
--===============================================
-- Close
--===============================================
function YuanbaoShop_Close()
ObjCared = -1
this:CareObject(objCared, 0, "YuanbaoShop");
if(IsWindowShow("Shop_Fitting")) then
CloseWindow("Shop_Fitting", true);
end
if(IsWindowShow("YBShopReference")) then
CloseWindow("YBShopReference",true)
end
SetDefaultMouse();
CloseBooth();
NpcShop:CloseConfirm();
RestoreShopFitting();
this:Hide();
end
--Ëæ»úÅÅÐò
function YuanbaoShop_Order()
local max = g_nTotalNum;
local oldt = {};
g_tOrderPool= {};
for i = 1, tonumber(max) do
oldt[i] = i-1;
end
if tonumber(NpcShop:GetIsShopReorder()) == 0 then
g_tOrderPool = oldt;
else
for i = 1, table.getn(oldt) do
local idx = math.random(1, table.getn(oldt));
local val = oldt[idx];
g_tOrderPool[i]= val;
table.remove(oldt, idx);
end
end
end
--È·ÈÏ°´Å¥
function YuanbaoShop_querengoumai_Clicked()
if(NpcShop:GetBuyDirectly() == 0)then
-- YuanbaoShop_querengoumai:SetCheck(0);
NpcShop:SetBuyDirectly(1);
else
-- YuanbaoShop_querengoumai:SetCheck(1);
NpcShop:SetBuyDirectly(0);
end
end
--È·ÈÏ°´Å¥
function YuanbaoShop_querenzhifu_Clicked()
if(NpcShop:GetUseYBForBind() == 0)then
NpcShop:SetUseYBForBind(1)
else
NpcShop:SetUseYBForBind(0)
end
end
--¿ìËÙ³äÖµ
function YuanbaoShop_web_Clicked()
GameProduceLogin:OpenURL("<b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b>")
end
--Ŀ¼ºÍ²éÕÒ˵Ã÷
function YuanbaoShop_Dis_Clicked()
OpenYBShopReference("#{YBSD_081225_070}")
end
--Ôª±¦É̵êʹÓÃ˵Ã÷
function YuanbaoShop_Dis2_Clicked()
OpenYBShopReference("#{YBSD_081225_098}")
end
--ÉñÃØÉ̵êʹÓÃ˵Ã÷
function YuanbaoShop_Dis3_Clicked()
OpenYBShopReference("#{SMSD_100127_01}")
end
--¹ö¶¯ÐÅϢ˳ÐòËæ»úÅÅÁÐ
function YubanbaoShop_ADRandom()
YuanbaoShop_ScrollInfo_Frame:ClearInfo()
local ADInfo = {
"#{YBSD_081225_093}",
"#{YBSD_081225_094}",
"#{YBSD_081225_095}",
}
local nADInfoNum = table.getn(ADInfo)
if (nil == nADInfoNum or nADInfoNum < 1 or nADInfoNum > 3) then
nADInfoNum = 3
end
for i = 0 ,1 do
local idx = math.random(1 ,nADInfoNum - i)
local str = ADInfo[idx]
ADInfo[idx] = ADInfo[nADInfoNum - i]
ADInfo[nADInfoNum - i] = str
end
for i = 1 ,nADInfoNum do
YuanbaoShop_ScrollInfo_Frame:SetScrollInfoFixed(AD Info[i])
end
end
function YuanbaoShop_ResetPos()
YuanbaoShop_Frame:SetProperty("UnifiedXPosition", g_YuanbaoShop_Frame_UnifiedXPosition);
YuanbaoShop_Frame:SetProperty("UnifiedYPosition", g_YuanbaoShop_Frame_UnifiedYPosition);
end
Mình muốn add thêm một shoplist chứa yếu quyết 35 của phái,nhưng add chỉ được button không hiển thị được cái frame ,ai chỉ mình với.
Powered by vBulletin® Version 4.2.0 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.