var SocketList = {
"0000" : "没有镶嵌栏",
"0001" : "红色镶嵌栏",
"0002" : "黄色镶嵌栏",
"0004" : "绿色镶嵌栏",
"0008" : "蓝色镶嵌栏",
"0010" : "白金镶嵌栏",
"ffef" : "彩色镶嵌栏",
"0000000" : "未镶嵌"
};
//查看穿戴的所有时装孔信息
function CheckSocket(user){
var inven = CUserCharacInfo_getCurCharacInvenW(user);
for(var i = 0; i <= 9; i++){
var avartar = CInventory_GetInvenRef(inven, INVENTORY_TYPE_BODY, i);
var avartar_add_info = Inven_Item_get_add_info(avartar);
var inven_avartar_mgr = CInventory_GetAvatarItemMgrR(inven);
var item_id = Inven_Item_getKey(avartar);
var itemname = api_CItem_GetItemName(item_id);
//console.log(item_id);
if(Inven_Item_isEmpty(avartar))
{
}else{
var jewel_socket_data = WongWork_CAvatarItemMgr_getJewelSocketData(inven_avartar_mgr, avartar_add_info);
//console.log(bin2hex(jewel_socket_data, 18));
//读取时装插槽数据
var GetStrtext = bin2hex(jewel_socket_data, 18);
//整理数据
var RSockethex = reverseString(GetStrtext, "");
var Sockethex = reverseString(GetStrtext, " ");
function reverseString(GetStrtext, r3){
return GetStrtext.split(r3).reverse().join(r3);
}
for(var j=0; j<=16;j++)
{
Sockethex = Sockethex.replace(" ","");
}
//console.log(Sockethex);
//镶嵌孔颜色
var Socket00 = Sockethex.slice(8,12);
var Socket01 = Sockethex.slice(20,24);
var Socket02 = Sockethex.slice(32,36);
//徽章ID
var Socket10 = Sockethex.slice(0,8);
var Socket11 = Sockethex.slice(13,20);
var Socket12 = Sockethex.slice(25,32);
//Socket01 = parseInt(Sockethex, 16);
CheckSocketList(user, itemname, Socket00, Socket01, Socket02, Socket10, Socket11, Socket12);
}
}
}
//播报徽章列表信息
function CheckSocketList(user, itemname, Socket00, Socket01, Socket02, Socket10, Socket11, Socket12){
var Socket_name00;
var Socket_name01;
var Socket_name02;
for (var key in SocketList)
{
if(Socket00 == key){
Socket00 = SocketList[key];
}
if(Socket01 == key){
Socket01 = SocketList[key];
}
if(Socket02 == key){
Socket02 = SocketList[key];
}
if(Socket10 == "00000000"){
Socket_name00 = "未镶嵌";
}else{
Socket_name00 = api_CItem_GetItemName(parseInt(Socket10, 16));
}
if(Socket11 == key){
Socket_name01 = SocketList[key];
}else{
Socket_name01 = api_CItem_GetItemName(parseInt(Socket11, 16));
}
if(Socket12 == key){
Socket_name02 = SocketList[key];
}else{
Socket_name02 = api_CItem_GetItemName(parseInt(Socket12, 16));
}
}
api_CUser_SendNotiPacketMessage(user, itemname, 1);
api_CUser_SendNotiPacketMessage(user, Socket00 + " : "+ Socket_name00+" ID: "+parseInt(Socket10, 16), 1);
api_CUser_SendNotiPacketMessage(user, Socket01 + " : "+ Socket_name01+" ID: "+parseInt(Socket11, 16), 1);
api_CUser_SendNotiPacketMessage(user, Socket02 + " : "+ Socket_name02+" ID: "+parseInt(Socket12, 16), 1);
api_CUser_SendNotiPacketMessage(user, "----------------------------------------", 1);
}
用0725镶嵌后,在0627也是生效的,只是无法查看到镶嵌的徽章信息。可以通过播报的方式在0627临时查看一下时装下镶嵌信息
© 版权声明
THE END
暂无评论内容