feat: 添加露露定制内容系统和开发技能文档
新增露露定制内容系统,实现稀有物品掉落功能 添加DP-S游戏服务器插件开发技能文档,包含框架架构、模块开发规范和常用API参考
This commit is contained in:
53
_DPS_/_BuiltProject/露露定制内容/露露定制内容.nut
Normal file
53
_DPS_/_BuiltProject/露露定制内容/露露定制内容.nut
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
文件名:露露定制内容.nut
|
||||
路径:_DPS_/_BuiltProject/露露定制内容/露露定制内容.nut
|
||||
创建日期:2026-03-23 11:05
|
||||
文件用途:
|
||||
*/
|
||||
|
||||
class LuluCustomizedSystemC {
|
||||
Data = null;
|
||||
|
||||
constructor() {
|
||||
InitPvf();
|
||||
|
||||
ClientSocketPackFuncMap.rawset(21016001, function(SUser, Jso) {
|
||||
SUser.DropItem(Jso.id, Jso.posX, Jso.posY);
|
||||
}.bindenv(this));
|
||||
|
||||
ClientSocketPackFuncMap.rawset(21016003, function(SUser, Jso) {
|
||||
if (Data.rawin(Jso.rarity)) {
|
||||
local Index = MathClass.Rand(0, Data[Jso.rarity].len());
|
||||
local ItemId = Data[Jso.rarity][Index];
|
||||
SUser.DropItem(ItemId, Jso.posX, Jso.posY);
|
||||
}
|
||||
}.bindenv(this));
|
||||
}
|
||||
|
||||
function InitPvf() {
|
||||
// getroottable()._Script_Data_Init_ <- false;
|
||||
Script();
|
||||
Data = {};
|
||||
ScriptData.GetFileData("etc/uniquehellpartydroptable.etc", function(_n, DataA) {
|
||||
while (!DataA.Eof()) {
|
||||
local Fragment = DataA.Get();
|
||||
if (Fragment.find("[") >= 0 && Fragment.find("/") == null) {
|
||||
local key = Fragment.slice(1, -1);
|
||||
Data[key] <- [];
|
||||
while (true) {
|
||||
local Id = DataA.Get();
|
||||
if (typeof Id == "string" && Id.find("[/") != null) {
|
||||
break;
|
||||
}
|
||||
Data[key].push(Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}.bindenv(this));
|
||||
print(Data);
|
||||
}
|
||||
}
|
||||
|
||||
Timer.SetTimeOut(function() {
|
||||
getroottable()._LuluCustomizedSystemC_ <- LuluCustomizedSystemC();
|
||||
}, 1);
|
||||
Reference in New Issue
Block a user