Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LLS] Add NPC Entity Type, annotate NPC scripts, correct issues identified #6202

Merged
merged 8 commits into from
Sep 2, 2024
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
28 changes: 28 additions & 0 deletions scripts/enum/item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4195,6 +4195,13 @@ xi.item =
DRACHEN_MAIL = 12649,
EVOKERS_DOUBLET = 12650,
MERCENARYS_GI = 12653,
CUSTOM_TUNIC = 12654,
CUSTOM_VEST = 12655,
MAGNA_JERKIN = 12656,
MAGNA_BODICE = 12657,
WONDER_KAFTAN = 12658,
SAVAGE_SEPARATES = 12659,
ELDERS_SURCOAT = 12660,
GAUNTLETS = 12672,
KOENIG_HANDSCHUHS = 12677,
IRON_MUSKETEERS_GAUNTLETS = 12678,
Expand Down Expand Up @@ -4242,6 +4249,13 @@ xi.item =
GALKAN_BRACERS = 12758,
ELVAAN_GAUNTLETS = 12759,
HUME_F_GLOVES = 12760,
CUSTOM_M_GLOVES = 12761,
CUSTOM_F_GLOVES = 12762,
MAGNA_GAUNTLETS = 12763,
MAGNA_GLOVES = 12764,
WONDER_MITTS = 12765,
SAVAGE_GAUNTLETS = 12766,
ELDERS_BRACERS = 12767,
CUISSES = 12800,
MYTHRIL_CUISSES = 12801,
KOENIG_DIECHLINGS = 12805,
Expand Down Expand Up @@ -4284,6 +4298,13 @@ xi.item =
LINEN_SLACKS = 12866,
WHITE_SLACKS = 12867,
COMBAT_CASTERS_SLACKS = 12870,
CUSTOM_SLACKS = 12871,
CUSTOM_PANTS = 12872,
MAGNA_M_CHAUSSES = 12873,
MAGNA_F_CHAUSSES = 12874,
WONDER_BRACCAE = 12875,
SAVAGE_LOINCLOTH = 12876,
ELDERS_BRAGUETTE = 12877,
LEGIONNAIRES_SUBLIGAR = 12881,
ROYAL_FOOTMANS_TROUSERS = 12882,
HUME_SLACKS = 12883,
Expand Down Expand Up @@ -4342,6 +4363,13 @@ xi.item =
POWER_SANDALS = 13012,
STUMBLING_SANDALS = 13013,
LEAPING_BOOTS = 13014,
CUSTOM_M_BOOTS = 13015,
CUSTOM_F_BOOTS = 13016,
MAGNA_M_LEDELSENS = 13017,
MAGNA_F_LEDELSENS = 13018,
WONDER_CLOMPS = 13019,
SAVAGE_GAITERS = 13020,
ELDERS_SANDALS = 13021,
ROYAL_FOOTMANS_CLOGS = 13045,
FUMA_KYAHAN = 13054,
PEACOCK_CHARM = 13056,
Expand Down
24 changes: 22 additions & 2 deletions scripts/specs/core/CBaseEntity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2687,11 +2687,31 @@ end
---@param effectFlag integer?
---@param silent boolean?
---@return boolean
---@overload fun(effectID: integer, effectIcon: integer, power: number, tick: number, duration: number, silent: boolean): boolean
---@overload fun(effectID: integer, effectIcon: integer, power: number, tick: number, duration: number, subType: integer, subPower: integer, silent: boolean): boolean
function CBaseEntity:addStatusEffectEx(effectID, effectIcon, power, tick, duration, subType, subPower, tier, effectFlag, silent)
end

---@param effectID integer
---@param effectIcon integer
---@param power number
---@param tick number
---@param duration number
---@param silent boolean?
---@return boolean
function CBaseEntity:addStatusEffectEx(effectID, effectIcon, power, tick, duration, silent)
end

---@param effectID integer
---@param effectIcon integer
---@param power number
---@param tick number
---@param duration number
---@param subType integer
---@param subPower integer
---@param silent boolean?
---@return boolean
function CBaseEntity:addStatusEffectEx(effectID, effectIcon, power, tick, duration, subType, subPower, silent)
end

---@nodiscard
---@param StatusID integer
---@param SubType integer?
Expand Down
2 changes: 1 addition & 1 deletion scripts/specs/core/CTradeContainer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function CTradeContainer:confirmItem(itemID, amountObj)
end

---@param slotID integer
---@param amountObj integer
---@param amountObj integer?
---@return boolean
function CTradeContainer:confirmSlot(slotID, amountObj)
end
12 changes: 12 additions & 0 deletions scripts/specs/types/NpcEntity.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---@meta

---@class TNpcEntity
---@field onEventUpdate? fun(player: CBaseEntity, csid: integer, option: integer, npc: CBaseEntity)
---@field onEventFinish? fun(player: CBaseEntity, csid: integer, option: integer, npc: CBaseEntity)
---@field onPath? fun(npc: CBaseEntity)
---@field onPathComplete? fun(npc: CBaseEntity)
---@field onPathPoint? fun(npc: CBaseEntity)
---@field onSpawn? fun(npc: CBaseEntity)
---@field onTimeTrigger? fun(npc: CBaseEntity, triggerId: integer)
---@field onTrade? fun(player: CBaseEntity, npc: CBaseEntity, trade: CTradeContainer)
---@field onTrigger? fun(player: CBaseEntity, npc: CBaseEntity): -1|nil
1 change: 1 addition & 0 deletions scripts/zones/Abdhaljs_Isle-Purgonorgo/npcs/Pursuivant.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-- Type: Warp
-- !pos 516.223 -3.038 545.258 44
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/Atma_Fabricant.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Zone: Abyssea - Altepa
-- NPC: Atma Fabricant
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/Atma_Infusionist.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Zone: Abyssea - La-Theine
-- NPC: Atma Infusionist
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/Bonarpant.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea_Altepa
-- NPC: Bonarpant
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/Cavernous_Maw.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-- !pos 444.000 -0.500 320.000 218
-- Notes Teleports Players to South Gustaberg
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/Conflux_Surveyor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Zone: Abyssea - Altepa
-- NPC: Conflux Surveyor
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
3 changes: 2 additions & 1 deletion scripts/zones/Abyssea-Altepa/npcs/Cruor_Prospector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- NPC: Cruor Prospector
-- Type: Cruor NPC
-----------------------------------
---@type TNpcEntity
local entity = {}

---@type TProspectorItems
Expand Down Expand Up @@ -180,7 +181,7 @@ entity.onEventFinish = function(player, csid, option, npc)

if enhanceData[2] <= cruorTotal then
for _, v in ipairs(enhanceData[1]) do
player:addStatusEffectEx(v[1], v[2], v[3] + xi.abyssea.getAbyssiteTotal(player, v[4]) * v[5])
player:addStatusEffectEx(v[1], v[2], v[3] + xi.abyssea.getAbyssiteTotal(player, v[4]) * v[5], 0, 0)

if v[1] == xi.effect.ABYSSEA_HP then
player:addHP(v[3] + xi.abyssea.getAbyssiteTotal(player, v[4]) * v[5])
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/DSgt_Excenmille.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea - Altepa
-- NPC: Dominion Sergeant
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/DSgt_Nanaa.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea - Altepa
-- NPC: Dominion Sergeant
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/DSgt_Volker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea - Altepa
-- NPC: Dominion Sergeant
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/Hildith.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea_Altepa
-- NPC: Hildith
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/Honoi-Gomoi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea_Altepa
-- NPC: Honoi-Gomoi
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/Justinius.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea_Altepa
-- NPC: Justinius
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/Mheca_Khetashipah.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea_Altepa
-- NPC: Mheca Khetashipah
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/Rielle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea_Altepa
-- NPC: Rielle
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/Ronta-Onta.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea_Altepa
-- NPC: Ronta-Onta
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/Sola_Jaab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea_Altepa
-- NPC: Sola Jaab
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/Sturdy_Pyxis.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea
-- NPC: Sturdy Pyxis
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/Taraihi-Perunhi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea_Altepa
-- NPC: Taraihi-Perunhi
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- NPC: Veridical Conflux #01
-- Aybssea Teleport NPC
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- NPC: Veridical Conflux #02
-- Aybssea Teleport NPC
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- NPC: Veridical Conflux #03
-- Aybssea Teleport NPC
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- NPC: Veridical Conflux #04
-- Aybssea Teleport NPC
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- NPC: Veridical Conflux #05
-- Aybssea Teleport NPC
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- NPC: Veridical Conflux #06
-- Aybssea Teleport NPC
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- NPC: Veridical Conflux #07
-- Aybssea Teleport NPC
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- NPC: Veridical Conflux #08
-- Aybssea Teleport NPC
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/Yuhito-Kubhito.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- Area: Abyssea_Altepa
-- NPC: Yuhito-Kubhito
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/qm_amarok.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
-----------------------------------
local ID = zones[xi.zone.ABYSSEA_ALTEPA]
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/qm_bennu_1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
-----------------------------------
local ID = zones[xi.zone.ABYSSEA_ALTEPA]
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/qm_bennu_2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
-----------------------------------
local ID = zones[xi.zone.ABYSSEA_ALTEPA]
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/qm_bennu_3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
-----------------------------------
local ID = zones[xi.zone.ABYSSEA_ALTEPA]
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/qm_bugul_noz.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
-----------------------------------
local ID = zones[xi.zone.ABYSSEA_ALTEPA]
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Abyssea-Altepa/npcs/qm_chickcharney.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
-----------------------------------
local ID = zones[xi.zone.ABYSSEA_ALTEPA]
-----------------------------------
---@type TNpcEntity
local entity = {}

entity.onTrade = function(player, npc, trade)
Expand Down
Loading
Loading