2016-01-16 01:26:33 -05:00
|
|
|
-----------------------------------
|
2021-04-01 15:10:15 -04:00
|
|
|
-- xi.effect.LEVEL_SYNC
|
2016-01-16 01:26:33 -05:00
|
|
|
-----------------------------------
|
2024-08-24 21:26:29 -04:00
|
|
|
---@type TEffect
|
2022-10-06 17:22:04 +03:00
|
|
|
local effectObject = {}
|
2016-01-16 01:26:33 -05:00
|
|
|
|
2022-10-06 17:22:04 +03:00
|
|
|
effectObject.onEffectGain = function(target, effect)
|
2018-08-07 19:36:44 -04:00
|
|
|
target:levelRestriction(effect:getPower())
|
2020-06-06 10:56:25 +03:00
|
|
|
|
2021-04-01 15:10:15 -04:00
|
|
|
if target:getObjType() == xi.objType.PC then
|
2020-06-06 10:56:25 +03:00
|
|
|
target:clearTrusts()
|
2023-06-09 18:30:17 -07:00
|
|
|
|
|
|
|
|
if xi.settings.map.DESPAWN_JUGPETS_BELOW_MINIMUM_LEVEL then
|
|
|
|
|
local pet = target:getPet()
|
|
|
|
|
local masterLevel = target:getMainLvl()
|
|
|
|
|
|
|
|
|
|
if
|
|
|
|
|
pet and
|
|
|
|
|
pet:getObjType() == xi.objType.PET and
|
2024-05-18 14:14:18 +03:00
|
|
|
target:hasJugPet() and -- hasJugPet checks m_PBaseEntity->PPet's check type, not the target's pet type.
|
2023-06-09 18:30:17 -07:00
|
|
|
masterLevel < pet:getMinimumPetLevel()
|
|
|
|
|
then
|
|
|
|
|
target:despawnPet()
|
|
|
|
|
end
|
|
|
|
|
end
|
2020-06-06 10:56:25 +03:00
|
|
|
end
|
2018-08-07 19:36:44 -04:00
|
|
|
end
|
2016-01-16 01:26:33 -05:00
|
|
|
|
2022-10-06 17:22:04 +03:00
|
|
|
effectObject.onEffectTick = function(target, effect)
|
2018-08-07 19:36:44 -04:00
|
|
|
end
|
2016-01-16 01:26:33 -05:00
|
|
|
|
2022-10-06 17:22:04 +03:00
|
|
|
effectObject.onEffectLose = function(target, effect)
|
2018-08-07 19:36:44 -04:00
|
|
|
target:levelRestriction(0)
|
|
|
|
|
target:disableLevelSync()
|
2020-03-19 18:41:42 -07:00
|
|
|
end
|
2021-01-07 03:22:42 -05:00
|
|
|
|
2022-10-06 17:22:04 +03:00
|
|
|
return effectObject
|