From 6f4438ea2cf74abb3962662efa75400ed6576516 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Fri, 2 Oct 2020 23:16:08 +0300 Subject: [PATCH] Document undocumented return values of bound event functions (#335) --- GlobalMethods.h | 16 ++++++++-------- Hooks.h | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/GlobalMethods.h b/GlobalMethods.h index 332dbb8..560595b 100644 --- a/GlobalMethods.h +++ b/GlobalMethods.h @@ -1051,7 +1051,7 @@ namespace LuaGlobalFunctions * 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 new damage + * 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 @@ -1068,7 +1068,7 @@ namespace LuaGlobalFunctions * 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, newRespawnDelay + * 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) @@ -1113,7 +1113,7 @@ namespace LuaGlobalFunctions * 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 new damage + * 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 @@ -1130,7 +1130,7 @@ namespace LuaGlobalFunctions * 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, newRespawnDelay + * 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) @@ -1170,9 +1170,9 @@ namespace LuaGlobalFunctions * { * 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) - * GAMEOBJECT_EVENT_ON_QUEST_ACCEPT = 4, // (event, player, go, quest) - Can return true - * GAMEOBJECT_EVENT_ON_QUEST_REWARD = 5, // (event, player, go, quest, opt) - Can return true + * 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) @@ -1181,7 +1181,7 @@ namespace LuaGlobalFunctions * // 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) + * GAMEOBJECT_EVENT_ON_USE = 14, // (event, go, player) - Can return true to stop normal action * GAMEOBJECT_EVENT_COUNT * }; * diff --git a/Hooks.h b/Hooks.h index 1ab86e1..9d2788a 100644 --- a/Hooks.h +++ b/Hooks.h @@ -261,7 +261,7 @@ namespace Hooks 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 new damage + 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 @@ -278,7 +278,7 @@ namespace Hooks 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, newRespawnDelay + 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) @@ -297,9 +297,9 @@ namespace Hooks { 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) - GAMEOBJECT_EVENT_ON_QUEST_ACCEPT = 4, // (event, player, go, quest) - Can return true - GAMEOBJECT_EVENT_ON_QUEST_REWARD = 5, // (event, player, go, quest, opt) - Can return true + 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) @@ -308,7 +308,7 @@ namespace Hooks // 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) + GAMEOBJECT_EVENT_ON_USE = 14, // (event, go, player) - Can return true to stop normal action GAMEOBJECT_EVENT_COUNT };