dp-s_doc/CallBack/BuyCeraShopItem/BuyCeraShopItem.md

53 lines
1.3 KiB
Markdown
Raw Permalink Normal View History

2025-03-23 18:51:55 +08:00
# BuyCeraShopItem 回调函数文档
**回调说明**
`BuyCeraShopItem`类用于在服务端中持续锻造时的HOOK。
---
**注册方法**
- `Cb_Dispatcher_BuyCeraShopItem_useCountDownCoinInFreeCoinDungeonFunc.rawset(Key,Function)`
**参数**
- `未知对象(C指针)`
- `角色对象`
- `被购买的道具对象`
- `原返回值`
**特殊说明**
- `如果返回值不为 -99 则返回你要返回的值`
- `在此回调中可以对Item对象进行修改操作并且不需要调用Flush函数`
**例子**
```squirrel
function Test_Function(C_Point1,SUser,ItemObj,OldRet)
{
return -99;
}
Cb_Dispatcher_BuyCeraShopItem_useCountDownCoinInFreeCoinDungeonFunc.rawset("Test", Test_Function);
```
or
```squirrel
function Test_Function(C_Point1,SUser,ItemObj,OldRet)
{
return -99;
}
Cb_Dispatcher_BuyCeraShopItem_useCountDownCoinInFreeCoinDungeonFunc.Test <- Test_Function;
```
or
```squirrel
function Test_Function(C_Point1,SUser,ItemObj,OldRet)
{
return -99;
}
Cb_Dispatcher_BuyCeraShopItem_useCountDownCoinInFreeCoinDungeonFunc["Test"] <- Test_Function;
```
or
```squirrel
Cb_Dispatcher_BuyCeraShopItem_useCountDownCoinInFreeCoinDungeonFunc.Test <- function (C_Point1,SUser,ItemObj,OldRet)
{
return -99;
};
```