From 5b2b6e06150b6299d1e19374be092c0858b0e3a8 Mon Sep 17 00:00:00 2001 From: archshift Date: Thu, 12 Jun 2014 19:50:02 -0700 Subject: Pawn: renamed HandleEntityEffects to HandleEntityEffect Exported entity effect functions for ToLua and documented them in APIDesc.lua --- MCServer/Plugins/APIDump/APIDesc.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 19ca971e2..1dba08fe3 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -1688,6 +1688,9 @@ a_Player:OpenWindow(Window); TakeDamage = { Return = "" }, KilledBy = { Return = "" }, GetHealth = { Return = "number" }, + AddEntityEffect = { Params = "EffectType, {{cEntityEffect}}", Return = "", Notes = "Applies an entity effect" }, + RemoveEntityEffect = { Params = "EffectType", Return = "", Notes = "Removes a currently applied entity effect" }, + ClearEntityEffects = { Return = "", Notes = "Removes all currently applied entity effects" }, }, Inherits = "cEntity", }, -- cPawn -- cgit v1.2.3 From a37d5410b4486dd95692076e3da0368a4ed23577 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 13 Jun 2014 12:50:54 +0200 Subject: APIDump: Added OnEntityAddEffect hook documentation. --- .../Plugins/APIDump/Hooks/OnEntityAddEffect.lua | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua b/MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua new file mode 100644 index 000000000..423a2200b --- /dev/null +++ b/MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua @@ -0,0 +1,34 @@ +return +{ + HOOK_ENTITY_ADD_EFFECT = + { + CalledWhen = "An entity effect is about to get added to an entity.", + DefaultFnName = "OnEntityAddEffect", -- also used as pagename + Desc = [[ + This hook is called whenever an entity effect is about to be added to an entity. The plugin may + disallow the addition by returning true.

+

Note that this hook only fires for adding the effect, but not for the actual effect application. See + also the {{OnEntityRemoveEffect|HOOK_ENTITY_REMOVE_EFFECT}} for notification about effects expiring / + removing, and {{OnEntityApplyEffect|HOOK_ENTITY_APPLY_EFFECT}} for the actual effect application to the + entity. + ]], + Params = + { + { Name = "Entity", Type = "{{cEntity}}", Notes = "The entity to which the effect is about to be added" }, + { Name = "EffectType", Type = "number", Notes = "The type of the effect to be added. One of the effXXX constants." }, + { Name = "EffectDuration", Type = "number", Notes = "The duration of the effect to be added, in ticks." }, + { Name = "EffectIntensity", Type = "number", Notes = "The intensity (level) of the effect to be added. " }, + { Name = "Originator", Type = "{{cEntity}}", Notes = "The entity who originated the effect (threw the potion, the cavespider that used poison bite, etc.) May be nil if there's no originator associated with the effect. " }, + { Name = "DistanceModifier", Type = "number", Notes = "The modifier for the effect intensity, based on distance. Used mainly for splash potions." }, + }, + Returns = [[ + If the plugin returns true, the effect will not be added and none of the remaining hook handlers will + be called. If the plugin returns false, MCServer calls all the remaining hook handlers and finally + the effect is added to the entity. + ]], + }, -- HOOK_EXECUTE_COMMAND +} + + + + -- cgit v1.2.3 From 554e1c0dd3cedbcb4035d8ffa7351d56bee5dfb5 Mon Sep 17 00:00:00 2001 From: archshift Date: Sun, 13 Jul 2014 16:10:01 -0700 Subject: OnEntityAddEffect.lua: Removed Originator param --- MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua | 1 - 1 file changed, 1 deletion(-) (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua b/MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua index 423a2200b..1d1658a6f 100644 --- a/MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua +++ b/MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua @@ -18,7 +18,6 @@ return { Name = "EffectType", Type = "number", Notes = "The type of the effect to be added. One of the effXXX constants." }, { Name = "EffectDuration", Type = "number", Notes = "The duration of the effect to be added, in ticks." }, { Name = "EffectIntensity", Type = "number", Notes = "The intensity (level) of the effect to be added. " }, - { Name = "Originator", Type = "{{cEntity}}", Notes = "The entity who originated the effect (threw the potion, the cavespider that used poison bite, etc.) May be nil if there's no originator associated with the effect. " }, { Name = "DistanceModifier", Type = "number", Notes = "The modifier for the effect intensity, based on distance. Used mainly for splash potions." }, }, Returns = [[ -- cgit v1.2.3