Files
mir_server/server/LogicServer/script/interface/ItemExportFun.h

534 lines
18 KiB
C
Raw Normal View History

2025-01-09 17:45:40 +08:00
/*
*
* 使
*/
#pragma once
//tolua_begin
namespace Item
{
/*
* Comments:
* Param void * pEntity:
* Param void * pUserItem:
* Param int nPropertyID:id tagItemProperty
enum tagItemProperty
{
ipItemID , //物品的ID
ipItemCount, //物品的数量
ipItemStrong, //强化等级
ipItemQuality, //装备的品质
ipItemActorLevel, //需要玩家的等级
ipItemBind, //物品的绑定标记
ipItemType, //物品的类型
ipItemMaxProperty,
};
* Param int nValue:,
* @Return bool: truefalse
*/
bool setItemProperty(void * pEntity, void* pUserItem,int nPropertyID,int nValue);
/*
* Comments:
* Param void * pEntity:
* Param void * pItem:
* Param int propID:id SystemParamDef.h tagItemProperty里定义的
* Param int &nAuxRetValue:
* @Return int:
*/
int getItemProperty(void * pEntity, void * pItem, int propID,int &nAuxRetValue);
/*
* Comments: ID查找物品的属性
* Param int nItemID: ID
* Param int nPropID: SystemParamDef.h tagItemProperty里定义的
* @Return int:
*/
int getItemPropertyById(int nItemID,int nPropID);
/*
* Comments: GUID
* Param void * pItem:
* @Return long long:guid
*/
double getItemGuid(void * pItem);
/*
* Comments:id
* Param void * pItem:
* @Return int:id,0
*/
int getItemId(void * pItem);
/*
* Comments: Guid字符串描述
* Param void * pItem:
* @Return char*:
* @Remark: 线
*/
char* getItemGuidStr(void *pItem);
/*
* Comments:
* Param void * pEntity:
* Param void * pUserItem:
* Param int nProceccType:
//装备处理的一些操作的操作类型
enum tagItemProcessType
{
itItemEnhance =1, //装备强化
itItemOpenHole =2, //装备的打孔
itItemDiamondEnlay =3, //装备镶嵌宝石
itItemDiamondRemove =4, //装备宝石摘除
itItemDiamondSynthetic =5, //宝石合成
itItemBreakUp=6, //装备的分解
itItemInject=7, //装备的注入
};
* Param bool bResult:true,false
* Param bool bAutoOperate: true, false
* @Return void:
*/
void sendItemProcessResult(void * pEntity, void* pUserItem,int nProceccType,bool bResult,bool bAutoOperate=false);
/*
* Comments:()
* Param void * pEntity:
* Param void * pUserItem:
* Param int nProcessType: tagItemProcessType里定义
* Param int nItemID:ID()
* Param int nCount:
* Param int nMoneyType:
* Param int nMoneyCount:
* Param int nProtectItemID: ID
* Param int nProtectCount:
* @Return void:
*/
void sendItemProcessConsume(void * pEntity,void * pUserItem, int nProcessType,int nItemID,int nCount, int nMoneyType,int nMoneyCount, int nProtectItemID=0, int nProtectCount=0);
/*
* Comments: (vector)
* Param void * pEntity:ID
* Param int nGetConfigParamID:ID,tagGetItemConfigParam
* Param int nParam1:
* Param int nParam2:,
* Param int nParam3:,
* Param int nParam4:,
* Param int nParam5:,
* Param int nParam6:,
* Param int nParam7:,
* Param int nParam8:,
* @Return void:
*/
//void sendItemConfig(void * pEntity,int nGetConfigParamID,int nParam1, int nParam2=-1,int nParam3=-1, int nParam4=-1,int nParam5=-1,int nParam6=-1,
// int nParam7=-1,int nParam8=-1);
/*
* Comments:
* Param int nItemID: ID
* Param int nCount:
* Param int nStar:
* Param int nLostStar:
* Param int nQuality:
* Param int nBind:
* Param int ntime: 0
* Param int nQualityDataIndex: QualityDataIndex
* @Return void *:
*/
void * createItem(int nItemID,int nCount=1,int nStar=0, int nLostStar=0, int nInscriptLevel=0, int nAreaId=0, int nBind=0, int ntime=0);
/*
* Comments:
* Param void * pEntity:
* Param void * pItem:
* Param int nCount:
* Param char * sComment:
* Param int nLogID:
* Param bool bNeedFreeMemory:
* @Return int:
*/
int removeItem(void *pEntity,void *pItem,int nCount, char * sComment,int nLogID,bool bNeedFreeMemory =true);
/*
* Comments: 使()
* Param void * pEntity:
* Param void * pItem:
* Param int nCount: nCount*m_dwUseDurDrop
* Param char * sComment:
* Param int nLogID:
* Param bool bNeedFreeMemory:
* @Return int:
*/
int removeItemDura(void *pEntity,void *pItem,int nCount = 1, char * sComment = "Script",int nLogID = 164,bool bNeedFreeMemory =true);
/*
* Comments:
* Param void * pEntity:
* Param void * pItem:
* Param int nCount:
* Param char * sComment:
* Param int nLogID:
* Param bool bNeedFreeMemory:
* Param bool bReqSB:
* @Return int:
*/
int removeOtherItem(void *pEntity,void *pItem,int nCount, char * sComment,int nLogID,bool bNeedFreeMemory =true,bool bReqSB = false);
/*
* Comments:
* Param void * pEntity:
* Param int nType:
* Param bool bIncEquipBar: true表明删除装备栏中的制定类型物品
* Param char * sComment:
* Param int nLogID:
* @Return int:
* @Remark:
*/
int removeItemByType(void* pEntity, int nType, bool bIncEquipBar, char * sComment,int nLogID);
/*
* Comments:
* Param void * pEntity:
* Param void * pItem:
* Param const char * sComment:
* Param int nLogId: Id
* @Return int:
* @Remark:
*/
int removeEquip(void* pEntity, void* pItem, const char* sComment, int nLogId, bool bIncHero=false);
/*
* Comments:
* Param void * pEntity:
* Param int nType:
* Param bool bIncEquipBar: true
* Param bool bInEquipBar: true表明是在装备栏
* @Return void*:
* @Remark:
*/
void* getItemByType(void* pEntity, int nType, bool bIncEquipBar, bool &bInEquipBar);
/*
* Comments:
* Param void * pEntity:
* Param void * pItem:
* Param char * comment:
* int nLogWay: /,LogDef.h里定义的
* int nItemCount:
使-1,使
* @Return int:
*/
int addItem(void *pEntity,void *pItem,char * comment,int nLogWay,int nItemCount =-1, int bNotice = 1);
/*
* Comments:
* Param int nItemID: ID
* Param void * pUserItem: =NULL就行
* @Return char *:
*/
const char* getItemLinkMsg( int nItemID,void* pUserItem = NULL);
/*
* Comments:
* Param void * pEntity:
* Param int nAwardType:
* Param int nAwardId: id,
* Param bool useChatLink:
* Param void * pUserItem:
* @Return char *
*/
const char * getAwardDesc(int nAwardType,int nAwardId=0, bool useChatLink=false,void *pUserItem =NULL);
/*
* Comments:
* @Return int:
*/
int getEquipCount(void * pEntity);
/*
* Comments:
* Param int nSortID:6使nSortID在[1,6]
* @Return void*:
*/
void* getEquipBySortID(void * pEntity,int nSortID);
/*
* Comments:
* @Return int:
*/
int getBagItemCount(void * pEntity);
/*
* Comments:
* Param int nSortID:6[1,6]
* @Return void *:
*/
void * getBagItemBySortID(void * pEntity,int nSortID);
/*
* Comments: guid返回物品的指针
* Param void * pEntity:
* Param long long lItemGuid:guid
* @Return void *:
*/
void * getBagItemPtrByGuid(void * pEntity,double lItemGuid);
/*
* Comments: id返回背包物品的指针
* Param void * pEntity:
* Param long long lItemGuid:guid
* @Return void *:
*/
void * getBagItemPtrById(void * pEntity,int lItemId, int nQuality /* = -1 */, int nStrong /* = -1 */);
/*
* Comments: guid返回装备的指针
* Param void * pEntity:
* Param long long lItemGuid:guid
* @Return void *:
*/
void * getEquipPtrByGuid(void *pEntity, double lItemGuid);
//查找物品
//nItemPos: 1背包 2玩家装备 3英雄装备
//nHeroId:如果是英雄装备则为英雄POS
//nEntityId: <=0则遍历查找 如果查找到则赋值nItemPos与nHeroId 如果>0用作heroId
void * getEquipItemPtr(void *pEntity, double lItemGuid, int &nItemPos, int &nHeroId, int nEntityId=-1);
/*
* Comments:
* Param void * pEntity:
* Param int nType:
* @Return void *:
*/
void * getEquipByType(void * pEntity, int nType);
/*
* Comments: ,西使
* Param void * pItem:
* @Return void:
*/
void releaseItemPtr(void * pItem);
/*
***
* Comments:
* Param void * pEntity:
* Param int type: --packageType这个字段获得
* @Return int:
*/
int getBagEmptyGridCount(void *pEntity, int type);
/*
***
* Comments:
* Param void * pEntity:
* @Return int:
*/
int getAllBagMinEmptyGridCount(void *pEntity);
/*
***
*nType: enum BagType
*/
bool bagIsEnough(void *pEntity,int nType);
/*
* Comments:
* Param void * pEntity:
* Param int nItemID: id
* Param int nItemCount:
* Param int nQuality:
* Param int nStrong:
* Param int nBind:
* Param int nParam:
* @Return int:
local nGridCount= Item.getBagEmptyGridCount(args) --
*/
int getAddItemNeedGridCount(void *pEntity,int nItemID, int nItemCount,int nQuality=0,
int nStrong =0, int nBind =-1, int nParam = 0);
/*
* Comments:id获取物品的静态属性
* Param int nItemId:id
* @param int nAttrType:idenum tagGameAttributeType
* @Return -1
*/
int getItemStaticAttrById(int nItemId, int nAttrType);
/*
* Comments:id获取物品的名字
* Param int nItemId:id
* @Return char *:
*/
char * getItemName(int nItemId );
/*
* Comments:id获取物品的名字
* Param int nItemId:id
* @Return int:
*/
int getItemPackageTyp(int nItemId );
/*
* Comments:线
* Param void * pEntity:
* Param void * itemPtr:
* Param int nItemCount: (0)
* @Return unsigned bool:truefalse
*/
bool addSellItem(void * pEntity, void * itemPtr, int nItemCount);
/*
* Comments:
* Param void * pEntity:
* Param void * pItem:
* @Return bool:true
*/
bool delSellItem(void * pEntity, void * pItem);
/*
* Comments:guid获得卖给商店的物品的指针
* Param void * pEntity:
* Param double lItemGuid:guid
* @Return void *:
*/
void * getSellItem(void * pEntity, double lItemGuid);
/*
* Comments:
* Param void * itemPtr:
* @Return bool:
*/
bool isForgeItem(void* itemPtr);
/*
* Comments:
* Param void * pEntity:
* Param int nLevel:
* @Return bool:
*/
bool isStrongLevel(void* pEntity,int nLevel);
/*
* Comments:使
* @Return bool:
*/
//bool hasForgeItem(void* pEntity);
/*
* Comments:
* Param void * pEntity:
* Param int nItemId:
* @Return void*:null表示没有
*/
void* getDuraFullItemFromBag(void* pEntity,int nItemId);
/*
* Comments:id获取所属的套装id
* Param int nItemId:
* @Return int:
*/
int getSuitIdByItemId(int nItemId);
/*
* Comments:
* Param void * pEntity:
* Param int nSuit:id
* Param int nCount:
* @Return bool:
*/
bool isGetAllSuitEquip(void* pEntity,int nSuit,int nCount);
/*
* Comments:
* Param void * pEntity:
* Param void * pUserItem:
* @Return bool:
* @Remark:
*/
bool equipItem(void* pEntity, void* pUserItem, int nHeroId = 0, bool isBagEquip = true);
//脱下装备
bool takeOffItem(void* pEntity, void* pUserItem, int nHeroId, bool checkGrid);
/*
* Comments:
* Param void * pEntity:
* @Return void:
* @Remark:
*/
void clearBag(void* pEntity);
//装备是否禁止修理 --不用了
//bool isDenyRepair(int nItemId);
/*
* Comments:
* Param void * pEntity:
* @Return void:
* @Remark:
*/
int getBagItemIndex(void* pEntity,void * itemPtr);
/*
* Comments:
* Param void * pEntity:
* @Return void:
* @Remark:
*/
void* getItemPtrByIndex(void* pEntity,int nIndex);
/*
* Comments:
* Param void * pEntity:
* Param void * pItemPtr:
* @Return bool:true
*/
//bool initEquipBaseAttr(void * pEntity, void *pItemPtr, int nQualityDataIndex);
bool isGuildMeltingItem(void* pItem);
//掉落组掉落物品可设置掉落捡取时间默认2min, nDropTips = 0
bool drop_item_in_random_area_byGroupID(int sceneId, int nPosX,int nPosY,int dropGroupId,int pick_time = 120, int nDropTips = 0);
//是否装备
bool isEquipment(void *pItemPtr);
bool isEquipmentById(int nItemId);
//获取背包里同样ID最高星的装备
void* getItemPtrHighestStar(void *pEntity, int nItemID);
//从属性库中给装备随机生成属性
void generateItemAttrsInSmith( void * pEntity, void *pItemPtr, int nSmithId, int nAttrNum, unsigned char nLockType1, unsigned char nLockType2,
unsigned char nLockType3, int nFlag, unsigned char nJob = 0 );
//从某个属性库中随机抽取一条属性
void generateOneAttrInSmith( int nSmithId, unsigned char& nAttrType, int& nAttrValue, unsigned char nLockType=enSmithLockType_No);
bool hasItemAttrs( void * pEntity, void *pItemPtr, int nFlag );
//转移装备属性
bool transferItemAttrs( void * pEntity, void *pSrcItemPtr, void *pDesItemPtr, int nFlag );
}
//tolua_end