53 lines
1.3 KiB
Markdown
53 lines
1.3 KiB
Markdown
|
|
# 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;
|
|||
|
|
};
|
|||
|
|
```
|