Skip to content

Commit

Permalink
Merge pull request #6204 from LandSandBoat/lls/mobentity
Browse files Browse the repository at this point in the history
[LLS] Add TMobEntity type, annotate mob scripts, correct issues identified
  • Loading branch information
claywar authored Sep 2, 2024
2 parents c0ea86d + ee3015c commit 5ceaed6
Show file tree
Hide file tree
Showing 3,755 changed files with 4,204 additions and 207 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
8 changes: 4 additions & 4 deletions scripts/enum/magic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ xi.magic.spellFlag =
-- Spell AOE IDs
-----------------------------------

---@enum xi.aoe
---@enum xi.magic.aoe
xi.magic.aoe =
{
NONE = 0,
Expand All @@ -34,7 +34,7 @@ xi.magic.aoe =
-- Spell Groups
-----------------------------------

---@enum xi.spellGroup
---@enum xi.magic.spellGroup
xi.magic.spellGroup =
{
NONE = 0,
Expand All @@ -52,7 +52,7 @@ xi.magic.spellGroup =
-- Spell Families
-----------------------------------

---@enum xi.spellFamily
---@enum xi.magic.spellFamily
xi.magic.spellFamily =
{
NONE = 0,
Expand Down Expand Up @@ -218,7 +218,7 @@ xi.magic.spellFamily =
-- Spell IDs
-----------------------------------

---@enum xi.spell
---@enum xi.magic.spell
xi.magic.spell =
{
CURE = 1,
Expand Down
30 changes: 30 additions & 0 deletions scripts/specs/types/MobEntity.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---@meta

---@class TMobEntity
---@field onMobInitialize? fun(mob: CBaseEntity)
---@field onPath? fun(mob: CBaseEntity)
---@field onPathPoint? fun(mob: CBaseEntity)
---@field onPathComplete? fun(mob: CBaseEntity)
---@field onMobEngage? fun(mob: CBaseEntity, target: CBaseEntity)
---@field onMobDisengage? fun(mob: CBaseEntity)
---@field onMobFollow? fun(mob: CBaseEntity, target: CBaseEntity)
---@field onMobUnfollow? fun(mob: CBaseEntity, target: CBaseEntity)
---@field onMobDrawIn? fun(mob: CBaseEntity, target: CBaseEntity)
---@field onMobFight? fun(mob: CBaseEntity, target: CBaseEntity)
---@field onCriticalHit? fun(mob: CBaseEntity, attacker: CBaseEntity?)
---@field onMobDeath? fun(mob: CBaseEntity, killer: CBaseEntity?, optParams: { isKiller: boolean, noKiller: boolean, isWeaponSkillKill: boolean, weaponskillUsed: xi.weaponskill, weaponskillDamage: integer })
---@field onMobSpawn? fun(mob: CBaseEntity)
---@field onMobRoamAction? fun(mob: CBaseEntity)
---@field onMobRoam? fun(mob: CBaseEntity)
---@field onMobDespawn? fun(mob: CBaseEntity)
---@field onMobWeaponSkillPrepare? fun(mob: CBaseEntity, target: CBaseEntity): integer?
---@field onMobWeaponSkill? fun(target: CBaseEntity, mob: CBaseEntity, mobSkill: CMobSkill, action: CAction): integer?
---@field onMobSkillTarget? fun(target: CBaseEntity, mob: CBaseEntity, mobSkill: CMobSkill): CBaseEntity?
---@field onAdditionalEffect? fun(mob: CBaseEntity, target: CBaseEntity, damage: integer): (integer?, integer?, integer?)
---@field onMobMagicPrepare? fun(mob: CBaseEntity, target: CBaseEntity, spell: CSpell?): xi.magic.spell|0?
---@field onWeaponskillHit? fun(mob: CBaseEntity, attacker: CBaseEntity, weaponskillId: xi.weaponskill)
---@field onSpikesDamage? fun(mob: CBaseEntity, target: CBaseEntity, damage: integer): (integer?, integer?, integer?)
---@field onMagicHit? fun(caster: CBaseEntity, target: CBaseEntity, spell: CSpell)
---@field onSpellPrecast? fun(mob: CBaseEntity, spell: CSpell)
---@field onSteal? fun(player: CBaseEntity, target: CBaseEntity, ability: CAbility, action: CAction): integer?
---@field onMagicCastingCheck? fun(mob: CBaseEntity, target: CBaseEntity, spell: CSpell): integer?
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/mobs/Desert_Puk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/puk') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobInitialize = function(mob)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/mobs/Rani.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea - Altepa
-- NM: Rani
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobFight = function(mob, target)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Attohwa/mobs/Funnel_Antlion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/antlion_ambush') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobDeath = function(mob, player, optParams)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Attohwa/mobs/Murrain_Chigoe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- Mob: Murrain Chigoe
-- Note: This mob does not need chigoe mixin
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobInitialize = function(mob)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Attohwa/mobs/Tunga.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/chigoe_nm') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobInitialize = function(mob)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Konschtat/mobs/Bakka.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/imp') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobDeath = function(mob, player, optParams)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Konschtat/mobs/Balaur.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-- TODO: When its HP is under 50%, Balaur has a chance to gain
-- a spikes effect after using Breath attacks (matches element of breath)
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobFight = function(mob, target)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Konschtat/mobs/Dapifer_Imp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/imp') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobDeath = function(mob, player, optParams)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Konschtat/mobs/Eccentric_Eve.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea - Konschtat (15)
-- NM: Eccentric Eve
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobDeath = function(mob, player, optParams)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Konschtat/mobs/Fistule.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- Mob: Fistule
-- Note: Spawn by dissolve Guimauve, Bloodguzzler or Lentor
-----------------------------------
---@type TMobEntity
local entity = {}

local getNearestMob = function(fistule, mobs)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Konschtat/mobs/Kukulkan.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/peiste') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobDeath = function(mob, player, optParams)
Expand Down
3 changes: 2 additions & 1 deletion scripts/zones/Abyssea-Konschtat/mobs/Lachrymater.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
-- Area: Abyssea-Konschtat
-- NM: Lachrymater
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobSpawn = function(mob, target)
entity.onMobSpawn = function(mob)
local DayOfTheWeek = VanadielDayOfTheWeek()

mob:setSpellList(188 + DayOfTheWeek)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Konschtat/mobs/Turul.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/amphiptere') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobFight = function(mob, target)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-La_Theine/mobs/Briareus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/rage') }
-----------------------------------
---@type TMobEntity
local entity = {}

local useMeikyoShisui = function(mob)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-La_Theine/mobs/Crepuscule_Puk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/puk') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobInitialize = function(mob)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-La_Theine/mobs/Luison.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/gnole') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobDeath = function(mob, player, optParams)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-La_Theine/mobs/Piasa.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea - La Theine
-- NM: Piasa
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobInitialize = function(mob)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Tahrongi/mobs/Bog_Body.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/qutrub') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobDeath = function(mob, player, optParams)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Tahrongi/mobs/Iratham.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea - Tahrongi
-- NM: Iratham
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobFight = function(mob, target)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Tahrongi/mobs/Manananggal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/qutrub') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobDeath = function(mob, player, optParams)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Uleguerand/mobs/Chillwing_Hwitti.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/imp') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobDeath = function(mob, player, optParams)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Uleguerand/mobs/Ermit_Imp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/imp') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobDeath = function(mob, player, optParams)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Vunkerl/mobs/Clammy_Imp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/imp') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobDeath = function(mob, player, optParams)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Vunkerl/mobs/Div-e_Sepid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/imp') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobDeath = function(mob, player, optParams)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Vunkerl/mobs/Peapuk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/puk') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobInitialize = function(mob)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Vunkerl/mobs/Sippoy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea - Vunkerl
-- NM: Sippoy
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobFight = function(mob, target)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/AlTaieu/mobs/Absolute_Virtue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
local ID = zones[xi.zone.ALTAIEU]
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobSpawn = function(mob)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/AlTaieu/mobs/Aweuvhi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
local ID = zones[xi.zone.ALTAIEU]
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobInitialize = function(mob)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/AlTaieu/mobs/Jailer_of_Hope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/job_special') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobInitialize = function(mob)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/AlTaieu/mobs/Jailer_of_Justice.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Al'Taieu
-- NM: Jailer of Justice
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobFight = function(mob, target)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/AlTaieu/mobs/Jailer_of_Love.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
-----------------------------------
local ID = zones[xi.zone.ALTAIEU]
-----------------------------------
---@type TMobEntity
local entity = {}

local minionGroup =
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/AlTaieu/mobs/Jailer_of_Prudence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
local ID = zones[xi.zone.ALTAIEU]
mixins = { require('scripts/mixins/job_special') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobInitialize = function(mob)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/AlTaieu/mobs/Omaern.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/aern') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobDeath = function(mob, player, optParams)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/AlTaieu/mobs/Omhpemde.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/hpemde') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobDeath = function(mob, player, optParams)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/AlTaieu/mobs/Omphuabo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-----------------------------------
mixins = { require('scripts/mixins/families/phuabo') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobDeath = function(mob, player, optParams)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/AlTaieu/mobs/Omxzomit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
mixins = { require('scripts/mixins/follow') }
local ID = zones[xi.zone.ALTAIEU]
-----------------------------------
---@type TMobEntity
local entity = {}

local leaders =
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/AlTaieu/mobs/Omyovra.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Al'Taieu
-- Mob: Om'yovra
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobSpawn = function(mob)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/AlTaieu/mobs/Qnhpemde.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
-----------------------------------
local ID = zones[xi.zone.ALTAIEU]
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobSpawn = function(mob)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/AlTaieu/mobs/Qnxzomit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
mixins = { require('scripts/mixins/job_special') }
local ID = zones[xi.zone.ALTAIEU]
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobDeath = function(mob, player, optParams)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/AlTaieu/mobs/Ruaern.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
-----------------------------------
mixins = { require('scripts/mixins/job_special') }
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobInitialize = function(mob)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/AlTaieu/mobs/Ruphuabo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- Mob: Ru'phuabo
-- Jailor of Love Pet version
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobDeath = function(mob, player, optParams)
Expand Down
Loading

0 comments on commit 5ceaed6

Please sign in to comment.