Skip to content

Commit

Permalink
Merge pull request #6245 from LandSandBoat/lls/zone
Browse files Browse the repository at this point in the history
LLS: Create TZone type, annotate zones/Zone.lua files, correct issues identified
  • Loading branch information
claywar authored Sep 14, 2024
2 parents 8527243 + c2ad1b1 commit 1b174fb
Show file tree
Hide file tree
Showing 408 changed files with 428 additions and 295 deletions.
1 change: 0 additions & 1 deletion scripts/actions/abilities/pets/automaton/arcuballista.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local abilityObject = {}

abilityObject.onAutomatonAbilityCheck = function(target, automaton, skill)
local master = automaton:getMaster()

if not master then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/actions/abilities/pets/automaton/armor_piercer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local abilityObject = {}

abilityObject.onAutomatonAbilityCheck = function(target, automaton, skill)
local master = automaton:getMaster()

if not master then
return
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local abilityObject = {}

abilityObject.onAutomatonAbilityCheck = function(target, automaton, skill)
local master = automaton:getMaster()

if not master then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/actions/abilities/pets/automaton/bone_crusher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local abilityObject = {}

abilityObject.onAutomatonAbilityCheck = function(target, automaton, skill)
local master = automaton:getMaster()

if not master then
return
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local abilityObject = {}

abilityObject.onAutomatonAbilityCheck = function(target, automaton, skill)
local master = automaton:getMaster()

if not master then
return
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local abilityObject = {}

abilityObject.onAutomatonAbilityCheck = function(target, automaton, skill)
local master = automaton:getMaster()

if not master then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/actions/abilities/pets/automaton/daze.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local abilityObject = {}

abilityObject.onAutomatonAbilityCheck = function(target, automaton, skill)
local master = automaton:getMaster()

if not master then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/actions/abilities/pets/automaton/knockout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local abilityObject = {}

abilityObject.onAutomatonAbilityCheck = function(target, automaton, skill)
local master = automaton:getMaster()

if not master then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/actions/abilities/pets/automaton/magic_mortar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local abilityObject = {}

abilityObject.onAutomatonAbilityCheck = function(target, automaton, skill)
local master = automaton:getMaster()

if not master then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/actions/abilities/pets/automaton/slapstick.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local abilityObject = {}

abilityObject.onAutomatonAbilityCheck = function(target, automaton, skill)
local master = automaton:getMaster()

if not master then
return
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local abilityObject = {}

abilityObject.onAutomatonAbilityCheck = function(target, automaton, skill)
local master = automaton:getMaster()

if not master then
return
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local abilityObject = {}

abilityObject.onAutomatonAbilityCheck = function(target, automaton, skill)
local master = automaton:getMaster()

if not master then
return
end
Expand Down
3 changes: 1 addition & 2 deletions scripts/actions/abilities/pets/concentric_pulse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ abilityObject.onAbilityCheck = function(player, target, ability)
end

abilityObject.onPetAbility = function(target, pet, skill)
local master = pet:getMaster()

local master = pet:getMaster()
if not master then
return
end
Expand Down
3 changes: 1 addition & 2 deletions scripts/actions/abilities/repair.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ abilityObject.onAbilityCheck = function(player, target, ability)
end

abilityObject.onUseAbility = function(player, target, ability)
local pet = player:getPet()

local pet = player:getPet()
if not pet then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/actions/abilities/role_reversal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ end

abilityObject.onUseAbility = function(player, target, ability)
local pet = player:getPet()

if pet then
local bonus = 1 + (player:getMerit(xi.merit.ROLE_REVERSAL) - 5) / 100
local playerHP = player:getHP()
Expand Down
1 change: 0 additions & 1 deletion scripts/actions/abilities/ventriloquy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ end

abilityObject.onUseAbility = function(player, target, ability)
local pet = player:getPet()

if pet then
local enmitylist = target:getEnmityList()
local playerfound, petfound = false, false
Expand Down
1 change: 0 additions & 1 deletion scripts/actions/mobskills/astral_flow_pet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ local petAstralFlowAbility =

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local pet = mob:getPet()

if not pet then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/actions/mobskills/eald2_warp_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local battletarget = mob:getTarget()

if not battletarget then
return
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/actions/spells/trust/sylvie_uc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ end

spellObject.onMobSpawn = function(mob)
xi.trust.message(mob, xi.trust.messageOffset.SPAWN)
local master = mob:getMaster()

local master = mob:getMaster()
if not master then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/commands/checklocalvar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ commandObj.onTrigger = function(player, arg1, arg2, arg3)
arg3 = tonumber(arg3)
if zone and zone:getTypeMask() == xi.zoneType.INSTANCED then
local instance = player:getInstance()

if not instance then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/globals/battlefield.lua
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,6 @@ function Battlefield.onEntryTrigger(player, npc)
local status = player:getStatusEffect(xi.effect.BATTLEFIELD)
local id = status:getPower()
local content = xi.battlefield.contents[id]

if not content then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/globals/beastmentreasure.lua
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ xi.beastmentreasure.updatePeddlestox = function(zone, peddlestoxID)
and once at the start of each new game day. Since Peddlestox is disabled in the db by default, we
only need to enable her on the appropriate day and disable her on the following day. ]]--
local peddlestox = GetNPCByID(peddlestoxID)

if not peddlestox then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/globals/chocobo_raising.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,6 @@ end

xi.chocoboRaising.initChocoboData = function(player)
local chocoState = player:getChocoboRaisingInfo()

if not chocoState then
return chocoState
end
Expand Down
1 change: 0 additions & 1 deletion scripts/globals/follow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ end

xi.follow.clearFollowers = function(leader)
local followers = xi.follow.getFollowers(leader)

if not followers then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/globals/job_utils/summoner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ end

xi.job_utils.summoner.onUseBloodPact = function(target, petskill, summoner, action)
local bloodPactAbility = GetAbility(petskill:getID()) -- Player abilities and Avatar abilities are mapped 1:1

if not bloodPactAbility then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/globals/magian.lua
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,6 @@ xi.magian.onItemEquip = function(player, itemObj)
end

local trialData = xi.magian.trials[itemTrialId]

if not trialData then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/globals/npc_util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,6 @@ end

function npcUtil.UpdateNPCSpawnPoint(id, minTime, maxTime, posTable, serverVar)
local npc = GetNPCByID(id)

if not npc then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/globals/pets/avatar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ end
xi.pets.avatar.getLightSpiritSpell = function(pet)
-- returns the spirit's preferred target based on positioning
local master = pet:getMaster()

if not master then
return 0, nil
end
Expand Down
2 changes: 0 additions & 2 deletions scripts/globals/regimes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,6 @@ xi.regime.bookOnEventUpdate = function(player, option, regimeType)
-- check valid option
local opts = getUpdateOpts(regimeType)
local opt = opts[option]

if not opt then
return
end
Expand Down Expand Up @@ -1154,7 +1153,6 @@ xi.regime.bookOnEventFinish = function(player, option, regimeType)
-- check valid option
local opts = getFinishOpts(regimeType)
local opt = opts[option]

if not opt then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/items/astral_pot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ end

itemObject.onEffectGain = function(target, effect)
local pet = target:getPet()

if not pet then
return
end
Expand Down
4 changes: 2 additions & 2 deletions scripts/items/bag_of_wyvern_feed.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ local itemObject = {}

itemObject.onItemCheck = function(target, item, param, caster)
local effect = target:getStatusEffect(xi.effect.ENCHANTMENT)
local pet = target:getPet()
local pet = target:getPet()

if not pet then
return xi.msg.basic.REQUIRES_A_PET, 0
elseif effect ~= nil and effect:getSubType() == 18242 then
Expand All @@ -25,7 +26,6 @@ end

itemObject.onEffectGain = function(target, effect)
local pet = target:getPet()

if not pet then
return
end
Expand Down
3 changes: 1 addition & 2 deletions scripts/items/bottle_of_dawn_mulsum.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ itemObject.onItemCheck = function(target, item, param, caster)
end

itemObject.onItemUse = function(target)
local percent = math.random(20, 35) * xi.settings.main.ITEM_POWER
local pet = target:getPet()

if not pet then
return
end

local percent = math.random(20, 35) * xi.settings.main.ITEM_POWER
local totalHP = (pet:getMaxHP() / 100) * percent
pet:addHP(totalHP)
pet:messageBasic(xi.msg.basic.RECOVERS_HP, 0, totalHP)
Expand Down
4 changes: 2 additions & 2 deletions scripts/items/chunk_of_smelling_salts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ local itemObject = {}

itemObject.onItemCheck = function(target, item, param, caster)
local pet = target:getPet()
if pet == nil then

if not pet then
return xi.msg.basic.REQUIRES_A_PET
elseif pet:hasStatusEffect(xi.effect.MEDICINE) then
return xi.msg.basic.ITEM_NO_USE_MEDICATED
Expand All @@ -21,7 +22,6 @@ end
itemObject.onItemUse = function(target)
if target:addStatusEffect(xi.effect.MEDICINE, 0, 0, 180, 5320) then
local pet = target:getPet()

if not pet then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/items/cirrocumulus_cell.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ end

itemObject.onItemUse = function(target)
local encumbrance = target:getStatusEffect(xi.effect.ENCUMBRANCE_I)

if not encumbrance then
return
end
Expand Down
2 changes: 0 additions & 2 deletions scripts/items/qiqirn_mine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ end

itemObject.onItemUse = function(target)
local instance = target:getInstance()

if not instance then
return
end

local bomb = instance:insertAlly(100)

if not bomb then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/items/scapegoat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ itemObject.onItemUse = function(target)

if target:hasStatusEffect(xi.effect.RERAISE) then
local effect = target:getStatusEffect(xi.effect.RERAISE)

if not effect then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/items/scroll_of_instant_reraise.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ itemObject.onItemUse = function(target)
local duration = 1800
if target:hasStatusEffect(xi.effect.RERAISE) then
local effect = target:getStatusEffect(xi.effect.RERAISE)

if not effect then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/items/tube_of_healing_salve_i.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ end

itemObject.onItemUse = function(target)
local pet = target:getPet()

if not pet then
return
end
Expand Down
1 change: 0 additions & 1 deletion scripts/items/tube_of_healing_salve_ii.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ end

itemObject.onItemUse = function(target)
local pet = target:getPet()

if not pet then
return
end
Expand Down
3 changes: 1 addition & 2 deletions scripts/missions/wotg/19_Betrayal_at_Beaucedine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ mission.sections =
if missionStatus == 0 then
return mission:progressEvent(15, 136, 300, 200, 100, 0, 9306122, 0, 0)
elseif missionStatus == 1 then
local zoneObj = player:getZone()

local zoneObj = player:getZone()
if not zoneObj then
return
end
Expand Down
2 changes: 0 additions & 2 deletions scripts/quests/outlands/Forge_Your_Destiny.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ quest.sections =
return quest:messageSpecial(konschtatID.text.BLACKENED_NOTHING_HAPPENS, xi.item.LUMP_OF_ORIENTAL_STEEL)
else
local forgerMob = SpawnMob(konschtatID.mob.FORGER)

if not forgerMob then
return quest:noAction()
end
Expand Down Expand Up @@ -246,7 +245,6 @@ quest.sections =
return quest:messageSpecial(zitahID.text.STRANGE_FORCE_PREVENTS)
else
local treantMob = SpawnMob(zitahID.mob.GUARDIAN_TREANT)

if not treantMob then
return quest:noAction()
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/specs/types/Container.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
---@alias onZoneHandler fun(player: CBaseEntity): TAction?

---@class onTriggerAreaHandler
---@field [integer] fun(player: CBaseEntity, triggerArea: CTriggerArea): TAction?
---@field [integer] fun(player: CBaseEntity, triggerArea: CTriggerArea, optInstance: CInstance?): TAction?

---@class EntitySection
---@field onTrade? TAction|fun(player: CBaseEntity, npc: CBaseEntity, trade: CTradeContainer): TAction?
Expand Down
Loading

0 comments on commit 1b174fb

Please sign in to comment.