dp-s_doc/Start/Example/13.md

33 lines
1006 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 副本难度解锁 (贡献者: 邪神)
> 首先我们先在dp_s文件夹中建立一个项目文件夹 MyProject 方便管理
![Alt text](../../image/6.png)
> 然后我们建立一个新文件 副本难度解锁.nut 用于编写我们的代码
> 然后我们在副本难度解锁.nut中写入以下代码
```
UnlockDGndiff_itemId <- 202203296 //副本难度解锁券道具ID
Cb_Use_Item_Sp_Func[UnlockDGndiff_itemId] <- function(SUser, ItemId) {
local a3 = Memory.allocUtf8String("3");
Sq_CallFunc(S_Ptr("0x0820BA90"), "int", ["pointer", "int", "pointer"], SUser.C_Object, 120, a3.C_Object);
Timer.SetTimeOut(function(SUser) {
Sq_CallFunc(S_Ptr("0x8686FEE"), "int", ["pointer", "int"], SUser.C_Object, 1);
}, 1, SUser);
}
```
> 最后我们回到dp_s文件夹中打开Main.nut 加载我们刚才编写的逻辑
```
sq_RunScript("MyProject/副本难度解锁.nut");
```
> 至此一个简单的副本难度解锁的逻辑就写完了