%%%------------------------------------------------
|
|
%%% File : record.hrl
|
|
%%% Author : xyao
|
|
%%% Created : 2011-12-13
|
|
%%% Description: 物品相关信息
|
|
%%% map 存储所有物品 key 为背包位置 value 是该背包内的所有物品dict格式
|
|
%%% 普通背包取消cell
|
|
%%%
|
|
%%%------------------------------------------------
|
|
%% 物品状态表:存于进程字典
|
|
-record(goods_status, {
|
|
player_id = 0 %% 用户ID
|
|
, player_lv = 0 %% 用户等级
|
|
, dict = #{} %% 物品maps
|
|
, cell_num = 0 %% 背包格子大小
|
|
, storage_num = 0 %% 仓库格子大小
|
|
, temp_bag = #{} %% 增加物品时,需要的背包大小
|
|
}).
|
|
|
|
%% 玩家物品记录
|
|
%% 获得时初始化:lib_goods_util:get_new_goods/1
|
|
%% 玩家数据加载时初始化:lib_goods_util:make/2
|
|
-record(goods, {
|
|
id=0, %% 物品Id
|
|
player_id=0, %% 角色Id
|
|
goods_id=0, %% 物品类型Id,对应ets_goods_type.goods_id
|
|
type=0, %% 物品类型
|
|
subtype=0, %% 物品子类型
|
|
bind=0, %% 绑定状态,0非绑定,1绑定
|
|
bag_location=0, %% 物品配置应当存放的背包位置, 见def_goods.hrl
|
|
location=0, %% 物品所在位置, 见def_goods.hrl
|
|
cell=0, %% 物品所在格子位置
|
|
num=0, %% 物品数量
|
|
expire_time=0, %% 有效期,0为无
|
|
color=0, %% 物品颜色
|
|
ctime = 0, %% 物品获得时间(创建):第一次使用程序时间:后面使用数据库的创建记录时间(时间有点误差)
|
|
extra_data = [] %% 一般以[{key, value}|_]格式存储,或者不同物品类型自定义
|
|
,level=0 %% 物品等级
|
|
}).
|
|
|
|
%% 吞噬
|
|
-record(status_devour, {
|
|
lv = 0,
|
|
exp = 0,
|
|
is_auto = 1,
|
|
active_lv = 0,
|
|
attr = []
|
|
}).
|
|
|
|
%%物品类型记录
|
|
-record(ets_goods_type, {
|
|
goods_id = 0, %% 物品类型Id
|
|
goods_name = <<>>, %% 物品名称
|
|
type = 0, %% 物品类型
|
|
subtype = 0, %% 物品子类型
|
|
bind=0, %% 绑定状态,0非绑定,1绑定
|
|
bag_location = 4, %% 物品存放的背包位置
|
|
use = 0, %% 是否在背包使用,0默认不可使用,1可使用
|
|
compose = 0, %% 是否在背包合成,0默认不可使用,1可合成
|
|
sell = 0, %% 是否在背包出售,0为不可出售,1为可出售
|
|
drop = 1, %% 是否可丢弃,0为不可丢弃,1为可丢弃
|
|
quick_use = 0, %% 是否获得立即使用,0不立即使用,1立即使用
|
|
level=0, %% 等级限制
|
|
max_overlap=0, %% 可叠加数:0为不可叠加
|
|
color=0, %% 物品颜色:0白色 1绿色 2蓝色 3紫色 4橙色 5红装
|
|
expire_type = 0, %% 过期类型:0无类型 1开服天数 2合服天数
|
|
expire_time=0, %% 有效期,0为无
|
|
model_id = 0, %% 模型资源id
|
|
jump = 0, %% 是否可以跳转:0否;1是
|
|
sell_category = 0, %% 交易市场商品类型
|
|
sell_subcategory = 0, %% 交易市场商品子类型
|
|
trade_price=0, %% 交易底价(为0时无底价)
|
|
price_markup = 0, %% 交易每次加价价格
|
|
buyout_price = 0, %% 交易一口价(为0时无一口价)
|
|
market_show_time = 0, %% 公示时间-上架多久后可交易(秒)
|
|
selling_time = 0, %% 上架时间-可交易多长时间(秒)
|
|
is_to_market = 0, %% 是否会流入世界拍卖(当上架公会拍卖流拍时是否能流入世界拍卖,1是0否)
|
|
market_range = 0, %% 可上架区域,0表示社团和世界都可以上架,1表示只能上架世界,2表示只能上架社团
|
|
sex=0, %% 性别限制,0为不限,1为男,2为女
|
|
|
|
%% 不用
|
|
career=0, %% 职业限制:0为不限 前端用
|
|
base_attrlist=[] %% 基础属性 前端用
|
|
}).
|
|
|
|
%% 物品价格表(不经常修改)
|
|
-record(goods_price, {
|
|
goods_id = 0, %% 物品类型id
|
|
price_type = 1, %% 价格类型:0:物品(一般物品出售不配为物品);1:钻石;2:绑定钻石;3金币;4:公会贡献
|
|
price = 0, %% 购买价格
|
|
sell_price_type = 3, %% 出售价格类型
|
|
sell_price = 0 %% 出售价格
|
|
}).
|
|
|
|
%% 快速购买价格
|
|
-record(quick_buy_price, {
|
|
goods_type_id = 0,
|
|
gold_price = 0,
|
|
bgold_price = 0,
|
|
coin_price = 0,
|
|
consume_type = unknown
|
|
}).
|
|
|
|
|
|
%% 物品分解配置
|
|
-record(goods_decompose_cfg, {
|
|
goods_id = 0, %% 物品类型id
|
|
module = 0, %% 功能id
|
|
irregular_num = 0, %% 随机材料能获得的种类
|
|
irregular_mat = [], %% 分解获得的随机材料
|
|
regular_num = 0, %% 固定材料种类
|
|
regular_mat = [] %% 分解获得的固定材料 [{type, goods_id, num}]
|
|
}).
|
|
|
|
%% 物品效果
|
|
-record(goods_effect, {
|
|
goods_id = 0, %% 物品类型ID
|
|
goods_type = 0, %% 道具类型:0,即一次性道具;1BUFF道具
|
|
buff_type = 0, %% BUFF类型ID
|
|
effect_list = [], %% 效果[{coin,铜钱},{gold,元宝},{onhook_time, 1|2|5小时},{renet_day, Day}...]
|
|
time = 0, %% 持续时长(秒)
|
|
limit_type = 0, %% 限制类型:0无限制,1每日限制,2每周限制,3终生限制
|
|
counter_module = 0, %% 次数所属模块ID
|
|
counter_id = 0, %% 次数ID
|
|
limit_scene = [] %% BUFF或者道具可使用和生效的场景ID
|
|
}).
|
|
|
|
%% 物品兑换规则
|
|
-record(goods_exchange_cfg, {
|
|
id = 0, %% 兑换规则id
|
|
type = 0, %% 兑换类型
|
|
role_lv = 0, %% 需要的玩家等级
|
|
max_role_lv = 0, %% 最大玩家等级
|
|
cost_list = [], %% 消耗的物品列表
|
|
obtain_list = [], %% 获得的物品列表
|
|
lim_type = 0, %% 次数限制类型 0: 不限制 1: 每天限制 2: 每周限制 3: 终身限制
|
|
module = 0, %% 模块id
|
|
sub_module = 0, %% 模块子功能id
|
|
lim_num = 0, %% 限制兑换数量
|
|
condition = [] %% 兑换开启条件[{Type, Value}], {Type:atom; Value:term}
|
|
}).
|
|
|
|
-define(SHOW_TIPS_0, 0). %% 0不飘
|
|
-define(SHOW_TIPS_1, 1). %% 1右下角飘字
|
|
-define(SHOW_TIPS_2, 2). %% 2聊天频道消息
|
|
-define(SHOW_TIPS_3, 3). %% 3右下角飘字 + 聊天频道消
|
|
|
|
%% 产出
|
|
-record(produce, {
|
|
type = undefined :: atom(), %% 类型
|
|
subtype = 0, %% 子类型
|
|
title = "", %% 标题[背包不足]
|
|
content = "", %% 邮件[背包不足]
|
|
off_title = "", %% 不在线标题(off_title或off_content为"",则取title和content的内容)
|
|
off_content = "", %% 不在线标题
|
|
module = 0,
|
|
module_sub = 0,
|
|
reward = [], %% 奖励
|
|
remark = "", %% 备注
|
|
show_tips = 3 %% 是否飘提示:0不飘|1右下角飘字|2聊天频道消息|3右下角飘字 + 聊天频道消
|
|
}).
|
|
|
|
%% 消耗额外参数
|
|
-record(cost_log_about, {
|
|
type = 0, %% 消费类型 商城为3
|
|
data = [], %% 自定义类型
|
|
remark = "" %% 备注
|
|
}).
|
|
|
|
|
|
%% 进化合成配置
|
|
-record(base_goods_compose_or_evolution_info, {
|
|
rule_id = 0 %% 规则id
|
|
, target_goods_id %% 目标物品id
|
|
, classify_id %% 合成分类
|
|
, subclass %% 合成子类
|
|
, condition %% 合成条件
|
|
, main_goods_id %% 主材料id
|
|
, cost_goods %% 消耗物品
|
|
, cost_money %% 消耗钱财
|
|
, base_ratio %% 初始成功率
|
|
, show_tv %% 是否传闻
|
|
}).
|