Added new methods and types from mod-eluna updates

This commit is contained in:
2024-03-03 01:04:10 -05:00
parent e2e621cd73
commit 1b553ffd81
4 changed files with 175 additions and 12 deletions

83
types/ac.d.ts vendored
View File

@@ -250,6 +250,41 @@ declare const enum WeatherState {
WEATHER_STATE_BLACKSNOW = 106,
}
declare const enum MechanicType {
MECHANIC_NONE = 0,
MECHANIC_CHARM = 1,
MECHANIC_DISORIENTED = 2,
MECHANIC_DISARM = 3,
MECHANIC_DISTRACT = 4,
MECHANIC_FEAR = 5,
MECHANIC_GRIP = 6,
MECHANIC_ROOT = 7,
MECHANIC_SLOW_ATTACK = 8,
MECHANIC_SILENCE = 9,
MECHANIC_SLEEP = 10,
MECHANIC_SNARE = 11,
MECHANIC_STUN = 12,
MECHANIC_FREEZE = 13,
MECHANIC_KNOCKOUT = 14,
MECHANIC_BLEED = 15,
MECHANIC_BANDAGE = 16,
MECHANIC_POLYMORPH = 17,
MECHANIC_BANISH = 18,
MECHANIC_SHIELD = 19,
MECHANIC_SHACKLE = 20,
MECHANIC_MOUNT = 21,
MECHANIC_INFECTED = 22,
MECHANIC_TURN = 23,
MECHANIC_HORROR = 24,
MECHANIC_INVULNERABILITY = 25,
MECHANIC_INTERRUPT = 26,
MECHANIC_DAZE = 27,
MECHANIC_DISCOVERY = 28,
MECHANIC_IMMUNE_SHIELD = 29, // Divine (Blessing) Shield/Protection and Ice Block
MECHANIC_SAPPED = 30,
MECHANIC_ENRAGED = 31
}
declare const enum ShutdownExitCode {
SHUTDOWN_EXIT_CODE = 0,
ERROR_EXIT_CODE = 1,
@@ -261,7 +296,7 @@ declare const enum ShutdownMask {
SHUTDOWN_MASK_IDLE = 2,
}
declare const BotEquipmentSlotMap = {
declare const BotEquipmentSlotMap: {
MAINHAND: 0,
OFFHAND: 1,
RANGED: 2,
@@ -280,12 +315,12 @@ declare const BotEquipmentSlotMap = {
TRINKET1: 15,
TRINKET2: 16,
NECK: 17,
} as const;
}
declare type BotEquipmentSlotName = keyof typeof BotEquipmentSlotMap;
declare type BotEquipmentSlotNum = typeof BotEquipmentSlotMap[BotEquipmentSlotName];
declare const BotStatMap = {
declare const BotStatMap: {
MANA: 0,
HEALTH: 1,
AGILITY: 3,
@@ -341,12 +376,46 @@ declare const BotStatMap = {
RESIST_ARCANE: 57,
EXPERTISE: 58,
MAX_BOT_ITEM_MOD: 59,
BOT_STAT_MOD_RESISTANCE_START: 51, // Assuming BOT_STAT_MOD_ARMOR is defined somewhere
} as const;
BOT_STAT_MOD_RESISTANCE_START: 51,
}
declare const enum StatModType {
STRENGTH = 0,
AGILITY = 1,
STAMINA = 2,
INTELLECT = 3,
SPIRIT = 4,
HEALTH = 5,
MANA = 6,
RAGE = 7,
FOCUS = 8,
ENERGY = 9,
HAPPINESS = 10,
RUNE = 11,
RUNIC_POWER = 12,
ARMOR = 13,
RESISTANCE_HOLY = 14,
RESISTANCE_FIRE = 15,
RESISTANCE_NATURE = 16,
RESISTANCE_FROST = 17,
RESISTANCE_SHADOW = 18,
RESISTANCE_ARCANE = 19,
ATTACK_POWER = 20,
ATTACK_POWER_RANGED = 21,
DAMAGE_MAINHAND = 22,
DAMAGE_OFFHAND = 23,
DAMAGE_RANGED = 24,
}
declare const enum StatModifierType {
BASE_VALUE = 0,
BASE_PCT = 1,
TOTAL_VALUE = 2,
TOTAL_PCT = 3,
}
declare type BotStatTypeName = keyof typeof BotStatMap;
declare type BotStatTypeNum = BotStatMap[BotStatTypeName];
declare type BotStatTypeNum = typeof BotStatMap[BotStatTypeName];
declare type ClassName =
| "WARRIOR"

98
types/global.d.ts vendored
View File

@@ -1,3 +1,5 @@
import { AssertEntry } from "typescript";
declare type HookFunction = (event:number, ...args: any[]) => any
declare type HookFunctionNoSelf<T extends HookFunction> = T extends (...a: infer U) => infer R ? (this: void, ...a:U) => R: never;
@@ -3766,6 +3768,11 @@ declare class Player extends Unit {
*/
GetComboTarget(): Unit;
/**
* Returns the total number of completed quests
*/
GetCompletedQuestCount(): number;
/**
* Returns the [Player]s [Corpse] object
*/
@@ -4189,6 +4196,27 @@ declare class Player extends Unit {
*/
HasTitle(titleId: number): boolean;
/**
* The [Player] has a melee talent spec
* @returns boolean
*/
HasMeleeSpec(): boolean;
/**
* The [Player] has a tank talent spec
*/
HasTankSpec(): boolean;
/**
* The [Player] has a healer talent spec
*/
HasHealSpec(): boolean;
/**
* The [Player] has a caster talent spec
*/
HasCasterSpec(): boolean;
/**
* Returns 'true' if the [Player] is currently in an arena, 'false' otherwise.
*/
@@ -4927,6 +4955,13 @@ declare class Spell {
*/
GetPowerCost(): number;
/**
* Returns the list of regeant needed to cast the spell.
* The list is an array of objects with the following structure:
* @returns { ItemTemplateId: number : Count: number }[]
*/
GetReagentCost(): Record<number, number>[]
/**
* Returns the target [Object] of the [Spell].
* The target can be any of the following [Object] types:
@@ -5455,6 +5490,17 @@ declare class Unit extends WorldObject {
*/
GetVictim(): Unit;
/**
* The [Unit] modifies a specific stat
*
* @param int32 stat : The stat to modify
* @param int8 type : The type of modifier to apply
* @param float value : The value to apply to the stat
* @param bool apply = false : Whether the modifier should be applied or removed
* @return bool : Whether the stat modification was successful
*/
HandleStatModifier(stat: StatModType, type: StatModifierType, value: number, apply?: boolean): boolean;
/**
* Returns true if the [Unit] has an aura from the given spell entry.
*/
@@ -5847,11 +5893,20 @@ declare class Unit extends WorldObject {
*/
SetHealth(health: number): void;
/**
* Set Immunt To a specific type of damage for the [Unit]
* @see MechanicType
* @param int32 immunity : new value for the immunity mask
* @param bool apply = true : if true, the immunity is applied, otherwise it is removed
*/
SetImmuneTo(immunity: number, apply?: boolean): void;
/**
* Sets the [Unit]'s level.
*/
SetLevel(level: number): void;
/**
* Sets the [Unit]'s max health.
*/
@@ -6329,11 +6384,44 @@ declare class WorldObject extends EObject {
* }, {1000,10000}, 0); // do it after 1 to 10 seconds forever
*
*/
RegisterEvent(
func: <T extends WorldObject>(delay: number | [number, number], repeats: number, worldobj: typeof T) => any,
delay: number | [number, number],
repeats?: number,
): number;
// RegisterEvent(
// func: <T extends WorldObject>(delay: number | [number, number], repeats: number, worldobj: typeof T) => any,
// delay: number | [number, number],
// repeats?: number,
// ): number;
RegisterEvent<T extends WorldObject>(
func: (delay: number | [number, number], repeats: number, worldobj: T) => any,
delay: number | [number, number],
repeats?: number,
): number;
// Overload for Unit
RegisterEvent(
func: (delay: number | [number, number], repeats: number, worldobj: Unit) => any,
delay: number | [number, number],
repeats?: number,
): number;
// Overload for Creature
RegisterEvent(
func: (delay: number | [number, number], repeats: number, worldobj: Creature) => any,
delay: number | [number, number],
repeats?: number,
): number;
// Overload for Player
RegisterEvent(
func: (delay: number | [number, number], repeats: number, worldobj: Player) => any,
delay: number | [number, number],
repeats?: number,
): number;
// Implementation of the function
RegisterEvent(
func: (delay: number | [number, number], repeats: number, worldobj: WorldObject | Unit | Creature | Player) => any,
delay: number | [number, number],
repeats?: number,
): number;
/**
* Removes the timed event from a [WorldObject] by the specified event ID

View File

@@ -1,3 +1,5 @@
import { Group, GroupEvents } from "../global";
declare type group_event_on_member_add = (
event: GroupEvents.GROUP_EVENT_ON_MEMBER_ADD,
group: Group,
@@ -17,6 +19,8 @@ declare type group_event_on_member_remove = (
method: number,
) => void;
declare type group_event_on_leader_change = (
event: GroupEvents.GROUP_EVENT_ON_LEADER_CHANGE,
group: Group,

View File

@@ -1,3 +1,5 @@
/// <reference path="../global.d.ts" />
declare type player_event_on_learn_talents = (
event: PlayerEvents.PLAYER_EVENT_ON_LEARN_TALENTS,
pPlayer: Player,