mirror of
https://github.com/araxiaonline/wow-eluna-ts-module.git
synced 2026-06-13 02:42:22 -04:00
Added original types with fixes
This commit is contained in:
262
types/ac.d.ts
vendored
Normal file
262
types/ac.d.ts
vendored
Normal file
@@ -0,0 +1,262 @@
|
||||
declare const enum ChatMsg {
|
||||
CHAT_MSG_ADDON = 0xFFFFFFFF,
|
||||
CHAT_MSG_SYSTEM = 0x00,
|
||||
CHAT_MSG_SAY = 0x01,
|
||||
CHAT_MSG_PARTY = 0x02,
|
||||
CHAT_MSG_RAID = 0x03,
|
||||
CHAT_MSG_GUILD = 0x04,
|
||||
CHAT_MSG_OFFICER = 0x05,
|
||||
CHAT_MSG_YELL = 0x06,
|
||||
CHAT_MSG_WHISPER = 0x07,
|
||||
CHAT_MSG_WHISPER_FOREIGN = 0x08,
|
||||
CHAT_MSG_WHISPER_INFORM = 0x09,
|
||||
CHAT_MSG_EMOTE = 0x0A,
|
||||
CHAT_MSG_TEXT_EMOTE = 0x0B,
|
||||
CHAT_MSG_MONSTER_SAY = 0x0C,
|
||||
CHAT_MSG_MONSTER_PARTY = 0x0D,
|
||||
CHAT_MSG_MONSTER_YELL = 0x0E,
|
||||
CHAT_MSG_MONSTER_WHISPER = 0x0F,
|
||||
CHAT_MSG_MONSTER_EMOTE = 0x10,
|
||||
CHAT_MSG_CHANNEL = 0x11,
|
||||
CHAT_MSG_CHANNEL_JOIN = 0x12,
|
||||
CHAT_MSG_CHANNEL_LEAVE = 0x13,
|
||||
CHAT_MSG_CHANNEL_LIST = 0x14,
|
||||
CHAT_MSG_CHANNEL_NOTICE = 0x15,
|
||||
CHAT_MSG_CHANNEL_NOTICE_USER = 0x16,
|
||||
CHAT_MSG_AFK = 0x17,
|
||||
CHAT_MSG_DND = 0x18,
|
||||
CHAT_MSG_IGNORED = 0x19,
|
||||
CHAT_MSG_SKILL = 0x1A,
|
||||
CHAT_MSG_LOOT = 0x1B,
|
||||
CHAT_MSG_MONEY = 0x1C,
|
||||
CHAT_MSG_OPENING = 0x1D,
|
||||
CHAT_MSG_TRADESKILLS = 0x1E,
|
||||
CHAT_MSG_PET_INFO = 0x1F,
|
||||
CHAT_MSG_COMBAT_MISC_INFO = 0x20,
|
||||
CHAT_MSG_COMBAT_XP_GAIN = 0x21,
|
||||
CHAT_MSG_COMBAT_HONOR_GAIN = 0x22,
|
||||
CHAT_MSG_COMBAT_FACTION_CHANGE = 0x23,
|
||||
CHAT_MSG_BG_SYSTEM_NEUTRAL = 0x24,
|
||||
CHAT_MSG_BG_SYSTEM_ALLIANCE = 0x25,
|
||||
CHAT_MSG_BG_SYSTEM_HORDE = 0x26,
|
||||
CHAT_MSG_RAID_LEADER = 0x27,
|
||||
CHAT_MSG_RAID_WARNING = 0x28,
|
||||
CHAT_MSG_RAID_BOSS_EMOTE = 0x29,
|
||||
CHAT_MSG_RAID_BOSS_WHISPER = 0x2A,
|
||||
CHAT_MSG_FILTERED = 0x2B,
|
||||
CHAT_MSG_BATTLEGROUND = 0x2C,
|
||||
CHAT_MSG_BATTLEGROUND_LEADER = 0x2D,
|
||||
CHAT_MSG_RESTRICTED = 0x2E,
|
||||
CHAT_MSG_BATTLENET = 0x2F,
|
||||
CHAT_MSG_ACHIEVEMENT = 0x30,
|
||||
CHAT_MSG_GUILD_ACHIEVEMENT = 0x31,
|
||||
CHAT_MSG_ARENA_POINTS = 0x32,
|
||||
CHAT_MSG_PARTY_LEADER = 0x33,
|
||||
}
|
||||
|
||||
declare const enum Language {
|
||||
LANG_UNIVERSAL = 0,
|
||||
LANG_ORCISH = 1,
|
||||
LANG_DARNASSIAN = 2,
|
||||
LANG_TAURAHE = 3,
|
||||
LANG_DWARVISH = 6,
|
||||
LANG_COMMON = 7,
|
||||
LANG_DEMONIC = 8,
|
||||
LANG_TITAN = 9,
|
||||
LANG_THALASSIAN = 10,
|
||||
LANG_DRACONIC = 11,
|
||||
LANG_KALIMAG = 12,
|
||||
LANG_GNOMISH = 13,
|
||||
LANG_TROLL = 14,
|
||||
LANG_GUTTERSPEAK = 33,
|
||||
LANG_DRAENEI = 35,
|
||||
LANG_ZOMBIE = 36,
|
||||
LANG_GNOMISH_BINARY = 37,
|
||||
LANG_GOBLIN_BINARY = 38,
|
||||
LANG_ADDON = 0xFFFFFFFF, // used by addons, in 2.4.0 not exist, replaced by messagetype?
|
||||
}
|
||||
|
||||
declare const enum BattleGroundTypeId {
|
||||
BATTLEGROUND_TYPE_NONE = 0, // None
|
||||
BATTLEGROUND_AV = 1, // Alterac Valley
|
||||
BATTLEGROUND_WS = 2, // Warsong Gulch
|
||||
BATTLEGROUND_AB = 3, // Arathi Basin
|
||||
BATTLEGROUND_NA = 4, // Nagrand Arena
|
||||
BATTLEGROUND_BE = 5, // Blade's Edge Arena
|
||||
BATTLEGROUND_AA = 6, // All Arenas
|
||||
BATTLEGROUND_EY = 7, // Eye of the Storm
|
||||
BATTLEGROUND_RL = 8, // Ruins of Lordaernon
|
||||
BATTLEGROUND_SA = 9, // Strand of the Ancients
|
||||
BATTLEGROUND_DS = 10, // Dalaran Sewers
|
||||
BATTLEGROUND_RV = 11, // Ring of Valor
|
||||
BATTLEGROUND_IC = 30, // Isle of Conquest
|
||||
BATTLEGROUND_RB = 32, // Random Battleground
|
||||
}
|
||||
|
||||
declare const enum SpellEffIndex {
|
||||
EFFECT_0 = 0,
|
||||
EFFECT_1 = 1,
|
||||
EFFECT_2 = 2,
|
||||
}
|
||||
|
||||
declare const enum Team {
|
||||
HORDE = 67,
|
||||
ALLIANCE = 469,
|
||||
// TEAM_STEAMWHEEDLE_CARTEL = 169, // not used in code
|
||||
// TEAM_ALLIANCE_FORCES = 891,
|
||||
// TEAM_HORDE_FORCES = 892,
|
||||
// TEAM_SANCTUARY = 936,
|
||||
// TEAM_OUTLAND = 980,
|
||||
TEAM_OTHER = 0, // if ReputationListId > 0 && Flags != FACTION_FLAG_TEAM_HEADER
|
||||
}
|
||||
|
||||
declare const enum GroupType {
|
||||
GROUPTYPE_NORMAL = 0x00,
|
||||
GROUPTYPE_BG = 0x01,
|
||||
GROUPTYPE_RAID = 0x02,
|
||||
GROUPTYPE_BGRAID = GROUPTYPE_BG | GROUPTYPE_RAID, // mask
|
||||
GROUPTYPE_LFG_RESTRICTED = 0x04, // Script_HasLFGRestrictions()
|
||||
GROUPTYPE_LFG = 0x08,
|
||||
// 0x10, leave/change group?, I saw this flag when leaving group and after leaving BG while in group
|
||||
// GROUPTYPE_ONE_PERSON_PARTY = 0x20, 4.x Script_IsOnePersonParty()
|
||||
// GROUPTYPE_EVERYONE_ASSISTANT = 0x40 4.x Script_IsEveryoneAssistant()
|
||||
}
|
||||
|
||||
declare const enum InventoryResult {
|
||||
EQUIP_ERR_OK = 0,
|
||||
EQUIP_ERR_CANT_EQUIP_LEVEL_I = 1,
|
||||
EQUIP_ERR_CANT_EQUIP_SKILL = 2,
|
||||
EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT = 3,
|
||||
EQUIP_ERR_BAG_FULL = 4,
|
||||
EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG = 5,
|
||||
EQUIP_ERR_CANT_TRADE_EQUIP_BAGS = 6,
|
||||
EQUIP_ERR_ONLY_AMMO_CAN_GO_HERE = 7,
|
||||
EQUIP_ERR_NO_REQUIRED_PROFICIENCY = 8,
|
||||
EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE = 9,
|
||||
EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM = 10,
|
||||
EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM2 = 11,
|
||||
EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE2 = 12,
|
||||
EQUIP_ERR_CANT_EQUIP_WITH_TWOHANDED = 13,
|
||||
EQUIP_ERR_CANT_DUAL_WIELD = 14,
|
||||
EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG = 15,
|
||||
EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG2 = 16,
|
||||
EQUIP_ERR_CANT_CARRY_MORE_OF_THIS = 17,
|
||||
EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE3 = 18,
|
||||
EQUIP_ERR_ITEM_CANT_STACK = 19,
|
||||
EQUIP_ERR_ITEM_CANT_BE_EQUIPPED = 20,
|
||||
EQUIP_ERR_ITEMS_CANT_BE_SWAPPED = 21,
|
||||
EQUIP_ERR_SLOT_IS_EMPTY = 22,
|
||||
EQUIP_ERR_ITEM_NOT_FOUND = 23,
|
||||
EQUIP_ERR_CANT_DROP_SOULBOUND = 24,
|
||||
EQUIP_ERR_OUT_OF_RANGE = 25,
|
||||
EQUIP_ERR_TRIED_TO_SPLIT_MORE_THAN_COUNT = 26,
|
||||
EQUIP_ERR_COULDNT_SPLIT_ITEMS = 27,
|
||||
EQUIP_ERR_MISSING_REAGENT = 28,
|
||||
EQUIP_ERR_NOT_ENOUGH_MONEY = 29,
|
||||
EQUIP_ERR_NOT_A_BAG = 30,
|
||||
EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS = 31,
|
||||
EQUIP_ERR_DONT_OWN_THAT_ITEM = 32,
|
||||
EQUIP_ERR_CAN_EQUIP_ONLY1_QUIVER = 33,
|
||||
EQUIP_ERR_MUST_PURCHASE_THAT_BAG_SLOT = 34,
|
||||
EQUIP_ERR_TOO_FAR_AWAY_FROM_BANK = 35,
|
||||
EQUIP_ERR_ITEM_LOCKED = 36,
|
||||
EQUIP_ERR_YOU_ARE_STUNNED = 37,
|
||||
EQUIP_ERR_YOU_ARE_DEAD = 38,
|
||||
EQUIP_ERR_CANT_DO_RIGHT_NOW = 39,
|
||||
EQUIP_ERR_INT_BAG_ERROR = 40,
|
||||
EQUIP_ERR_CAN_EQUIP_ONLY1_BOLT = 41,
|
||||
EQUIP_ERR_CAN_EQUIP_ONLY1_AMMOPOUCH = 42,
|
||||
EQUIP_ERR_STACKABLE_CANT_BE_WRAPPED = 43,
|
||||
EQUIP_ERR_EQUIPPED_CANT_BE_WRAPPED = 44,
|
||||
EQUIP_ERR_WRAPPED_CANT_BE_WRAPPED = 45,
|
||||
EQUIP_ERR_BOUND_CANT_BE_WRAPPED = 46,
|
||||
EQUIP_ERR_UNIQUE_CANT_BE_WRAPPED = 47,
|
||||
EQUIP_ERR_BAGS_CANT_BE_WRAPPED = 48,
|
||||
EQUIP_ERR_ALREADY_LOOTED = 49,
|
||||
EQUIP_ERR_INVENTORY_FULL = 50,
|
||||
EQUIP_ERR_BANK_FULL = 51,
|
||||
EQUIP_ERR_ITEM_IS_CURRENTLY_SOLD_OUT = 52,
|
||||
EQUIP_ERR_BAG_FULL3 = 53,
|
||||
EQUIP_ERR_ITEM_NOT_FOUND2 = 54,
|
||||
EQUIP_ERR_ITEM_CANT_STACK2 = 55,
|
||||
EQUIP_ERR_BAG_FULL4 = 56,
|
||||
EQUIP_ERR_ITEM_SOLD_OUT = 57,
|
||||
EQUIP_ERR_OBJECT_IS_BUSY = 58,
|
||||
EQUIP_ERR_NONE = 59,
|
||||
EQUIP_ERR_NOT_IN_COMBAT = 60,
|
||||
EQUIP_ERR_NOT_WHILE_DISARMED = 61,
|
||||
EQUIP_ERR_BAG_FULL6 = 62,
|
||||
EQUIP_ERR_CANT_EQUIP_RANK = 63,
|
||||
EQUIP_ERR_CANT_EQUIP_REPUTATION = 64,
|
||||
EQUIP_ERR_TOO_MANY_SPECIAL_BAGS = 65,
|
||||
EQUIP_ERR_LOOT_CANT_LOOT_THAT_NOW = 66,
|
||||
EQUIP_ERR_ITEM_UNIQUE_EQUIPABLE = 67,
|
||||
EQUIP_ERR_VENDOR_MISSING_TURNINS = 68,
|
||||
EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS = 69,
|
||||
EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS = 70,
|
||||
EQUIP_ERR_ITEM_MAX_COUNT_SOCKETED = 71,
|
||||
EQUIP_ERR_MAIL_BOUND_ITEM = 72,
|
||||
EQUIP_ERR_NO_SPLIT_WHILE_PROSPECTING = 73,
|
||||
EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED = 75,
|
||||
EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED = 76,
|
||||
EQUIP_ERR_TOO_MUCH_GOLD = 77,
|
||||
EQUIP_ERR_NOT_DURING_ARENA_MATCH = 78,
|
||||
EQUIP_ERR_CANNOT_TRADE_THAT = 79,
|
||||
EQUIP_ERR_PERSONAL_ARENA_RATING_TOO_LOW = 80,
|
||||
EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM = 81,
|
||||
EQUIP_ERR_ARTEFACTS_ONLY_FOR_OWN_CHARACTERS = 82,
|
||||
// no output = 83,
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED = 84,
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED = 85,
|
||||
EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_EXCEEDED = 86,
|
||||
EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW = 87,
|
||||
EQUIP_ERR_CANT_EQUIP_NEED_TALENT = 88,
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED = 89,
|
||||
}
|
||||
|
||||
declare const enum DuelCompleteType {
|
||||
DUEL_INTERRUPTED = 0,
|
||||
DUEL_WON = 1,
|
||||
DUEL_FLED = 2,
|
||||
}
|
||||
|
||||
declare const enum Difficulty {
|
||||
REGULAR_DIFFICULTY = 0,
|
||||
|
||||
DUNGEON_DIFFICULTY_NORMAL = 0,
|
||||
DUNGEON_DIFFICULTY_HEROIC = 1,
|
||||
DUNGEON_DIFFICULTY_EPIC = 2,
|
||||
|
||||
RAID_DIFFICULTY_10MAN_NORMAL = 0,
|
||||
RAID_DIFFICULTY_25MAN_NORMAL = 1,
|
||||
RAID_DIFFICULTY_10MAN_HEROIC = 2,
|
||||
RAID_DIFFICULTY_25MAN_HEROIC = 3,
|
||||
}
|
||||
|
||||
declare const enum WeatherState {
|
||||
WEATHER_STATE_FINE = 0,
|
||||
WEATHER_STATE_FOG = 1,
|
||||
WEATHER_STATE_LIGHT_RAIN = 3,
|
||||
WEATHER_STATE_MEDIUM_RAIN = 4,
|
||||
WEATHER_STATE_HEAVY_RAIN = 5,
|
||||
WEATHER_STATE_LIGHT_SNOW = 6,
|
||||
WEATHER_STATE_MEDIUM_SNOW = 7,
|
||||
WEATHER_STATE_HEAVY_SNOW = 8,
|
||||
WEATHER_STATE_LIGHT_SANDSTORM = 22,
|
||||
WEATHER_STATE_MEDIUM_SANDSTORM = 41,
|
||||
WEATHER_STATE_HEAVY_SANDSTORM = 42,
|
||||
WEATHER_STATE_THUNDERS = 86,
|
||||
WEATHER_STATE_BLACKRAIN = 90,
|
||||
WEATHER_STATE_BLACKSNOW = 106,
|
||||
}
|
||||
|
||||
declare const enum ShutdownExitCode {
|
||||
SHUTDOWN_EXIT_CODE = 0,
|
||||
ERROR_EXIT_CODE = 1,
|
||||
RESTART_EXIT_CODE = 2,
|
||||
}
|
||||
|
||||
declare const enum ShutdownMask {
|
||||
SHUTDOWN_MASK_RESTART = 1,
|
||||
SHUTDOWN_MASK_IDLE = 2,
|
||||
}
|
||||
7
types/db.helpers.d.ts
vendored
Normal file
7
types/db.helpers.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Sanitize a string for SQL
|
||||
*
|
||||
* @param str
|
||||
* @returns Sanitized string
|
||||
*/
|
||||
export declare function stringSanitizer(str: string): string;
|
||||
5889
types/global.d.ts
vendored
Normal file
5889
types/global.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
types/hook.helpers.d.ts
vendored
Normal file
6
types/hook.helpers.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export declare type IRegisterHook<T> = (hook: T,
|
||||
/** the number of times the function will be called, 0 means "always call this function" */
|
||||
shots?: number) => any;
|
||||
export declare type IRegisterHookWithId<T> = (id: number, hook: T,
|
||||
/** the number of times the function will be called, 0 means "always call this function" */
|
||||
shots?: number) => any;
|
||||
67
types/hooks/BattleGroundHooks.d.ts
vendored
Normal file
67
types/hooks/BattleGroundHooks.d.ts
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
declare type bg_event_on_start = (
|
||||
event: BGEvents.BG_EVENT_ON_START,
|
||||
bg: BattleGround,
|
||||
bgId: BattleGroundTypeId,
|
||||
instanceId: number,
|
||||
) => void;
|
||||
|
||||
declare type bg_event_on_end = (
|
||||
event: BGEvents.BG_EVENT_ON_END,
|
||||
bg: BattleGround,
|
||||
bgId: BattleGroundTypeId,
|
||||
instanceId: number,
|
||||
winner: Team,
|
||||
) => void;
|
||||
|
||||
declare type bg_event_on_create = (
|
||||
event: BGEvents.BG_EVENT_ON_CREATE,
|
||||
bg: BattleGround,
|
||||
bgId: BattleGroundTypeId,
|
||||
instanceId: number,
|
||||
) => void;
|
||||
|
||||
declare type bg_event_on_pre_destroy = (
|
||||
event: BGEvents.BG_EVENT_ON_PRE_DESTROY,
|
||||
bg: BattleGround,
|
||||
bgId: BattleGroundTypeId,
|
||||
instanceId: number,
|
||||
) => void;
|
||||
|
||||
|
||||
/**
|
||||
* Registers a [BattleGround] event handler.
|
||||
* ```typescript
|
||||
* enum BGEvents
|
||||
* {
|
||||
* BG_EVENT_ON_START = 1, // (event, bg, bgId, instanceId) - Needs to be added to TC
|
||||
* BG_EVENT_ON_END = 2, // (event, bg, bgId, instanceId, winner) - Needs to be added to TC
|
||||
* BG_EVENT_ON_CREATE = 3, // (event, bg, bgId, instanceId) - Needs to be added to TC
|
||||
* BG_EVENT_ON_PRE_DESTROY = 4, // (event, bg, bgId, instanceId) - Needs to be added to TC
|
||||
* BG_EVENT_COUNT
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
declare function RegisterBGEvent(
|
||||
this: void,
|
||||
event: BGEvents.BG_EVENT_ON_START,
|
||||
func: HookFunctionNoSelf<bg_event_on_start>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterBGEvent(
|
||||
this: void,
|
||||
event: BGEvents.BG_EVENT_ON_END,
|
||||
func: HookFunctionNoSelf<bg_event_on_end>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterBGEvent(
|
||||
this: void,
|
||||
event: BGEvents.BG_EVENT_ON_CREATE,
|
||||
func: HookFunctionNoSelf<bg_event_on_create>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterBGEvent(
|
||||
this: void,
|
||||
event: BGEvents.BG_EVENT_ON_PRE_DESTROY,
|
||||
func: HookFunctionNoSelf<bg_event_on_pre_destroy>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
689
types/hooks/CreatureHooks.d.ts
vendored
Normal file
689
types/hooks/CreatureHooks.d.ts
vendored
Normal file
@@ -0,0 +1,689 @@
|
||||
declare type creature_event_on_dummy_effect = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_DUMMY_EFFECT,
|
||||
pCaster: WorldObject,
|
||||
spellId: number,
|
||||
effIndex: SpellEffIndex,
|
||||
pTarget: Creature,
|
||||
) => void;
|
||||
|
||||
declare type creature_event_on_quest_accept = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_QUEST_ACCEPT,
|
||||
pPlayer: Player,
|
||||
pCreature: Creature,
|
||||
pQuest: Quest,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_quest_reward = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_QUEST_REWARD,
|
||||
pPlayer: Player,
|
||||
pCreature: Creature,
|
||||
pQuest: Quest,
|
||||
opt: number,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_dialog_status = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_DIALOG_STATUS,
|
||||
pPlayer: Player,
|
||||
pCreature: Creature,
|
||||
) => void;
|
||||
|
||||
declare type creature_event_on_add = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_ADD,
|
||||
pCreature: Creature,
|
||||
) => void;
|
||||
|
||||
declare type creature_event_on_remove = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_REMOVE,
|
||||
pCreature: Creature,
|
||||
) => void;
|
||||
|
||||
declare type creature_event_on_summoned = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_SUMMONED,
|
||||
pCreature: Creature,
|
||||
pSummoner: Unit,
|
||||
) => boolean;
|
||||
|
||||
/**
|
||||
* Called on creature initial spawn, respawn, death, evade (leave combat)
|
||||
*/
|
||||
declare type creature_event_on_reset = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_RESET,
|
||||
pCreature: Creature,
|
||||
) => void;
|
||||
|
||||
declare type creature_event_on_aiupdate = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_AIUPDATE,
|
||||
me: Creature,
|
||||
diff: number,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_enter_combat = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_ENTER_COMBAT,
|
||||
me: Creature,
|
||||
target: Unit,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_damage_taken = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_DAMAGE_TAKEN,
|
||||
me: Creature,
|
||||
attacker: Unit,
|
||||
damage: number,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_died = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_DIED,
|
||||
me: Creature,
|
||||
killer: Unit,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_target_died = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_TARGET_DIED,
|
||||
me: Creature,
|
||||
victim: Unit,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_just_summoned_creature = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_JUST_SUMMONED_CREATURE,
|
||||
me: Creature,
|
||||
summon: Creature,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_summoned_creature_despawn = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_SUMMONED_CREATURE_DESPAWN,
|
||||
me: Creature,
|
||||
summon: Creature,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_reach_wp = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_REACH_WP,
|
||||
me: Creature,
|
||||
type: number,
|
||||
id: number,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_pre_combat = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_PRE_COMBAT,
|
||||
me: Creature,
|
||||
target: Unit,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_leave_combat = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_LEAVE_COMBAT,
|
||||
me: Creature,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_spawn = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_SPAWN,
|
||||
me: Creature,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_reach_home = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_REACH_HOME,
|
||||
me: Creature,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_receive_emote = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_RECEIVE_EMOTE,
|
||||
me: Creature,
|
||||
player: Player,
|
||||
emoteId: number,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_corpse_removed = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_CORPSE_REMOVED,
|
||||
me: Creature,
|
||||
respawnDelay: number,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_move_in_los = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_MOVE_IN_LOS,
|
||||
me: Creature,
|
||||
who: Unit,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_hit_by_spell = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_HIT_BY_SPELL,
|
||||
me: Creature,
|
||||
caster: WorldObject,
|
||||
spell: number,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_spell_hit_target = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_SPELL_HIT_TARGET,
|
||||
me: Creature,
|
||||
target: WorldObject,
|
||||
spell: number,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_summoned_creature_died = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_SUMMONED_CREATURE_DIED,
|
||||
me: Creature,
|
||||
summon: Creature,
|
||||
killer: Unit,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_owner_attacked_at = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_OWNER_ATTACKED_AT,
|
||||
me: Creature,
|
||||
attacker: Unit,
|
||||
) => boolean;
|
||||
|
||||
declare type creature_event_on_owner_attacked = (
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_OWNER_ATTACKED,
|
||||
me: Creature,
|
||||
target: Unit,
|
||||
) => boolean;
|
||||
|
||||
/**
|
||||
* Registers a [Creature] event handler.
|
||||
* ```typescript
|
||||
* enum CreatureEvents
|
||||
* {
|
||||
* CREATURE_EVENT_ON_ENTER_COMBAT = 1, // (event, creature, target) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_LEAVE_COMBAT = 2, // (event, creature) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_TARGET_DIED = 3, // (event, creature, victim) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_DIED = 4, // (event, creature, killer) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_SPAWN = 5, // (event, creature) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_REACH_WP = 6, // (event, creature, type, id) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_AIUPDATE = 7, // (event, creature, diff) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_RECEIVE_EMOTE = 8, // (event, creature, player, emoteid) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_DAMAGE_TAKEN = 9, // (event, creature, attacker, damage) - Can return true to stop normal action, can return new damage as second return value.
|
||||
* CREATURE_EVENT_ON_PRE_COMBAT = 10, // (event, creature, target) - Can return true to stop normal action
|
||||
* // UNUSED
|
||||
* CREATURE_EVENT_ON_OWNER_ATTACKED = 12, // (event, creature, target) - Can return true to stop normal action // Not on mangos
|
||||
* CREATURE_EVENT_ON_OWNER_ATTACKED_AT = 13, // (event, creature, attacker) - Can return true to stop normal action // Not on mangos
|
||||
* CREATURE_EVENT_ON_HIT_BY_SPELL = 14, // (event, creature, caster, spellid) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_SPELL_HIT_TARGET = 15, // (event, creature, target, spellid) - Can return true to stop normal action
|
||||
* // UNUSED = 16, // (event, creature)
|
||||
* // UNUSED = 17, // (event, creature)
|
||||
* // UNUSED = 18, // (event, creature)
|
||||
* CREATURE_EVENT_ON_JUST_SUMMONED_CREATURE = 19, // (event, creature, summon) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_SUMMONED_CREATURE_DESPAWN = 20, // (event, creature, summon) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_SUMMONED_CREATURE_DIED = 21, // (event, creature, summon, killer) - Can return true to stop normal action // Not on mangos
|
||||
* CREATURE_EVENT_ON_SUMMONED = 22, // (event, creature, summoner) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_RESET = 23, // (event, creature)
|
||||
* CREATURE_EVENT_ON_REACH_HOME = 24, // (event, creature) - Can return true to stop normal action
|
||||
* // UNUSED = 25, // (event, creature)
|
||||
* CREATURE_EVENT_ON_CORPSE_REMOVED = 26, // (event, creature, respawndelay) - Can return true to stop normal action, can return new respawndelay as second return value
|
||||
* CREATURE_EVENT_ON_MOVE_IN_LOS = 27, // (event, creature, unit) - Can return true to stop normal action. Does not actually check LOS, just uses the sight range
|
||||
* // UNUSED = 28, // (event, creature)
|
||||
* // UNUSED = 29, // (event, creature)
|
||||
* CREATURE_EVENT_ON_DUMMY_EFFECT = 30, // (event, caster, spellid, effindex, creature)
|
||||
* CREATURE_EVENT_ON_QUEST_ACCEPT = 31, // (event, player, creature, quest) - Can return true
|
||||
* // UNUSED = 32, // (event, creature)
|
||||
* // UNUSED = 33, // (event, creature)
|
||||
* CREATURE_EVENT_ON_QUEST_REWARD = 34, // (event, player, creature, quest, opt) - Can return true
|
||||
* CREATURE_EVENT_ON_DIALOG_STATUS = 35, // (event, player, creature)
|
||||
* CREATURE_EVENT_ON_ADD = 36, // (event, creature)
|
||||
* CREATURE_EVENT_ON_REMOVE = 37, // (event, creature)
|
||||
* CREATURE_EVENT_COUNT
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_ENTER_COMBAT,
|
||||
func: HookFunctionNoSelf<creature_event_on_enter_combat>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_LEAVE_COMBAT,
|
||||
func: HookFunctionNoSelf<creature_event_on_leave_combat>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_TARGET_DIED,
|
||||
func: HookFunctionNoSelf<creature_event_on_target_died>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_DIED,
|
||||
func: HookFunctionNoSelf<creature_event_on_died>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_SPAWN,
|
||||
func: HookFunctionNoSelf<creature_event_on_spawn>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_REACH_WP,
|
||||
func: HookFunctionNoSelf<creature_event_on_reach_wp>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_AIUPDATE,
|
||||
func: HookFunctionNoSelf<creature_event_on_aiupdate>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_RECEIVE_EMOTE,
|
||||
func: HookFunctionNoSelf<creature_event_on_receive_emote>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_DAMAGE_TAKEN,
|
||||
func: HookFunctionNoSelf<creature_event_on_damage_taken>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_PRE_COMBAT,
|
||||
func: HookFunctionNoSelf<creature_event_on_pre_combat>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_OWNER_ATTACKED,
|
||||
func: HookFunctionNoSelf<creature_event_on_owner_attacked>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_OWNER_ATTACKED_AT,
|
||||
func: HookFunctionNoSelf<creature_event_on_owner_attacked_at>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_HIT_BY_SPELL,
|
||||
func: HookFunctionNoSelf<creature_event_on_hit_by_spell>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_SPELL_HIT_TARGET,
|
||||
func: HookFunctionNoSelf<creature_event_on_spell_hit_target>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_JUST_SUMMONED_CREATURE,
|
||||
func: HookFunctionNoSelf<creature_event_on_just_summoned_creature>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_SUMMONED_CREATURE_DESPAWN,
|
||||
func: HookFunctionNoSelf<creature_event_on_summoned_creature_despawn>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_SUMMONED_CREATURE_DIED,
|
||||
func: HookFunctionNoSelf<creature_event_on_summoned_creature_died>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_SUMMONED,
|
||||
func: HookFunctionNoSelf<creature_event_on_summoned>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_RESET,
|
||||
func: HookFunctionNoSelf<creature_event_on_reset>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_REACH_HOME,
|
||||
func: HookFunctionNoSelf<creature_event_on_reach_home>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_CORPSE_REMOVED,
|
||||
func: HookFunctionNoSelf<creature_event_on_corpse_removed>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_MOVE_IN_LOS,
|
||||
func: HookFunctionNoSelf<creature_event_on_move_in_los>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_DUMMY_EFFECT,
|
||||
func: HookFunctionNoSelf<creature_event_on_dummy_effect>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_QUEST_ACCEPT,
|
||||
func: HookFunctionNoSelf<creature_event_on_quest_accept>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_QUEST_REWARD,
|
||||
func: HookFunctionNoSelf<creature_event_on_quest_reward>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_DIALOG_STATUS,
|
||||
func: HookFunctionNoSelf<creature_event_on_dialog_status>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_ADD,
|
||||
func: HookFunctionNoSelf<creature_event_on_add>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_REMOVE,
|
||||
func: HookFunctionNoSelf<creature_event_on_remove>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
|
||||
/**
|
||||
* Registers a [Creature] event handler for a *single* [Creature].
|
||||
* ```typescript
|
||||
* enum CreatureEvents
|
||||
* {
|
||||
* CREATURE_EVENT_ON_ENTER_COMBAT = 1, // (event, creature, target) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_LEAVE_COMBAT = 2, // (event, creature) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_TARGET_DIED = 3, // (event, creature, victim) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_DIED = 4, // (event, creature, killer) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_SPAWN = 5, // (event, creature) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_REACH_WP = 6, // (event, creature, type, id) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_AIUPDATE = 7, // (event, creature, diff) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_RECEIVE_EMOTE = 8, // (event, creature, player, emoteid) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_DAMAGE_TAKEN = 9, // (event, creature, attacker, damage) - Can return true to stop normal action, can return new damage as second return value.
|
||||
* CREATURE_EVENT_ON_PRE_COMBAT = 10, // (event, creature, target) - Can return true to stop normal action
|
||||
* // UNUSED
|
||||
* CREATURE_EVENT_ON_OWNER_ATTACKED = 12, // (event, creature, target) - Can return true to stop normal action // Not on mangos
|
||||
* CREATURE_EVENT_ON_OWNER_ATTACKED_AT = 13, // (event, creature, attacker) - Can return true to stop normal action // Not on mangos
|
||||
* CREATURE_EVENT_ON_HIT_BY_SPELL = 14, // (event, creature, caster, spellid) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_SPELL_HIT_TARGET = 15, // (event, creature, target, spellid) - Can return true to stop normal action
|
||||
* // UNUSED = 16, // (event, creature)
|
||||
* // UNUSED = 17, // (event, creature)
|
||||
* // UNUSED = 18, // (event, creature)
|
||||
* CREATURE_EVENT_ON_JUST_SUMMONED_CREATURE = 19, // (event, creature, summon) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_SUMMONED_CREATURE_DESPAWN = 20, // (event, creature, summon) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_SUMMONED_CREATURE_DIED = 21, // (event, creature, summon, killer) - Can return true to stop normal action // Not on mangos
|
||||
* CREATURE_EVENT_ON_SUMMONED = 22, // (event, creature, summoner) - Can return true to stop normal action
|
||||
* CREATURE_EVENT_ON_RESET = 23, // (event, creature)
|
||||
* CREATURE_EVENT_ON_REACH_HOME = 24, // (event, creature) - Can return true to stop normal action
|
||||
* // UNUSED = 25, // (event, creature)
|
||||
* CREATURE_EVENT_ON_CORPSE_REMOVED = 26, // (event, creature, respawndelay) - Can return true to stop normal action, can return new respawndelay as second return value
|
||||
* CREATURE_EVENT_ON_MOVE_IN_LOS = 27, // (event, creature, unit) - Can return true to stop normal action. Does not actually check LOS, just uses the sight range
|
||||
* // UNUSED = 28, // (event, creature)
|
||||
* // UNUSED = 29, // (event, creature)
|
||||
* CREATURE_EVENT_ON_DUMMY_EFFECT = 30, // (event, caster, spellid, effindex, creature)
|
||||
* CREATURE_EVENT_ON_QUEST_ACCEPT = 31, // (event, player, creature, quest) - Can return true
|
||||
* // UNUSED = 32, // (event, creature)
|
||||
* // UNUSED = 33, // (event, creature)
|
||||
* CREATURE_EVENT_ON_QUEST_REWARD = 34, // (event, player, creature, quest, opt) - Can return true
|
||||
* CREATURE_EVENT_ON_DIALOG_STATUS = 35, // (event, player, creature)
|
||||
* CREATURE_EVENT_ON_ADD = 36, // (event, creature)
|
||||
* CREATURE_EVENT_ON_REMOVE = 37, // (event, creature)
|
||||
* CREATURE_EVENT_COUNT
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_ENTER_COMBAT,
|
||||
func: HookFunctionNoSelf<creature_event_on_enter_combat>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_LEAVE_COMBAT,
|
||||
func: HookFunctionNoSelf<creature_event_on_leave_combat>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_TARGET_DIED,
|
||||
func: HookFunctionNoSelf<creature_event_on_target_died>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_DIED,
|
||||
func: HookFunctionNoSelf<creature_event_on_died>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_SPAWN,
|
||||
func: HookFunctionNoSelf<creature_event_on_spawn>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_REACH_WP,
|
||||
func: HookFunctionNoSelf<creature_event_on_reach_wp>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_AIUPDATE,
|
||||
func: HookFunctionNoSelf<creature_event_on_aiupdate>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_RECEIVE_EMOTE,
|
||||
func: HookFunctionNoSelf<creature_event_on_receive_emote>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_DAMAGE_TAKEN,
|
||||
func: HookFunctionNoSelf<creature_event_on_damage_taken>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_PRE_COMBAT,
|
||||
func: HookFunctionNoSelf<creature_event_on_pre_combat>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_OWNER_ATTACKED,
|
||||
func: HookFunctionNoSelf<creature_event_on_owner_attacked>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_OWNER_ATTACKED_AT,
|
||||
func: HookFunctionNoSelf<creature_event_on_owner_attacked_at>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_HIT_BY_SPELL,
|
||||
func: HookFunctionNoSelf<creature_event_on_hit_by_spell>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_SPELL_HIT_TARGET,
|
||||
func: HookFunctionNoSelf<creature_event_on_spell_hit_target>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_JUST_SUMMONED_CREATURE,
|
||||
func: HookFunctionNoSelf<creature_event_on_just_summoned_creature>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_SUMMONED_CREATURE_DESPAWN,
|
||||
func: HookFunctionNoSelf<creature_event_on_summoned_creature_despawn>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_SUMMONED_CREATURE_DIED,
|
||||
func: HookFunctionNoSelf<creature_event_on_summoned_creature_died>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_SUMMONED,
|
||||
func: HookFunctionNoSelf<creature_event_on_summoned>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_RESET,
|
||||
func: HookFunctionNoSelf<creature_event_on_reset>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_REACH_HOME,
|
||||
func: HookFunctionNoSelf<creature_event_on_reach_home>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_CORPSE_REMOVED,
|
||||
func: HookFunctionNoSelf<creature_event_on_corpse_removed>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_MOVE_IN_LOS,
|
||||
func: HookFunctionNoSelf<creature_event_on_move_in_los>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_DUMMY_EFFECT,
|
||||
func: HookFunctionNoSelf<creature_event_on_dummy_effect>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_QUEST_ACCEPT,
|
||||
func: HookFunctionNoSelf<creature_event_on_quest_accept>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_QUEST_REWARD,
|
||||
func: HookFunctionNoSelf<creature_event_on_quest_reward>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_DIALOG_STATUS,
|
||||
func: HookFunctionNoSelf<creature_event_on_dialog_status>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_ADD,
|
||||
func: HookFunctionNoSelf<creature_event_on_add>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterUniqueCreatureEvent(
|
||||
this: void,
|
||||
guid: number,
|
||||
instance_id: number,
|
||||
event: CreatureEvents.CREATURE_EVENT_ON_REMOVE,
|
||||
func: HookFunctionNoSelf<creature_event_on_remove>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
194
types/hooks/GameObjectHooks.d.ts
vendored
Normal file
194
types/hooks/GameObjectHooks.d.ts
vendored
Normal file
@@ -0,0 +1,194 @@
|
||||
declare type gameobject_event_on_dummy_effect = (
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_DUMMY_EFFECT,
|
||||
pCaster: WorldObject,
|
||||
spellId: number,
|
||||
effIndex: SpellEffIndex,
|
||||
pTarget: GameObject,
|
||||
) => void;
|
||||
|
||||
declare type gameobject_event_on_aiupdate = (
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_AIUPDATE,
|
||||
pGameObject: GameObject,
|
||||
diff: number,
|
||||
) => void;
|
||||
|
||||
declare type gameobject_event_on_quest_accept = (
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_QUEST_ACCEPT,
|
||||
pPlayer: Player,
|
||||
pGameObject: GameObject,
|
||||
pQuest: Quest,
|
||||
) => boolean;
|
||||
|
||||
declare type gameobject_event_on_quest_reward = (
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_QUEST_REWARD,
|
||||
pPlayer: Player,
|
||||
pGameObject: GameObject,
|
||||
pQuest: Quest,
|
||||
opt: number,
|
||||
) => boolean;
|
||||
|
||||
declare type gameobject_event_on_dialog_status = (
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_DIALOG_STATUS,
|
||||
pPlayer: Player,
|
||||
pGameObject: GameObject,
|
||||
) => void;
|
||||
|
||||
declare type gameobject_event_on_destroyed = (
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_DESTROYED,
|
||||
pGameObject: GameObject,
|
||||
attacker: WorldObject,
|
||||
) => void;
|
||||
|
||||
declare type gameobject_event_on_damaged = (
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_DAMAGED,
|
||||
pGameObject: GameObject,
|
||||
attacker: WorldObject,
|
||||
) => void;
|
||||
|
||||
declare type gameobject_event_on_loot_state_change = (
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_LOOT_STATE_CHANGE,
|
||||
pGameObject: GameObject,
|
||||
state: number,
|
||||
) => void;
|
||||
|
||||
declare type gameobject_event_on_go_state_changed = (
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_GO_STATE_CHANGED,
|
||||
pGameObject: GameObject,
|
||||
state: number,
|
||||
) => void;
|
||||
|
||||
declare type gameobject_event_on_spawn = (
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_SPAWN,
|
||||
pGameObject: GameObject,
|
||||
) => void;
|
||||
|
||||
declare type gameobject_event_on_add = (
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_ADD,
|
||||
pGameObject: GameObject,
|
||||
) => void;
|
||||
|
||||
declare type gameobject_event_on_remove = (
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_REMOVE,
|
||||
pGameObject: GameObject,
|
||||
) => void;
|
||||
|
||||
declare type gameobject_event_on_use = (
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_USE,
|
||||
pPlayer: Player,
|
||||
pGameObject: GameObject,
|
||||
) => boolean;
|
||||
|
||||
/**
|
||||
* Registers a [GameObject] event handler.
|
||||
* ```typescript
|
||||
* enum GameObjectEvents
|
||||
* {
|
||||
* GAMEOBJECT_EVENT_ON_AIUPDATE = 1, // (event, go, diff)
|
||||
* GAMEOBJECT_EVENT_ON_SPAWN = 2, // (event, go)
|
||||
* GAMEOBJECT_EVENT_ON_DUMMY_EFFECT = 3, // (event, caster, spellid, effindex, go) - Can return true to stop normal action
|
||||
* GAMEOBJECT_EVENT_ON_QUEST_ACCEPT = 4, // (event, player, go, quest) - Can return true to stop normal action
|
||||
* GAMEOBJECT_EVENT_ON_QUEST_REWARD = 5, // (event, player, go, quest, opt) - Can return true to stop normal action
|
||||
* GAMEOBJECT_EVENT_ON_DIALOG_STATUS = 6, // (event, player, go)
|
||||
* GAMEOBJECT_EVENT_ON_DESTROYED = 7, // (event, go, attacker)
|
||||
* GAMEOBJECT_EVENT_ON_DAMAGED = 8, // (event, go, attacker)
|
||||
* GAMEOBJECT_EVENT_ON_LOOT_STATE_CHANGE = 9, // (event, go, state)
|
||||
* GAMEOBJECT_EVENT_ON_GO_STATE_CHANGED = 10, // (event, go, state)
|
||||
* // UNUSED = 11, // (event, gameobject)
|
||||
* GAMEOBJECT_EVENT_ON_ADD = 12, // (event, gameobject)
|
||||
* GAMEOBJECT_EVENT_ON_REMOVE = 13, // (event, gameobject)
|
||||
* GAMEOBJECT_EVENT_ON_USE = 14, // (event, go, player) - Can return true to stop normal action
|
||||
* GAMEOBJECT_EVENT_COUNT
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
declare function RegisterGameObjectEvent(
|
||||
this: void,
|
||||
entry: number,
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_AIUPDATE,
|
||||
func: HookFunctionNoSelf<gameobject_event_on_aiupdate>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGameObjectEvent(
|
||||
this: void,
|
||||
entry: number,
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_SPAWN,
|
||||
func: HookFunctionNoSelf<gameobject_event_on_spawn>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGameObjectEvent(
|
||||
this: void,
|
||||
entry: number,
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_DUMMY_EFFECT,
|
||||
func: HookFunctionNoSelf<gameobject_event_on_dummy_effect>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGameObjectEvent(
|
||||
this: void,
|
||||
entry: number,
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_QUEST_ACCEPT,
|
||||
func: HookFunctionNoSelf<gameobject_event_on_quest_accept>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGameObjectEvent(
|
||||
this: void,
|
||||
entry: number,
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_QUEST_REWARD,
|
||||
func: HookFunctionNoSelf<gameobject_event_on_quest_reward>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGameObjectEvent(
|
||||
this: void,
|
||||
entry: number,
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_DIALOG_STATUS,
|
||||
func: HookFunctionNoSelf<gameobject_event_on_dialog_status>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGameObjectEvent(
|
||||
this: void,
|
||||
entry: number,
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_DESTROYED,
|
||||
func: HookFunctionNoSelf<gameobject_event_on_destroyed>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGameObjectEvent(
|
||||
this: void,
|
||||
entry: number,
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_DAMAGED,
|
||||
func: HookFunctionNoSelf<gameobject_event_on_damaged>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGameObjectEvent(
|
||||
this: void,
|
||||
entry: number,
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_LOOT_STATE_CHANGE,
|
||||
func: HookFunctionNoSelf<gameobject_event_on_loot_state_change>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGameObjectEvent(
|
||||
this: void,
|
||||
entry: number,
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_GO_STATE_CHANGED,
|
||||
func: HookFunctionNoSelf<gameobject_event_on_go_state_changed>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGameObjectEvent(
|
||||
this: void,
|
||||
entry: number,
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_ADD,
|
||||
func: HookFunctionNoSelf<gameobject_event_on_add>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGameObjectEvent(
|
||||
this: void,
|
||||
entry: number,
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_REMOVE,
|
||||
func: HookFunctionNoSelf<gameobject_event_on_remove>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGameObjectEvent(
|
||||
this: void,
|
||||
entry: number,
|
||||
event: GameObjectEvents.GAMEOBJECT_EVENT_ON_USE,
|
||||
func: HookFunctionNoSelf<gameobject_event_on_use>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
127
types/hooks/GossipHooks.d.ts
vendored
Normal file
127
types/hooks/GossipHooks.d.ts
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
declare type gossip_event_on_hello = (
|
||||
event: GossipEvents.GOSSIP_EVENT_ON_HELLO,
|
||||
player: Player,
|
||||
object: GameObject | Creature | Item,
|
||||
) => boolean;
|
||||
|
||||
/**
|
||||
* Can return false to do the default action
|
||||
*/
|
||||
declare type gossip_event_on_select = (
|
||||
event: GossipEvents.GOSSIP_EVENT_ON_SELECT,
|
||||
player: Player,
|
||||
object: GameObject | Creature | Item | Player,
|
||||
sender: number,
|
||||
action: number,
|
||||
code: string,
|
||||
/** menuId is only for Player Gossip */
|
||||
menuId?: number,
|
||||
) => boolean;
|
||||
|
||||
|
||||
/**
|
||||
* Registers a [Creature] gossip event handler.
|
||||
* ```typescript
|
||||
* enum GossipEvents
|
||||
* {
|
||||
* GOSSIP_EVENT_ON_HELLO = 1, // (event, player, object) - Object is the Creature/GameObject/Item. Can return false to do default action. For item gossip can return false to stop spell casting.
|
||||
* GOSSIP_EVENT_ON_SELECT = 2, // (event, player, object, sender, intid, code, menu_id) - Object is the Creature/GameObject/Item/Player, menu_id is only for player gossip. Can return false to do default action.
|
||||
* GOSSIP_EVENT_COUNT
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
declare function RegisterCreatureGossipEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: GossipEvents.GOSSIP_EVENT_ON_HELLO,
|
||||
func: HookFunctionNoSelf<gossip_event_on_hello>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterCreatureGossipEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: GossipEvents.GOSSIP_EVENT_ON_SELECT,
|
||||
func: HookFunctionNoSelf<gossip_event_on_select>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
|
||||
|
||||
/**
|
||||
* Registers a [GameObject] gossip event handler.
|
||||
* ```typescript
|
||||
* enum GossipEvents
|
||||
* {
|
||||
* GOSSIP_EVENT_ON_HELLO = 1, // (event, player, object) - Object is the Creature/GameObject/Item. Can return false to do default action. For item gossip can return false to stop spell casting.
|
||||
* GOSSIP_EVENT_ON_SELECT = 2, // (event, player, object, sender, intid, code, menu_id) - Object is the Creature/GameObject/Item/Player, menu_id is only for player gossip. Can return false to do default action.
|
||||
* GOSSIP_EVENT_COUNT
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
declare function RegisterGameObjectGossipEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: GossipEvents.GOSSIP_EVENT_ON_HELLO,
|
||||
func: HookFunctionNoSelf<gossip_event_on_hello>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGameObjectGossipEvent(
|
||||
this:void,
|
||||
entry: number,
|
||||
event: GossipEvents.GOSSIP_EVENT_ON_SELECT,
|
||||
func: HookFunctionNoSelf<gossip_event_on_select>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
|
||||
/**
|
||||
* Registers an [Item] gossip event handler.
|
||||
* ```typescript
|
||||
* enum GossipEvents
|
||||
* {
|
||||
* GOSSIP_EVENT_ON_HELLO = 1, // (event, player, object) - Object is the Creature/GameObject/Item. Can return false to do default action. For item gossip can return false to stop spell casting.
|
||||
* GOSSIP_EVENT_ON_SELECT = 2, // (event, player, object, sender, intid, code, menu_id) - Object is the Creature/GameObject/Item/Player, menu_id is only for player gossip. Can return false to do default action.
|
||||
* GOSSIP_EVENT_COUNT
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
declare function RegisterItemGossipEvent(
|
||||
this:void,
|
||||
id: number,
|
||||
event: GossipEvents.GOSSIP_EVENT_ON_HELLO,
|
||||
func: HookFunctionNoSelf<gossip_event_on_hello>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterItemGossipEvent(
|
||||
this:void,
|
||||
id: number,
|
||||
event: GossipEvents.GOSSIP_EVENT_ON_SELECT,
|
||||
func: HookFunctionNoSelf<gossip_event_on_select>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
|
||||
/**
|
||||
* Registers a [Player] gossip event handler.
|
||||
* Note that you can not use `GOSSIP_EVENT_ON_HELLO` with this hook. It does nothing since players dont have an "on hello".
|
||||
* ```typescript
|
||||
* enum GossipEvents
|
||||
* {
|
||||
* GOSSIP_EVENT_ON_HELLO = 1, // (event, player, object) - Object is the Creature/GameObject/Item. Can return false to do default action. For item gossip can return false to stop spell casting.
|
||||
* GOSSIP_EVENT_ON_SELECT = 2, // (event, player, object, sender, intid, code, menu_id) - Object is the Creature/GameObject/Item/Player, menu_id is only for player gossip. Can return false to do default action.
|
||||
* GOSSIP_EVENT_COUNT
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
declare function RegisterPlayerGossipEvent(
|
||||
this:void,
|
||||
menu_id: number,
|
||||
event: GossipEvents.GOSSIP_EVENT_ON_HELLO,
|
||||
func: HookFunctionNoSelf<gossip_event_on_hello>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerGossipEvent(
|
||||
this:void,
|
||||
menu_id: number,
|
||||
event: GossipEvents.GOSSIP_EVENT_ON_SELECT,
|
||||
func: HookFunctionNoSelf<gossip_event_on_select>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
|
||||
91
types/hooks/GroupHooks.d.ts
vendored
Normal file
91
types/hooks/GroupHooks.d.ts
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
declare type group_event_on_member_add = (
|
||||
event: GroupEvents.GROUP_EVENT_ON_MEMBER_ADD,
|
||||
group: Group,
|
||||
guid: number,
|
||||
) => void;
|
||||
|
||||
declare type group_event_on_member_invite = (
|
||||
event: GroupEvents.GROUP_EVENT_ON_MEMBER_INVITE,
|
||||
group: Group,
|
||||
guid: number,
|
||||
) => void;
|
||||
|
||||
declare type group_event_on_member_remove = (
|
||||
event: GroupEvents.GROUP_EVENT_ON_MEMBER_REMOVE,
|
||||
group: Group,
|
||||
guid: number,
|
||||
method: number,
|
||||
) => void;
|
||||
|
||||
declare type group_event_on_leader_change = (
|
||||
event: GroupEvents.GROUP_EVENT_ON_LEADER_CHANGE,
|
||||
group: Group,
|
||||
newLeaderGuid: number,
|
||||
oldLeaderGuid: number,
|
||||
) => void;
|
||||
|
||||
declare type group_event_on_disband = (
|
||||
event: GroupEvents.GROUP_EVENT_ON_DISBAND,
|
||||
group: Group,
|
||||
) => void;
|
||||
|
||||
declare type group_event_on_create = (
|
||||
event: GroupEvents.GROUP_EVENT_ON_CREATE,
|
||||
group: Group,
|
||||
leaderGuid: number,
|
||||
groupType: GroupType,
|
||||
) => void;
|
||||
|
||||
|
||||
/**
|
||||
* Registers a [Group] event handler.
|
||||
* ```typescript
|
||||
* enum GroupEvents
|
||||
* {
|
||||
* // Group
|
||||
* GROUP_EVENT_ON_MEMBER_ADD = 1, // (event, group, guid)
|
||||
* GROUP_EVENT_ON_MEMBER_INVITE = 2, // (event, group, guid)
|
||||
* GROUP_EVENT_ON_MEMBER_REMOVE = 3, // (event, group, guid, method, kicker, reason)
|
||||
* GROUP_EVENT_ON_LEADER_CHANGE = 4, // (event, group, newLeaderGuid, oldLeaderGuid)
|
||||
* GROUP_EVENT_ON_DISBAND = 5, // (event, group)
|
||||
* GROUP_EVENT_ON_CREATE = 6, // (event, group, leaderGuid, groupType)
|
||||
* GROUP_EVENT_COUNT
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
declare function RegisterGroupEvent(
|
||||
this: void,
|
||||
event: GroupEvents.GROUP_EVENT_ON_MEMBER_ADD,
|
||||
func: HookFunctionNoSelf<group_event_on_member_add>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGroupEvent(
|
||||
this: void,
|
||||
event: GroupEvents.GROUP_EVENT_ON_MEMBER_INVITE,
|
||||
func: HookFunctionNoSelf<group_event_on_member_invite>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGroupEvent(
|
||||
this: void,
|
||||
event: GroupEvents.GROUP_EVENT_ON_MEMBER_REMOVE,
|
||||
func: HookFunctionNoSelf<group_event_on_member_remove>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGroupEvent(
|
||||
this: void,
|
||||
event: GroupEvents.GROUP_EVENT_ON_LEADER_CHANGE,
|
||||
func: HookFunctionNoSelf<group_event_on_leader_change>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGroupEvent(
|
||||
this: void,
|
||||
event: GroupEvents.GROUP_EVENT_ON_DISBAND,
|
||||
func: HookFunctionNoSelf<group_event_on_disband>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGroupEvent(
|
||||
this: void,
|
||||
event: GroupEvents.GROUP_EVENT_ON_CREATE,
|
||||
func: HookFunctionNoSelf<group_event_on_create>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
173
types/hooks/GuildHooks.d.ts
vendored
Normal file
173
types/hooks/GuildHooks.d.ts
vendored
Normal file
@@ -0,0 +1,173 @@
|
||||
declare type guild_event_on_add_member = (
|
||||
event: GuildEvents.GUILD_EVENT_ON_ADD_MEMBER,
|
||||
guild: Guild,
|
||||
player: Player,
|
||||
plRank: number,
|
||||
) => void;
|
||||
|
||||
declare type guild_event_on_remove_member = (
|
||||
event: GuildEvents.GUILD_EVENT_ON_REMOVE_MEMBER,
|
||||
guild: Guild,
|
||||
player: Player,
|
||||
isDisbanding: boolean,
|
||||
) => void;
|
||||
|
||||
declare type guild_event_on_motd_change = (
|
||||
event: GuildEvents.GUILD_EVENT_ON_MOTD_CHANGE,
|
||||
guild: Guild,
|
||||
newMotd: string,
|
||||
) => void;
|
||||
|
||||
declare type guild_event_on_info_change = (
|
||||
event: GuildEvents.GUILD_EVENT_ON_INFO_CHANGE,
|
||||
guild: Guild,
|
||||
newInfo: string,
|
||||
) => void;
|
||||
|
||||
declare type guild_event_on_create = (
|
||||
event: GuildEvents.GUILD_EVENT_ON_CREATE,
|
||||
guild: Guild,
|
||||
leader: Player,
|
||||
name: string,
|
||||
) => void;
|
||||
|
||||
declare type guild_event_on_disband = (
|
||||
event: GuildEvents.GUILD_EVENT_ON_DISBAND,
|
||||
guild: Guild,
|
||||
) => void;
|
||||
|
||||
declare type guild_event_on_money_withdraw = (
|
||||
event: GuildEvents.GUILD_EVENT_ON_MONEY_WITHDRAW,
|
||||
guild: Guild,
|
||||
player: Player,
|
||||
amount: number,
|
||||
isRepair: boolean,
|
||||
) => void;
|
||||
|
||||
declare type guild_event_on_money_deposit = (
|
||||
event: GuildEvents.GUILD_EVENT_ON_MONEY_DEPOSIT,
|
||||
guild: Guild,
|
||||
player: Player,
|
||||
amount: number,
|
||||
) => void;
|
||||
|
||||
declare type guild_event_on_item_move = (
|
||||
event: GuildEvents.GUILD_EVENT_ON_ITEM_MOVE,
|
||||
guild: Guild,
|
||||
player: Player,
|
||||
item: Item,
|
||||
isSrcBank: boolean,
|
||||
srcContainer: number,
|
||||
srcSlotId: number,
|
||||
isDestBank: boolean,
|
||||
destContainer:number,
|
||||
destSlotId:number
|
||||
) => void;
|
||||
|
||||
declare type guild_event_on_event = (
|
||||
event: GuildEvents.GUILD_EVENT_ON_EVENT,
|
||||
guild: Guild,
|
||||
eventType: number,
|
||||
playerGuid1: number,
|
||||
playerGuid2: number,
|
||||
newRank: number,
|
||||
) => void;
|
||||
|
||||
declare type guild_event_on_bank_event = (
|
||||
event: GuildEvents.GUILD_EVENT_ON_BANK_EVENT,
|
||||
guild: Guild,
|
||||
eventType: number,
|
||||
tabId: number,
|
||||
playerGuid: number,
|
||||
itemOrMoney: number,
|
||||
itemStackCount: number,
|
||||
destTabId: number,
|
||||
) => void;
|
||||
|
||||
/**
|
||||
* Registers a [Guild] event handler.
|
||||
* ```typescript
|
||||
* enum GuildEvents
|
||||
* {
|
||||
* // Guild
|
||||
* GUILD_EVENT_ON_ADD_MEMBER = 1, // (event, guild, player, rank)
|
||||
* GUILD_EVENT_ON_REMOVE_MEMBER = 2, // (event, guild, player, isDisbanding)
|
||||
* GUILD_EVENT_ON_MOTD_CHANGE = 3, // (event, guild, newMotd)
|
||||
* GUILD_EVENT_ON_INFO_CHANGE = 4, // (event, guild, newInfo)
|
||||
* GUILD_EVENT_ON_CREATE = 5, // (event, guild, leader, name) // Not on TC
|
||||
* GUILD_EVENT_ON_DISBAND = 6, // (event, guild)
|
||||
* GUILD_EVENT_ON_MONEY_WITHDRAW = 7, // (event, guild, player, amount, isRepair) - Can return new money amount
|
||||
* GUILD_EVENT_ON_MONEY_DEPOSIT = 8, // (event, guild, player, amount) - Can return new money amount
|
||||
* GUILD_EVENT_ON_ITEM_MOVE = 9, // (event, guild, player, item, isSrcBank, srcContainer, srcSlotId, isDestBank, destContainer, destSlotId) // TODO
|
||||
* GUILD_EVENT_ON_EVENT = 10, // (event, guild, eventType, plrGUIDLow1, plrGUIDLow2, newRank) // TODO
|
||||
* GUILD_EVENT_ON_BANK_EVENT = 11, // (event, guild, eventType, tabId, playerGUIDLow, itemOrMoney, itemStackCount, destTabId)
|
||||
* GUILD_EVENT_COUNT
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
declare function RegisterGuildEvent(
|
||||
this: void,
|
||||
event: GuildEvents.GUILD_EVENT_ON_ADD_MEMBER,
|
||||
func: HookFunctionNoSelf<guild_event_on_add_member>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGuildEvent(
|
||||
this: void,
|
||||
event: GuildEvents.GUILD_EVENT_ON_REMOVE_MEMBER,
|
||||
func: HookFunctionNoSelf<guild_event_on_remove_member>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGuildEvent(
|
||||
this: void,
|
||||
event: GuildEvents.GUILD_EVENT_ON_MOTD_CHANGE,
|
||||
func: HookFunctionNoSelf<guild_event_on_motd_change>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGuildEvent(
|
||||
this: void,
|
||||
event: GuildEvents.GUILD_EVENT_ON_INFO_CHANGE,
|
||||
func: HookFunctionNoSelf<guild_event_on_info_change>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGuildEvent(
|
||||
this: void,
|
||||
event: GuildEvents.GUILD_EVENT_ON_CREATE,
|
||||
func: HookFunctionNoSelf<guild_event_on_create>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGuildEvent(
|
||||
this: void,
|
||||
event: GuildEvents.GUILD_EVENT_ON_DISBAND,
|
||||
func: HookFunctionNoSelf<guild_event_on_disband>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGuildEvent(
|
||||
this: void,
|
||||
event: GuildEvents.GUILD_EVENT_ON_MONEY_WITHDRAW,
|
||||
func: HookFunctionNoSelf<guild_event_on_money_withdraw>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGuildEvent(
|
||||
this: void,
|
||||
event: GuildEvents.GUILD_EVENT_ON_MONEY_DEPOSIT,
|
||||
func: HookFunctionNoSelf<guild_event_on_money_deposit>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGuildEvent(
|
||||
this: void,
|
||||
event: GuildEvents.GUILD_EVENT_ON_ITEM_MOVE,
|
||||
func: HookFunctionNoSelf<guild_event_on_item_move>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGuildEvent(
|
||||
this: void,
|
||||
event: GuildEvents.GUILD_EVENT_ON_EVENT,
|
||||
func: HookFunctionNoSelf<guild_event_on_event>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterGuildEvent(
|
||||
this: void,
|
||||
event: GuildEvents.GUILD_EVENT_ON_BANK_EVENT,
|
||||
func: HookFunctionNoSelf<guild_event_on_bank_event>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
83
types/hooks/ItemHooks.d.ts
vendored
Normal file
83
types/hooks/ItemHooks.d.ts
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
declare type item_event_on_dummy_effect = (
|
||||
event: ItemEvents.ITEM_EVENT_ON_DUMMY_EFFECT,
|
||||
pCaster: WorldObject,
|
||||
spellId: number,
|
||||
effIndex: SpellEffIndex,
|
||||
pTarget: Item,
|
||||
) => void;
|
||||
|
||||
declare type item_event_on_quest_accept = (
|
||||
event: ItemEvents.ITEM_EVENT_ON_QUEST_ACCEPT,
|
||||
pPlayer: Player,
|
||||
pItem: Item,
|
||||
pQuest: Quest,
|
||||
) => boolean;
|
||||
|
||||
declare type item_event_on_use = (
|
||||
event: ItemEvents.ITEM_EVENT_ON_USE,
|
||||
player: Player,
|
||||
item: Item,
|
||||
target: GameObject | Item | Corpse | Unit | WorldObject,
|
||||
) => boolean;
|
||||
|
||||
declare type item_event_on_expire = (
|
||||
event: ItemEvents.ITEM_EVENT_ON_EXPIRE,
|
||||
player: Player,
|
||||
itemdId: number,
|
||||
) => boolean;
|
||||
|
||||
declare type item_event_on_remove = (
|
||||
event: ItemEvents.ITEM_EVENT_ON_REMOVE,
|
||||
pPlayer: Player,
|
||||
pItem: Item,
|
||||
) => boolean;
|
||||
|
||||
/**
|
||||
* Registers an [Item] event handler.
|
||||
* ```typescript
|
||||
* enum ItemEvents
|
||||
* {
|
||||
* ITEM_EVENT_ON_DUMMY_EFFECT = 1, // (event, caster, spellid, effindex, item)
|
||||
* ITEM_EVENT_ON_USE = 2, // (event, player, item, target) - Can return false to stop the spell casting
|
||||
* ITEM_EVENT_ON_QUEST_ACCEPT = 3, // (event, player, item, quest) - Can return true
|
||||
* ITEM_EVENT_ON_EXPIRE = 4, // (event, player, itemid) - Can return true
|
||||
* ITEM_EVENT_ON_REMOVE = 5, // (event, player, item) - Can return true
|
||||
* ITEM_EVENT_COUNT
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
declare function RegisterItemEvent(
|
||||
this: void,
|
||||
id: number,
|
||||
event: ItemEvents.ITEM_EVENT_ON_DUMMY_EFFECT,
|
||||
func: HookFunctionNoSelf<item_event_on_dummy_effect>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterItemEvent(
|
||||
this: void,
|
||||
id: number,
|
||||
event: ItemEvents.ITEM_EVENT_ON_USE,
|
||||
func: HookFunctionNoSelf<item_event_on_use>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterItemEvent(
|
||||
this: void,
|
||||
id: number,
|
||||
event: ItemEvents.ITEM_EVENT_ON_QUEST_ACCEPT,
|
||||
func: HookFunctionNoSelf<item_event_on_quest_accept>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterItemEvent(
|
||||
this: void,
|
||||
id: number,
|
||||
event: ItemEvents.ITEM_EVENT_ON_EXPIRE,
|
||||
func: HookFunctionNoSelf<item_event_on_expire>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterItemEvent(
|
||||
this: void,
|
||||
id: number,
|
||||
event: ItemEvents.ITEM_EVENT_ON_REMOVE,
|
||||
func: HookFunctionNoSelf<item_event_on_remove>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
179
types/hooks/MapHooks.d.ts
vendored
Normal file
179
types/hooks/MapHooks.d.ts
vendored
Normal file
@@ -0,0 +1,179 @@
|
||||
declare type instance_event_on_initialize = (
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_INITIALIZE,
|
||||
instance_data: number[],
|
||||
map: EMap,
|
||||
) => void;
|
||||
|
||||
declare type instance_event_on_load = (
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_LOAD,
|
||||
instance_data: number[],
|
||||
map: EMap,
|
||||
) => void;
|
||||
|
||||
declare type instance_event_on_update = (
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_UPDATE,
|
||||
instance_data: number[],
|
||||
map: EMap,
|
||||
diff: number,
|
||||
) => void;
|
||||
|
||||
declare type instance_event_on_player_enter = (
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_PLAYER_ENTER,
|
||||
instance_data: number[],
|
||||
map: EMap,
|
||||
player: Player,
|
||||
) => void;
|
||||
|
||||
declare type instance_event_on_creature_create = (
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_CREATURE_CREATE,
|
||||
instance_data: number[],
|
||||
map: EMap,
|
||||
creature: Creature,
|
||||
) => void;
|
||||
|
||||
declare type instance_event_on_gameobject_create = (
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_GAMEOBJECT_CREATE,
|
||||
instance_data: number[],
|
||||
map: EMap,
|
||||
go: GameObject,
|
||||
) => void;
|
||||
|
||||
declare type instance_event_on_check_encounter_in_progress = (
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_CHECK_ENCOUNTER_IN_PROGRESS,
|
||||
instance_data: number[],
|
||||
map: EMap,
|
||||
) => boolean;
|
||||
|
||||
|
||||
/**
|
||||
* Registers a [Map] event handler for one instance of a [Map].
|
||||
* ```typescript
|
||||
* enum InstanceEvents
|
||||
* {
|
||||
* INSTANCE_EVENT_ON_INITIALIZE = 1, // (event, instance_data, map)
|
||||
* INSTANCE_EVENT_ON_LOAD = 2, // (event, instance_data, map)
|
||||
* INSTANCE_EVENT_ON_UPDATE = 3, // (event, instance_data, map, diff)
|
||||
* INSTANCE_EVENT_ON_PLAYER_ENTER = 4, // (event, instance_data, map, player)
|
||||
* INSTANCE_EVENT_ON_CREATURE_CREATE = 5, // (event, instance_data, map, creature)
|
||||
* INSTANCE_EVENT_ON_GAMEOBJECT_CREATE = 6, // (event, instance_data, map, go)
|
||||
* INSTANCE_EVENT_ON_CHECK_ENCOUNTER_IN_PROGRESS = 7, // (event, instance_data, map)
|
||||
* INSTANCE_EVENT_COUNT
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
declare function RegisterInstanceEvent(
|
||||
this: void,
|
||||
instance_id: number,
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_INITIALIZE,
|
||||
func: HookFunctionNoSelf<instance_event_on_initialize>,
|
||||
shots?: number,
|
||||
): void;
|
||||
declare function RegisterInstanceEvent(
|
||||
this: void,
|
||||
instance_id: number,
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_LOAD,
|
||||
func: HookFunctionNoSelf<instance_event_on_load>,
|
||||
shots?: number,
|
||||
): void;
|
||||
declare function RegisterInstanceEvent(
|
||||
this: void,
|
||||
instance_id: number,
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_UPDATE,
|
||||
func: HookFunctionNoSelf<instance_event_on_update>,
|
||||
shots?: number,
|
||||
): void;
|
||||
declare function RegisterInstanceEvent(
|
||||
this: void,
|
||||
instance_id: number,
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_PLAYER_ENTER,
|
||||
func: HookFunctionNoSelf<instance_event_on_player_enter>,
|
||||
shots?: number,
|
||||
): void;
|
||||
declare function RegisterInstanceEvent(
|
||||
this: void,
|
||||
instance_id: number,
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_CREATURE_CREATE,
|
||||
func: HookFunctionNoSelf<instance_event_on_creature_create>,
|
||||
shots?: number,
|
||||
): void;
|
||||
declare function RegisterInstanceEvent(
|
||||
this: void,
|
||||
instance_id: number,
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_GAMEOBJECT_CREATE,
|
||||
func: HookFunctionNoSelf<instance_event_on_gameobject_create>,
|
||||
shots?: number,
|
||||
): void;
|
||||
declare function RegisterInstanceEvent(
|
||||
this: void,
|
||||
instance_id: number,
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_CHECK_ENCOUNTER_IN_PROGRESS,
|
||||
func: HookFunctionNoSelf<instance_event_on_check_encounter_in_progress>,
|
||||
shots?: number,
|
||||
): void;
|
||||
|
||||
|
||||
/**
|
||||
* Registers a [Map] event handler for all instance of a [Map].
|
||||
* ```typescript
|
||||
* enum InstanceEvents
|
||||
* {
|
||||
* INSTANCE_EVENT_ON_INITIALIZE = 1, // (event, instance_data, map)
|
||||
* INSTANCE_EVENT_ON_LOAD = 2, // (event, instance_data, map)
|
||||
* INSTANCE_EVENT_ON_UPDATE = 3, // (event, instance_data, map, diff)
|
||||
* INSTANCE_EVENT_ON_PLAYER_ENTER = 4, // (event, instance_data, map, player)
|
||||
* INSTANCE_EVENT_ON_CREATURE_CREATE = 5, // (event, instance_data, map, creature)
|
||||
* INSTANCE_EVENT_ON_GAMEOBJECT_CREATE = 6, // (event, instance_data, map, go)
|
||||
* INSTANCE_EVENT_ON_CHECK_ENCOUNTER_IN_PROGRESS = 7, // (event, instance_data, map)
|
||||
* INSTANCE_EVENT_COUNT
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
declare function RegisterMapEvent(
|
||||
this: void,
|
||||
map_id: number,
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_INITIALIZE,
|
||||
func: HookFunctionNoSelf<instance_event_on_initialize>,
|
||||
shots?: number,
|
||||
): void;
|
||||
declare function RegisterMapEvent(
|
||||
this: void,
|
||||
map_id: number,
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_LOAD,
|
||||
func: HookFunctionNoSelf<instance_event_on_load>,
|
||||
shots?: number,
|
||||
): void;
|
||||
declare function RegisterMapEvent(
|
||||
this: void,
|
||||
map_id: number,
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_UPDATE,
|
||||
func: HookFunctionNoSelf<instance_event_on_update>,
|
||||
shots?: number,
|
||||
): void;
|
||||
declare function RegisterMapEvent(
|
||||
this: void,
|
||||
map_id: number,
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_PLAYER_ENTER,
|
||||
func: HookFunctionNoSelf<instance_event_on_player_enter>,
|
||||
shots?: number,
|
||||
): void;
|
||||
declare function RegisterMapEvent(
|
||||
this: void,
|
||||
map_id: number,
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_CREATURE_CREATE,
|
||||
func: HookFunctionNoSelf<instance_event_on_creature_create>,
|
||||
shots?: number,
|
||||
): void;
|
||||
declare function RegisterMapEvent(
|
||||
this: void,
|
||||
map_id: number,
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_GAMEOBJECT_CREATE,
|
||||
func: HookFunctionNoSelf<instance_event_on_gameobject_create>,
|
||||
shots?: number,
|
||||
): void;
|
||||
declare function RegisterMapEvent(
|
||||
this: void,
|
||||
map_id: number,
|
||||
event: InstanceEvents.INSTANCE_EVENT_ON_CHECK_ENCOUNTER_IN_PROGRESS,
|
||||
func: HookFunctionNoSelf<instance_event_on_check_encounter_in_progress>,
|
||||
shots?: number,
|
||||
): void;
|
||||
62
types/hooks/PacketHooks.d.ts
vendored
Normal file
62
types/hooks/PacketHooks.d.ts
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
declare type server_event_on_packet_send_any = (
|
||||
event: ServerEvents.SERVER_EVENT_ON_PACKET_SEND,
|
||||
packet: WorldPacket,
|
||||
player: Player,
|
||||
) => boolean | WorldPacket;
|
||||
|
||||
declare type packet_event_on_packet_send_one = (
|
||||
event: PacketEvents.PACKET_EVENT_ON_PACKET_SEND,
|
||||
packet: WorldPacket,
|
||||
player: Player,
|
||||
) => boolean | WorldPacket;
|
||||
|
||||
declare type server_event_on_packet_receive_any = (
|
||||
event: ServerEvents.SERVER_EVENT_ON_PACKET_RECEIVE,
|
||||
packet: WorldPacket,
|
||||
player: Player,
|
||||
) => boolean | WorldPacket;
|
||||
|
||||
declare type packet_event_on_packet_receive_one = (
|
||||
event: PacketEvents.PACKET_EVENT_ON_PACKET_RECEIVE,
|
||||
packet: WorldPacket,
|
||||
player: Player,
|
||||
) => boolean | WorldPacket;
|
||||
|
||||
|
||||
/**
|
||||
* Registers a [WorldPacket] event handler.
|
||||
*
|
||||
* @param entry: Opcode ID
|
||||
*
|
||||
* ```typescript
|
||||
* enum PacketEvents
|
||||
* {
|
||||
* PACKET_EVENT_ON_PACKET_RECEIVE = 5, // (event, packet, player) - Player only if accessible. Can return false, newPacket
|
||||
* PACKET_EVENT_ON_PACKET_RECEIVE_UNKNOWN = 6, // Not Implemented
|
||||
* PACKET_EVENT_ON_PACKET_SEND = 7, // (event, packet, player) - Player only if accessible. Can return false, newPacket
|
||||
* PACKET_EVENT_COUNT
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
declare function RegisterPacketEvent(
|
||||
this: void,
|
||||
entry: number,
|
||||
event: PacketEvents.PACKET_EVENT_ON_PACKET_RECEIVE,
|
||||
func: HookFunctionNoSelf<packet_event_on_packet_receive_one>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPacketEvent(
|
||||
this: void,
|
||||
entry: number,
|
||||
event: PacketEvents.PACKET_EVENT_ON_PACKET_SEND,
|
||||
func: HookFunctionNoSelf<packet_event_on_packet_send_one>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
|
||||
// declare function RegisterPacketEvent(
|
||||
// this: void,
|
||||
// entry: number,
|
||||
// event: PacketEvents.PACKET_EVENT_ON_PACKET_RECEIVE_UNKNOWN,
|
||||
// func: HookFunctionNoSelf<packet_event_on_packet_receive_unknown>,
|
||||
// shots?: number,
|
||||
// ): (...args: any[]) => any;
|
||||
556
types/hooks/PlayerHooks.d.ts
vendored
Normal file
556
types/hooks/PlayerHooks.d.ts
vendored
Normal file
@@ -0,0 +1,556 @@
|
||||
declare type player_event_on_learn_talents = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_LEARN_TALENTS,
|
||||
pPlayer: Player,
|
||||
talentId: number,
|
||||
talentRank: number,
|
||||
spellid: number,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_loot_item = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_LOOT_ITEM,
|
||||
pPlayer: Player,
|
||||
pItem: Item,
|
||||
count: number,
|
||||
guid: number,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_loot_money = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_LOOT_MONEY,
|
||||
pPlayer: Player,
|
||||
amount: number,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_first_login = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_FIRST_LOGIN,
|
||||
pPlayer: Player,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_repop = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_REPOP,
|
||||
pPlayer: Player,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_resurrect = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_RESURRECT,
|
||||
pPlayer: Player,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_quest_abandon = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_QUEST_ABANDON,
|
||||
pPlayer: Player,
|
||||
questId: number,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_equip = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_EQUIP,
|
||||
pPlayer: Player,
|
||||
pItem: Item,
|
||||
bag: number,
|
||||
slot: number,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_can_use_item = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_CAN_USE_ITEM,
|
||||
pPlayer: Player,
|
||||
itemEntry: number,
|
||||
) => InventoryResult;
|
||||
|
||||
declare type player_event_on_enter_combat = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_ENTER_COMBAT,
|
||||
pPlayer: Player,
|
||||
pEnemy: Unit,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_leave_combat = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_LEAVE_COMBAT,
|
||||
pPlayer: Player,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_kill_player = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_KILL_PLAYER,
|
||||
pKiller: Player,
|
||||
pKilled: Player,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_kill_creature = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_KILL_CREATURE,
|
||||
pKiller: Player,
|
||||
pKilled: Creature,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_killed_by_creature = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_KILLED_BY_CREATURE,
|
||||
pKiller: Creature,
|
||||
pKilled: Player,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_level_change = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_LEVEL_CHANGE,
|
||||
pPlayer: Player,
|
||||
oldLevel: number,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_talents_change = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_TALENTS_CHANGE,
|
||||
pPlayer: Player,
|
||||
newPoints: number,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_talents_reset = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_TALENTS_RESET,
|
||||
pPlayer: Player,
|
||||
noCost: boolean,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_money_change = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_MONEY_CHANGE,
|
||||
pPlayer: Player,
|
||||
amount: number,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_give_xp = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_GIVE_XP,
|
||||
pPlayer: Player,
|
||||
amount: number,
|
||||
pVictim: Unit,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_reputation_change = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_REPUTATION_CHANGE,
|
||||
pPlayer: Player,
|
||||
factionID: number,
|
||||
standing: number,
|
||||
incremental: boolean,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_duel_request = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_DUEL_REQUEST,
|
||||
pTarget: Player,
|
||||
pChallenger: Player,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_duel_start = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_DUEL_START,
|
||||
pStarter: Player,
|
||||
pChallenger: Player,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_duel_end = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_DUEL_END,
|
||||
pWinner: Player,
|
||||
pLoser: Player,
|
||||
type: DuelCompleteType,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_emote = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_EMOTE,
|
||||
pPlayer: Player,
|
||||
emote: number,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_text_emote = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_TEXT_EMOTE,
|
||||
pPlayer: Player,
|
||||
textEmote: number,
|
||||
emoteNum: number,
|
||||
guid: number,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_spell_cast = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_SPELL_CAST,
|
||||
pPlayer: Player,
|
||||
pSpell: Spell,
|
||||
skipCheck: boolean,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_login = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_LOGIN,
|
||||
pPlayer: Player,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_logout = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_LOGOUT,
|
||||
pPlayer: Player,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_character_create = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_CHARACTER_CREATE,
|
||||
pPlayer: Player,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_character_delete = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_CHARACTER_DELETE,
|
||||
guidlow: number,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_save = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_SAVE,
|
||||
pPlayer: Player,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_bind_to_instance = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_BIND_TO_INSTANCE,
|
||||
pPlayer: Player,
|
||||
difficulty: Difficulty,
|
||||
mapid: number,
|
||||
permanent: boolean,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_update_zone = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_UPDATE_ZONE,
|
||||
pPlayer: Player,
|
||||
newZone: number,
|
||||
newArea: number,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_map_change = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_MAP_CHANGE,
|
||||
player: Player,
|
||||
) => void;
|
||||
|
||||
declare type player_event_on_chat = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_CHAT,
|
||||
pPlayer: Player,
|
||||
msg: string,
|
||||
type: ChatMsg,
|
||||
lang: Language,
|
||||
) => boolean | string;
|
||||
|
||||
declare type player_event_on_group_chat = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_GROUP_CHAT,
|
||||
pPlayer: Player,
|
||||
msg: string,
|
||||
type: ChatMsg,
|
||||
lang: Language,
|
||||
pGroup: Group,
|
||||
) => boolean | string;
|
||||
|
||||
declare type player_event_on_guild_chat = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_GUILD_CHAT,
|
||||
pPlayer: Player,
|
||||
msg: string,
|
||||
type: ChatMsg,
|
||||
lang: Language,
|
||||
pGuild: Guild,
|
||||
) => boolean | string;
|
||||
|
||||
declare type player_event_on_channel_chat = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_CHANNEL_CHAT,
|
||||
player: Player,
|
||||
msg: string,
|
||||
type: ChatMsg,
|
||||
lang: Language,
|
||||
channel: number,
|
||||
) => boolean | string;
|
||||
|
||||
declare type player_event_on_whisper = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_WHISPER,
|
||||
pPlayer: Player,
|
||||
msg: string,
|
||||
type: ChatMsg,
|
||||
lang: Language,
|
||||
pReceiver: Player,
|
||||
) => boolean | string;
|
||||
|
||||
/**
|
||||
* player is nil if command used from console. Can return false
|
||||
*/
|
||||
declare type player_event_on_command = (
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_COMMAND,
|
||||
pPlayer: Player,
|
||||
command: string
|
||||
) => boolean;
|
||||
|
||||
/**
|
||||
* @noself
|
||||
*
|
||||
* Registers a [Player] event handler.
|
||||
* ```typescript
|
||||
* enum PlayerEvents
|
||||
* {
|
||||
* PLAYER_EVENT_ON_CHARACTER_CREATE = 1, // (event, player)
|
||||
* PLAYER_EVENT_ON_CHARACTER_DELETE = 2, // (event, guid)
|
||||
* PLAYER_EVENT_ON_LOGIN = 3, // (event, player)
|
||||
* PLAYER_EVENT_ON_LOGOUT = 4, // (event, player)
|
||||
* PLAYER_EVENT_ON_SPELL_CAST = 5, // (event, player, spell, skipCheck)
|
||||
* PLAYER_EVENT_ON_KILL_PLAYER = 6, // (event, killer, killed)
|
||||
* PLAYER_EVENT_ON_KILL_CREATURE = 7, // (event, killer, killed)
|
||||
* PLAYER_EVENT_ON_KILLED_BY_CREATURE = 8, // (event, killer, killed)
|
||||
* PLAYER_EVENT_ON_DUEL_REQUEST = 9, // (event, target, challenger)
|
||||
* PLAYER_EVENT_ON_DUEL_START = 10, // (event, player1, player2)
|
||||
* PLAYER_EVENT_ON_DUEL_END = 11, // (event, winner, loser, type)
|
||||
* PLAYER_EVENT_ON_GIVE_XP = 12, // (event, player, amount, victim) - Can return new XP amount
|
||||
* PLAYER_EVENT_ON_LEVEL_CHANGE = 13, // (event, player, oldLevel)
|
||||
* PLAYER_EVENT_ON_MONEY_CHANGE = 14, // (event, player, amount) - Can return new money amount
|
||||
* PLAYER_EVENT_ON_REPUTATION_CHANGE = 15, // (event, player, factionId, standing, incremental) - Can return new standing
|
||||
* PLAYER_EVENT_ON_TALENTS_CHANGE = 16, // (event, player, points)
|
||||
* PLAYER_EVENT_ON_TALENTS_RESET = 17, // (event, player, noCost)
|
||||
* PLAYER_EVENT_ON_CHAT = 18, // (event, player, msg, Type, lang) - Can return false, newMessage
|
||||
* PLAYER_EVENT_ON_WHISPER = 19, // (event, player, msg, Type, lang, receiver) - Can return false, newMessage
|
||||
* PLAYER_EVENT_ON_GROUP_CHAT = 20, // (event, player, msg, Type, lang, group) - Can return false, newMessage
|
||||
* PLAYER_EVENT_ON_GUILD_CHAT = 21, // (event, player, msg, Type, lang, guild) - Can return false, newMessage
|
||||
* PLAYER_EVENT_ON_CHANNEL_CHAT = 22, // (event, player, msg, Type, lang, channel) - Can return false, newMessage
|
||||
* PLAYER_EVENT_ON_EMOTE = 23, // (event, player, emote) - Not triggered on any known emote
|
||||
* PLAYER_EVENT_ON_TEXT_EMOTE = 24, // (event, player, textEmote, emoteNum, guid)
|
||||
* PLAYER_EVENT_ON_SAVE = 25, // (event, player)
|
||||
* PLAYER_EVENT_ON_BIND_TO_INSTANCE = 26, // (event, player, difficulty, mapid, permanent)
|
||||
* PLAYER_EVENT_ON_UPDATE_ZONE = 27, // (event, player, newZone, newArea)
|
||||
* PLAYER_EVENT_ON_MAP_CHANGE = 28, // (event, player)
|
||||
* // Custom
|
||||
* PLAYER_EVENT_ON_EQUIP = 29, // (event, player, item, bag, slot)
|
||||
* PLAYER_EVENT_ON_FIRST_LOGIN = 30, // (event, player)
|
||||
* PLAYER_EVENT_ON_CAN_USE_ITEM = 31, // (event, player, itemEntry) - Can return InventoryResult enum value
|
||||
* PLAYER_EVENT_ON_LOOT_ITEM = 32, // (event, player, item, count)
|
||||
* PLAYER_EVENT_ON_ENTER_COMBAT = 33, // (event, player, enemy)
|
||||
* PLAYER_EVENT_ON_LEAVE_COMBAT = 34, // (event, player)
|
||||
* PLAYER_EVENT_ON_REPOP = 35, // (event, player)
|
||||
* PLAYER_EVENT_ON_RESURRECT = 36, // (event, player)
|
||||
* PLAYER_EVENT_ON_LOOT_MONEY = 37, // (event, player, amount)
|
||||
* PLAYER_EVENT_ON_QUEST_ABANDON = 38, // (event, player, questId)
|
||||
* PLAYER_EVENT_ON_LEARN_TALENTS = 39, // (event, player, talentId, talentRank, spellid)
|
||||
* // UNUSED = 40, // (event, player)
|
||||
* // UNUSED = 41, // (event, player)
|
||||
* PLAYER_EVENT_ON_COMMAND = 42, // (event, player, command) - player is nil if command used from console. Can return false
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_CHARACTER_CREATE,
|
||||
func: HookFunctionNoSelf<player_event_on_character_create>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_CHARACTER_DELETE,
|
||||
func: HookFunctionNoSelf<player_event_on_character_delete>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_LOGIN,
|
||||
func: HookFunctionNoSelf<player_event_on_login>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_LOGOUT,
|
||||
func: HookFunctionNoSelf<player_event_on_logout>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_SPELL_CAST,
|
||||
func: HookFunctionNoSelf<player_event_on_spell_cast>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_KILL_PLAYER,
|
||||
func: HookFunctionNoSelf<player_event_on_kill_player>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_KILL_CREATURE,
|
||||
func: HookFunctionNoSelf<player_event_on_kill_creature>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_KILLED_BY_CREATURE,
|
||||
func: HookFunctionNoSelf<player_event_on_killed_by_creature>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_DUEL_REQUEST,
|
||||
func: HookFunctionNoSelf<player_event_on_duel_request>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_DUEL_START,
|
||||
func: HookFunctionNoSelf<player_event_on_duel_start>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_DUEL_END,
|
||||
func: HookFunctionNoSelf<player_event_on_duel_end>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_GIVE_XP,
|
||||
func: HookFunctionNoSelf<player_event_on_give_xp>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_LEVEL_CHANGE,
|
||||
func: HookFunctionNoSelf<player_event_on_level_change>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_MONEY_CHANGE,
|
||||
func: HookFunctionNoSelf<player_event_on_money_change>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_REPUTATION_CHANGE,
|
||||
func: HookFunctionNoSelf<player_event_on_reputation_change>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_TALENTS_CHANGE,
|
||||
func: HookFunctionNoSelf<player_event_on_talents_change>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_TALENTS_RESET,
|
||||
func: HookFunctionNoSelf<player_event_on_talents_reset>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_CHAT,
|
||||
func: HookFunctionNoSelf<player_event_on_chat>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_WHISPER,
|
||||
func: HookFunctionNoSelf<player_event_on_whisper>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_GROUP_CHAT,
|
||||
func: HookFunctionNoSelf<player_event_on_group_chat>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_GUILD_CHAT,
|
||||
func: HookFunctionNoSelf<player_event_on_guild_chat>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_CHANNEL_CHAT,
|
||||
func: HookFunctionNoSelf<player_event_on_channel_chat>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_EMOTE,
|
||||
func: HookFunctionNoSelf<player_event_on_emote>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_TEXT_EMOTE,
|
||||
func: HookFunctionNoSelf<player_event_on_text_emote>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_SAVE,
|
||||
func: HookFunctionNoSelf<player_event_on_save>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_BIND_TO_INSTANCE,
|
||||
func: HookFunctionNoSelf<player_event_on_bind_to_instance>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_UPDATE_ZONE,
|
||||
func: HookFunctionNoSelf<player_event_on_update_zone>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_MAP_CHANGE,
|
||||
func: HookFunctionNoSelf<player_event_on_map_change>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_EQUIP,
|
||||
func: HookFunctionNoSelf<player_event_on_equip>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_FIRST_LOGIN,
|
||||
func: HookFunctionNoSelf<player_event_on_first_login>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_CAN_USE_ITEM,
|
||||
func: HookFunctionNoSelf<player_event_on_can_use_item>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_LOOT_ITEM,
|
||||
func: HookFunctionNoSelf<player_event_on_loot_item>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_ENTER_COMBAT,
|
||||
func: HookFunctionNoSelf<player_event_on_enter_combat>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_LEAVE_COMBAT,
|
||||
func: HookFunctionNoSelf<player_event_on_leave_combat>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_REPOP,
|
||||
func: HookFunctionNoSelf<player_event_on_repop>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_RESURRECT,
|
||||
func: HookFunctionNoSelf<player_event_on_resurrect>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_LOOT_MONEY,
|
||||
func: HookFunctionNoSelf<player_event_on_loot_money>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_QUEST_ABANDON,
|
||||
func: HookFunctionNoSelf<player_event_on_quest_abandon>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_LEARN_TALENTS,
|
||||
func: HookFunctionNoSelf<player_event_on_learn_talents>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterPlayerEvent(
|
||||
this:void,
|
||||
event: PlayerEvents.PLAYER_EVENT_ON_COMMAND,
|
||||
func: HookFunctionNoSelf<player_event_on_command>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
374
types/hooks/ServerHooks.d.ts
vendored
Normal file
374
types/hooks/ServerHooks.d.ts
vendored
Normal file
@@ -0,0 +1,374 @@
|
||||
declare type addon_event_on_message = (
|
||||
event: ServerEvents.ADDON_EVENT_ON_MESSAGE,
|
||||
sender: Player,
|
||||
type: number,
|
||||
prefix: string,
|
||||
msg: string,
|
||||
target: Player | Guild | Group | number,
|
||||
) => boolean;
|
||||
|
||||
declare type game_event_start = (
|
||||
event: ServerEvents.GAME_EVENT_START,
|
||||
eventid: number,
|
||||
) => void;
|
||||
|
||||
declare type game_event_stop = (
|
||||
event: ServerEvents.GAME_EVENT_STOP,
|
||||
eventid: number,
|
||||
) => void;
|
||||
|
||||
declare type eluna_event_on_lua_state_close = (
|
||||
event: ServerEvents.ELUNA_EVENT_ON_LUA_STATE_CLOSE,
|
||||
) => void;
|
||||
|
||||
declare type eluna_event_on_lua_state_open = (
|
||||
event: ServerEvents.ELUNA_EVENT_ON_LUA_STATE_OPEN,
|
||||
) => void;
|
||||
|
||||
declare type trigger_event_on_trigger = (
|
||||
event: ServerEvents.TRIGGER_EVENT_ON_TRIGGER,
|
||||
pPlayer: Player,
|
||||
pTrigger: number,
|
||||
) => boolean;
|
||||
|
||||
declare type weather_event_on_change = (
|
||||
event: ServerEvents.WEATHER_EVENT_ON_CHANGE,
|
||||
zone: number,
|
||||
state: WeatherState,
|
||||
grade: number,
|
||||
) => void;
|
||||
|
||||
declare type auction_event_on_add = (
|
||||
event: ServerEvents.AUCTION_EVENT_ON_ADD,
|
||||
auctionId: number,
|
||||
owner: Player,
|
||||
item: Item,
|
||||
expireTime: number,
|
||||
buyout: number,
|
||||
startBid: number,
|
||||
currentBid: number,
|
||||
bidderGUIDLow: number,
|
||||
) => void;
|
||||
|
||||
declare type auction_event_on_remove = (
|
||||
event: ServerEvents.AUCTION_EVENT_ON_REMOVE,
|
||||
auctionId: number,
|
||||
owner: Player,
|
||||
item: Item,
|
||||
expireTime: number,
|
||||
buyout: number,
|
||||
startBid: number,
|
||||
currentBid: number,
|
||||
bidderGUIDLow: number,
|
||||
) => void;
|
||||
|
||||
declare type auction_event_on_successful = (
|
||||
event: ServerEvents.AUCTION_EVENT_ON_SUCCESSFUL,
|
||||
auctionId: number,
|
||||
owner: Player,
|
||||
item: Item,
|
||||
expireTime: number,
|
||||
buyout: number,
|
||||
startBid: number,
|
||||
currentBid: number,
|
||||
bidderGUIDLow: number,
|
||||
) => void;
|
||||
|
||||
declare type auction_event_on_expire = (
|
||||
event: ServerEvents.AUCTION_EVENT_ON_EXPIRE,
|
||||
auctionId: number,
|
||||
owner: Player,
|
||||
item: Item,
|
||||
expireTime: number,
|
||||
buyout: number,
|
||||
startBid: number,
|
||||
currentBid: number,
|
||||
bidderGUIDLow: number,
|
||||
) => void;
|
||||
|
||||
declare type world_event_on_open_state_change = (
|
||||
event: ServerEvents.WORLD_EVENT_ON_OPEN_STATE_CHANGE,
|
||||
open: boolean,
|
||||
) => void;
|
||||
|
||||
declare type world_event_on_config_load = (
|
||||
event: ServerEvents.WORLD_EVENT_ON_CONFIG_LOAD,
|
||||
reload: boolean,
|
||||
) => void;
|
||||
|
||||
declare type world_event_on_shutdown_init = (
|
||||
event: ServerEvents.WORLD_EVENT_ON_SHUTDOWN_INIT,
|
||||
code: ShutdownExitCode,
|
||||
mask: ShutdownMask,
|
||||
) => void;
|
||||
|
||||
declare type world_event_on_shutdown_cancel = (
|
||||
event: ServerEvents.WORLD_EVENT_ON_SHUTDOWN_CANCEL,
|
||||
) => void;
|
||||
|
||||
declare type world_event_on_update = (
|
||||
event: ServerEvents.WORLD_EVENT_ON_UPDATE,
|
||||
diff: number
|
||||
) => void;
|
||||
|
||||
declare type world_event_on_startup = (
|
||||
event: ServerEvents.WORLD_EVENT_ON_STARTUP,
|
||||
) => void;
|
||||
|
||||
declare type world_event_on_shutdown = (
|
||||
event: ServerEvents.WORLD_EVENT_ON_SHUTDOWN,
|
||||
) => void;
|
||||
|
||||
declare type map_event_on_create = (
|
||||
event: ServerEvents.MAP_EVENT_ON_CREATE,
|
||||
map: EMap,
|
||||
) => void;
|
||||
|
||||
declare type map_event_on_destroy = (
|
||||
event: ServerEvents.MAP_EVENT_ON_DESTROY,
|
||||
map: EMap,
|
||||
) => void;
|
||||
|
||||
declare type map_event_on_player_enter = (
|
||||
event: ServerEvents.MAP_EVENT_ON_PLAYER_ENTER,
|
||||
map: EMap,
|
||||
player: Player,
|
||||
) => void;
|
||||
|
||||
declare type map_event_on_player_leave = (
|
||||
event: ServerEvents.MAP_EVENT_ON_PLAYER_LEAVE,
|
||||
map: EMap,
|
||||
player: Player,
|
||||
) => void;
|
||||
|
||||
declare type map_event_on_update = (
|
||||
event: ServerEvents.MAP_EVENT_ON_UPDATE,
|
||||
map: EMap,
|
||||
diff: number,
|
||||
) => void;
|
||||
|
||||
declare type world_event_on_delete_gameobject = (
|
||||
event: ServerEvents.WORLD_EVENT_ON_DELETE_GAMEOBJECT,
|
||||
gameobject: GameObject,
|
||||
) => void;
|
||||
|
||||
declare type world_event_on_delete_creature = (
|
||||
event: ServerEvents.WORLD_EVENT_ON_DELETE_CREATURE,
|
||||
creature: Creature,
|
||||
) => void;
|
||||
|
||||
|
||||
/**
|
||||
* Registers a server event handler.
|
||||
* enum ServerEvents
|
||||
* {
|
||||
* // Server
|
||||
* SERVER_EVENT_ON_NETWORK_START = 1, // Not Implemented
|
||||
* SERVER_EVENT_ON_NETWORK_STOP = 2, // Not Implemented
|
||||
* SERVER_EVENT_ON_SOCKET_OPEN = 3, // Not Implemented
|
||||
* SERVER_EVENT_ON_SOCKET_CLOSE = 4, // Not Implemented
|
||||
* SERVER_EVENT_ON_PACKET_RECEIVE = 5, // (event, packet, player) - Player only if accessible. Can return false, newPacket
|
||||
* SERVER_EVENT_ON_PACKET_RECEIVE_UNKNOWN = 6, // Not Implemented
|
||||
* SERVER_EVENT_ON_PACKET_SEND = 7, // (event, packet, player) - Player only if accessible. Can return false, newPacket
|
||||
* // World
|
||||
* WORLD_EVENT_ON_OPEN_STATE_CHANGE = 8, // (event, open) - Needs core support on Mangos
|
||||
* WORLD_EVENT_ON_CONFIG_LOAD = 9, // (event, reload)
|
||||
* // UNUSED = 10,
|
||||
* WORLD_EVENT_ON_SHUTDOWN_INIT = 11, // (event, code, mask)
|
||||
* WORLD_EVENT_ON_SHUTDOWN_CANCEL = 12, // (event)
|
||||
* WORLD_EVENT_ON_UPDATE = 13, // (event, diff)
|
||||
* WORLD_EVENT_ON_STARTUP = 14, // (event)
|
||||
* WORLD_EVENT_ON_SHUTDOWN = 15, // (event)
|
||||
* // Eluna
|
||||
* ELUNA_EVENT_ON_LUA_STATE_CLOSE = 16, // (event) - triggers just before shutting down eluna (on shutdown and restart)
|
||||
* // Map
|
||||
* MAP_EVENT_ON_CREATE = 17, // (event, map)
|
||||
* MAP_EVENT_ON_DESTROY = 18, // (event, map)
|
||||
* MAP_EVENT_ON_GRID_LOAD = 19, // Not Implemented
|
||||
* MAP_EVENT_ON_GRID_UNLOAD = 20, // Not Implemented
|
||||
* MAP_EVENT_ON_PLAYER_ENTER = 21, // (event, map, player)
|
||||
* MAP_EVENT_ON_PLAYER_LEAVE = 22, // (event, map, player)
|
||||
* MAP_EVENT_ON_UPDATE = 23, // (event, map, diff)
|
||||
* // Area trigger
|
||||
* TRIGGER_EVENT_ON_TRIGGER = 24, // (event, player, triggerId) - Can return true
|
||||
* // Weather
|
||||
* WEATHER_EVENT_ON_CHANGE = 25, // (event, zoneId, state, grade)
|
||||
* // Auction house
|
||||
* AUCTION_EVENT_ON_ADD = 26, // (event, auctionId, owner, item, expireTime, buyout, startBid, currentBid, bidderGUIDLow)
|
||||
* AUCTION_EVENT_ON_REMOVE = 27, // (event, auctionId, owner, item, expireTime, buyout, startBid, currentBid, bidderGUIDLow)
|
||||
* AUCTION_EVENT_ON_SUCCESSFUL = 28, // (event, auctionId, owner, item, expireTime, buyout, startBid, currentBid, bidderGUIDLow)
|
||||
* AUCTION_EVENT_ON_EXPIRE = 29, // (event, auctionId, owner, item, expireTime, buyout, startBid, currentBid, bidderGUIDLow)
|
||||
* // AddOns
|
||||
* ADDON_EVENT_ON_MESSAGE = 30, // (event, sender, type, prefix, msg, target) - target can be nil/whisper_target/guild/group/channel. Can return false
|
||||
* WORLD_EVENT_ON_DELETE_CREATURE = 31, // (event, creature)
|
||||
* WORLD_EVENT_ON_DELETE_GAMEOBJECT = 32, // (event, gameobject)
|
||||
* // Eluna
|
||||
* ELUNA_EVENT_ON_LUA_STATE_OPEN = 33, // (event) - triggers after all scripts are loaded
|
||||
* GAME_EVENT_START = 34, // (event, gameeventid)
|
||||
* GAME_EVENT_STOP = 35, // (event, gameeventid)
|
||||
* };
|
||||
*/
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
entry: number,
|
||||
event: ServerEvents.SERVER_EVENT_ON_PACKET_RECEIVE,
|
||||
func: HookFunctionNoSelf<server_event_on_packet_receive_any>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
entry: number,
|
||||
event: ServerEvents.SERVER_EVENT_ON_PACKET_SEND,
|
||||
func: HookFunctionNoSelf<server_event_on_packet_send_any>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.WORLD_EVENT_ON_OPEN_STATE_CHANGE,
|
||||
func: HookFunctionNoSelf<world_event_on_open_state_change>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.WORLD_EVENT_ON_CONFIG_LOAD,
|
||||
func: HookFunctionNoSelf<world_event_on_config_load>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.WORLD_EVENT_ON_SHUTDOWN_INIT,
|
||||
func: HookFunctionNoSelf<world_event_on_shutdown_init>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.WORLD_EVENT_ON_SHUTDOWN_CANCEL,
|
||||
func: HookFunctionNoSelf<world_event_on_shutdown_cancel>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.WORLD_EVENT_ON_UPDATE,
|
||||
func: HookFunctionNoSelf<world_event_on_update>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.WORLD_EVENT_ON_STARTUP,
|
||||
func: HookFunctionNoSelf<world_event_on_startup>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.WORLD_EVENT_ON_SHUTDOWN,
|
||||
func: HookFunctionNoSelf<world_event_on_shutdown>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.ELUNA_EVENT_ON_LUA_STATE_CLOSE,
|
||||
func: HookFunctionNoSelf<eluna_event_on_lua_state_close>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.MAP_EVENT_ON_CREATE,
|
||||
func: HookFunctionNoSelf<map_event_on_create>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.MAP_EVENT_ON_DESTROY,
|
||||
func: HookFunctionNoSelf<map_event_on_destroy>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.MAP_EVENT_ON_PLAYER_ENTER,
|
||||
func: HookFunctionNoSelf<map_event_on_player_enter>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.MAP_EVENT_ON_PLAYER_LEAVE,
|
||||
func: HookFunctionNoSelf<map_event_on_player_leave>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.MAP_EVENT_ON_UPDATE,
|
||||
func: HookFunctionNoSelf<map_event_on_update>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.TRIGGER_EVENT_ON_TRIGGER,
|
||||
func: HookFunctionNoSelf<trigger_event_on_trigger>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.WEATHER_EVENT_ON_CHANGE,
|
||||
func: HookFunctionNoSelf<weather_event_on_change>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.AUCTION_EVENT_ON_ADD,
|
||||
func: HookFunctionNoSelf<auction_event_on_add>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.AUCTION_EVENT_ON_REMOVE,
|
||||
func: HookFunctionNoSelf<auction_event_on_remove>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.AUCTION_EVENT_ON_SUCCESSFUL,
|
||||
func: HookFunctionNoSelf<auction_event_on_successful>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.AUCTION_EVENT_ON_EXPIRE,
|
||||
func: HookFunctionNoSelf<auction_event_on_expire>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.ADDON_EVENT_ON_MESSAGE,
|
||||
func: HookFunctionNoSelf<addon_event_on_message>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.WORLD_EVENT_ON_DELETE_CREATURE,
|
||||
func: HookFunctionNoSelf<world_event_on_delete_creature>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.WORLD_EVENT_ON_DELETE_GAMEOBJECT,
|
||||
func: HookFunctionNoSelf<world_event_on_delete_gameobject>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.ELUNA_EVENT_ON_LUA_STATE_OPEN,
|
||||
func: HookFunctionNoSelf<eluna_event_on_lua_state_open>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.GAME_EVENT_START,
|
||||
func: HookFunctionNoSelf<game_event_start>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
declare function RegisterServerEvent(
|
||||
this: void,
|
||||
event: ServerEvents.GAME_EVENT_STOP,
|
||||
func: HookFunctionNoSelf<game_event_stop>,
|
||||
shots?: number,
|
||||
): (...args: any[]) => any;
|
||||
28
types/hooks/VehicleHooks.d.ts
vendored
Normal file
28
types/hooks/VehicleHooks.d.ts
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
declare type vehicle_event_on_install = (
|
||||
event: VehicleEvents.VEHICLE_EVENT_ON_INSTALL,
|
||||
vehicle: Vehicle,
|
||||
) => void;
|
||||
|
||||
declare type vehicle_event_on_uninstall = (
|
||||
event: VehicleEvents.VEHICLE_EVENT_ON_UNINSTALL,
|
||||
vehicle: Vehicle,
|
||||
) => void;
|
||||
|
||||
declare type vehicle_event_on_install_accessory = (
|
||||
event: VehicleEvents.VEHICLE_EVENT_ON_INSTALL_ACCESSORY,
|
||||
vehicle: Vehicle,
|
||||
accessory: Creature,
|
||||
) => void;
|
||||
|
||||
declare type vehicle_event_on_add_passenger = (
|
||||
event: VehicleEvents.VEHICLE_EVENT_ON_ADD_PASSENGER,
|
||||
vehicle: Vehicle,
|
||||
passenger: Unit,
|
||||
seatId: number,
|
||||
) => void;
|
||||
|
||||
declare type vehicle_event_on_remove_passenger = (
|
||||
event: VehicleEvents.VEHICLE_EVENT_ON_REMOVE_PASSENGER,
|
||||
vehicle: Vehicle,
|
||||
passenger: Unit,
|
||||
) => void;
|
||||
9
types/hotfix.d.ts
vendored
Normal file
9
types/hotfix.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
// Unused in Eluna
|
||||
declare const enum VehicleEvents {
|
||||
VEHICLE_EVENT_ON_INSTALL = 1, // (event, vehicle)
|
||||
VEHICLE_EVENT_ON_UNINSTALL = 2, // (event, vehicle)
|
||||
// UNUSED = 3, // (event, vehicle)
|
||||
VEHICLE_EVENT_ON_INSTALL_ACCESSORY = 4, // (event, vehicle, creature)
|
||||
VEHICLE_EVENT_ON_ADD_PASSENGER = 5, // (event, vehicle, unit, seatId)
|
||||
VEHICLE_EVENT_ON_REMOVE_PASSENGER = 6, // (event, vehicle, unit)
|
||||
}
|
||||
19
types/index.d.ts
vendored
Normal file
19
types/index.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/** @noResolution */
|
||||
declare module "@azerothcore/eluna-ts-lib" {}
|
||||
|
||||
import "./ac";
|
||||
import "./hotfix";
|
||||
import "./global";
|
||||
|
||||
import "./hooks/BattleGroundHooks";
|
||||
import "./hooks/CreatureHooks";
|
||||
import "./hooks/GameObjectHooks";
|
||||
import "./hooks/GossipHooks";
|
||||
import "./hooks/GroupHooks";
|
||||
import "./hooks/GuildHooks";
|
||||
import "./hooks/MapHooks";
|
||||
import "./hooks/ItemHooks";
|
||||
import "./hooks/PacketHooks";
|
||||
import "./hooks/PlayerHooks";
|
||||
import "./hooks/ServerHooks";
|
||||
import "./hooks/VehicleHooks";
|
||||
Reference in New Issue
Block a user