Add C_PetBattles module with comprehensive pet battle functions and methods

This commit is contained in:
2025-05-17 19:19:34 +02:00
parent 6cb045f3d9
commit 80f16398e1
57 changed files with 264 additions and 338 deletions

264
C_PetBattles.lua Normal file
View File

@@ -0,0 +1,264 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@class C_PetBattles
C_PetBattles = {
---@return nil
AcceptPVPDuel = function() end,
---@return nil
AcceptQueuedPVPMatch = function() end,
---@return boolean canAccept
CanAcceptQueuedPVPMatch = function() end,
---@return boolean usable
CanActivePetSwapOut = function() end,
---@param petIndex number
---@return nil
CanPetSwapIn = function(petIndex) end,
---@return nil
CancelPVPDuel = function() end,
---@param petIndex number
---@return nil
ChangePet = function(petIndex) end,
---@return nil
DeclineQueuedPVPMatch = function() end,
---@return nil
ForfeitGame = function() end,
---@param abilityID number
---@param turnIndex number
---@param effectIndex number
---@param effectName string
---@return number value
GetAbilityEffectInfo = function(abilityID, turnIndex, effectIndex, effectName) end,
---@param id number
---@return number id
---@return string name
---@return string icon
---@return number maxCooldown
---@return string unparsedDescription
---@return number numTurns
---@return number petType
---@return boolean noStrongWeakHints
GetAbilityInfoByID = function(id) end,
---@param petOwner ownerType
---@param petIndex number
---@param abilityIndex number
---@return number id
---@return string name
---@return string icon
---@return number maxCooldown
---@return string unparsedDescription
---@return number numTurns
---@return number petType
---@return boolean noStrongWeakHints
GetAbilityInfo = function(petOwner, petIndex, abilityIndex) end,
---@param abilityID number
---@param procType number
---@return number turnIndex
GetAbilityProcTurnIndex = function(abilityID, procType) end,
---@param abilityID number
---@param stateID number
---@return number abilityStateMod
GetAbilityStateModification = function(abilityID, stateID) end,
---@param petOwner ownerType
---@param petIndex number
---@param actionIndex number
---@return boolean isUsable
---@return number currentCooldown
---@return number currentLockdown
GetAbilityState = function(petOwner, petIndex, actionIndex) end,
---@param petOwner number
---@return number petIndex
GetActivePet = function(petOwner) end,
---@return table
GetAllEffectNames = function() end,
---@param stateEnv table
---@return number
GetAllStates = function(stateEnv) end,
---@param petType number
---@param enemyPetType number
---@return number modifier
GetAttackModifier = function(petType, enemyPetType) end,
---@param petOwner ownerType
---@param petIndex number
---@param auraIndex number
---@return number auraID
---@return number instanceID
---@return number turnsRemaining
---@return boolean isBuff
GetAuraInfo = function(petOwner, petIndex, auraIndex) end,
---@return number battleState
GetBattleState = function() end,
---@param petOwner ownerType
---@param slot number
---@return number quality
GetBreedQuality = function(petOwner, slot) end,
---@param petOwner ownerType
---@param petIndex number
---@return number displayID
GetDisplayID = function(petOwner, petIndex) end,
---@return number forfeitPenalty
GetForfeitPenalty = function() end,
---@param petOwner ownerType
---@param petIndex number
---@return number health
GetHealth = function(petOwner, petIndex) end,
---@param petOwner ownerType
---@param slot number
---@return number iconFileID
GetIcon = function(petOwner, slot) end,
---@param petOwner ownerType
---@param petIndex number
---@return number level
GetLevel = function(petOwner, petIndex) end,
---@param petOwner ownerType
---@param petIndex number
---@return number maxHealth
GetMaxHealth = function(petOwner, petIndex) end,
---@param petOwner ownerType
---@param slot number
---@return string customName
---@return string speciesName
GetName = function(petOwner, slot) end,
---@param petOwner ownerType
---@param petIndex number
---@return number numAuras
GetNumAuras = function(petOwner, petIndex) end,
---@alias ownerType
---| 1 The player
---| 2 The opponent
---@param petOwner ownerType
---@return number numPets
GetNumPets = function(petOwner) end,
---@return string queueState
---@return number estimatedTime
---@return number queuedTime
GetPVPMatchmakingInfo = function() end,
---@param petOwner number
---@param petIndex number
---@return number speciesID
GetPetSpeciesID = function(petOwner, petIndex) end,
---@param petOwner number
---@param petIndex number
---@return number petType
GetPetType = function(petOwner, petIndex) end,
---@return number trapAbilityID
GetPlayerTrapAbility = function() end,
---@param petOwner number
---@param petIndex number
---@return number power
GetPower = function(petOwner, petIndex) end,
---@alias selectedActionType
---| 2 Ability
---| 3 Switch Pet
---| 4 Trap
---| 5 Skip Turn
---@return selectedActionType selectedActionType
---@return number selectedActionIndex
GetSelectedAction = function() end,
---@param petOwner number
---@param petIndex number
---@return number speed
GetSpeed = function(petOwner, petIndex) end,
---@param petOwner number
---@param petIndex number
---@param stateID number
---@return number stateValue
GetStateValue = function(petOwner, petIndex, stateID) end,
---@return number timeRemaining
---@return number turnTime
GetTurnTimeInfo = function() end,
---@param petOwner number
---@param petIndex number
---@return number xp
---@return number maxXp
GetXP = function(petOwner, petIndex) end,
---@return boolean inBattle
IsInBattle = function() end,
---@param player string
---@return boolean isPlayerNPC
IsPlayerNPC = function(player) end,
---@return boolean usable
IsSkipAvailable = function() end,
---@return boolean usable
IsTrapAvailable = function() end,
---@return boolean isWaiting
IsWaitingOnOpponent = function() end,
---@return boolean isWildBattle
IsWildBattle = function() end,
---@param petIndex number
SetPendingReportBattlePetTarget = function(petIndex) end,
---@param unit string
SetPendingReportTargetFromUnit = function(unit) end,
---@return boolean shouldShow
ShouldShowPetSelect = function() end,
---@return nil
SkipTurn = function() end, -- #hwevent
---@return nil
StartPVPDuel = function() end,
---@return nil
StartPVPMatchmaking = function() end,
---@return nil
StopPVPMatchmaking = function() end,
---@param actionIndex number
---@return nil
UseAbility = function(actionIndex) end, -- #hwevent
---@return nil
UseTrap = function() end, -- #hwevent
}

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.AcceptPVPDuel() end

View File

@@ -1,5 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---Accepts a found Pet Battle Queue.
function C_PetBattles.AcceptQueuedPVPMatch() end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.CanAcceptQueuedPVPMatch() end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.CanActivePetSwapOut() end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.CanPetSwapIn() end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.CancelPVPDuel() end

View File

@@ -1,6 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param id number
---Attempts to change your active pet. Has no effect if used when this switch isn't impossible (out of turn, with the ID of a dead pet, etc.).
function C_PetBattles.ChangePet(id) end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.DeclineQueuedPVPMatch() end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.ForfeitGame() end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.GetAbilityEffectInfo() end

View File

@@ -1,18 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param owner 2
---@param 1
---@param 2
---@param slotnumber number
---@param spellIndex number
---@return number id
---@return string name
---@return string icon
---@return number maxcooldown
---@return string desc
---@return number numTurns
---@return number abilityPetType
---@return boolean nostrongweak
---Returns information on a battle pet's ability
function C_PetBattles.GetAbilityInfo(owner, 1, 2, slotnumber, spellIndex) end

View File

@@ -1,14 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param id number
---@return nil
---@return string name
---@return string icon
---@return nil
---@return nil
---@return nil
---@return number? petType
---@return boolean nostrongweakhint
---Returns information about a pet battle ability based on the ID.
function C_PetBattles.GetAbilityInfoByID(id) end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.GetAbilityProcTurnIndex() end

View File

@@ -1,12 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param owner 2
---@param 1
---@param 2
---@param slotnumber number
---@param spellIndex number
---@return boolean isUsable
---@return number currentCooldown
---Returns the cooldown state of a pet ability
function C_PetBattles.GetAbilityState(owner, 1, 2, slotnumber, spellIndex) end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.GetAbilityStateModification() end

View File

@@ -1,9 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param owner 2
---@param 1
---@param 2
---@return number index
---Returns the index of the currently active pet.
function C_PetBattles.GetActivePet(owner, 1, 2) end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.GetAllEffectNames() end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.GetAllStates() end

View File

@@ -1,7 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param YourType number?
---@param EnemyType number?
---Returns the modification to attacks based on types.
function C_PetBattles.GetAttackModifier(YourType, EnemyType) end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.GetAuraInfo() end

View File

@@ -1,10 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@return 7 battleState
---@return 2
---@return 3
---@return 4
---@return 7
---Returns the current battle state.
function C_PetBattles.GetBattleState() end

View File

@@ -1,8 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param petOwner number
---@param petIndex number
---@return number quality
---Returns the breed quality of a pet.
function C_PetBattles.GetBreedQuality(petOwner, petIndex) end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.GetDisplayID() end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.GetForfeitPenalty() end

View File

@@ -1,8 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param petOwner number
---@param petIndex number
---@return number health
---Returns the current health of a specific pet in the current pet battle.
function C_PetBattles.GetHealth(petOwner, petIndex) end

View File

@@ -1,10 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param owner 2
---@param 1
---@param 2
---@param index number
---@return string icon
---Returns the path of a pet's icon texture.
function C_PetBattles.GetIcon(owner, 1, 2, index) end

View File

@@ -1,8 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param petOwner number
---@param petIndex number
---@return number level
---Returns the level of a pet
function C_PetBattles.GetLevel(petOwner, petIndex) end

View File

@@ -1,8 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param petOwner number
---@param petIndex number
---@return number maxHealth
---Returns the maximum health of a specific pet in the current pet battle.
function C_PetBattles.GetMaxHealth(petOwner, petIndex) end

View File

@@ -1,9 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param owner number?
---@param index number
---@return string name
---@return string default
---Returns the name of a pet
function C_PetBattles.GetName(owner, index) end

View File

@@ -1,8 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param owner string?
---@param index number
---@return number auras
---Returns the number of auras on a pet
function C_PetBattles.GetNumAuras(owner, index) end

View File

@@ -1,9 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param owner 2
---@param 1
---@param 2
---@return number amount
---Returns the number of pets a player/enemy has.
function C_PetBattles.GetNumPets(owner, 1, 2) end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.GetPVPMatchmakingInfo() end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.GetPetSpeciesID() end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.GetPetType() end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.GetPlayerTrapAbility() end

View File

@@ -1,7 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param owner number
---@param index number
---Returns the power of a pet.
function C_PetBattles.GetPower(owner, index) end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.GetSelectedAction() end

View File

@@ -1,10 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param owner 2
---@param 1
---@param 2
---@param index number
---@return number speed
---Returns the speed of a pet.
function C_PetBattles.GetSpeed(owner, 1, 2, index) end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.GetStateValue() end

View File

@@ -1,7 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@return number timeRemaining
---@return number totalTime
---Returns the remaining time and max time for waiting on a turn
function C_PetBattles.GetTurnTimeInfo() end

View File

@@ -1,9 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param owner string?
---@param index number
---@return number xp
---@return number maxXP
---Returns the current and maximum experience of a pet
function C_PetBattles.GetXP(owner, index) end

View File

@@ -1,5 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---Returns true during a pet battle
function C_PetBattles.IsInBattle() end

View File

@@ -1,7 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param player string?
---@return boolean isnpc
---Returns whether a participant in a pet battle is a player or an NPC
function C_PetBattles.IsPlayerNPC(player) end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.IsSkipAvailable() end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.IsTrapAvailable() end

View File

@@ -1,6 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@return boolean waiting
---Returns whether or not you are waiting on the opponent
function C_PetBattles.IsWaitingOnOpponent() end

View File

@@ -1,6 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@return boolean isWild
---Returns whether or not in wild battle.. Returns true if the pet battle is against a wild pet.
function C_PetBattles.IsWildBattle() end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.SetPendingReportBattlePetTarget() end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.SetPendingReportTargetFromUnit() end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.ShouldShowPetSelect() end

View File

@@ -1,5 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---Does a pass on your turn for a round.
function C_PetBattles.SkipTurn() end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.StartPVPDuel() end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.StartPVPMatchmaking() end

View File

@@ -1,4 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
function C_PetBattles.StopPVPMatchmaking() end

View File

@@ -1,6 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---@param id number
---Uses an ability.
function C_PetBattles.UseAbility(id) end

View File

@@ -1,5 +0,0 @@
---@diagnostic disable: missing-return, lowercase-global
---@meta
---Throws the trap if the target pet has low enough health. Always uses best trap.
function C_PetBattles.UseTrap() end