From 65e64d321a526efd42dcd24b323f5e05336e5bb5 Mon Sep 17 00:00:00 2001 From: Jasson McMorris Date: Sat, 7 Sep 2024 19:57:29 -0700 Subject: [PATCH 1/2] Change Imps detection and standback behavior to be retail accurate --- sql/mob_family_mods.sql | 6 ++++++ sql/mob_family_system.sql | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sql/mob_family_mods.sql b/sql/mob_family_mods.sql index ee562dd7917..422df72dabb 100644 --- a/sql/mob_family_mods.sql +++ b/sql/mob_family_mods.sql @@ -514,11 +514,17 @@ INSERT INTO `mob_family_mods` VALUES (165,10,13,1); -- SUBLINK: 13 INSERT INTO `mob_family_mods` VALUES (165,29,24,0); -- MDEF: 24 INSERT INTO `mob_family_mods` VALUES (165,36,50,1); -- ROAM_COOL: 50 INSERT INTO `mob_family_mods` VALUES (165,51,3,1); -- ROAM_TURNS: 3 +INSERT INTO `mob_family_mods` VALUES (165,56,-1,1); -- HP_STANDBACK: -1 +INSERT INTO `mob_family_mods` VALUES (165,4,10,1); -- SIGHT_RANGE: 10 +INSERT INTO `mob_family_mods` VALUES (165,5,5,1); -- SOUND_RANGE: 5 -- Imp INSERT INTO `mob_family_mods` VALUES (166,10,13,1); -- SUBLINK: 13 INSERT INTO `mob_family_mods` VALUES (166,36,50,1); -- ROAM_COOL: 50 INSERT INTO `mob_family_mods` VALUES (166,51,3,1); -- ROAM_TURNS: 3 +INSERT INTO `mob_family_mods` VALUES (166,56,-1,1); -- HP_STANDBACK: -1 +INSERT INTO `mob_family_mods` VALUES (166,4,10,1); -- SIGHT_RANGE: 10 +INSERT INTO `mob_family_mods` VALUES (166,5,5,1); -- SOUND_RANGE: 5 -- Kindred INSERT INTO `mob_family_mods` VALUES (169,10,1,1); -- SUBLINK: 1 diff --git a/sql/mob_family_system.sql b/sql/mob_family_system.sql index e9960f1f852..ee1e80e3f31 100644 --- a/sql/mob_family_system.sql +++ b/sql/mob_family_system.sql @@ -216,8 +216,8 @@ INSERT INTO `mob_family_system` VALUES (162,'HybridElemental-Water',87,'Hybrid_E INSERT INTO `mob_family_system` VALUES (163,'Hydra',88,'Hydra',10,'Dragon',4.00,40,90,90,2,3,1,2,1,5,3,1,2,1,3,6.0,2,0); INSERT INTO `mob_family_system` VALUES (164,'Hydra',88,'Hydra',10,'Dragon',4.00,40,90,90,2,3,1,2,1,5,3,1,2,1,3,6.0,2,0); -INSERT INTO `mob_family_system` VALUES (165,'Imp',89,'Imp',9,'Demon',0.00,50,70,140,6,3,4,3,1,5,4,1,3,1,5,8.0,1,0); -INSERT INTO `mob_family_system` VALUES (166,'Imp',89,'Imp',9,'Demon',0.00,50,70,140,6,3,4,3,1,5,4,1,3,1,5,8.0,1,0); +INSERT INTO `mob_family_system` VALUES (165,'Imp',89,'Imp',9,'Demon',0.00,50,70,140,6,3,4,3,1,5,4,1,3,1,5,8.0,3,0); +INSERT INTO `mob_family_system` VALUES (166,'Imp',89,'Imp',9,'Demon',0.00,50,70,140,6,3,4,3,1,5,4,1,3,1,5,8.0,3,0); INSERT INTO `mob_family_system` VALUES (167,'Karakul',90,'Sheep',6,'Beast',1.00,40,90,110,3,4,4,4,5,4,4,1,3,1,3,4.0,1,1); INSERT INTO `mob_family_system` VALUES (168,'Khimaira',91,'Khimaira',3,'Arcana',3.00,40,90,90,4,3,3,3,4,6,5,1,3,1,3,5.0,3,0); INSERT INTO `mob_family_system` VALUES (169,'Kindred',92,'Kindred',9,'Demon',0.00,50,110,140,1,2,4,4,1,2,4,1,3,1,3,8.0,257,0); From 3d77d437e7346222332de65b4dd5e7638d2d63b3 Mon Sep 17 00:00:00 2001 From: Jasson McMorris Date: Sat, 7 Sep 2024 19:58:27 -0700 Subject: [PATCH 2/2] Some Imps only aggro by sight during the night --- scripts/mixins/families/imp_aggro.lua | 33 +++++++++++++++++++ .../zones/Caedarva_Mire/mobs/Heraldic_Imp.lua | 2 +- .../zones/Caedarva_Mire/mobs/Orderly_Imp.lua | 2 +- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 scripts/mixins/families/imp_aggro.lua diff --git a/scripts/mixins/families/imp_aggro.lua b/scripts/mixins/families/imp_aggro.lua new file mode 100644 index 00000000000..3efcf314ab5 --- /dev/null +++ b/scripts/mixins/families/imp_aggro.lua @@ -0,0 +1,33 @@ +require('scripts/globals/mixins') +----------------------------------- +xi = xi or {} +xi.mix = xi.mix or {} +xi.mix.imp_aggro = xi.mix.imp_aggro or {} + +g_mixins = g_mixins or {} +g_mixins.families = g_mixins.families or {} + +local function updateAggro(mob, hour) + mob:setLocalVar('hour', hour) + + if hour >= 18 or hour < 6 then + mob:setMobMod(xi.mobMod.DETECTION, bit.bor(xi.detects.SIGHT, xi.detects.HEARING)) + elseif hour < 18 and hour >= 6 then + mob:setMobMod(xi.mobMod.DETECTION, xi.detects.HEARING) + end +end + +g_mixins.families.imp_aggro = function(mob) + mob:addListener('SPAWN', 'IMP_AGGRO_SPAWN', function(imp) + updateAggro(imp, VanadielHour()) + end) + + mob:addListener('ROAM_TICK', 'IMP_AGGRO_ROAM_TICK', function(imp) + local hour = VanadielHour() + if hour ~= imp:getLocalVar('hour') then + updateAggro(imp, hour) + end + end) +end + +return g_mixins.families.imp_aggro diff --git a/scripts/zones/Caedarva_Mire/mobs/Heraldic_Imp.lua b/scripts/zones/Caedarva_Mire/mobs/Heraldic_Imp.lua index 69d11f75898..a21515696de 100644 --- a/scripts/zones/Caedarva_Mire/mobs/Heraldic_Imp.lua +++ b/scripts/zones/Caedarva_Mire/mobs/Heraldic_Imp.lua @@ -2,7 +2,7 @@ -- Area: Caedarva Mire -- Mob: Heraldic Imp ----------------------------------- -mixins = { require('scripts/mixins/families/imp') } +mixins = { require('scripts/mixins/families/imp'), require('scripts/mixins/families/imp_aggro') } ----------------------------------- ---@type TMobEntity local entity = {} diff --git a/scripts/zones/Caedarva_Mire/mobs/Orderly_Imp.lua b/scripts/zones/Caedarva_Mire/mobs/Orderly_Imp.lua index 4400a71b70e..2f7eebaa4f6 100644 --- a/scripts/zones/Caedarva_Mire/mobs/Orderly_Imp.lua +++ b/scripts/zones/Caedarva_Mire/mobs/Orderly_Imp.lua @@ -2,7 +2,7 @@ -- Area: Caedarva Mire -- Mob: Orderly Imp ----------------------------------- -mixins = { require('scripts/mixins/families/imp') } +mixins = { require('scripts/mixins/families/imp'), require('scripts/mixins/families/imp_aggro') } ----------------------------------- ---@type TMobEntity local entity = {}