150 lines
5.0 KiB
JavaScript
150 lines
5.0 KiB
JavaScript
|
|
|||
|
var EItemType =
|
|||
|
{
|
|||
|
Material: 0,
|
|||
|
Equip: 1,
|
|||
|
Pet: 2,
|
|||
|
Medicine: 4,
|
|||
|
BestBook: 5,
|
|||
|
BetterBook: 6,
|
|||
|
CommonBook: 7,
|
|||
|
FiveElemeBook: 8,
|
|||
|
Treasure: 9,
|
|||
|
QualityCard:10,
|
|||
|
ChangeBody: 11,
|
|||
|
FeastDay: 12,
|
|||
|
TianCeFu: 13
|
|||
|
};
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
class CItemType
|
|||
|
{
|
|||
|
constructor( nItemKind,nParam, strTypeName,strIcon )
|
|||
|
{
|
|||
|
this.nItemKind = nItemKind;
|
|||
|
this.nParam = nParam; //當 nItemType 為裝備時,nParam 為裝備類型。當 nItemType 為 藥品,材料,寵物,書時,nParam 為 ItemID
|
|||
|
this.strTypeName = strTypeName;
|
|||
|
this.strIcon = strIcon;
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
/********************************************************************* */
|
|||
|
|
|||
|
let g_ctCItemMgr = null;
|
|||
|
|
|||
|
|
|||
|
class CItemMgr
|
|||
|
{
|
|||
|
constructor()
|
|||
|
{
|
|||
|
this.mapItemKind = {};
|
|||
|
this.mapEquipType = {};
|
|||
|
this.mapPet = {};
|
|||
|
this.mapMaterial = {};
|
|||
|
|
|||
|
this.LoadDataFromJson();
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
LoadDataFromJson()
|
|||
|
{
|
|||
|
|
|||
|
|
|||
|
//一級分類:物品分類
|
|||
|
|
|||
|
this.mapItemKind[EItemType.Equip] = '珍品裝備';
|
|||
|
this.mapItemKind[EItemType.Pet] = '珍品寵物';
|
|||
|
this.mapItemKind[EItemType.Material] = '強化材料';
|
|||
|
this.mapItemKind[EItemType.Medicine] = '藥品道具';
|
|||
|
this.mapItemKind[EItemType.BestBook] = '終極技能書';
|
|||
|
this.mapItemKind[EItemType.BetterBook] = '高級技能書';
|
|||
|
this.mapItemKind[EItemType.CommonBook] = '普通技能書';
|
|||
|
this.mapItemKind[EItemType.FiveElemeBook] = '五行天書';
|
|||
|
this.mapItemKind[EItemType.Treasure] = '奇珍異寶';
|
|||
|
this.mapItemKind[EItemType.QualityCard] = '屬性卡';
|
|||
|
this.mapItemKind[EItemType.ChangeBody] = '變身卡';
|
|||
|
this.mapItemKind[EItemType.FeastDay] = '節日珍品';
|
|||
|
this.mapItemKind[EItemType.TianCeFu] = '天策符';
|
|||
|
|
|||
|
|
|||
|
//裝備分類
|
|||
|
|
|||
|
this.mapEquipType[0] = new CItemType(EItemType.Equip, 0, '全部', '');
|
|||
|
this.mapEquipType[1] = new CItemType(EItemType.Equip,1, '祭劍魂', '');
|
|||
|
|
|||
|
this.mapEquipType[2] = new CItemType(EItemType.Equip, 2, '男衣', '');
|
|||
|
this.mapEquipType[3] = new CItemType(EItemType.Equip, 3, '男帽', '');
|
|||
|
this.mapEquipType[4] = new CItemType(EItemType.Equip, 4, '項鍊', '');
|
|||
|
this.mapEquipType[5] = new CItemType(EItemType.Equip, 5, '鞋子', '');
|
|||
|
|
|||
|
this.mapEquipType[6] = new CItemType(EItemType.Equip, 6, '男性挂件', '');
|
|||
|
this.mapEquipType[7] = new CItemType(EItemType.Equip,7, '男性腰帶', '');
|
|||
|
this.mapEquipType[8] = new CItemType(EItemType.Equip, 8,'戒指', '');
|
|||
|
this.mapEquipType[9] = new CItemType(EItemType.Equip, 9,'披風', '');
|
|||
|
|
|||
|
this.mapEquipType[10] = new CItemType(EItemType.Equip, 10,'逍遙生-扇', '');
|
|||
|
this.mapEquipType[11] = new CItemType(EItemType.Equip, 11,'俏千金-刀', '');
|
|||
|
this.mapEquipType[12] = new CItemType(EItemType.Equip, 12,'神天兵-槍', '');
|
|||
|
this.mapEquipType[13] = new CItemType(EItemType.Equip, 13,'玄劍娥-劍', '');
|
|||
|
|
|||
|
this.mapEquipType[14] = new CItemType(EItemType.Equip, 14,'虎頭怪-棍', '');
|
|||
|
this.mapEquipType[15] = new CItemType(EItemType.Equip, 15,'狐美人-鞭', '');
|
|||
|
this.mapEquipType[16] = new CItemType(EItemType.Equip, 16,'夜溪靈-燈', '');
|
|||
|
this.mapEquipType[17] = new CItemType(EItemType.Equip, 17,'飛劍俠-劍', '');
|
|||
|
|
|||
|
this.mapEquipType[18] = new CItemType(EItemType.Equip, 18,'燕山雪-劍', '');
|
|||
|
this.mapEquipType[19] = new CItemType(EItemType.Equip, 19,'武神尊-槍', '');
|
|||
|
this.mapEquipType[20] = new CItemType(EItemType.Equip, 20,'媚靈狐-刀', '');
|
|||
|
this.mapEquipType[21] = new CItemType(EItemType.Equip, 21,'無崖子-書', '');
|
|||
|
|
|||
|
this.mapEquipType[22] = new CItemType(EItemType.Equip, 22,'燕山雪-劍', '');
|
|||
|
this.mapEquipType[23] = new CItemType(EItemType.Equip, 23,'武神尊-槍', '');
|
|||
|
this.mapEquipType[24] = new CItemType(EItemType.Equip, 24,'媚靈狐-刀', '');
|
|||
|
this.mapEquipType[25] = new CItemType(EItemType.Equip, 25,'無崖子-書', '');
|
|||
|
|
|||
|
this.mapEquipType[26] = new CItemType(EItemType.Equip, 26,'幽夢影-帶', '');
|
|||
|
this.mapEquipType[27] = new CItemType(EItemType.Equip, 27,'神秀生-筆', '');
|
|||
|
this.mapEquipType[28] = new CItemType(EItemType.Equip, 28,'紅拂女-劍', '');
|
|||
|
this.mapEquipType[29] = new CItemType(EItemType.Equip, 29,'龍戰將-棍', '');
|
|||
|
|
|||
|
this.mapEquipType[30] = new CItemType(EItemType.Equip, 30,'雲中君-環', '');
|
|||
|
this.mapEquipType[31] = new CItemType(EItemType.Equip, 31,'混天魔-刀', '');
|
|||
|
this.mapEquipType[32] = new CItemType(EItemType.Equip, 32,'九尾狐-爪', '');
|
|||
|
this.mapEquipType[33] = new CItemType(EItemType.Equip, 33,'南冠客-刀', '');
|
|||
|
|
|||
|
this.mapEquipType[34] = new CItemType(EItemType.Equip, 34,'鏡花影-劍', '');
|
|||
|
this.mapEquipType[35] = new CItemType(EItemType.Equip, 35,'女衣', '');
|
|||
|
this.mapEquipType[36] = new CItemType(EItemType.Equip, 36,'女帽', '');
|
|||
|
this.mapEquipType[37] = new CItemType(EItemType.Equip, 37,'女性挂件', '');
|
|||
|
this.mapEquipType[38] = new CItemType(EItemType.Equip, 38,'女性腰帶', '');
|
|||
|
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
GetItem( nConfigID )
|
|||
|
{
|
|||
|
for (let it in this.mapSkill)
|
|||
|
{
|
|||
|
if ( it == nID)
|
|||
|
return this.mapSkill[it];
|
|||
|
}
|
|||
|
|
|||
|
return null;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
module.exports = { g_ctCItemMgr: new CItemMgr(), EItemType, CItemType };
|
|||
|
|