58 lines
1.3 KiB
Plaintext
58 lines
1.3 KiB
Plaintext
/*
|
|
文件名:PvfItemClass.nut
|
|
路径:BaseClass/PvfClass/PvfItemClass.nut
|
|
创建日期:2024-04-26 19:28
|
|
文件用途:PVF item数据
|
|
*/
|
|
class PvfItem extends Base_C_Object {
|
|
Attribute = null;
|
|
constructor(CObject) {
|
|
base.constructor(CObject);
|
|
Attribute = Sq_Point2Blob(CObject, 600);
|
|
}
|
|
|
|
function Output() {
|
|
local Str = "[";
|
|
foreach(Value in Attribute) {
|
|
Str = format("%s%02X", Str, Value);
|
|
Str += ",";
|
|
}
|
|
Str += "]";
|
|
print(Str);
|
|
}
|
|
|
|
//获取编号
|
|
function GetIndex() {
|
|
Attribute.seek(1 * 4);
|
|
return Attribute.readn('i');
|
|
}
|
|
|
|
//获取可用等级
|
|
function GetUsableLevel() {
|
|
Attribute.seek(18 * 4);
|
|
return Attribute.readn('i');
|
|
}
|
|
|
|
//获取稀有度
|
|
function GetRarity() {
|
|
Attribute.seek(14 * 4);
|
|
return Attribute.readn('i');
|
|
}
|
|
|
|
//获取名字
|
|
function GetName() {
|
|
return Sq_GetNameByIdFromPvf(GetIndex());
|
|
}
|
|
|
|
//Public
|
|
function GetNameById(Id) {
|
|
return Sq_GetNameByIdFromPvf(Id);
|
|
}
|
|
//Public
|
|
function GetPvfItemById(Idx) {
|
|
local Ret = Sq_GetDataByIdFromPvf(Idx);
|
|
if (Ret) {
|
|
return PvfItem(Ret);
|
|
} else return null;
|
|
}
|
|
} |