diff --git a/scripts/battlefields/Apollyon/sw_apollyon.lua b/scripts/battlefields/Apollyon/sw_apollyon.lua index 92290083d12..8ad56c15c6f 100644 --- a/scripts/battlefields/Apollyon/sw_apollyon.lua +++ b/scripts/battlefields/Apollyon/sw_apollyon.lua @@ -351,10 +351,10 @@ content.groups = mobs = { 'Armoury_Crate_Mimic' }, mobMods = { - [xi.mobMod.DRAW_IN ] = 1, - [xi.mobMod.NO_MOVE ] = 1, - [xi.mobMod.NO_DESPAWN] = 1, - [xi.mobMod.NO_AGGRO ] = 1, + [xi.mobMod.DRAW_IN_BITMASK ] = xi.drawin.NORMAL, + [xi.mobMod.NO_MOVE ] = 1, + [xi.mobMod.NO_DESPAWN] = 1, + [xi.mobMod.NO_AGGRO ] = 1, }, setup = function(battlefield, mobs) diff --git a/scripts/enum/drawin.lua b/scripts/enum/drawin.lua new file mode 100644 index 00000000000..cd7de948d04 --- /dev/null +++ b/scripts/enum/drawin.lua @@ -0,0 +1,12 @@ +----------------------------------- +-- Drawin bits +----------------------------------- +xi = xi or {} + +xi.drawin = +{ + NONE = 0x000, -- no draw-in (mob can only draw-in by explictly calling the lua drawin function) + NORMAL = 0x001, -- basic draw-in where mob will draw-in battle target when target some distance from mob + TO_FRONT_OF_MOB = 0x002, -- determines if draw-in to the center of mob (bit not set) or front of mob (bit set) + INCLUDE_ALLIANCE = 0x004, -- determines if draw-in includes just the battle target (bit not set) or entire alliance (bit set) +} diff --git a/scripts/enum/mob_mod.lua b/scripts/enum/mob_mod.lua index 06134f45a3f..7f4ae5e53ba 100644 --- a/scripts/enum/mob_mod.lua +++ b/scripts/enum/mob_mod.lua @@ -20,7 +20,7 @@ xi.mobMod = HP_HEAL_CHANCE = 9, -- can cast cures below this HP % SUBLINK = 10, -- sub link group LINK_RADIUS = 11, -- link radius - DRAW_IN = 12, -- 1 - player draw in, 2 - alliance draw in -- only add as a spawn mod! + DRAW_IN_BITMASK = 12, -- bitmask with different binary options for draw-in (see DRAWIN enum for options) SEVERE_SPELL_CHANCE = 13, -- % chance to use a severe spell like death or impact SKILL_LIST = 14, -- uses given mob skill list MUG_GIL = 15, -- amount gil carried for mugging @@ -90,4 +90,6 @@ xi.mobMod = CANNOT_GUARD = 79, -- Check if the mob does not guard (despite being a MNK or PUP mob) SKIP_ALLEGIANCE_CHECK = 80, -- Skip the allegiance check for valid target (allows for example a mob to cast a TARGET_ENEMY spell on itself) ABILITY_RESPONSE = 81, -- Mob can respond to player ability use with onPlayerAbilityUse() + DRAW_IN_TRIGGER_DIST = 82, -- Distance to trigger a draw-in (overrides a default of 2 * melee dist) + DRAW_IN_MAX_RANGE = 83, -- Max range to draw-in an entity (overrides a default of entire zone) } diff --git a/scripts/zones/Attohwa_Chasm/mobs/Tiamat.lua b/scripts/zones/Attohwa_Chasm/mobs/Tiamat.lua index fe8188c2eff..5b26aa2eb2a 100644 --- a/scripts/zones/Attohwa_Chasm/mobs/Tiamat.lua +++ b/scripts/zones/Attohwa_Chasm/mobs/Tiamat.lua @@ -15,7 +15,8 @@ end entity.onMobInitialize = function(mob) mob:setCarefulPathing(true) - mob:setMobMod(xi.mobMod.DRAW_IN, 8) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) + mob:setMobMod(xi.mobMod.DRAW_IN_TRIGGER_DIST, 8) end entity.onMobSpawn = function(mob) diff --git a/scripts/zones/Balgas_Dais/mobs/Black_Dragon.lua b/scripts/zones/Balgas_Dais/mobs/Black_Dragon.lua index 1a14c4be4e6..4e567dad2e5 100644 --- a/scripts/zones/Balgas_Dais/mobs/Black_Dragon.lua +++ b/scripts/zones/Balgas_Dais/mobs/Black_Dragon.lua @@ -7,7 +7,7 @@ local entity = {} entity.onMobInitialize = function(mob) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Balgas_Dais/mobs/Large_Box.lua b/scripts/zones/Balgas_Dais/mobs/Large_Box.lua index 0b7620aa17b..4c1d121f01d 100644 --- a/scripts/zones/Balgas_Dais/mobs/Large_Box.lua +++ b/scripts/zones/Balgas_Dais/mobs/Large_Box.lua @@ -22,7 +22,7 @@ entity.onMobEngage = function(mob, target) then small:setLocalVar('engaged', 1) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) DespawnMob(mobId - 2) DespawnMob(mobId - 1) diff --git a/scripts/zones/Balgas_Dais/mobs/Medium_Box.lua b/scripts/zones/Balgas_Dais/mobs/Medium_Box.lua index 521e13f1ca3..a2624009042 100644 --- a/scripts/zones/Balgas_Dais/mobs/Medium_Box.lua +++ b/scripts/zones/Balgas_Dais/mobs/Medium_Box.lua @@ -16,7 +16,7 @@ entity.onMobEngage = function(mob, target) then small:setLocalVar('engaged', 1) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) DespawnMob(mobId - 1) DespawnMob(mobId + 1) diff --git a/scripts/zones/Balgas_Dais/mobs/Small_Box.lua b/scripts/zones/Balgas_Dais/mobs/Small_Box.lua index c45e6cc9586..a4ee9058b83 100644 --- a/scripts/zones/Balgas_Dais/mobs/Small_Box.lua +++ b/scripts/zones/Balgas_Dais/mobs/Small_Box.lua @@ -18,7 +18,7 @@ entity.onMobEngage = function(mob, target) if mob:getLocalVar('engaged') == 0 then mob:setLocalVar('engaged', 1) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) DespawnMob(mobId + 1) DespawnMob(mobId + 2) diff --git a/scripts/zones/Balgas_Dais/mobs/Wyrm.lua b/scripts/zones/Balgas_Dais/mobs/Wyrm.lua index 9a0f234314c..437073edde5 100644 --- a/scripts/zones/Balgas_Dais/mobs/Wyrm.lua +++ b/scripts/zones/Balgas_Dais/mobs/Wyrm.lua @@ -11,7 +11,7 @@ entity.onMobInitialize = function(mob) end entity.onMobSpawn = function(mob) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) -- has a bug during flight, like Tiamat + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) -- has a bug during flight, like Tiamat mob:setTP(3000) -- opens fight with a skill end diff --git a/scripts/zones/Behemoths_Dominion/mobs/King_Behemoth.lua b/scripts/zones/Behemoths_Dominion/mobs/King_Behemoth.lua index fb5b3d37b61..1f194939c25 100644 --- a/scripts/zones/Behemoths_Dominion/mobs/King_Behemoth.lua +++ b/scripts/zones/Behemoths_Dominion/mobs/King_Behemoth.lua @@ -14,6 +14,8 @@ entity.onMobInitialize = function(mob) end entity.onMobSpawn = function(mob) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) + mob:setMobMod(xi.mobMod.DRAW_IN_TRIGGER_DIST, 25) mob:setLocalVar('[rage]timer', 3600) -- 60 minutes -- Despawn the ??? diff --git a/scripts/zones/Dragons_Aery/mobs/Fafnir.lua b/scripts/zones/Dragons_Aery/mobs/Fafnir.lua index 6a4d3c31bf2..987a4ef11bb 100644 --- a/scripts/zones/Dragons_Aery/mobs/Fafnir.lua +++ b/scripts/zones/Dragons_Aery/mobs/Fafnir.lua @@ -9,6 +9,8 @@ mixins = { require('scripts/mixins/rage') } local entity = {} entity.onMobSpawn = function(mob) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) + mob:setMobMod(xi.mobMod.DRAW_IN_TRIGGER_DIST, 20) mob:setLocalVar('[rage]timer', 3600) -- 60 minutes mob:setMobMod(xi.mobMod.WEAPON_BONUS, 50) -- Level 90 + 50 = 140 Base Weapon Damage diff --git a/scripts/zones/FeiYin/mobs/Capricious_Cassie.lua b/scripts/zones/FeiYin/mobs/Capricious_Cassie.lua index 44f71f0029e..1ebcf5c3c87 100644 --- a/scripts/zones/FeiYin/mobs/Capricious_Cassie.lua +++ b/scripts/zones/FeiYin/mobs/Capricious_Cassie.lua @@ -8,7 +8,7 @@ mixins = { require('scripts/mixins/rage') } local entity = {} entity.onMobInitialize = function(mob) - mob:setMobMod(xi.mobMod.DRAW_IN, 2) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, bit.bor(xi.drawin.NORMAL, xi.drawin.INCLUDE_ALLIANCE)) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Garlaige_Citadel/mobs/Serket.lua b/scripts/zones/Garlaige_Citadel/mobs/Serket.lua index 3dc07438ed8..01d58241a84 100644 --- a/scripts/zones/Garlaige_Citadel/mobs/Serket.lua +++ b/scripts/zones/Garlaige_Citadel/mobs/Serket.lua @@ -8,7 +8,7 @@ mixins = { require('scripts/mixins/rage') } local entity = {} entity.onMobInitialize = function(mob) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) end entity.onMobSpawn = function(mob) diff --git a/scripts/zones/Ifrits_Cauldron/mobs/Bomb_Queen.lua b/scripts/zones/Ifrits_Cauldron/mobs/Bomb_Queen.lua index ee80082cd1d..856a2ca0a45 100644 --- a/scripts/zones/Ifrits_Cauldron/mobs/Bomb_Queen.lua +++ b/scripts/zones/Ifrits_Cauldron/mobs/Bomb_Queen.lua @@ -9,7 +9,7 @@ local entity = {} entity.onMobInitialize = function(mob) mob:setMobMod(xi.mobMod.IDLE_DESPAWN, 180) mob:setMobMod(xi.mobMod.HP_STANDBACK, -1) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) mob:setMod(xi.mod.STUN_MEVA, 50) end diff --git a/scripts/zones/King_Ranperres_Tomb/mobs/Cemetery_Cherry.lua b/scripts/zones/King_Ranperres_Tomb/mobs/Cemetery_Cherry.lua index e217ad576ff..76c6682cadb 100644 --- a/scripts/zones/King_Ranperres_Tomb/mobs/Cemetery_Cherry.lua +++ b/scripts/zones/King_Ranperres_Tomb/mobs/Cemetery_Cherry.lua @@ -20,7 +20,7 @@ end entity.onMobInitialize = function(mob) mob:setMobMod(xi.mobMod.IDLE_DESPAWN, 180) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) local saplingsRespawn = math.random(1800, 3600) -- 30 to 60 minutes mob:timer(saplingsRespawn * 1000, function(mobArg) diff --git a/scripts/zones/Konschtat_Highlands/mobs/Steelfleece_Baldarich.lua b/scripts/zones/Konschtat_Highlands/mobs/Steelfleece_Baldarich.lua index 927449db19e..3251b6f9c49 100644 --- a/scripts/zones/Konschtat_Highlands/mobs/Steelfleece_Baldarich.lua +++ b/scripts/zones/Konschtat_Highlands/mobs/Steelfleece_Baldarich.lua @@ -10,7 +10,7 @@ local entity = {} entity.onMobInitialize = function(mob) mob:setMobMod(xi.mobMod.ALWAYS_AGGRO, 1) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) end entity.onMobSpawn = function(mob) diff --git a/scripts/zones/La_Theine_Plateau/mobs/Bloodtear_Baldurf.lua b/scripts/zones/La_Theine_Plateau/mobs/Bloodtear_Baldurf.lua index 3af66336de1..a491573afe1 100644 --- a/scripts/zones/La_Theine_Plateau/mobs/Bloodtear_Baldurf.lua +++ b/scripts/zones/La_Theine_Plateau/mobs/Bloodtear_Baldurf.lua @@ -10,7 +10,7 @@ local entity = {} entity.onMobInitialize = function(mob) mob:setMobMod(xi.mobMod.ALWAYS_AGGRO, 1) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) end entity.onMobSpawn = function(mob) diff --git a/scripts/zones/Labyrinth_of_Onzozo/mobs/Lord_of_Onzozo.lua b/scripts/zones/Labyrinth_of_Onzozo/mobs/Lord_of_Onzozo.lua index 124362e5c7e..d61dcd516b0 100644 --- a/scripts/zones/Labyrinth_of_Onzozo/mobs/Lord_of_Onzozo.lua +++ b/scripts/zones/Labyrinth_of_Onzozo/mobs/Lord_of_Onzozo.lua @@ -8,7 +8,7 @@ mixins = { require('scripts/mixins/rage') } local entity = {} entity.onMobInitialize = function(mob) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Mamook/mobs/Gulool_Ja_Ja.lua b/scripts/zones/Mamook/mobs/Gulool_Ja_Ja.lua index adc75b7778a..4f4e14c9519 100644 --- a/scripts/zones/Mamook/mobs/Gulool_Ja_Ja.lua +++ b/scripts/zones/Mamook/mobs/Gulool_Ja_Ja.lua @@ -10,7 +10,7 @@ local entity = {} entity.onMobSpawn = function(mob) mob:setMod(xi.mod.DOUBLE_ATTACK, 20) - mob:setMobMod(xi.mobMod.DRAW_IN, 2) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, bit.bor(xi.drawin.NORMAL, xi.drawin.INCLUDE_ALLIANCE)) end entity.onMobEngage = function(mob, target) diff --git a/scripts/zones/Meriphataud_Mountains/mobs/Waraxe_Beak.lua b/scripts/zones/Meriphataud_Mountains/mobs/Waraxe_Beak.lua index a31605b8678..e4697b54193 100644 --- a/scripts/zones/Meriphataud_Mountains/mobs/Waraxe_Beak.lua +++ b/scripts/zones/Meriphataud_Mountains/mobs/Waraxe_Beak.lua @@ -6,7 +6,7 @@ local entity = {} entity.onMobInitialize = function(mob) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) mob:setMobMod(xi.mobMod.HP_STANDBACK, -1) end diff --git a/scripts/zones/Nyzul_Isle/mobs/Alexander.lua b/scripts/zones/Nyzul_Isle/mobs/Alexander.lua index f6926b7084e..552518f6cda 100644 --- a/scripts/zones/Nyzul_Isle/mobs/Alexander.lua +++ b/scripts/zones/Nyzul_Isle/mobs/Alexander.lua @@ -10,7 +10,7 @@ local entity = {} entity.onMobSpawn = function(mob) mob:setMobMod(xi.mobMod.NO_MOVE, 1) -- 'Draw in' should only trigger when target is beyond 20' (out of Radiant_Sacrament range) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) mob:addListener('WEAPONSKILL_STATE_ENTER', 'WS_START_MSG', function(mobArg, skillID) -- Radiant Sacrament diff --git a/scripts/zones/Phomiuna_Aqueducts/mobs/Minotaur.lua b/scripts/zones/Phomiuna_Aqueducts/mobs/Minotaur.lua index 3968bbcf6c6..42a60eaa389 100644 --- a/scripts/zones/Phomiuna_Aqueducts/mobs/Minotaur.lua +++ b/scripts/zones/Phomiuna_Aqueducts/mobs/Minotaur.lua @@ -8,7 +8,8 @@ mixins = { require('scripts/mixins/fomor_hate') } local entity = {} entity.onMobInitialize = function(mob) - mob:setMobMod(xi.mobMod.DRAW_IN, 15) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, bit.bor(xi.drawin.NORMAL, xi.drawin.INCLUDE_ALLIANCE)) + mob:setMobMod(xi.mobMod.DRAW_IN_TRIGGER_DIST, 15) end entity.onMobSpawn = function(mob) diff --git a/scripts/zones/Riverne-Site_A01/mobs/Ouryu.lua b/scripts/zones/Riverne-Site_A01/mobs/Ouryu.lua index 24657edfc93..3ad906fb291 100644 --- a/scripts/zones/Riverne-Site_A01/mobs/Ouryu.lua +++ b/scripts/zones/Riverne-Site_A01/mobs/Ouryu.lua @@ -7,7 +7,8 @@ local entity = {} entity.onMobInitialize = function(mob) - mob:setMobMod(xi.mobMod.DRAW_IN, 15) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) + mob:setMobMod(xi.mobMod.DRAW_IN_TRIGGER_DIST, 15) end entity.onMobSpawn = function(mob) diff --git a/scripts/zones/Riverne-Site_B01/mobs/Vrtra.lua b/scripts/zones/Riverne-Site_B01/mobs/Vrtra.lua index 84594533277..4f5a26683fe 100644 --- a/scripts/zones/Riverne-Site_B01/mobs/Vrtra.lua +++ b/scripts/zones/Riverne-Site_B01/mobs/Vrtra.lua @@ -6,7 +6,8 @@ local entity = {} entity.onMobInitialize = function(mob) - mob:setMobMod(xi.mobMod.DRAW_IN, 15) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) + mob:setMobMod(xi.mobMod.DRAW_IN_TRIGGER_DIST, 15) end return entity diff --git a/scripts/zones/Temenos/mobs/Proto-Ultima.lua b/scripts/zones/Temenos/mobs/Proto-Ultima.lua index 339889f0b84..797f9e0c71f 100644 --- a/scripts/zones/Temenos/mobs/Proto-Ultima.lua +++ b/scripts/zones/Temenos/mobs/Proto-Ultima.lua @@ -47,7 +47,7 @@ executeCitadelBusterState = function(mob) mob:setMagicCastingEnabled(true) mob:setAutoAttackEnabled(true) mob:setMobAbilityEnabled(true) - mob:setMobMod(xi.mobMod.DRAW_IN, 0) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NONE) -- Use Citadel Buster at a regular interval mob:setLocalVar('citadelBusterTime', os.time() + math.random(90, 100)) return @@ -64,7 +64,7 @@ entity.onMobSpawn = function(mob) mob:setMagicCastingEnabled(false) mob:setAutoAttackEnabled(true) mob:setMobAbilityEnabled(true) - mob:setMobMod(xi.mobMod.DRAW_IN, 0) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NONE) mob:setMobMod(xi.mobMod.SKILL_LIST, 729) end @@ -99,7 +99,7 @@ entity.onMobFight = function(mob, target) mob:setMobAbilityEnabled(false) mob:setMagicCastingEnabled(false) mob:setAutoAttackEnabled(false) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) executeCitadelBusterState(mob) end end diff --git a/scripts/zones/The_Boyahda_Tree/mobs/Ancient_Goobbue.lua b/scripts/zones/The_Boyahda_Tree/mobs/Ancient_Goobbue.lua index a10b3e5bf58..d4610650ab9 100644 --- a/scripts/zones/The_Boyahda_Tree/mobs/Ancient_Goobbue.lua +++ b/scripts/zones/The_Boyahda_Tree/mobs/Ancient_Goobbue.lua @@ -18,7 +18,7 @@ entity.onMobSpawn = function(mob) { id = xi.jsa.HUNDRED_FISTS, cooldown = 60, hpp = math.random(85, 95) }, }, }) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/The_Boyahda_Tree/mobs/Voluptuous_Vivian.lua b/scripts/zones/The_Boyahda_Tree/mobs/Voluptuous_Vivian.lua index 0d22b7410a7..a71c7d9a481 100644 --- a/scripts/zones/The_Boyahda_Tree/mobs/Voluptuous_Vivian.lua +++ b/scripts/zones/The_Boyahda_Tree/mobs/Voluptuous_Vivian.lua @@ -8,7 +8,7 @@ mixins = { require('scripts/mixins/job_special') } local entity = {} entity.onMobInitialize = function(mob) - mob:setMobMod(xi.mobMod.DRAW_IN, 2) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, bit.bor(xi.drawin.NORMAL, xi.drawin.INCLUDE_ALLIANCE)) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Uleguerand_Range/mobs/Jormungand.lua b/scripts/zones/Uleguerand_Range/mobs/Jormungand.lua index 17204dc701a..f01c7a24259 100644 --- a/scripts/zones/Uleguerand_Range/mobs/Jormungand.lua +++ b/scripts/zones/Uleguerand_Range/mobs/Jormungand.lua @@ -14,7 +14,8 @@ end entity.onMobInitialize = function(mob) mob:setCarefulPathing(true) - mob:setMobMod(xi.mobMod.DRAW_IN, 15) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) + mob:setMobMod(xi.mobMod.DRAW_IN_TRIGGER_DIST, 15) end entity.onMobSpawn = function(mob) diff --git a/scripts/zones/Wajaom_Woodlands/mobs/Tinnin.lua b/scripts/zones/Wajaom_Woodlands/mobs/Tinnin.lua index 7f830544ce3..64212979a0f 100644 --- a/scripts/zones/Wajaom_Woodlands/mobs/Tinnin.lua +++ b/scripts/zones/Wajaom_Woodlands/mobs/Tinnin.lua @@ -18,7 +18,7 @@ entity.onMobInitialize = function(mob) mob:setMobMod(xi.mobMod.GIL_MIN, 12000) mob:setMobMod(xi.mobMod.GIL_MAX, 30000) mob:setMobMod(xi.mobMod.MUG_GIL, 8000) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) mob:setMod(xi.mod.UDMGBREATH, -10000) -- immune to breath damage mob:setMobMod(xi.mobMod.IDLE_DESPAWN, 300) end diff --git a/scripts/zones/Waughroon_Shrine/mobs/Dark_Dragon.lua b/scripts/zones/Waughroon_Shrine/mobs/Dark_Dragon.lua index bd020cb8758..081c711be46 100644 --- a/scripts/zones/Waughroon_Shrine/mobs/Dark_Dragon.lua +++ b/scripts/zones/Waughroon_Shrine/mobs/Dark_Dragon.lua @@ -7,7 +7,8 @@ local entity = {} entity.onMobInitialize = function(mob) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) + mob:setMobMod(xi.mobMod.DRAW_IN_TRIGGER_DIST, 25) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Waughroon_Shrine/mobs/Flayer_Franz.lua b/scripts/zones/Waughroon_Shrine/mobs/Flayer_Franz.lua index 99ac1ccb96a..f61a932c4a3 100644 --- a/scripts/zones/Waughroon_Shrine/mobs/Flayer_Franz.lua +++ b/scripts/zones/Waughroon_Shrine/mobs/Flayer_Franz.lua @@ -7,7 +7,7 @@ local entity = {} entity.onMobSpawn = function(mob) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) end entity.onMobDeath = function(mob, player, optParams) diff --git a/scripts/zones/Western_Altepa_Desert/mobs/King_Vinegarroon.lua b/scripts/zones/Western_Altepa_Desert/mobs/King_Vinegarroon.lua index 361efa1ba4a..6d94a406727 100644 --- a/scripts/zones/Western_Altepa_Desert/mobs/King_Vinegarroon.lua +++ b/scripts/zones/Western_Altepa_Desert/mobs/King_Vinegarroon.lua @@ -17,7 +17,8 @@ end entity.onMobInitialize = function(mob) mob:setMobMod(xi.mobMod.ADD_EFFECT, 1) - mob:setMobMod(xi.mobMod.DRAW_IN, 2) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, bit.bor(xi.drawin.NORMAL, xi.drawin.INCLUDE_ALLIANCE)) + mob:setMobMod(xi.mobMod.DRAW_IN_TRIGGER_DIST, 15) end entity.onMobDrawIn = function(mob, target) diff --git a/scripts/zones/Xarcabard/mobs/Boreal_Coeurl.lua b/scripts/zones/Xarcabard/mobs/Boreal_Coeurl.lua index ca695e7deb1..4286c5368c6 100644 --- a/scripts/zones/Xarcabard/mobs/Boreal_Coeurl.lua +++ b/scripts/zones/Xarcabard/mobs/Boreal_Coeurl.lua @@ -86,6 +86,8 @@ entity.onMobEngage = function(mob) end entity.onMobSpawn = function(mob) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, bit.bor(xi.drawin.NORMAL, xi.drawin.INCLUDE_ALLIANCE)) + mob:setMobMod(xi.mobMod.DRAW_IN_TRIGGER_DIST, 15) mob:setSpeed(baseSpeed) -- Failsafe to make sure NPC is down when NM is up if xi.settings.main.OLDSCHOOL_G2 then diff --git a/scripts/zones/Xarcabard/mobs/Boreal_Hound.lua b/scripts/zones/Xarcabard/mobs/Boreal_Hound.lua index 5075fdd2403..6d7617367af 100644 --- a/scripts/zones/Xarcabard/mobs/Boreal_Hound.lua +++ b/scripts/zones/Xarcabard/mobs/Boreal_Hound.lua @@ -88,6 +88,8 @@ entity.onMobEngage = function(mob) end entity.onMobSpawn = function(mob) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, bit.bor(xi.drawin.NORMAL, xi.drawin.INCLUDE_ALLIANCE)) + mob:setMobMod(xi.mobMod.DRAW_IN_TRIGGER_DIST, 15) mob:setSpeed(baseSpeed) -- Failsafe to make sure NPC is down when NM is up if xi.settings.main.OLDSCHOOL_G2 then diff --git a/scripts/zones/Xarcabard/mobs/Boreal_Tiger.lua b/scripts/zones/Xarcabard/mobs/Boreal_Tiger.lua index 9d6212900b5..fe3890886d9 100644 --- a/scripts/zones/Xarcabard/mobs/Boreal_Tiger.lua +++ b/scripts/zones/Xarcabard/mobs/Boreal_Tiger.lua @@ -83,6 +83,8 @@ entity.onMobEngage = function(mob) end entity.onMobSpawn = function(mob) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, bit.bor(xi.drawin.NORMAL, xi.drawin.INCLUDE_ALLIANCE)) + mob:setMobMod(xi.mobMod.DRAW_IN_TRIGGER_DIST, 15) mob:setSpeed(baseSpeed) -- Failsafe to make sure NPC is down when NM is up if xi.settings.main.OLDSCHOOL_G2 then diff --git a/scripts/zones/Xarcabard_[S]/mobs/Zirnitra.lua b/scripts/zones/Xarcabard_[S]/mobs/Zirnitra.lua index 085bcdd6df9..366cabae2ac 100644 --- a/scripts/zones/Xarcabard_[S]/mobs/Zirnitra.lua +++ b/scripts/zones/Xarcabard_[S]/mobs/Zirnitra.lua @@ -14,7 +14,7 @@ entity.onMobSpawn = function(mob) mob:setMod(xi.mod.REGEN, 50) mob:setMod(xi.mod.REGAIN, 100) mob:setMod(xi.mod.WIND_ABSORB, 100) - mob:setMobMod(xi.mobMod.DRAW_IN, 1) + mob:setMobMod(xi.mobMod.DRAW_IN_BITMASK, xi.drawin.NORMAL) end entity.onMobEngage = function(mob) diff --git a/sql/mob_pool_mods.sql b/sql/mob_pool_mods.sql index 1a8f0c21f59..b364607b67e 100644 --- a/sql/mob_pool_mods.sql +++ b/sql/mob_pool_mods.sql @@ -70,7 +70,7 @@ INSERT INTO `mob_pool_mods` VALUES (268,368,150,0); -- REGAIN: 150 INSERT INTO `mob_pool_mods` VALUES (268,370,50,0); -- REGEN: 50 -- Athamas -INSERT INTO `mob_pool_mods` VALUES (276,12,1,1); -- DRAW_IN: 1 +INSERT INTO `mob_pool_mods` VALUES (276,12,1,1); -- DRAW_IN_BITMASK: 1 -- Aura Statue INSERT INTO `mob_pool_mods` VALUES (289,4,4,1); -- SIGHT_RANGE: 4 @@ -131,9 +131,6 @@ INSERT INTO `mob_pool_mods` VALUES (820,368,10,0); -- REGAIN: 10 -- Darksteel Golem INSERT INTO `mob_pool_mods` VALUES (906,4,4,1); -- SIGHT_RANGE: 4 --- Dark Dragon -INSERT INTO `mob_pool_mods` VALUES (912,12,25,1); -- DRAW_IN: 25 - -- Dea INSERT INTO `mob_pool_mods` VALUES (930,370,15,0); -- REGEN: 15 @@ -154,7 +151,7 @@ INSERT INTO `mob_pool_mods` VALUES (979,9,60,1); -- HP_HEAL_CHANCE: 60 INSERT INTO `mob_pool_mods` VALUES (1013,28,-100,1); -- EXP_BONUS: -100 -- Diabolos -INSERT INTO `mob_pool_mods` VALUES (1027,12,1,1); -- DRAW_IN: 1 +INSERT INTO `mob_pool_mods` VALUES (1027,12,1,1); -- DRAW_IN_BITMASK: 1 -- Effigy Prototype INSERT INTO `mob_pool_mods` VALUES (1178,163,-100,0); -- DMGMAGIC: -100 @@ -282,7 +279,7 @@ INSERT INTO `mob_pool_mods` VALUES (2643,160,-50,0); -- DMG: -50 INSERT INTO `mob_pool_mods` VALUES (2647,160,-50,0); -- DMG: -50 -- Mimic -INSERT INTO `mob_pool_mods` VALUES (2664,12,1,1); -- DRAW_IN: 1 +INSERT INTO `mob_pool_mods` VALUES (2664,12,1,1); -- DRAW_IN_BITMASK: 1 -- Minotaur INSERT INTO `mob_pool_mods` VALUES (2675,4,25,1); -- SIGHT_RANGE: 25 diff --git a/sql/mob_spawn_mods.sql b/sql/mob_spawn_mods.sql index f3fc7aa1719..76cce6fb708 100644 --- a/sql/mob_spawn_mods.sql +++ b/sql/mob_spawn_mods.sql @@ -332,16 +332,11 @@ INSERT INTO `mob_spawn_mods` VALUES (17235987,2,2765,1); -- GIL_MAX: 2765 INSERT INTO `mob_spawn_mods` VALUES (17236201,55,180,1); -- IDLE_DESPAWN: 180 -- Boreal Hound -INSERT INTO `mob_spawn_mods` VALUES (17236202,12,15,1); -- DRAW_IN: 15 INSERT INTO `mob_spawn_mods` VALUES (17236202,160,50,0); -- DMG: 50 -- Boreal Coeurl -INSERT INTO `mob_spawn_mods` VALUES (17236203,12,15,1); -- DRAW_IN: 15 INSERT INTO `mob_spawn_mods` VALUES (17236203,23,8,1); -- IMMUNITY: 8 --- Boreal Tiger -INSERT INTO `mob_spawn_mods` VALUES (17236204,12,15,1); -- DRAW_IN: 15 - -- Koenigstiger INSERT INTO `mob_spawn_mods` VALUES (17236205,55,240,1); -- IDLE_DESPAWN: 240 @@ -399,9 +394,6 @@ INSERT INTO `mob_spawn_mods` VALUES (17285545,55,300,1); -- IDLE_DESPAWN: 300 -- Kappa Biwa INSERT INTO `mob_spawn_mods` VALUES (17285546,55,150,1); -- IDLE_DESPAWN: 150 --- King Vinegarroon -INSERT INTO `mob_spawn_mods` VALUES (17289575,12,15,1); -- DRAW_IN: 15 - -- Eastern Sphinx INSERT INTO `mob_spawn_mods` VALUES (17289654,55,168,1); -- IDLE_DESPAWN: 168 @@ -412,9 +404,6 @@ INSERT INTO `mob_spawn_mods` VALUES (17289655,55,168,1); -- IDLE_DESPAWN: 168 INSERT INTO `mob_spawn_mods` VALUES (17293486,31,5,1); -- ROAM_DISTANCE: 5 INSERT INTO `mob_spawn_mods` VALUES (17293486,51,1,1); -- ROAM_TURNS: 1 --- King Behemoth -INSERT INTO `mob_spawn_mods` VALUES (17297441,12,25,1); -- DRAW_IN: 25 - -- Picklix Longindex INSERT INTO `mob_spawn_mods` VALUES (17297446,55,180,1); -- IDLE_DESPAWN: 180 @@ -827,9 +816,6 @@ INSERT INTO `mob_spawn_mods` VALUES (17404337,55,288,1); -- IDLE_DESPAWN: 288 -- Beet Leafhopper INSERT INTO `mob_spawn_mods` VALUES (17404338,55,120,1); -- IDLE_DESPAWN: 120 --- Fafnir -INSERT INTO `mob_spawn_mods` VALUES (17408018,12,20,1); -- DRAW_IN: 20 - -- Gerwitz'S Scythe INSERT INTO `mob_spawn_mods` VALUES (17420629,55,300,1); -- IDLE_DESPAWN: 300 diff --git a/src/map/ai/controllers/mob_controller.cpp b/src/map/ai/controllers/mob_controller.cpp index 80e477b2ccb..691ab4caf4c 100644 --- a/src/map/ai/controllers/mob_controller.cpp +++ b/src/map/ai/controllers/mob_controller.cpp @@ -708,11 +708,11 @@ void CMobController::Move() if (((currentDistance > closeDistance) || move) && PMob->PAI->CanFollowPath()) { // TODO: can this be moved to scripts entirely? - if (PMob->getMobMod(MOBMOD_DRAW_IN) > 0) + if ((PMob->getMobMod(MOBMOD_DRAW_IN_BITMASK) & DRAWIN::DRAWIN_NORMAL)) { - if (currentDistance >= PMob->GetMeleeRange() * 2 && battleutils::DrawIn(PTarget, PMob, PMob->GetMeleeRange() - 0.2f)) + bool didDrawin = HandleDrawin(currentDistance); + if (didDrawin) { - FaceTarget(); return; } } @@ -1415,3 +1415,26 @@ bool CMobController::IsSpellReady(float currentDistance) return m_Tick >= m_nextMagicTime; } + +bool CMobController::HandleDrawin(float currentDistance) +{ + // get specific draw-in settings that can be set on any given mob otherwise use default values + const uint32 drawInTriggerDistance = PMob->getMobMod(MOBMOD_DRAW_IN_TRIGGER_DIST) ? PMob->getMobMod(MOBMOD_DRAW_IN_TRIGGER_DIST) : PMob->GetMeleeRange() * 2; + const uint32 drawInMaxDistance = PMob->getMobMod(MOBMOD_DRAW_IN_MAX_RANGE) ? PMob->getMobMod(MOBMOD_DRAW_IN_MAX_RANGE) : std::numeric_limits::max(); + const bool includeAlliance = (PMob->getMobMod(MOBMOD_DRAW_IN_BITMASK) & DRAWIN::DRAWIN_INCLUDE_ALLIANCE); + const bool toFrontOfMob = (PMob->getMobMod(MOBMOD_DRAW_IN_BITMASK) & DRAWIN::DRAWIN_TO_FRONT_OF_MOB); + + bool didDrawin = false; + + if (currentDistance >= drawInTriggerDistance) + { + bool didDrawin = battleutils::DrawIn(PTarget, PMob, PMob->GetMeleeRange() - 0.2f, drawInMaxDistance, includeAlliance, toFrontOfMob); + + if (didDrawin) + { + FaceTarget(); + } + } + + return didDrawin; +} diff --git a/src/map/ai/controllers/mob_controller.h b/src/map/ai/controllers/mob_controller.h index 071bafc4956..d39ea3d1a46 100644 --- a/src/map/ai/controllers/mob_controller.h +++ b/src/map/ai/controllers/mob_controller.h @@ -85,6 +85,7 @@ class CMobController : public CController bool CanMoveForward(float currentDistance); bool IsSpecialSkillReady(float currentDistance); bool IsSpellReady(float currentDistance); + bool HandleDrawin(float currentDistance); CBattleEntity* PTarget{ nullptr }; diff --git a/src/map/entities/mobentity.h b/src/map/entities/mobentity.h index 88cb168dd61..113d74142a2 100644 --- a/src/map/entities/mobentity.h +++ b/src/map/entities/mobentity.h @@ -102,6 +102,14 @@ enum BEHAVIOUR : uint16 BEHAVIOUR_NO_TURN = 0x400 // mob does not turn to face target }; +enum DRAWIN : uint16 +{ + DRAWIN_NONE = 0x000, // no draw-in (mob can only draw-in by explictly calling the lua drawin function) + DRAWIN_NORMAL = 0x001, // basic draw-in where mob will draw-in battle target when target some distance from mob + DRAWIN_TO_FRONT_OF_MOB = 0x002, // determines if draw-in to the center of mob (bit not set) or front of mob (bit set) + DRAWIN_INCLUDE_ALLIANCE = 0x004, // determines if draw-in includes just the battle target (bit not set) or entire alliance (bit set) +}; + class CMobSkillState; class CMobEntity : public CBattleEntity diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index 4c346f32963..6e19f7038d3 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -17061,8 +17061,8 @@ bool CLuaBaseEntity::hasTPMoves() /************************************************************************ * Function: drawIn() - * Purpose : Draws in the target, or current target if not specified - * Example : mob:drawIn() mob:drawIn(player) + * Purpose : Draws in the target or current the curent battle target if not specified + * Example : mob:drawIn() * Notes : Draws in a player even if within the draw-in leash ************************************************************************/ void CLuaBaseEntity::drawIn(sol::variadic_args va) @@ -17073,39 +17073,58 @@ void CLuaBaseEntity::drawIn(sol::variadic_args va) return; } - auto mobObj = dynamic_cast(m_PBaseEntity); - - if (va.size() == 0) + if (auto mobObj = dynamic_cast(m_PBaseEntity)) { - auto defaultTarget = mobObj->GetBattleTarget(); + // default to current battle target + auto drawInTarget = mobObj->GetBattleTarget(); - if (defaultTarget == nullptr) + // check the first param as it could be a battle target + CLuaBaseEntity* drawInTargetParam = va.get(0); + if (drawInTargetParam) { - return; + if (auto drawInTargetParamBattle = dynamic_cast(drawInTargetParam->m_PBaseEntity)) + { + drawInTarget = drawInTargetParamBattle; + } } - battleutils::DrawIn(defaultTarget, mobObj, mobObj->GetMeleeRange() - 0.2f); - return; - } - CLuaBaseEntity* PLuaBaseEntity = va.get(0); + if (drawInTarget == nullptr) + { + return; + } - if (!PLuaBaseEntity) - { - ShowError("Attempt to draw-in non-valid target."); - return; - } + uint32 maxDist = std::numeric_limits::max(); + if (va.get_type(1) == sol::type::number) + { + maxDist = va.get(1); + } + else if (mobObj->getMobMod(MOBMOD_DRAW_IN_MAX_RANGE) > 0) + { + maxDist = mobObj->getMobMod(MOBMOD_DRAW_IN_MAX_RANGE); + } - CBaseEntity* PBaseEntity = PLuaBaseEntity->m_PBaseEntity; - CBattleEntity* PTarget = nullptr; + bool includeAlliance = false; + if (va.get_type(2) == sol::type::boolean) + { + includeAlliance = va.get(2); + } + else if ((mobObj->getMobMod(MOBMOD_DRAW_IN_BITMASK) & DRAWIN::DRAWIN_INCLUDE_ALLIANCE) > 0) + { + includeAlliance = true; + } - if (PBaseEntity) - { - PTarget = dynamic_cast(PBaseEntity); - } + bool toFrontOfMob = false; + if (va.get_type(3) == sol::type::boolean) + { + toFrontOfMob = va.get(3); + } + else if ((mobObj->getMobMod(MOBMOD_DRAW_IN_BITMASK) & DRAWIN::DRAWIN_TO_FRONT_OF_MOB) > 0) + { + toFrontOfMob = true; + } - if (PTarget) - { - battleutils::DrawIn(PTarget, mobObj, mobObj->GetMeleeRange() - 0.2f); + // call draw-in with the params and a draw-in distance of 0, thus the target will be drawn in unless they are 0 distance from the mob + battleutils::DrawIn(drawInTarget, mobObj, mobObj->GetMeleeRange() - 0.2f, maxDist, includeAlliance, toFrontOfMob); } return; diff --git a/src/map/mob_modifier.h b/src/map/mob_modifier.h index 1d862c4ac38..7e642a45f7d 100644 --- a/src/map/mob_modifier.h +++ b/src/map/mob_modifier.h @@ -40,7 +40,7 @@ enum MOBMODIFIER : int MOBMOD_HP_HEAL_CHANCE = 9, // can cast cures below this HP % MOBMOD_SUBLINK = 10, // sub link group MOBMOD_LINK_RADIUS = 11, // link radius - MOBMOD_DRAW_IN = 12, // 1 - player draw in, 2 - alliance draw in -- only add as a spawn mod! + MOBMOD_DRAW_IN_BITMASK = 12, // bitmask with different binary options for draw-in (see DRAWIN enum for options) MOBMOD_SEVERE_SPELL_CHANCE = 13, // % chance to use a severe spell like death or impact MOBMOD_SKILL_LIST = 14, // uses given mob skill list MOBMOD_MUG_GIL = 15, // amount gil carried for mugging @@ -110,6 +110,8 @@ enum MOBMODIFIER : int MOBMOD_CANNOT_GUARD = 79, // Check if the mob does not guard(despite being a MNK or PUP mob) MOBMOD_SKIP_ALLEGIANCE_CHECK = 80, // Skip the allegiance check for valid target (allows for example a mob to cast a TARGET_ENEMY spell on itself) MOBMOD_ABILITY_RESPONSE = 81, // Mob can respond to player ability use with onPlayerAbilityUse() + MOBMOD_DRAW_IN_TRIGGER_DIST = 82, // Distance to trigger a draw-in (overrides a default of 2 * melee dist) + MOBMOD_DRAW_IN_MAX_RANGE = 83, // Max range to draw-in an entity (overrides a default of entire zone) }; #endif diff --git a/src/map/utils/battleutils.cpp b/src/map/utils/battleutils.cpp index ac8dc47a04e..6b2b54e1dae 100644 --- a/src/map/utils/battleutils.cpp +++ b/src/map/utils/battleutils.cpp @@ -5582,8 +5582,13 @@ namespace battleutils } } - bool DrawIn(CBattleEntity* PTarget, CMobEntity* PMob, float offset) + bool DrawIn(CBattleEntity* PTarget, CMobEntity* PMob, float offset, int16 maxDistance, bool includeAlli, bool toFrontOfMob) { + if (std::chrono::time_point_cast(server_clock::now()).time_since_epoch().count() - PMob->GetLocalVar("DrawInTime") < 2) + { + return false; + } + position_t& pos = PMob->loc.p; position_t nearEntity = nearPosition(pos, offset, (float)0); @@ -5609,19 +5614,15 @@ namespace battleutils // Move the target a little higher, just in case nearEntity.y -= 1.0f; - bool success = false; - float drawInDistance = (float)(PMob->getMobMod(MOBMOD_DRAW_IN) > 1 ? PMob->getMobMod(MOBMOD_DRAW_IN) : PMob->GetMeleeRange() * 2); + bool success = false; - if (std::chrono::time_point_cast(server_clock::now()).time_since_epoch().count() - PMob->GetLocalVar("DrawInTime") < 2) - { - return false; - } - - std::function drawInFunc = [PMob, drawInDistance, &nearEntity, &success](CBattleEntity* PMember) + std::function drawInFunc = [PMob, maxDistance, toFrontOfMob, &nearEntity, &success](CBattleEntity* PMember) { float pDistance = distance(PMob->loc.p, PMember->loc.p); - if (PMob->loc.zone == PMember->loc.zone && pDistance > drawInDistance && PMember->status != STATUS_TYPE::CUTSCENE_ONLY) + if (PMob->loc.zone == PMember->loc.zone && + pDistance < maxDistance && + PMember->status != STATUS_TYPE::CUTSCENE_ONLY) { // don't draw in dead players for now! // see tractor @@ -5631,10 +5632,18 @@ namespace battleutils } else { - // draw in! - PMember->loc.p.x = nearEntity.x; - PMember->loc.p.y = nearEntity.y; - PMember->loc.p.z = nearEntity.z; + if (toFrontOfMob) + { + PMember->loc.p.x = nearEntity.x; + PMember->loc.p.y = nearEntity.y; + PMember->loc.p.z = nearEntity.z; + } + else + { + PMember->loc.p.x = PMob->loc.p.x; + PMember->loc.p.y = nearEntity.y; + PMember->loc.p.z = PMob->loc.p.z; + } if (PMember->objtype == TYPE_PC) { @@ -5654,7 +5663,7 @@ namespace battleutils }; // check if i should draw-in party/alliance - if (PMob->getMobMod(MOBMOD_DRAW_IN) > 1) + if (includeAlli) { PTarget->ForAlliance(drawInFunc); } diff --git a/src/map/utils/battleutils.h b/src/map/utils/battleutils.h index 6e74f584527..a1136348999 100644 --- a/src/map/utils/battleutils.h +++ b/src/map/utils/battleutils.h @@ -246,7 +246,7 @@ namespace battleutils WEATHER GetWeather(CBattleEntity* PEntity, bool ignoreScholar); WEATHER GetWeather(CBattleEntity* PEntity, bool ignoreScholar, uint16 zoneWeather); bool WeatherMatchesElement(WEATHER weather, uint8 element); - bool DrawIn(CBattleEntity* PEntity, CMobEntity* PMob, float offset); + bool DrawIn(CBattleEntity* PEntity, CMobEntity* PMob, float offset, int16 maxDistance, bool includeAlli, bool toFrontOfMob); void DoWildCardToEntity(CCharEntity* PCaster, CCharEntity* PTarget, uint8 roll); bool DoRandomDealToEntity(CCharEntity* PChar, CBattleEntity* PTarget);