DP-S-Script/Dps_A/main.nut

241 lines
7.5 KiB
Plaintext
Raw Normal View History

2024-09-16 17:05:26 +08:00
getroottable().DebugModelFlag <- false;
//初始化插件
function InitPluginInfo() {
//初始化定时器
_Timer_Object <- Timer();
2024-10-05 11:47:12 +08:00
2024-10-11 23:56:27 +08:00
2024-10-05 11:47:12 +08:00
//初始化自动重载 只在15线开启
local ConfigPath = Sq_Game_GetConfig();
local Channel = ConfigPath.slice(ConfigPath.find("cfg/") + 4, ConfigPath.len());
2024-11-15 19:53:44 +08:00
// if (Channel.find("15")) GameManager.OpenHotFix("/dp_s/Dps_A");
2025-03-27 20:21:11 +08:00
if (Channel.find("15")) {
GameManager.OpenHotFix("/dp_s/Dps_A");
GameManager.OpenHotFix("/dp_s/MyProject");
}
local PoolObj = MysqlPool.GetInstance();
PoolObj.SetBaseConfiguration("127.0.0.1", 3306, "game", "uu5!^%jg");
//连接池大小
PoolObj.PoolSize = 10;
//初始化
PoolObj.Init();
2025-03-27 20:21:11 +08:00
GameManager.Fix14Skill();
2024-10-02 21:00:21 +08:00
2025-03-27 20:21:11 +08:00
Sq_CreatSocketConnect("192.168.200.20", "65109");
2024-10-05 11:47:12 +08:00
//初始化结婚
2024-11-15 19:53:44 +08:00
// ProjectInitFuncMap.P_Marry <- Marry();
2024-10-11 23:56:27 +08:00
//初始化日志器
Log({
"normal": "/dp_s/log/normal.log",
"error": "/dp_s/log/error.log"
});
//调用方式
//Log.Put("normal", "测试日志");
//Log.Put("error", "测试错误日志");
2025-03-27 20:21:11 +08:00
GameManager.OpenCreateJob_CreatorMage();
2025-04-21 13:36:35 +08:00
GameManager.FixPracticemode();
2025-03-27 20:21:11 +08:00
2025-04-05 22:03:40 +08:00
// function IndependenceDropLogic(SUser, MonsterId, MonsterLevel, Xpos, Ypos, DgnName, DgnId, DgnLevel,DgnDiff, HellDiff)
// {
// //注意这里组队时每一个队员都会调用一次这个函数
// //如果角色名字为游戏管理员 掉落3037
// if(SUser.GetCharacName() == "游戏管理员")
// SUser.DropItem(3037, Xpos, Ypos);
// //如果怪物ID 为 1 掉落 3038
// if(MonsterId == 1)
// SUser.DropItem(3038, Xpos, Ypos);
// }
// GameManager.OpenIndependenceDropMode(IndependenceDropLogic);
GameManager.FixEmailRemovalVerification();
2024-09-16 17:05:26 +08:00
}
function PrintTag() {
print(InitSuccessTag);
}
2025-04-05 22:03:40 +08:00
2024-09-16 17:05:26 +08:00
function main() {
InitPluginInfo();
PrintTag();
2025-04-05 22:03:40 +08:00
//读取全部配置文件
GameManager.SetGameMaxLevel(95);
2024-11-15 19:53:44 +08:00
// GameManager.FixAvatarUseJewel();
2024-10-11 23:56:27 +08:00
GameManager.FixSaveTown();
GameManager.FixDespairGold();
2024-10-27 15:32:44 +08:00
GameManager.FixGlodTradeDaily(80000000);
2024-11-15 19:53:44 +08:00
2024-10-27 15:32:44 +08:00
// local PvfObject = Script();
// local Data = ScriptData.GetEquipment(305014);
// printT(Data);
// Sq_Conversion("這是一個繁體字符串");
2025-04-05 22:03:40 +08:00
2025-04-21 13:36:35 +08:00
_Official_Project_();
2025-04-05 22:03:40 +08:00
// if (getroottable().rawin("DP_S_VERSION") && DP_S_VERSION >= 25.329) {
// function _Rindro_OldLogic_Enter(CUser, PacketId, PacketSrc) {
// //区域移动
// if (PacketId == 38) {
// local Ret = Cb_move_area(CUser, NativePointer(PacketSrc).add(0x0D).readU8(), NativePointer(PacketSrc).add(0x0E).readU8());
// if (!Ret) {
// return -1;
// }
// }
// //普通输入
// else if (PacketId == 17) {
// Timer.SetTimeOut(function() {
// local Size = NativePointer(PacketSrc).add(20).readInt();
// local Str = NativePointer(PacketSrc).add(24).readUtf8String(Size);
// Cb_base_input(CUser, Str);
// }, 1);
// }
// //GM输入
// else if (PacketId == 179) {
// Timer.SetTimeOut(function() {
// local Size = NativePointer(PacketSrc).add(13).readInt();
// local Str = NativePointer(PacketSrc).add(17).readUtf8String(Size);
// Cb_gm_input(CUser, Str.slice(2));
// }, 1);
// }
// //特殊道具使用
// else if (PacketId == 255) {
// Timer.SetTimeOut(function() {
// Cb_use_item_sp(CUser, NativePointer(PacketSrc).add(0x0D).readInt());
// }, 1);
// }
// //返回选择角色
// else if (PacketId == 7) {
// Timer.SetTimeOut(function() {
// Cb_return_select_character(CUser);
// }, 1);
// }
// //组队 创建和加入
// else if (PacketId == 10) {
// local Ret = Cb_userpartycreate(CUser);
// if (!Ret) {
// return -1;
// }
// }
// //下线
// else if (PacketId == 3) {
// Timer.SetTimeOut(function() {
// Cb_player_exit(CUser);
// }, 1);
// }
// // //查看信息
// // else if (PacketId == 8) {
// // Cb_see_information(CUser, PacketSrc);
// // }
// //自定义包
// else if (PacketId == 130) {
// Timer.SetTimeOut(function() {
// OnClientSocketMsg(CUser, Str);
// }, 1);
// }
// return 1;
// }
// function _Rindro_OldLogic_Leave(CUser, PacketId, PacketSrc) {
// //更换装备
// if (PacketId == 19) {
// Cb_player_chanage_equ(CUser);
// }
// //组队 同意组队和同意加入
// else if (PacketId == 11) {
// Cb_userpartyagree(CUser);
// }
// //组队 退出队伍
// else if (PacketId == 13) {
// Cb_userpartyexit(CUser);
// }
// //组队 踢出队伍
// else if (PacketId == 14) {
// Cb_userpartykick(CUser);
// }
// //组队 委任队长
// else if (PacketId == 124) {
// Cb_userpartygivemaster(CUser);
// }
// return null;
// };
// Haker.LoadHook("0x08594E52", ["pointer", "int", "pointer", "int", "int"],
// function(args) {
// local CallArr = [];
// local v4 = Sq_CallFunc(S_Ptr("0x080CC18E"), "pointer", []);
// local cuser = Sq_CallFunc(S_Ptr("0x082947A4"), "pointer", ["pointer", "int"], v4, args[1]);
// if (!cuser) return;
// local PacketId = NativePointer(args[2]).add(1).readShort();
// local Ret = _Rindro_OldLogic_Enter(cuser, PacketId, args[2]);
// if (Ret == -1) {
// NativePointer(args[2]).add(1).writeShort(-1);
// }
// return null;
// },
// function(args) {
// local CallArr = [];
// local v4 = Sq_CallFunc(S_Ptr("0x080CC18E"), "pointer", []);
// local cuser = Sq_CallFunc(S_Ptr("0x082947A4"), "pointer", ["pointer", "int"], v4, args[1]);
// if (!cuser) return;
// local PacketId = NativePointer(args[2]).add(1).readShort();
// Timer.SetTimeOut(function() {
// _Rindro_OldLogic_Leave(cuser, PacketId, args[2]);
// }, 1);
// return null;
// }
// );
// }
2024-09-16 17:05:26 +08:00
}
2025-03-27 20:21:11 +08:00
/*
function onil() {
print(11);
local T = {
op = 20065005,
uid = 0,
cid = 0
}
local WorldMap = World.GetOnlinePlayer();
foreach(W_User in WorldMap) {
T.uid = W_User.GetUniqueId();
T.cid = W_User.GetCID();
Socket.SendGateway(T);
}
}
Timer.SetCronTask(onil, "0/10 * * * * *");
*/
2024-09-16 17:05:26 +08:00
// getroottable().CombatRankServerProject <- CombatRank();
// getroottable().ServerControlProject <- ServerControl();
// getroottable().AntonServerProject <- Anton();
// getroottable().FiendwarServerProject <- Fiendwar();