📄 item.h
字号:
// Item.h: interface for the CItem class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_ITEM_H__CA7CE885_1DCF_4B96_B308_FB7F40CCF4BA__INCLUDED_)
#define AFX_ITEM_H__CA7CE885_1DCF_4B96_B308_FB7F40CCF4BA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ItemData.h"
#include "MyHeap.h"
#include "T_SingleObjSet2.h"
#include "T_SingleMap2.h"
#include "UserTable.h"
//////////////////////////////////////////////////////////////////////
const int ITEMREPAIR_PERCENT = 200; // 修理费为原价的200%
const int ITEMIDENT_PERCENT = 10; // 鉴定费10%
const int ERROR_WEIGHT = 123456789; // 错误的重量
//---品质---begin
const int QUALITY_ZERO = 0; // 普通品
const int QUALITY_ONE = 1; // 良品
const int QUALITY_TWO = 2; // 上品
const int QUALITY_THREE = 3; // 精品
const int QUALITY_FOUR = 4; // 极品
//---品质---end
const int EUDEMON_EVOLVE_LEVEL1 = 20; // 幻兽第一次进化等级
const int EUDEMON_EVOLVE_LEVEL2 = 40; // 幻兽第二次进化等级
const int EUDEMON_EVOLVE_MAXTYPE = 2; // 幻兽第一次进化的最大类型编号
//////////////////////////////////////////////////////////////////////
//
const int EUDEMON_GROUP_SAINT = 1; // 圣兽
const int EUDEMON_GROUP_EVIL = 2; // 魔兽
const int MIN_DIVINE_ID = 1; // 最小神识编号
const int MAX_DIVINE_ID = 8; // 最大神识编号
const int EUDEMON_HATCH_SECS = 24*60*60; // 幻兽孵化需要24小时
// chest
const OBJID TYPE_CHEST_SPACE3 = 1070000;
const OBJID TYPE_CHEST_SPACE6 = 1070001;
const OBJID TYPE_CHEST_SPACE9 = 1070002;
// treasure
const OBJID TYPE_DRAGONBALL = 1088000;
const OBJID TYPE_SHOOTINGSTAR = 1088001;
const OBJID TYPE_DIVOICEITEM = 1088002;
// gems
const OBJID GEM_WPNEXP_LOW = 700051;
const OBJID GEM_WPNEXP_MID = 700052;
const OBJID GEM_WPNEXP_HGT = 700053;
const OBJID GEM_MGCEXP_LOW = 700061;
const OBJID GEM_MGCEXP_MID = 700062;
const OBJID GEM_MGCEXP_HGT = 700063;
const OBJID GEM_EXP_LOW = 700031;
const OBJID GEM_EXP_MID = 700032;
const OBJID GEM_EXP_HGT = 700033;
const OBJID GEM_DUR_LOW = 700041;
const OBJID GEM_DUR_MID = 700042;
const OBJID GEM_DUR_HGT = 700043;
const OBJID GEM_DMG_LOW = 700011;
const OBJID GEM_DMG_MID = 700012;
const OBJID GEM_DMG_HGT = 700013;
const OBJID GEM_HIT_LOW = 700021;
const OBJID GEM_HIT_MID = 700022;
const OBJID GEM_HIT_HGT = 700023;
const OBJID GEM_MATK_LOW = 700001;
const OBJID GEM_MATK_MID = 700002;
const OBJID GEM_MATK_HGT = 700003;
const OBJID GEM_EUDEMON_REBORN = 1033020; // 幻兽复活用宝石
const OBJID GEM_EUDEMON_ENHANCE = 1033030; // 幻兽强化用宝石
const OBJID NORMAL_ARROW_TYPE = 1050000; // normal arrow itemtype
const OBJID ARROW_SUBTYPE = 50; // normal arrow subtype
const OBJID CARD_FEE_POINT = 780000; // game card for fee
const OBJID CARD_FEE_POINT2 = 780001; // game card for fee
// add by zlong 2003-12-05
const OBJID ARROW_TYPE_ID = 170001; // 箭
const OBJID DART_TYPE_ID = 171001; // 弩箭
//LW拍买得到的类型筹码----------------------
const int AUCTION_CHIP = 720000;
//------------------------------------------
const OBJID ARROW_PILE_WEIGHT = 100; // 多少支箭矢的重量为1. 100->100支重量为1
//---jinggy---铸造系统---begin
const int MAX_LEVEL_EQUIP1 = 9;
const int MAX_LEVEL_EQUIP2 = 22;
const int MAX_LEVEL_QUALITYANDADDITION = 9;
//---jinggy---铸造系统---end
//////////////////////////////////////////////////////////////////////
// 魔魂宝石
// 以下4个宝石按照检查使用的优先级先後顺序排列
const OBJID GHOST_GEM_AVOID_DEATH = 1033040; // 移魂宝石——免死,恢复全部生命
const OBJID GHOST_GEM_AMULET = 1036000; // 护身宝石——免死,恢复1点生命
const OBJID GHOST_GEM_SCAPEGOAT = 1036030; // 替身宝石——被杀死不掉物品和经验
const OBJID GHOST_GEM_REBORN = 1036020; // 复活宝石——死亡20秒后复活
const OBJID GHOST_GEM_AVOID_STEAL = 1034020; // 反偷盗宝石——避免被偷盗
//////////////////////////////////////////////////////////////////////
enum ITEM_IDENT
{
_ITEM_STATUS_NONE = 0, // 无
_ITEM_STATUS_NOT_IDENT = 1, // 未鉴定
_ITEM_STATUS_CANNOT_REPAIR = 2, // 不可修复
_ITEM_STATUS_NEVER_DAMAGE = 4, // 永不磨损
};
//////////////////////////////////////////////////////////////////////
// Itemtype表的target字段掩码
enum TARGET_MASK
{
TARGET_NONE = 0x0000, // 只能对自己使用 —— 兼容旧系统数据
// 目标类型
TARGET_USER = 0x0001, // 可以对玩家使用
TARGET_MONSTER = 0x0002, // 可以对怪物使用
TARGET_EUDEMON = 0x0004, // 可以对幻兽使用
// 限制条件
TARGET_SELF = 0x0010, // 限制只能对自己或属于自己的目标
TARGET_OTHERS = 0x0020, // 限制只能对其他玩家或属于其他玩家的目标
TARGET_BODY = 0x0040, // 限制只能对尸体使用
// 其他类型检查
TARGET_CHK_PKMODE = 0x0100, // 需要检查pk模式
TARGET_FORBIDDEN = 0x0200, // 禁止对任何目标使用
};
//////////////////////////////////////////////////////////////////////
class CItem : public CItemData
{
protected:
CItem();
virtual ~CItem();
public:
static CItem* CreateNew() { return (new CItem); }
UINT ReleaseByOwner() { delete this; return 0; }
static bool CreateItemInfo(ItemInfoStruct& info, DWORD dwValue, CNpcType* pType, int nQuality=0);
public: // 分类
bool IsNormal() { return GetItemSort() == ITEMSORT_EXPEND; }
bool IsWeapon1() { return GetItemSort() == ITEMSORT_WEAPON1; } // single hand use
bool IsWeapon2() { return GetItemSort() == ITEMSORT_WEAPON2; } // two hand use
bool IsWeapon() { return GetItemSort() == ITEMSORT_WEAPON1 || GetItemSort() == ITEMSORT_WEAPON2; }
bool IsMount() { return CItem::IsMount(GetInt(ITEMDATA_TYPE)); }
bool IsShield() { return CItem::IsShield(GetInt(ITEMDATA_TYPE)); }
bool IsOther() { return GetItemSort() == ITEMSORT_OTHER; }
bool IsFinery() { return !IsArrowSort() && GetItemSort() == IETMSORT_FINERY; }
bool IsArrowSort() { return CItem::IsArrowSort(GetInt(ITEMDATA_TYPE)); }
bool IsArrow() { return CItem::IsArrow(GetInt(ITEMDATA_TYPE)); } //IsNormal() && GetItemType() == ITEMTYPE_ARROW; }
bool IsDart() { return CItem::IsDart(GetInt(ITEMDATA_TYPE)); } //IsNormal() && GetItemType() == ITEMTYPE_DART; }
bool IsSpell() { return CItem::IsSpell(GetInt(ITEMDATA_TYPE)); }
bool IsExpend() { return CItem::IsExpend(GetInt(ITEMDATA_TYPE)); }
bool IsHelmet() { return IsFinery() && GetItemType() == ITEMTYPE_HELMET; }
bool IsNecklace() { return IsFinery() && GetItemType() == ITEMTYPE_NECKLACE; }
bool IsArmor() { return IsFinery() && GetItemType() == ITEMTYPE_ARMOR; }
bool IsRing() { return IsFinery() && GetItemType() == ITEMTYPE_RING; }
bool IsBangle() { return IsFinery() && GetItemType() == ITEMTYPE_BANGLE; } // 是否手镯 -- zlong 2004-02-03
bool IsShoes() { return IsFinery() && GetItemType() == ITEMTYPE_SHOES; }
bool IsEquipment() { return CItem::IsEquipment(GetInt(ITEMDATA_TYPE)); }
bool IsTransSpell() { return false; } //? 作废 GetInt(ITEMDATA_TYPE) == 107000099;
bool IsBowSort() { return CItem::IsBowSort(GetInt(ITEMDATA_TYPE)); }
bool IsBow() { return CItem::IsBow(GetInt(ITEMDATA_TYPE)); }
bool IsCrossBow() { return CItem::IsCrossBow(GetInt(ITEMDATA_TYPE)); }
bool IsActionItem() { return IsOther() && GetItemType() == ITEMTYPE_ACTIONITEM || IsSpell(); }
bool IsTaskItem() { return IsOther() && GetItemType() == ITEMTYPE_TASKITEM; }
bool IsGem() { return IsOther() && GetItemType() == ITEMTYPE_GEM; }
bool IsNonsuch() { return GetQuality() == 9; }
bool IsGameCard() { return CItem::IsGameCard(GetInt(ITEMDATA_TYPE)); } //IsOther() && GetItemType() == ITEMTYPE_GAMECARD; }
bool IsMedicine() { return CItem::IsMedicine(GetInt(ITEMDATA_TYPE)); }
bool IsGhostGem() { return CItem::IsGhostGem(GetInt(ITEMDATA_TYPE)); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -