多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
| **TUserItem** | | | --- | --- | | **属性名称** | **功能** | | property Name: String | 数据库中物品名称 | | property DisplayName: String | 物品在客户端显示的名称(过滤了属性字符及末尾的数字) | | property Job: Byte | 和物品数据库字段值对应 | | property StdMode: Byte | 和物品数据库字段值对应 | | property Shape: Word | 和物品数据库字段值对应 | | property AniCount: Word | 和物品数据库字段值对应 | | property Source: ShortInt | 和物品数据库字段值对应 | | property Need: Integer | 和物品数据库字段值对应 | | property NeedLevel: Integer | 和物品数据库字段值对应 | | property Price: Integer | 和物品数据库字段值对应 | | property \_DuraMax: Integer | \_DuraMax为数据库字段DuraMax | | property Price2: Integer | 物品当前卖出价格,受持久、极品属性及数量等因素影响 | | property MakeIndex: int64 | 物品唯一ID值 | | property ItemIndex: Word | 物品数据库中此物品序号 | | property Dura: Integer | 当前持久(可叠加物品为数量) | | property DuraMax: Integer | 最大持久 | | property MaxDate: TDateTime | 到期时间(0为无限制) | | property Color: Byte | 物品颜色(0-255,可在版本工具中预览颜色) | | property State : TItemState; | 物品特殊设置类,详情查看TItemState类 | | property AddLAC: int64 | 增加防御点数下限 | | property AddLMAC: int64 | 增加魔法防御点数下限 | | property AddLDC: int64 | 增加攻击点数下限 | | property AddLMC: int64 | 增加魔法点数下限 | | property AddLSC: int64 | 增加道术点数下限 | | property AddLTC: int64 | 增加的射术点数下限 | | property AddLPC: int64 | 增加的刺术点数下限 | | property AddLWC: int64 | 增加的武术点数下限 | | property AddAC: int64 | 增加防御点数上限 | | property AddMAC: int64 | 增加魔法防御点数上限 | | property AddDC: int64 | 增加攻击点数上限 | | property AddMC: int64 | 增加魔法点数上限 | | property AddSC: int64 | 增加道术点数上限 | | property AddTC: int64 | 增加的射术点数上限 | | property AddPC: int64 | 增加的刺术点数上限 | | property AddWC: int64 | 增加的武术点数上限 | | property AddHitPoint: ShortInt | 准确点 | | property AddHitSpeed: ShortInt | 攻击速度 | | property AddSpeedPoint: ShortInt | 敏捷 | | property AddAntiMagic: ShortInt | 魔法躲避 | | property AddAntiPoison: ShortInt | 中毒躲避 | | property AddHealthRecover: ShortInt | 体力回复 | | property AddSpellRecover: ShortInt | 魔法恢复 | | property AddPoisonRecover: ShortInt | 中毒恢复 | | property AddLuck: ShortInt | 幸运值 | | property Upgrade: Byte | 已强化次数 | | property MaxUpgrade: Byte | 最大可强化次数 | | property OpenedSoul: Boolean | 是否开启了魂炼(注意和开启魂炼函数OpenSoul的区别) | | property SoulLevel: Byte | 魂炼等级 | | property SoulExp: Integer | 当前魂炼经验值 | | property SoulMaxExp: Integer | 当前等级的最大魂炼经验值 | | property EffectType: Word | 物品特效 | | property TotalAbility: int64 | 物品战斗力 | | property AddPoint\[Index: int64\]: TAddPointItem | 附加属性值,Index为0-20,同时显示只支持20个 | | property AddLevel\[Index: int64\]: TAddLevelItem | 强化属性,index为0-7,同时显示只支持7个 | | property AddHold\[Index: Integer \]: Integer | 打孔状态,Index为0-5,分别表示第一到第六个孔,值为-1表示没开孔,0表示已开孔,大于0则表示镶嵌的宝石的数据库序号 | | UserItem.OutWay\[const index:integer\]:word; | 修改物品的产出途径 对应的文字提示在 版本管理器 扩展数据库 物品产出类型对照表 即可对其进行编辑 ,支持\[0..40\]共41条,如果输入文本中有{Line},将自动画一条装备属性背景中的分割线 | | UserItem.OutWay2\[const index:integer\]:integer; | outway2\[0..41\]的值必须在物品自定义备注对照表中添加关键字Value才会显示。举例说明item.outway\[0\]:=100; 对照表中此处文字为 {S=神力附体 HP+:$OUTWAY2$;c=251};  则客户端会自动解析outway2\[0\]的值替换$OUTWAY2$这一关键字给客户端显示。 | | UserItem.OutWay3\[const index:integer\]:integer; | outway3\[0..41\]的值必须在物品自定义备注对照表中添加关键字$OUTWAY3$才会显示。举例说明item.outway\[0\]:=100; 对照表中此处文字为 {S=神力附体 HP+:$OUTWAY3$;c=251};  则客户端会自动解析outway3\[0\]的值替换$OUTWAY3$这一关键字给客户端显示 。 | | function CustomEffect: Word; | 改变自定义特效。使用版本管理器内的特效配置ID 进行修改。 | | property CanInQuickBar : Boolean; | 动态修改物品是否可以放入快捷栏 | | property CustomCaption\[Index:Integer\]: String; | 物品来源字段设置功能 0-2 | | property DropEff: Word; | 地面掉落特效,取DropEff.data文件中每10个图片为一组,显示为地面掉落特效 从1开始 0为无特效 | | property FromDateTime: TDateTime; | 物品产出时间 | | property CustomValue\[0...10\]; | 自定义值 方便对物品做额外标记操作 | | **函数名称** | **功能** | | function Rename(const NewName: String ): Boolean ; | 装备改名,返回改名是否成功 | | function RevertName: Boolean ; | 将已改名的装备还原为物品数据库的名称 | | function MakeHole: Boolean ; | 开一个孔,最多可以开5个孔 | | function OpenSoul: Boolean ; | 开启魂炼功能 | | function CopyFrom(Source: TUserItem): Boolean ; | 从另外一个物品拷贝属性 | | function MakeString : String ; | 将装备格式化为属性字符串,供客户端显示用 | 范例: ``` { 示例中使用了DateUtils单元,此单元为系统处理日期的单元,在单元use段必须引用此单元 } unit Q28; interface uses Classes, SysUtils, DateUtils; procedure Main(Npc: TNormNpc; Player: TPlayObject; Args: TArgs); implementation procedure Main(Npc: TNormNPC; Player: TPlayObject; Args: TArgs); begin if Player.Wepon <> nil then begin Player.Wepon.state.Bind := True; //装备为绑定状态 Player.Wepon.MaxDate := DateUtils.IncDay(Now, 7); //武器的有效期为当前时间加7天 Player.Wepon.MakeHole; //打一个孔,如果已开3孔则无效 Player.UpdateItem(Player.Wepon); //任何装备的属性更新,最后都必须给客户端发送更新消息 end; end; end. ```