From cb44b3935ae490bbc850b69c7ad771dcb14324b4 Mon Sep 17 00:00:00 2001 From: Yuuki <6851027-yukiz@users.noreply.gitlab.com> Date: Thu, 13 Jun 2024 22:15:07 +0800 Subject: [PATCH] Fixed Primo Geovishap spawn and respawn (by ShiroySan) --- Resources/Scripts/Common/DrakePrimoRockBoss.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Resources/Scripts/Common/DrakePrimoRockBoss.lua b/Resources/Scripts/Common/DrakePrimoRockBoss.lua index 3e16ba2cd..f27160c96 100644 --- a/Resources/Scripts/Common/DrakePrimoRockBoss.lua +++ b/Resources/Scripts/Common/DrakePrimoRockBoss.lua @@ -71,16 +71,26 @@ end --刷新时加载怪物 function action_group_load(context, evt) + monsters = { + { config_id = 640001, monster_id = 26050201, pos = { x = 208.324, y = 185.011, z = 1481.172 }, rot = { x = 0.000, y = 327.681, z = 0.000 }, level = 36, pose_id = 101, area_id = 6 }, + { config_id = 640003, monster_id = 26050101, pos = { x = 208.324, y = 185.011, z = 1481.172 }, rot = { x = 0.000, y = 327.681, z = 0.000 }, level = 36, pose_id = 101, area_id = 6 }, + { config_id = 640005, monster_id = 26050301, pos = { x = 208.324, y = 185.011, z = 1481.172 }, rot = { x = 0.000, y = 327.681, z = 0.000 }, level = 36, pose_id = 101, area_id = 6 }, + { config_id = 640006, monster_id = 26050401, pos = { x = 208.324, y = 185.011, z = 1481.172 }, rot = { x = 0.000, y = 327.681, z = 0.000 }, level = 36, pose_id = 101, area_id = 6 } + } ScriptLib.PrintContextLog(context, "DrakePrimoRockBossGroupLoad") math.randomseed(ScriptLib.GetServerTime(context)) local newIdx=math.random(#monsters) if ScriptLib.GetGroupVariableValue(context, "current_idx") == 0 then ScriptLib.SetGroupVariableValue(context, "current_idx", newIdx) --ScriptLib.CreateMonster(context, { config_id = monster[newIdx].config_id, delay_time = 0 }) - ScriptLib.CreateMonsterByConfigIdByPos(context, monsters[newIdx].config_id, monsters[newIdx].pos, monsters[newIdx].rot) + ScriptLib.CreateMonster(context, { config_id = monsters[ScriptLib.GetGroupVariableValue(context, "current_idx")].config_id, delay_time = 0 }) return 0 end if ScriptLib.GetGroupVariableValue(context, "killed") ~= 0 and evt.param1 ~=1 then + ScriptLib.SetGroupVariableValue(context, "current_idx", newIdx) + ScriptLib.CreateMonster(context, { config_id = monsters[ScriptLib.GetGroupVariableValue(context, "current_idx")].config_id, delay_time = 0 }) + ScriptLib.SetGroupVariableValue(context, "killed", 0) + ScriptLib.SetGroupVariableValue(context, "boss_exist", 1) return 0 end if ScriptLib.GetGroupVariableValue(context, "killed") ~= 0 and evt.param1 ==1 then