//TESH.scrollpos=191
//TESH.alwaysfold=0
function ConvertAttackTypeReverse takes attacktype at returns integer
if at == ATTACK_TYPE_NORMAL then
return 0
elseif at == ATTACK_TYPE_MELEE then
return 1
elseif at == ATTACK_TYPE_PIERCE then
return 2
elseif at == ATTACK_TYPE_SIEGE then
return 3
elseif at == ATTACK_TYPE_MAGIC then
return 4
elseif at == ATTACK_TYPE_CHAOS then
return 5
elseif at == ATTACK_TYPE_HERO then
return 6
endif
return 0
endfunction
function ConvertDamageTypeReverse takes damagetype dt returns integer
if dt == DAMAGE_TYPE_UNKNOWN then
return 0
elseif dt == DAMAGE_TYPE_NORMAL then
return 4
elseif dt == DAMAGE_TYPE_ENHANCED then
return 5
elseif dt == DAMAGE_TYPE_FIRE then
return 8
elseif dt == DAMAGE_TYPE_COLD then
return 9
elseif dt == DAMAGE_TYPE_LIGHTNING then
return 10
elseif dt == DAMAGE_TYPE_POISON then
return 11
elseif dt == DAMAGE_TYPE_DISEASE then
return 12
elseif dt == DAMAGE_TYPE_DIVINE then
return 13
elseif dt == DAMAGE_TYPE_MAGIC then
return 14
elseif dt == DAMAGE_TYPE_SONIC then
return 15
elseif dt == DAMAGE_TYPE_ACID then
return 16
elseif dt == DAMAGE_TYPE_FORCE then
return 17
elseif dt == DAMAGE_TYPE_DEATH then
return 18
elseif dt == DAMAGE_TYPE_MIND then
return 19
elseif dt == DAMAGE_TYPE_PLANT then
return 20
elseif dt == DAMAGE_TYPE_DEFENSIVE then
return 21
elseif dt == DAMAGE_TYPE_DEMOLITION then
return 22
elseif dt == DAMAGE_TYPE_SLOW_POISON then
return 23
elseif dt == DAMAGE_TYPE_SPIRIT_LINK then
return 24
elseif dt == DAMAGE_TYPE_SHADOW_STRIKE then
return 25
elseif dt == DAMAGE_TYPE_UNIVERSAL then
return 26
endif
return 0
endfunction
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// EOT System header file
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Reset all variables to null.
function EOT_Set_Default_Variables takes nothing returns nothing
set udg_EOT_Param_Source = null
set udg_EOT_Param_Target = null
set udg_EOT_Param_Duration = 0.
set udg_EOT_Param_Remaining_Duration = -1.
set udg_EOT_Param_Interval = 0.
set udg_EOT_Param_Remaining_Interval = -1.
set udg_EOT_Param_Hidden = false
set udg_EOT_Param_Buff = 0
set udg_EOT_Param_Buff_Holder = 0
set udg_EOT_Param_Buff_Holder_Level = 1
set udg_EOT_Param_Ability = 0
set udg_EOT_Param_Ability_Level = 1
set udg_EOT_Param_Type = 0
set udg_EOT_Param_Subtype = 0
set udg_EOT_Param_Subtype2 = 0
set udg_EOT_Param_Positive = false
set udg_EOT_Param_Can_Dispell = true
set udg_EOT_Param_Is_Passive = false
//set udg_EOT_Param_Is_Paused = false
set udg_EOT_Param_Special_Effect = null
set udg_EOT_Param_Special_Effect_Model = ""
set udg_EOT_Param_Special_Effect_Point = ""
set udg_EOT_Event_Null_Variables = 1
set udg_EOT_Event_Null_Variables = 0
endfunction
//Save an EOT in the cache.
function EOT_Save_To_Cache takes integer cacheId returns nothing
call SaveUnitHandle( udg_EOT_Hashtable, cacheId + 100, 1000, udg_EOT_Param_Source)
call SaveUnitHandle( udg_EOT_Hashtable, cacheId + 100, 1001, udg_EOT_Param_Target)
call SaveReal( udg_EOT_Hashtable, cacheId + 100, 1002, udg_EOT_Param_Duration)
call SaveReal( udg_EOT_Hashtable, cacheId + 100, 1003, udg_EOT_Param_Remaining_Duration)
call SaveReal( udg_EOT_Hashtable, cacheId + 100, 1004, udg_EOT_Param_Interval)
call SaveReal( udg_EOT_Hashtable, cacheId + 100, 1005, udg_EOT_Param_Remaining_Interval)
call SaveBoolean( udg_EOT_Hashtable, cacheId + 100, 1006, udg_EOT_Param_Hidden)
call SaveInteger( udg_EOT_Hashtable, cacheId + 100, 1007, udg_EOT_Param_Buff)
call SaveInteger( udg_EOT_Hashtable, cacheId + 100, 1008, udg_EOT_Param_Buff_Holder)
call SaveInteger( udg_EOT_Hashtable, cacheId + 100, 1009, udg_EOT_Param_Buff_Holder_Level)
call SaveInteger( udg_EOT_Hashtable, cacheId + 100, 1010, udg_EOT_Param_Ability)
call SaveInteger( udg_EOT_Hashtable, cacheId + 100, 1011, udg_EOT_Param_Ability_Level)
call SaveInteger( udg_EOT_Hashtable, cacheId + 100, 1012, udg_EOT_Param_Type)
call SaveInteger( udg_EOT_Hashtable, cacheId + 100, 1013, udg_EOT_Param_Subtype)
call SaveInteger( udg_EOT_Hashtable, cacheId + 100, 1014, udg_EOT_Param_Subtype2)
call SaveBoolean( udg_EOT_Hashtable, cacheId + 100, 1015, udg_EOT_Param_Positive)
call SaveBoolean( udg_EOT_Hashtable, cacheId + 100, 1016, udg_EOT_Param_Can_Dispell)
call SaveBoolean( udg_EOT_Hashtable, cacheId + 100, 1017, udg_EOT_Param_Is_Passive)
//call SaveBoolean( udg_EOT_Hashtable, cacheId + 100, 1018, udg_EOT_Param_Is_Paused)
call SaveEffectHandle( udg_EOT_Hashtable, cacheId + 100, 1019, udg_EOT_Param_Special_Effect)
call SaveStr( udg_EOT_Hashtable, cacheId + 100, 1020, udg_EOT_Param_Special_Effect_Model)
call SaveStr( udg_EOT_Hashtable, cacheId + 100, 1021, udg_EOT_Param_Special_Effect_Point)
endfunction
//Load an EOT from the cache.
function EOT_Load_From_Cache takes integer cacheId returns nothing
set udg_EOT_Param_Source = LoadUnitHandle( udg_EOT_Hashtable, cacheId + 100, 1000)
set udg_EOT_Param_Target = LoadUnitHandle( udg_EOT_Hashtable, cacheId + 100, 1001)
set udg_EOT_Param_Duration = LoadReal( udg_EOT_Hashtable, cacheId + 100, 1002)
set udg_EOT_Param_Remaining_Duration = LoadReal( udg_EOT_Hashtable, cacheId + 100, 1003)
set udg_EOT_Param_Interval = LoadReal( udg_EOT_Hashtable, cacheId + 100, 1004)
set udg_EOT_Param_Remaining_Interval = LoadReal( udg_EOT_Hashtable, cacheId + 100, 1005)
set udg_EOT_Param_Hidden = LoadBoolean( udg_EOT_Hashtable, cacheId + 100, 1006)
set udg_EOT_Param_Buff = LoadInteger( udg_EOT_Hashtable, cacheId + 100, 1007)
set udg_EOT_Param_Buff_Holder = LoadInteger( udg_EOT_Hashtable, cacheId + 100, 1008)
set udg_EOT_Param_Buff_Holder_Level = LoadInteger( udg_EOT_Hashtable, cacheId + 100, 1009)
set udg_EOT_Param_Ability = LoadInteger( udg_EOT_Hashtable, cacheId + 100, 1010)
set udg_EOT_Param_Ability_Level = LoadInteger( udg_EOT_Hashtable, cacheId + 100, 1011)
set udg_EOT_Param_Type = LoadInteger( udg_EOT_Hashtable, cacheId + 100, 1012)
set udg_EOT_Param_Subtype = LoadInteger( udg_EOT_Hashtable, cacheId + 100, 1013)
set udg_EOT_Param_Subtype = LoadInteger( udg_EOT_Hashtable, cacheId + 100, 1014)
set udg_EOT_Param_Positive = LoadBoolean( udg_EOT_Hashtable, cacheId + 100, 1015)
set udg_EOT_Param_Can_Dispell = LoadBoolean( udg_EOT_Hashtable, cacheId + 100, 1016)
set udg_EOT_Param_Is_Passive = LoadBoolean( udg_EOT_Hashtable, cacheId + 100, 1017)
//set udg_EOT_Param_Is_Paused = LoadBoolean( udg_EOT_Hashtable, cacheId + 100, 1018)
set udg_EOT_Param_Special_Effect = LoadEffectHandle( udg_EOT_Hashtable, cacheId + 100, 1019)
set udg_EOT_Param_Special_Effect_Model = LoadStr( udg_EOT_Hashtable, cacheId + 100, 1020)
set udg_EOT_Param_Special_Effect_Point = LoadStr( udg_EOT_Hashtable, cacheId + 100, 1021)
endfunction
//Save and Load additional data to an EOT.
//Raw values:
function EOT_Save_Integer takes integer id, integer value returns nothing
call SaveInteger(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000, value)
endfunction
function EOT_Save_Real takes integer id, real value returns nothing
call SaveReal(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000, value)
endfunction
function EOT_Save_String takes integer id, string value returns nothing
call SaveStr(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000, value)
endfunction
function EOT_Save_Boolean takes integer id, boolean value returns nothing
call SaveBoolean(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000, value)
endfunction
function EOT_Load_Integer takes integer id returns integer
return LoadInteger(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000)
endfunction
function EOT_Load_Real takes integer id returns real
return LoadReal(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000)
endfunction
function EOT_Load_String takes integer id returns string
return LoadStr(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000)
endfunction
function EOT_Load_Boolean takes integer id returns boolean
return LoadBoolean(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000)
endfunction
//Handles:
function EOT_Save_Unit takes integer id, unit value returns nothing
call SaveUnitHandle(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000, value)
endfunction
function EOT_Save_Player takes integer id, player value returns nothing
call SavePlayerHandle(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000, value)
endfunction
function EOT_Save_Item takes integer id, item value returns nothing
call SaveItemHandle(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000, value)
endfunction
function EOT_Save_Group takes integer id, group value returns nothing
call SaveGroupHandle(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000, value)
endfunction
function EOT_Save_Effect takes integer id, effect value returns nothing
call SaveEffectHandle(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000, value)
endfunction
function EOT_Save_Location takes integer id, location value returns nothing
call SaveLocationHandle(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000, value)
endfunction
function EOT_Save_Lightning takes integer id, lightning value returns nothing
call SaveLightningHandle(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000, value)
endfunction
function EOT_Load_Unit takes integer id returns unit
return LoadUnitHandle(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000)
endfunction
function EOT_Load_Player takes integer id returns player
return LoadPlayerHandle(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000)
endfunction
function EOT_Load_Item takes integer id returns item
return LoadItemHandle(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000)
endfunction
function EOT_Load_Group takes integer id returns group
return LoadGroupHandle(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000)
endfunction
function EOT_Load_Effect takes integer id returns effect
return LoadEffectHandle(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000)
endfunction
function EOT_Load_Location takes integer id returns location
return LoadLocationHandle(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000)
endfunction
function EOT_Load_Lightning takes integer id returns lightning
return LoadLightningHandle(udg_EOT_Hashtable, udg_EOT_Param_Id, id + 1000)
endfunction
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// EOT System header file end
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Name | Type | is_array | initial_value |
DOT_Attack_Type | attacktype | No | |
DOT_Damage | real | No | |
DOT_Damage_Type | damagetype | No | |
EOT_Amount | integer | No | |
EOT_Array_Ability | abilcode | Yes | |
EOT_Array_Ability_Level | integer | Yes | |
EOT_Array_Buff | buffcode | Yes | |
EOT_Array_Buff_Holder | abilcode | Yes | |
EOT_Array_Buff_Holder_Level | integer | Yes | |
EOT_Array_Can_Dispell | boolean | Yes | |
EOT_Array_Duration | real | Yes | |
EOT_Array_Hidden | boolean | Yes | |
EOT_Array_Id | integer | Yes | |
EOT_Array_Interval | real | Yes | |
EOT_Array_Is_Passive | boolean | Yes | |
EOT_Array_Is_Paused | boolean | Yes | |
EOT_Array_On_Period_Trigger | trigger | Yes | |
EOT_Array_Positive | boolean | Yes | |
EOT_Array_Remaining_Duration | real | Yes | |
EOT_Array_Remaining_Interval | real | Yes | |
EOT_Array_Source | unit | Yes | |
EOT_Array_Special_Effect | effect | Yes | |
EOT_Array_Special_Effect_Model | string | Yes | |
EOT_Array_Special_Effect_Point | string | Yes | |
EOT_Array_Subtype | integer | Yes | |
EOT_Array_Subtype2 | integer | Yes | |
EOT_Array_Target | unit | Yes | |
EOT_Array_Type | integer | Yes | |
EOT_Event_An_EOT_Has_Expired | real | No | |
EOT_Event_An_EOT_Is_Created | real | No | |
EOT_Event_An_EOT_Is_Destroyed | real | No | |
EOT_Event_An_EOT_Is_Dispelled | real | No | |
EOT_Event_Creation_After | real | No | |
EOT_Event_Creation_Before | real | No | |
EOT_Event_Destruction_After | real | No | |
EOT_Event_Destruction_Before | real | No | |
EOT_Event_Dispell_After | real | No | |
EOT_Event_Dispell_Before | real | No | |
EOT_Event_EOT_Changed_Target | real | No | |
EOT_Event_Expire_After | real | No | |
EOT_Event_Expire_Before | real | No | |
EOT_Event_Get_Data | real | No | |
EOT_Event_Interval_After | real | No | |
EOT_Event_Interval_Before | real | No | |
EOT_Event_Null_Variables | real | No | |
EOT_Event_On_Interval | real | No | |
EOT_Event_Save_Data | real | No | |
EOT_Hashtable | hashtable | No | |
EOT_Index | integer | No | |
EOT_Param_Ability | abilcode | No | |
EOT_Param_Ability_Level | integer | No | |
EOT_Param_Buff | buffcode | No | |
EOT_Param_Buff_Holder | abilcode | No | |
EOT_Param_Buff_Holder_Level | integer | No | |
EOT_Param_Can_Dispell | boolean | No | |
EOT_Param_Destroy | boolean | No | |
EOT_Param_Destroy_Passive | boolean | No | |
EOT_Param_Duration | real | No | |
EOT_Param_Expire | boolean | No | |
EOT_Param_Force_Destroy | boolean | No | |
EOT_Param_Hidden | boolean | No | |
EOT_Param_Id | integer | No | |
EOT_Param_Interval | real | No | |
EOT_Param_Is_Passive | boolean | No | |
EOT_Param_Is_Paused | boolean | No | |
EOT_Param_Negative | boolean | No | |
EOT_Param_Positive | boolean | No | |
EOT_Param_Remaining_Duration | real | No | |
EOT_Param_Remaining_Interval | real | No | |
EOT_Param_Source | unit | No | |
EOT_Param_Special_Effect | effect | No | |
EOT_Param_Special_Effect_Model | string | No | |
EOT_Param_Special_Effect_Point | string | No | |
EOT_Param_Subtype | integer | No | |
EOT_Param_Subtype2 | integer | No | |
EOT_Param_Target | unit | No | |
EOT_Param_Type | integer | No | |
EOT_Timer | timer | No | |
EOT_Trigger_Create_EOT | trigger | No | |
EOT_Trigger_Destroy_EOT | trigger | No | |
EOT_Trigger_Get_Data | trigger | No | |
EOT_Trigger_Remove_EOTs | trigger | No | |
EOT_Trigger_Save_Data | trigger | No | |
EOT_Unique_Id | integer | No | |
TempAbility | abilcode | No | |
TempBoolean | boolean | No | |
TempForce | force | No | |
TempInteger | integer | No | |
TempInteger2 | integer | No | |
TempLightning | lightning | No | |
TempLocation | location | No | |
TempLocation2 | location | No | |
TempPlayer | player | No | |
TempReal | real | No | |
TempReal2 | real | No | |
TempSound | sound | No | |
TempSpecialEffect | effect | No | |
TempUnit | unit | No | |
TempUnit2 | unit | No | |
TempUnitGroup | group | No | |
unit | handle | No |
//TESH.scrollpos=273
//TESH.alwaysfold=0
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Wietlol's Effect Over Time System 2.3.2 17/07/2015
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Description:
// This system is made to create and add effects that expire over time.
// Once in a while, which is configurable using the interval variable, the event "EOT_Event_On_Interval" is called.
// You can define your own actions on the On_Interval event.
// This system can be used as a buff system and there is an implemented extension for damage over time.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// How to install:
// 1. Copy or create all variables that are used in this map into your map.
// 1a. If you use vJASS then you can enable the EOT_vJASS_variables trigger and use that one.
// 1b. If you use GUI then you can use the EOT_GUI_variables trigger to automatically import them.
// 2. Copy the EOT_System trigger and paste it into your map.
// 2a. (optional) You can also copy the DOT_Extension trigger to make use of damage over time effects.
// 3. Copy all code from the header file and paste it into your map's header file.
// 4. Create some spells with EOTs.
// 5. Enjoy your Effect Over Time Spells.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// How to use:
// Create an EOT:
// 1. Create a trigger for your spell.
// 2. Make a "Custom script: call EOT_Set_Default_Variables()".
// 3. Set the EOT_Param_Source and EOT_Param_Target to the proper units.
// 4. Set EOT_Param_Type to a variable specific for that type of EOT.
// For abilities, you can use the id of the ability (which is the same for every casting of that ability).
// You cannot use the handle id of a unit for example but you can use the unit-type id.
// When you want subtypes of an EOT, you can put those inside the EOT_Param_Subtype.
// 5. Set additional data for the EOT.
// 5a. Set EOT_Param_Duration and EOT_Param_Interval.
// If the duration is not specified or is 0 or lower, the duration is infinite.
// If the interval is not specified or is 0 or lower, the EOT will not have intervals.
// 5b. Set EOT_Param_Buff and EOT_Param_Buff_Holder.
// If EOT_Param_Buff_Holder is not specified, this EOT will not display a buff.
// If EOT_Param_Buff_Holder is specified, this EOT will have the buff "EOT_Param_Buff".
// 5c. Set EOT_Param_Special_Effect_Model and EOT_Param_Special_Effect_Point.
// If EOT_Param_Special_Effect_Model is not specified, this EOT will not have a special effect.
// If EOT_Param_Special_Effect_Point is not specifid, the attachment point "origin" will be used.
// 5d. Set EOT_Param_Abiliy and EOT_Param_Abiliy_Level.
// If EOT_Param_Abiliy is not specified or EOT_Param_Abiliy_Level is set to 0 (1 by default), this EOT will not have an ability.
// Be aware that the ability given is showed in the UI. If you do not want this, add the ability to a disabled spellbook.
// 5e. Set EOT_Param_Positive and EOT_Param_Can_Dispell.
// These variables are used as buff type variables.
// EOT_Param_Positive is false by default, meaning that the EOT has a negative attitude.
// When the EOT_Trigger_Remove_EOTs is called, you can specify if you want to remove positive, negative, both or neither of them.
// EOT_Param_Can_Dispell is true by default, meaning that the EOT can be dispelled.
// If it is set to false, the EOT will not dispell unless you set EOT_Param_Force_Destroy to true before the dispell is called.
// 5f. Set EOT_Param_Is_Passive to true if the EOT must not be removed on death.
// This is usefull for units with passive abilities.
// You can destroy these EOTs only with EOT_Param_Destroy_Passive.
// 6. Call the EOT_Trigger_Create_EOT trigger.
// 7. Create additional effects.
// Since you created an EOT, you also have an id.
// With this id, you can save data in the hashtable using the EOT_Save_Value (Value being the value type) functions.
//
// Using the EOT_System's events:
// 1. Create a trigger.
// 2. Create an event of "Game - Value Of Real Variable" and set the variable to the event you want. Leave the value to 0.
// For spells you can use:
// - EOT_Event_An_EOT_Is_Created
// - EOT_Event_An_EOT_Is_Destroyed
// - EOT_Event_An_EOT_Is_Dispelled
// - EOT_Event_An_EOT_Has_Expired
// - EOT_Event_On_Interval
// All other events are reserved for extensions and systems.
// 3. Now you have the data of your EOT in the Param variables.
// You can stop the destruction or dispell of an EOT by setting EOT_Param_Destroy to false.
// You can stop the expiring of an EOT by setting EOT_Param_Expire to false.
// (For actions on certain EOTs, you can also choose to run a trigger on the interval instead of using the event.
// this improves performance very much.)
//
// Accessing and modifying an EOT's data:
// 1. Set the EOT_Param_Target to the unit that has the EOT.
// 2. Set the EOT_Param_Type to the type of EOT that you want.
// 3. Make an If/Then/Else function.
// 3a. Create a condition of "Boolean Comparison -> Trigger - Evaluate Trigger Conditions".
// Set the trigger to EOT_Trigger_Get_Data.
// 4. Now you know if the target has the EOT or not.
// If the target has it, (which means that the condition is right,) the data of the EOT is set in the Param variables.
// 5. Now you can also save the data of the Param variables (which you can change between these two function) by calling
// the EOT_Trigger_Save_Data trigger.
//
// The additional data has some reserved slots. The first 1.000 slots are reserved for extensions or other systems.
// However when calling the EOT_Save_Value functions, the 1.000 are automatically added.
// So when making spells, you can start with 0.
// When making extensions or systems, you have to descend, starting at -1.
// The extension DOT (Damage Over Time) uses the last 3 of them (-1, -2, -3, aka 999, 998, 997).
// Extensions/Systems cannot use the same indexes as other extensions/systems.
//
// The same counts for the EOT cache.
// The first 100 cache slot are reserved.
// The extension DOT (Damage Over Time) does not use an EOT cache.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Feature list:
// This system:
// - allows you to create an effect over time on a unit.
// - allows you to give a unit a buff as long as the eot lasts.
// - allows you to give a unit an ability as long as the eot lasts.
// - allows you to run a piece of code once in a while as long as the eot lasts.
// - allows you to attach a special effect to an eot.
// - allows you to change the parameters of the eot.
// - allows you to get the data, change the data and save the data of every eot that is active.
// - allows you to create your own extensions to make better use of the system.
// - allows you to save the data of an eot in the cache. The first 100 are reserved for systems and extensions.
// This can be used for either presets, already having the references to units, and creation/modification of other eot's inside an eot's function.
// - allows you to save additional data to an eot.
// The first 1000 are reserved for systems and extensions.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Variable explaination:
//////////////////////////
// General:
// - EOT_Trigger_Create_EOT - trigger
// This is the function that creates an eot on a unit.
//
// - EOT_Trigger_Destroy_EOT - trigger
// This is the function that destroys the specified eot on the targeted unit.
//
// - EOT_Trigger_Get_Data - trigger
// This is the function that retrieves all the data of the specified eot on the targeted unit.
//
// - EOT_Trigger_Save_Data - trigger
// This is the function that saves all the variables to the specified eot on the targeted unit.
//
// - EOT_Trigger_Remove_EOTs - trigger
// This is the function that removes all or filtered eots on the targeted unit.
//
// - EOT_Hashtable - hashtable
// This is the hashtable that is used by the Effect Over Time System.
//
// - EOT_Index - integer
// This integer is used as an indexing number in loops.
//
// - EOT_Amount - integer
// This is the amount of EOTs that are active.
//
// - EOT_Unique_Id - integer
// This is a unique number that increases for each EOT.
//
// - EOT_Param_Destroy - booleam
// This boolean tells if the EOT must be destroyed.
//
// - EOT_Param_Expire - boolean
// This boolean tells if the EOT is expired and if it has to be destroyed.
// This one is additional to EOT_Destroy because expired EOTs might be able to keep going
// on certain conditions while destroyed EOTs may not.
//
// - EOT_Param_Force_Destroy - boolean
// This boolean tells if the destruction of an EOT must go through Can_Dispell values.
// It can also be used as an additional Destroy variable.
//
// - EOT_Param_Destroy_Passive - boolean
// This boolean tells if the Destroy function must remove a passive effect.
// This is the only way to remove the passive effects.
//
//////////////////////////
// Events:
// Events must be called with "Real value becomes equal to 0"
// - EOT_Event_An_EOT_Is_Created - real (event simulator)
// This event is ran when an eot is created.
// EOT_Event_Creation_Before and EOT_Event_Creation_After are reserved for other systems and extensions.
//
// - EOT_Event_An_EOT_Is_Destroyed - real (event simulator)
// This event is ran when an eot is destroyed.
// If an EOT is destroyed in any possible way (expired, dispelled, bugs, etc.) then this event will see it.
// EOT_Event_Destruction_Before and EOT_Event_Destruction_After are reserved for other systems and extensions.
//
// - EOT_Event_An_EOT_Is_Dispelled - real (event simulator)
// This event is ran when an eot is dispelled.
// Dispelling can be done via Remove_EOTs function
// or on the next interval by having their buff removed. (non-hidden only)
// EOT_Event_Dispell_Before and EOT_Event_Dispell_After are reserved for other systems and extensions.
//
// - EOT_Event_An_EOT_Has_Expired - real (event simulator)
// This event is ran when an eot has properly expired.
// EOT_Event_Expire_Before and EOT_Event_Expire_After are reserved for other systems and extensions.
//
// - EOT_Event_On_Interval - real (event simulator)
// This event is ran when the interval is activated.
// EOT_Event_Interval_Before and EOT_Event_Interval_After are reserved for other systems and extensions.
//
// - EOT_Event_Get_Data - real (event simulator)
// This event is made for extensions to know when a trigger called the "Get Data" function.
//
// - EOT_Event_Save_Data - real (event simulator)
// This event is made for extensions to know when a trigger called the "Save Data" function.
//
// - EOT_Event_Null_Variables - real (event simulator)
// This event is made for extensions to know when a trigger called the "Null Variables" function.
//
// - EOT_Event_EOT_Changed_Target - real (event simulator)
// This event fires when an EOT is changing targets.
// The target in the array under the index is the old target and the target in the param is the new target.
//
//////////////////////////
// Parameters:
// - EOT_Array_... - ... array
// These variables are the parameters of EOTs saved for each active EOT.
//
// - EOT_Param_Id - integer
// This is a unique Id of the EOT.
// This value can be used to save additional data to an EOT.
// This is similar to a handle id... but then an EOT id.
//
// - EOT_Param_Source - unit
// This is the source of the eot.
// This unit gets the credit for the kills, or whatever the eot is doing.
//
// - EOT_Param_Target - unit
// This is the unit on which the eot runs.
//
// - EOT_Param_Duration - real
// This is the duration of the eot.
// Be aware that this is not the remaining duration.
//
// - EOT_Param_Remaining_Duration - real
// This is the remaining duration of the eot.
//
// - EOT_Param_Interval - real
// This is the duration between each call of the trigger of the eot.
// Be aware that this is not the remaining interval.
//
// - EOT_Param_Remaining_Interval - real
// This is the remaining duration between each call of the trigger of the eot.
//
// - EOT_Param_Hidden - boolean
// If the eot is hidden, it will not display a buff.
// When removing all eots, you can filter out hidden eots.
//
// - EOT_Param_Buff - buff (integer in JASS)
// This is the buff that the target has if the eot is not hidden.
//
// - EOT_Param_Buff_Holder - ability (integer in JASS)
// This is the ability that makes the buff for the target.
//
// - EOT_Param_Buff_Holder_Level - integer
// This is the level for the ability that makes the buff.
// This can be used to show different buffs or use an effect that is on that ability.
//
// - EOT_Param_Ability - ability (integer in JASS)
// This ability is given to the target and removed when the eot ends.
//
// - EOT_Param_Ability_Level - integer
// This is the level of the EOT_Param_Ability.
//
// - EOT_Param_Positive - boolean
// This determines if the effect is positive or negative.
// This is used to filter out positive or negative effects.
// This is also used by the Remove_EOTs to know if positive EOTs should be removed.
//
// - EOT_Param_Negative - boolean
// This is used by the Remove_EOTs to know if negative EOTs should be removed.
//
// - EOT_Param_Special_Effect - special effect (effect in JASS)
// This is a special effect that is attached to the target.
// You should not make the effect yourself but rather define the model and attachment point.
//
// - EOT_Param_Special_Effect_Model - string
// This is the filepath of the model that is used to create the special effect.
//
// - EOT_Param_Special_Effect_Point - string
// This is the attachment point for the special effect.
//
// - EOT_Param_Type - integer
// This variable is a simple integer that can be used as the type of EOT.
// The easiest way to make this is to set it to an ability id which created the EOT.
//
// - EOT_Param_Subtype - integer
// This variable is a simple integer that can be used to give one type multiple subtypes.
//
// - EOT_Param_Subtype2 - integer
// This variable is a simple integer that can be used to give and EOT even better MUI-ness.
//
// - EOT_Param_Is_Paused - integer
// Paused EOTs will not expire or call the interval.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Changelog:
// 2.3.1 - 17/07/2015 - Fixed death bug and added OnPeriodTrigger
// - Fixed a bug where an EOT was not removed when a unit died.
// - Re-added the option to run a trigger on the periods.
// - Removed AEM implementation.
//
// 2.3 - 17/04/2015 - Better Events
// - Added AEM Events implementation.
// - Improved Death checks.
// - Created EOT_Does_Exist().
//
// 2.2.2 - 25/03/2015 - Ultimate MUI-ness
// - Added Subtype2 as an additional type. This can be used as sourceid for example to have even better MUI-ness.
// - Added the event "EOT_Event_EOT_Changed_Target".
// - Added the paused functionality.
//
// 2.2.1 - 01/03/2015 - Fixed dead unit crash.
// - Fixed a bug where the game would crash when a dead unit would gain an EOT.
//
// 2.2 - 20/02/2015 - Added Is_Passive and fixed a few bugs.
// - Changed the variable type of EOT_Type from real to integer.
// This is because a real has a much lower maximum than an integer.
// The maximum would be a little bit below the value of ability ids.
// Subtypes can be declared in the new variable: EOT_Subtype.
// - Fixed a bug where the Id would be changed to the highest current Id. When an eot would be destroyed.
// - Added Is_Passive and Destroy_Passive.
// The Is_Passive is used for passive abilities.
// They can only be removed using a manual Destroy call while Destroy_Passive is turned on.
//
// 2.1 - 13/02/2015 - Finished the system. All upcoming updates are fixes.
// Code:
// - Replaced redundant code with "EOT_Check_For_New_Target".
// - Changed the name of "EOT_Null_Variables" to "EOT_Set_Default_Variables" which makes more sense.
// - Added a disabled trigger with all GUI variables.
// - Now has a better order of which event/check is called first in the looping action.
// - Now you don't have to set the hidden parameter in the creation. Just leaving the buff open is enough.
// - Removed some bugs where ids would be changed.
//
// 2.0.1 - 10/02/2015 - Fixed event simulators.
// Code:
// - The events now run on 0 and are separated to remove non-calling bugs.
//
// 2.0 - 10/02/2015 - Rewritten the system from timers to arrays.
//
// Documentation:
// - Updated for new functions and variables.
// Code:
// - Rewritten the whole code.
// - Ripped the code into triggers only.
// - Added hashtable functions in the header.
// - Added cache functions in the header.
// - Damage transferred to an extension to remove a lot of empty values in the arrays.
// Added Features:
// - Now has a cache where you can save the current EOT in or load a saved EOT from.
// This can be used as presets or when you want to create a new one during the interval.
// - Now you can save additional data to an EOT.
// - Events are now handled better to function with extensions properly and create
// - You can now leave unnecessary data open. The variables are set to their standard values.
// - You can now set the level of the buff holder.
// - Added the Force_Destroy variable which allows you to break through the Can_Dispell value.
// Bug Fixes:
// - The EOT is not removed if you set a too high interval.
// - The Special Effect is now recreated properly if the EOT changed targets, effect-model or attachment point.
// - The EOT is now removed immediately when the buff is removed.
//
// 1.2 - 27/01/2015 - Update of simplified system.
//
// Documentation:
// - Added the complete documentation.
// Code:
// - Put all code of the system in one trigger with exception of the configuration and made it more readable.
// - Completed the buff system.
// Added Features:
// - Added an ability that is active on the unit as long as the eot exists.
// - Automatically removes or adds existing eots depending on a configurable, eot-dependant variable.
// - Now allows the player to change the target of the effect over time.
// Bug Fixes:
// - Fixed a bug where an eot which would not last until the next interval would be removed at that moment
// rather than when the duration expires.
//
// 1.1 - 20/01/2015 - Update of reworked system.
//
// Added Features:
// - Added the Get_Data and Save_Data functions.
// Bug Fixes:
// - Fixed a bug where an eot which was already active on the target would have been removed when the first expired.
//
// 1.0 - First official release on the Hive.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Known bugs:
// - The buffs of EOTs are aura buffs. This means that they are not dispelled by buff dispell abilities by default.
// To be able to dispell the buffs you have to trigger all buff dispel abilities.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// These functions are used by this system only.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Check if the EOT has a new target. If so transfer buff, ability and special effect to the new target.
function EOT_Check_For_New_Target takes integer index returns nothing
//Check for new target.
if udg_EOT_Param_Target != udg_EOT_Array_Target[index] then
//remove and add ability
call UnitRemoveAbility(udg_EOT_Array_Target[index], udg_EOT_Array_Ability[index])
if udg_EOT_Param_Ability > 0 and udg_EOT_Param_Ability_Level > 0 then
call UnitAddAbility(udg_EOT_Param_Target, udg_EOT_Param_Ability)
call SetUnitAbilityLevel(udg_EOT_Param_Target, udg_EOT_Param_Ability, udg_EOT_Param_Ability_Level)
endif
//remove and add buff
call UnitRemoveAbility(udg_EOT_Array_Target[index], udg_EOT_Array_Buff[index])
if udg_EOT_Param_Buff_Holder > 0 and udg_EOT_Param_Buff_Holder_Level > 0 then
call UnitAddAbility(udg_EOT_Param_Target, udg_EOT_Param_Buff_Holder)
call SetUnitAbilityLevel(udg_EOT_Param_Target, udg_EOT_Param_Ability, udg_EOT_Param_Buff_Holder_Level)
call UnitRemoveAbility(udg_EOT_Param_Target, udg_EOT_Param_Buff_Holder)
endif
//remove and add special effect.
call DestroyEffect(udg_EOT_Param_Special_Effect)
if udg_EOT_Param_Special_Effect_Model != "" then
if udg_EOT_Param_Special_Effect_Point == "" then
set udg_EOT_Param_Special_Effect_Point = "origin"
endif
set udg_EOT_Param_Special_Effect = AddSpecialEffectTarget(udg_EOT_Param_Special_Effect_Model, udg_EOT_Param_Target, udg_EOT_Param_Special_Effect_Point)
endif
endif
endfunction
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// This code is the actions of this system.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//This is the loop for every 0.03 seconds of gametime.
function EOT_Interval takes nothing returns nothing
local integer i
set i = 0
loop
set udg_EOT_Index = i
exitwhen udg_EOT_Index > udg_EOT_Amount
//Set global variables.
set udg_EOT_Param_Destroy = false
set udg_EOT_Param_Expire = false
set udg_EOT_Param_Force_Destroy = false
set udg_EOT_Param_Id = udg_EOT_Array_Id[udg_EOT_Index]
set udg_EOT_Param_Source = udg_EOT_Array_Source[udg_EOT_Index]
set udg_EOT_Param_Target = udg_EOT_Array_Target[udg_EOT_Index]
set udg_EOT_Param_Duration = udg_EOT_Array_Duration[udg_EOT_Index]
set udg_EOT_Param_Remaining_Duration = udg_EOT_Array_Remaining_Duration[udg_EOT_Index]
set udg_EOT_Param_Interval = udg_EOT_Array_Interval[udg_EOT_Index]
set udg_EOT_Param_Remaining_Interval = udg_EOT_Array_Remaining_Interval[udg_EOT_Index]
set udg_EOT_Param_Hidden = udg_EOT_Array_Hidden[udg_EOT_Index]
set udg_EOT_Param_Buff = udg_EOT_Array_Buff[udg_EOT_Index]
set udg_EOT_Param_Buff_Holder = udg_EOT_Array_Buff_Holder[udg_EOT_Index]
set udg_EOT_Param_Buff_Holder_Level = udg_EOT_Array_Buff_Holder_Level[udg_EOT_Index]
set udg_EOT_Param_Ability = udg_EOT_Array_Ability[udg_EOT_Index]
set udg_EOT_Param_Ability_Level = udg_EOT_Array_Ability_Level[udg_EOT_Index]
set udg_EOT_Param_Type = udg_EOT_Array_Type[udg_EOT_Index]
set udg_EOT_Param_Subtype = udg_EOT_Array_Subtype[udg_EOT_Index]
set udg_EOT_Param_Positive = udg_EOT_Array_Positive[udg_EOT_Index]
set udg_EOT_Param_Can_Dispell = udg_EOT_Array_Can_Dispell[udg_EOT_Index]
set udg_EOT_Param_Is_Passive = udg_EOT_Array_Is_Passive[udg_EOT_Index]
set udg_EOT_Param_Special_Effect = udg_EOT_Array_Special_Effect[udg_EOT_Index]
set udg_EOT_Param_Special_Effect_Model = udg_EOT_Array_Special_Effect_Model[udg_EOT_Index]
set udg_EOT_Param_Special_Effect_Point = udg_EOT_Array_Special_Effect_Point[udg_EOT_Index]
//Decrease remaining duration.
set udg_EOT_Param_Remaining_Duration = udg_EOT_Param_Remaining_Duration - 0.03
if IsUnitType(udg_EOT_Param_Target, UNIT_TYPE_DEAD) and GetUnitTypeId(udg_EOT_Param_Target) != 0 and udg_EOT_Param_Is_Passive then
if udg_EOT_Param_Remaining_Duration <= 0. and udg_EOT_Param_Remaining_Duration > -1 then
set udg_EOT_Param_Expire = true
//Call the expire event.
set udg_EOT_Event_Expire_Before = 1 //<<< don't use
set udg_EOT_Event_Expire_Before = 0 //<<< use this
set udg_EOT_Event_An_EOT_Has_Expired = 1 //<<< don't use
set udg_EOT_Event_An_EOT_Has_Expired = 0 //<<< use this
set udg_EOT_Event_Expire_After = 1 //<<< don't use
set udg_EOT_Event_Expire_After = 0 //<<< use this
call EOT_Check_For_New_Target(i)
endif
else
set udg_EOT_Param_Remaining_Interval = udg_EOT_Param_Remaining_Interval - 0.03
if GetUnitTypeId(udg_EOT_Param_Target) == 0 or (GetUnitAbilityLevel(udg_EOT_Param_Target, udg_EOT_Param_Buff) == 0 and not(udg_EOT_Param_Hidden)) or IsUnitType(udg_EOT_Param_Target, UNIT_TYPE_DEAD) then
if GetUnitTypeId(udg_EOT_Param_Target) == 0 or IsUnitType(udg_EOT_Param_Target, UNIT_TYPE_DEAD) then
set udg_EOT_Param_Destroy_Passive = true
set udg_EOT_Param_Destroy = true
elseif not udg_EOT_Param_Can_Dispell then
//This eot may not be dispelled.
call UnitAddAbility(udg_EOT_Param_Target, udg_EOT_Param_Buff_Holder)
//call SetUnitAbilityLevel(udg_EOT_Param_Target, udg_EOT_Param_Buff_Holder, udg_EOT_Param_Buff_Holder_Level) << removed because of bug with auras.
call UnitRemoveAbility(udg_EOT_Param_Target, udg_EOT_Param_Buff_Holder)
else
set udg_EOT_Param_Destroy = true
//Call the dispell event.
set udg_EOT_Event_Dispell_Before = 1 //<<< don't use
set udg_EOT_Event_Dispell_Before = 0 //<<< use this
set udg_EOT_Event_An_EOT_Is_Dispelled = 1 //<<< don't use
set udg_EOT_Event_An_EOT_Is_Dispelled = 0 //<<< use this
set udg_EOT_Event_Dispell_After = 1 //<<< don't use
set udg_EOT_Event_Dispell_After = 0 //<<< use this
endif
call EOT_Check_For_New_Target(i)
endif
if not(udg_EOT_Param_Destroy) then
if udg_EOT_Param_Remaining_Interval <= 0. and udg_EOT_Param_Remaining_Interval > -1. and (udg_EOT_Param_Remaining_Interval <= udg_EOT_Param_Remaining_Duration or udg_EOT_Param_Duration == -1.) then
set udg_EOT_Param_Remaining_Interval = udg_EOT_Param_Remaining_Interval + udg_EOT_Param_Interval
set udg_EOT_Event_Interval_Before = 1 //<<< don't use
set udg_EOT_Event_Interval_Before = 0 //<<< use this
set udg_EOT_Event_On_Interval = 1 //<<< don't use
set udg_EOT_Event_On_Interval = 0 //<<< use this
set udg_EOT_Event_Interval_After = 1 //<<< don't use
set udg_EOT_Event_Interval_After = 0 //<<< use this
//Check for new target.
call EOT_Check_For_New_Target(i)
endif
endif
if not(udg_EOT_Param_Destroy) then
//Check if EOT has expired.
if udg_EOT_Param_Remaining_Duration <= 0. and udg_EOT_Param_Remaining_Duration > -1. then
set udg_EOT_Param_Expire = true
//Call the expire event.
set udg_EOT_Event_Expire_Before = 1 //<<< don't use
set udg_EOT_Event_Expire_Before = 0 //<<< use this
set udg_EOT_Event_An_EOT_Has_Expired = 1 //<<< don't use
set udg_EOT_Event_An_EOT_Has_Expired = 0 //<<< use this
set udg_EOT_Event_Expire_After = 1 //<<< don't use
set udg_EOT_Event_Expire_After = 0 //<<< use this
call EOT_Check_For_New_Target(i)
endif
endif
//Update ability level.
if udg_EOT_Param_Ability > 0 then
call SetUnitAbilityLevel(udg_EOT_Param_Target, udg_EOT_Param_Ability, udg_EOT_Param_Ability_Level)
endif
//Update buff.
if not(udg_EOT_Param_Hidden) then
call UnitAddAbility(udg_EOT_Param_Target, udg_EOT_Param_Buff_Holder)
//call SetUnitAbilityLevel(udg_EOT_Param_Target, udg_EOT_Param_Buff_Holder, udg_EOT_Param_Buff_Holder_Level) << removed because of bug with auras.
call UnitRemoveAbility(udg_EOT_Param_Target, udg_EOT_Param_Buff_Holder)
endif
endif
//Update new values.
set udg_EOT_Array_Source[i] = udg_EOT_Param_Source
set udg_EOT_Array_Target[i] = udg_EOT_Param_Target
set udg_EOT_Array_Duration[i] = udg_EOT_Param_Duration
set udg_EOT_Array_Remaining_Duration[i] = udg_EOT_Param_Remaining_Duration
set udg_EOT_Array_Interval[i] = udg_EOT_Param_Interval
set udg_EOT_Array_Remaining_Interval[i] = udg_EOT_Param_Remaining_Interval
set udg_EOT_Array_Hidden[i] = udg_EOT_Param_Hidden
set udg_EOT_Array_Buff[i] = udg_EOT_Param_Buff
set udg_EOT_Array_Buff_Holder[i] = udg_EOT_Param_Buff_Holder
set udg_EOT_Array_Buff_Holder_Level[i] = udg_EOT_Param_Buff_Holder_Level
set udg_EOT_Array_Ability[i] = udg_EOT_Param_Ability
set udg_EOT_Array_Ability_Level[i] = udg_EOT_Param_Ability_Level
set udg_EOT_Array_Type[i] = udg_EOT_Param_Type
set udg_EOT_Array_Subtype[i] = udg_EOT_Param_Subtype
set udg_EOT_Array_Positive[i] = udg_EOT_Param_Positive
set udg_EOT_Array_Can_Dispell[i] = udg_EOT_Param_Can_Dispell
set udg_EOT_Array_Is_Passive[i] = udg_EOT_Param_Is_Passive
set udg_EOT_Array_Special_Effect[i] = udg_EOT_Param_Special_Effect
set udg_EOT_Array_Special_Effect_Model[i] = udg_EOT_Param_Special_Effect_Model
set udg_EOT_Array_Special_Effect_Point[i] = udg_EOT_Param_Special_Effect_Point
//Destroy.
if udg_EOT_Param_Destroy or udg_EOT_Param_Expire or udg_EOT_Param_Force_Destroy then
call TriggerExecute(udg_EOT_Trigger_Destroy_EOT)
set i = i - 1
endif
//Next EOT.
set i = i + 1
endloop
call EOT_Set_Default_Variables()
endfunction
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// This code is the functions that this system has.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//This function checks if the EOT exists.
function EOT_Does_Exist takes nothing returns boolean
set udg_EOT_Index = 0
loop
exitwhen udg_EOT_Index > udg_EOT_Amount
if udg_EOT_Param_Target == udg_EOT_Array_Target[udg_EOT_Index] and udg_EOT_Param_Type == udg_EOT_Array_Type[udg_EOT_Index] and udg_EOT_Param_Subtype == udg_EOT_Array_Subtype[udg_EOT_Index] then
return true
endif
set udg_EOT_Index = udg_EOT_Index + 1
endloop
return false
endfunction
//This function creates a new EOT.
function EOT_Create_EOT takes nothing returns nothing
//Requires:
// - udg_EOT_Param_Source : unit
// - udg_EOT_Param_Target : unit
// - udg_EOT_Param_Type : integer
//Optional:
// - udg_EOT_Param_Subtype : integer
// - udg_EOT_Param_Duration : real
// - udg_EOT_Param_Interval : real
// - udg_EOT_Param_Buff : integer (buff)
// - udg_EOT_Param_Buff_Holder : integer (ability)
// - udg_EOT_Param_Buff_Holder_Level : integer
// - udg_EOT_Param_Ability : integer (ability)
// - udg_EOT_Param_Ability_Level : integer
// - udg_EOT_Param_Positive : boolean
// - udg_EOT_Param_Can_Dispell : boolean
// - udg_EOT_Param_Is_Passive : boolean
// - udg_EOT_Param_Special_Effect_Model : string
// - udg_EOT_Param_Special_Effect_Point : string
//If target is dead then don't do SHIT!
if IsUnitType(udg_EOT_Param_Target, UNIT_TYPE_DEAD) and GetUnitTypeId(udg_EOT_Param_Target) != 0 then
return
endif
//If the duration is 0 or lower then dset the duration to -1 (infinite).
if udg_EOT_Param_Duration <= 0. then
set udg_EOT_Param_Duration = -1.
endif
//Update the old EOT if that one existed.
if EOT_Does_Exist() then
set udg_EOT_Param_Remaining_Duration = udg_EOT_Param_Duration
call TriggerExecute(udg_EOT_Trigger_Save_Data)
return
endif
//Add the buff if applyable.
if udg_EOT_Param_Buff_Holder > 0 and udg_EOT_Param_Buff_Holder_Level > 0 then
set udg_EOT_Param_Hidden = false
call UnitAddAbility(udg_EOT_Param_Target, udg_EOT_Param_Buff_Holder)
//call SetUnitAbilityLevel(udg_EOT_Param_Target, udg_EOT_Param_Buff_Holder, udg_EOT_Param_Buff_Holder_Level) << removed because of bug with auras.
call UnitRemoveAbility(udg_EOT_Param_Target, udg_EOT_Param_Buff_Holder)
else
set udg_EOT_Param_Hidden = true
endif
//Add the ability if applyable.
if udg_EOT_Param_Ability > 0 and udg_EOT_Param_Ability_Level > 0 then
call UnitAddAbility(udg_EOT_Param_Target, udg_EOT_Param_Ability)
call SetUnitAbilityLevel(udg_EOT_Param_Target, udg_EOT_Param_Ability, udg_EOT_Param_Ability_Level)
endif
//Make a special effect.
if udg_EOT_Param_Special_Effect_Model != "" then
if udg_EOT_Param_Special_Effect_Point == "" or udg_EOT_Param_Special_Effect_Point == null then
set udg_EOT_Param_Special_Effect_Point = "origin"
endif
set udg_EOT_Param_Special_Effect = AddSpecialEffectTarget(udg_EOT_Param_Special_Effect_Model, udg_EOT_Param_Target, udg_EOT_Param_Special_Effect_Point)
endif
set udg_EOT_Param_Remaining_Duration = udg_EOT_Param_Duration
set udg_EOT_Param_Remaining_Interval = udg_EOT_Param_Interval
set udg_EOT_Amount = udg_EOT_Amount + 1
set udg_EOT_Unique_Id = udg_EOT_Unique_Id + 1
set udg_EOT_Param_Id = udg_EOT_Unique_Id
call SaveInteger(udg_EOT_Hashtable, udg_EOT_Param_Id, 0, udg_EOT_Amount)
//Call the event.
set udg_EOT_Event_Creation_Before = 1 //<<< don't use
set udg_EOT_Event_Creation_Before = 0 //<<< use this
set udg_EOT_Event_An_EOT_Is_Created = 1 //<<< don't use
set udg_EOT_Event_An_EOT_Is_Created = 0 //<<< use this
set udg_EOT_Event_Creation_After = 1 //<<< don't use
set udg_EOT_Event_Creation_After = 0 //<<< use this
set udg_EOT_Array_Id[udg_EOT_Amount] = udg_EOT_Param_Id
set udg_EOT_Array_Source[udg_EOT_Amount] = udg_EOT_Param_Source
set udg_EOT_Array_Target[udg_EOT_Amount] = udg_EOT_Param_Target
set udg_EOT_Array_Duration[udg_EOT_Amount] = udg_EOT_Param_Duration
set udg_EOT_Array_Remaining_Duration[udg_EOT_Amount] = udg_EOT_Param_Remaining_Duration
set udg_EOT_Array_Interval[udg_EOT_Amount] = udg_EOT_Param_Interval
set udg_EOT_Array_Remaining_Interval[udg_EOT_Amount] = udg_EOT_Param_Remaining_Interval
set udg_EOT_Array_Hidden[udg_EOT_Amount] = udg_EOT_Param_Hidden
set udg_EOT_Array_Buff[udg_EOT_Amount] = udg_EOT_Param_Buff
set udg_EOT_Array_Buff_Holder[udg_EOT_Amount] = udg_EOT_Param_Buff_Holder
set udg_EOT_Array_Buff_Holder_Level[udg_EOT_Amount] = udg_EOT_Param_Buff_Holder_Level
set udg_EOT_Array_Ability[udg_EOT_Amount] = udg_EOT_Param_Ability
set udg_EOT_Array_Ability_Level[udg_EOT_Amount] = udg_EOT_Param_Ability_Level
set udg_EOT_Array_Type[udg_EOT_Amount] = udg_EOT_Param_Type
set udg_EOT_Array_Subtype[udg_EOT_Amount] = udg_EOT_Param_Subtype
set udg_EOT_Array_Positive[udg_EOT_Amount] = udg_EOT_Param_Positive
set udg_EOT_Array_Can_Dispell[udg_EOT_Amount] = udg_EOT_Param_Can_Dispell
set udg_EOT_Array_Is_Passive[udg_EOT_Amount] = udg_EOT_Param_Is_Passive
set udg_EOT_Array_Special_Effect[udg_EOT_Amount] = udg_EOT_Param_Special_Effect
set udg_EOT_Array_Special_Effect_Model[udg_EOT_Amount] = udg_EOT_Param_Special_Effect_Model
set udg_EOT_Array_Special_Effect_Point[udg_EOT_Amount] = udg_EOT_Param_Special_Effect_Point
//Start the timer if this is the only EOT.
if udg_EOT_Amount == 0 then
call TimerStart(udg_EOT_Timer, 0.03, true, function EOT_Interval)
endif
return
endfunction
//This function destroys an EOT.
function EOT_Destroy_EOT takes nothing returns boolean
//Requires:
// - udg_EOT_Index : integer
set udg_EOT_Param_Destroy = true
//Call the destroy event.
set udg_EOT_Event_Destruction_Before = 1 //<<< don't use
set udg_EOT_Event_Destruction_Before = 0 //<<< use this
set udg_EOT_Event_An_EOT_Is_Destroyed = 1 //<<< don't use
set udg_EOT_Event_An_EOT_Is_Destroyed = 0 //<<< use this
set udg_EOT_Event_Destruction_After = 1 //<<< don't use
set udg_EOT_Event_Destruction_After = 0 //<<< use this
//Destroy the EOT.
if not(udg_EOT_Param_Is_Passive) or udg_EOT_Param_Destroy_Passive then
if udg_EOT_Param_Destroy or udg_EOT_Param_Force_Destroy then
call DestroyEffect(udg_EOT_Array_Special_Effect[udg_EOT_Index])
call UnitRemoveAbility(udg_EOT_Array_Target[udg_EOT_Index], udg_EOT_Array_Buff_Holder[udg_EOT_Index])
call UnitRemoveAbility(udg_EOT_Array_Target[udg_EOT_Index], udg_EOT_Array_Buff[udg_EOT_Index])
call UnitRemoveAbility(udg_EOT_Array_Target[udg_EOT_Index], udg_EOT_Array_Ability[udg_EOT_Index])
call FlushChildHashtable(udg_EOT_Hashtable, udg_EOT_Array_Id[udg_EOT_Index])
set udg_EOT_Array_Id[udg_EOT_Index] = udg_EOT_Array_Id[udg_EOT_Amount]
call SaveInteger(udg_EOT_Hashtable, udg_EOT_Array_Id[udg_EOT_Index], 0, udg_EOT_Index)
set udg_EOT_Array_Source[udg_EOT_Index] = udg_EOT_Array_Source[udg_EOT_Amount]
set udg_EOT_Array_Target[udg_EOT_Index] = udg_EOT_Array_Target[udg_EOT_Amount]
set udg_EOT_Array_Duration[udg_EOT_Index] = udg_EOT_Array_Duration[udg_EOT_Amount]
set udg_EOT_Array_Remaining_Duration[udg_EOT_Index] = udg_EOT_Array_Remaining_Duration[udg_EOT_Amount]
set udg_EOT_Array_Interval[udg_EOT_Index] = udg_EOT_Array_Interval[udg_EOT_Amount]
set udg_EOT_Array_Remaining_Interval[udg_EOT_Index] = udg_EOT_Array_Remaining_Interval[udg_EOT_Amount]
set udg_EOT_Array_Hidden[udg_EOT_Index] = udg_EOT_Array_Hidden[udg_EOT_Amount]
set udg_EOT_Array_Buff[udg_EOT_Index] = udg_EOT_Array_Buff[udg_EOT_Amount]
set udg_EOT_Array_Buff_Holder[udg_EOT_Index] = udg_EOT_Array_Buff_Holder[udg_EOT_Amount]
set udg_EOT_Array_Buff_Holder_Level[udg_EOT_Index] = udg_EOT_Array_Buff_Holder_Level[udg_EOT_Amount]
set udg_EOT_Array_Ability[udg_EOT_Index] = udg_EOT_Array_Ability[udg_EOT_Amount]
set udg_EOT_Array_Ability_Level[udg_EOT_Index] = udg_EOT_Array_Ability_Level[udg_EOT_Amount]
set udg_EOT_Array_Type[udg_EOT_Index] = udg_EOT_Array_Type[udg_EOT_Amount]
set udg_EOT_Array_Subtype[udg_EOT_Index] = udg_EOT_Array_Subtype[udg_EOT_Amount]
set udg_EOT_Array_Positive[udg_EOT_Index] = udg_EOT_Array_Positive[udg_EOT_Amount]
set udg_EOT_Array_Can_Dispell[udg_EOT_Index] = udg_EOT_Array_Can_Dispell[udg_EOT_Amount]
set udg_EOT_Array_Is_Passive[udg_EOT_Index] = udg_EOT_Array_Is_Passive[udg_EOT_Amount]
set udg_EOT_Array_Special_Effect[udg_EOT_Index] = udg_EOT_Array_Special_Effect[udg_EOT_Amount]
set udg_EOT_Array_Special_Effect_Model[udg_EOT_Index] = udg_EOT_Array_Special_Effect_Model[udg_EOT_Amount]
set udg_EOT_Array_Special_Effect_Point[udg_EOT_Index] = udg_EOT_Array_Special_Effect_Point[udg_EOT_Amount]
set udg_EOT_Array_Id[udg_EOT_Amount] = 0
set udg_EOT_Array_Source[udg_EOT_Amount] = null
set udg_EOT_Array_Target[udg_EOT_Amount] = null
set udg_EOT_Array_Duration[udg_EOT_Amount] = 0.
set udg_EOT_Array_Remaining_Duration[udg_EOT_Amount] = 0.
set udg_EOT_Array_Interval[udg_EOT_Amount] = 0.
set udg_EOT_Array_Remaining_Interval[udg_EOT_Amount] = 0.
set udg_EOT_Array_Hidden[udg_EOT_Amount] = false
set udg_EOT_Array_Buff[udg_EOT_Amount] = 0
set udg_EOT_Array_Buff_Holder[udg_EOT_Amount] = 0
set udg_EOT_Array_Buff_Holder_Level[udg_EOT_Amount] = 0
set udg_EOT_Array_Ability[udg_EOT_Amount] = 0
set udg_EOT_Array_Ability_Level[udg_EOT_Amount] = 0
set udg_EOT_Array_Type[udg_EOT_Amount] = 0
set udg_EOT_Array_Subtype[udg_EOT_Amount] = 0
set udg_EOT_Array_Positive[udg_EOT_Amount] = false
set udg_EOT_Array_Can_Dispell[udg_EOT_Amount] = false
set udg_EOT_Array_Is_Passive[udg_EOT_Amount] = false
set udg_EOT_Array_Special_Effect[udg_EOT_Amount] = null
set udg_EOT_Array_Special_Effect_Model[udg_EOT_Amount] = ""
set udg_EOT_Array_Special_Effect_Point[udg_EOT_Amount] = ""
set udg_EOT_Amount = udg_EOT_Amount - 1
if udg_EOT_Amount < 0 then
call PauseTimer(udg_EOT_Timer)
endif
set udg_EOT_Param_Destroy = false
set udg_EOT_Param_Force_Destroy = false
set udg_EOT_Param_Destroy_Passive = false
return true
endif
endif
set udg_EOT_Param_Destroy = false
set udg_EOT_Param_Force_Destroy = false
set udg_EOT_Param_Destroy_Passive = false
return false
endfunction
//This function retrieves the data of an EOT and set the Param variables to that data.
function EOT_Get_Data takes nothing returns boolean
//Requires:
// - udg_EOT_Param_Target : unit
// - udg_EOT_Param_Type : integer
// - udg_EOT_Param_Subtype : integer
set udg_EOT_Index = 0
loop
exitwhen udg_EOT_Index > udg_EOT_Amount
if udg_EOT_Param_Target == udg_EOT_Array_Target[udg_EOT_Index] and udg_EOT_Param_Type == udg_EOT_Array_Type[udg_EOT_Index] and udg_EOT_Param_Subtype == udg_EOT_Array_Subtype[udg_EOT_Index] then
set udg_EOT_Param_Id = udg_EOT_Array_Id[udg_EOT_Index]
set udg_EOT_Param_Source = udg_EOT_Array_Source[udg_EOT_Index]
set udg_EOT_Param_Duration = udg_EOT_Array_Duration[udg_EOT_Index]
set udg_EOT_Param_Remaining_Duration = udg_EOT_Array_Remaining_Duration[udg_EOT_Index]
set udg_EOT_Param_Interval = udg_EOT_Array_Interval[udg_EOT_Index]
set udg_EOT_Param_Remaining_Interval = udg_EOT_Array_Remaining_Interval[udg_EOT_Index]
set udg_EOT_Param_Hidden = udg_EOT_Array_Hidden[udg_EOT_Index]
set udg_EOT_Param_Buff = udg_EOT_Array_Buff[udg_EOT_Index]
set udg_EOT_Param_Buff_Holder = udg_EOT_Array_Buff_Holder[udg_EOT_Index]
set udg_EOT_Param_Buff_Holder_Level = udg_EOT_Array_Buff_Holder_Level[udg_EOT_Index]
set udg_EOT_Param_Ability = udg_EOT_Array_Ability[udg_EOT_Index]
set udg_EOT_Param_Ability_Level = udg_EOT_Array_Ability_Level[udg_EOT_Index]
set udg_EOT_Param_Positive = udg_EOT_Array_Positive[udg_EOT_Index]
set udg_EOT_Param_Can_Dispell = udg_EOT_Array_Can_Dispell[udg_EOT_Index]
set udg_EOT_Param_Is_Passive = udg_EOT_Array_Is_Passive[udg_EOT_Index]
set udg_EOT_Param_Special_Effect = udg_EOT_Array_Special_Effect[udg_EOT_Index]
set udg_EOT_Param_Special_Effect_Model = udg_EOT_Array_Special_Effect_Model[udg_EOT_Index]
set udg_EOT_Param_Special_Effect_Point = udg_EOT_Array_Special_Effect_Point[udg_EOT_Index]
set udg_EOT_Event_Get_Data = 1 //<<< don't use
set udg_EOT_Event_Get_Data = 0 //<<< use this
return true
endif
set udg_EOT_Index = udg_EOT_Index + 1
endloop
return false
endfunction
//This function saves the data stored in the Param variables to the EOT.
function EOT_Save_Data takes nothing returns nothing
//Requires:
// - udg_EOT_Param_Id : integer
//If target is dead then don't do SHIT!
if IsUnitType(udg_EOT_Param_Target, UNIT_TYPE_DEAD) and GetUnitTypeId(udg_EOT_Param_Target) != 0 then
return
endif
set udg_EOT_Index = LoadInteger(udg_EOT_Hashtable, udg_EOT_Param_Id, 0)
//Check for new target.
call EOT_Check_For_New_Target(udg_EOT_Index)
set udg_EOT_Array_Source[udg_EOT_Index] = udg_EOT_Param_Source
set udg_EOT_Array_Duration[udg_EOT_Index] = udg_EOT_Param_Duration
set udg_EOT_Array_Remaining_Duration[udg_EOT_Index] = udg_EOT_Param_Remaining_Duration
set udg_EOT_Array_Interval[udg_EOT_Index] = udg_EOT_Param_Interval
set udg_EOT_Array_Remaining_Interval[udg_EOT_Index] = udg_EOT_Param_Remaining_Interval
set udg_EOT_Array_Hidden[udg_EOT_Index] = udg_EOT_Param_Hidden
set udg_EOT_Array_Buff[udg_EOT_Index] = udg_EOT_Param_Buff
set udg_EOT_Array_Buff_Holder[udg_EOT_Index] = udg_EOT_Param_Buff_Holder
set udg_EOT_Array_Buff_Holder_Level[udg_EOT_Index] = udg_EOT_Param_Buff_Holder_Level
set udg_EOT_Array_Ability[udg_EOT_Index] = udg_EOT_Param_Ability
set udg_EOT_Array_Ability_Level[udg_EOT_Index] = udg_EOT_Param_Ability_Level
set udg_EOT_Array_Type[udg_EOT_Index] = udg_EOT_Param_Type
set udg_EOT_Array_Subtype[udg_EOT_Index] = udg_EOT_Param_Subtype
set udg_EOT_Array_Positive[udg_EOT_Index] = udg_EOT_Param_Positive
set udg_EOT_Array_Can_Dispell[udg_EOT_Index] = udg_EOT_Param_Can_Dispell
set udg_EOT_Array_Is_Passive[udg_EOT_Index] = udg_EOT_Param_Is_Passive
set udg_EOT_Array_Special_Effect[udg_EOT_Index] = udg_EOT_Param_Special_Effect
set udg_EOT_Array_Special_Effect_Model[udg_EOT_Index] = udg_EOT_Param_Special_Effect_Model
set udg_EOT_Array_Special_Effect_Point[udg_EOT_Index] = udg_EOT_Param_Special_Effect_Point
set udg_EOT_Event_Save_Data = 1 //<<< don't use
set udg_EOT_Event_Save_Data = 0 //<<< use this
endfunction
//This function removes EOTs that are filtered by the Hidden, Positive and Negative variables.
function EOT_Remove_EOTs takes nothing returns nothing
//Requires:
// - udg_EOT_Param_Target : unit
// - udg_EOT_Param_Hidden : boolean
// - udg_EOT_Param_Positive : boolean
// - udg_EOT_Param_Negative : boolean
//Optional:
// - udg_EOT_Param_Force_Destroy : boolean
local unit target = udg_EOT_Param_Target
local boolean hidden = udg_EOT_Param_Hidden
local boolean positive = udg_EOT_Param_Positive
local boolean negative = udg_EOT_Param_Negative
local integer i = 0
loop
exitwhen i > udg_EOT_Amount
set udg_EOT_Param_Target = target
set udg_EOT_Param_Ability = udg_EOT_Array_Ability[i]
if TriggerEvaluate(udg_EOT_Trigger_Get_Data) then
if not(udg_EOT_Param_Is_Passive) and (udg_EOT_Param_Can_Dispell or udg_EOT_Param_Force_Destroy) then
if udg_EOT_Param_Hidden == hidden then
if (udg_EOT_Param_Positive and positive) or (not(udg_EOT_Param_Positive) and negative) then
//Call the dispell event.
set udg_EOT_Event_Dispell_Before = 1 //<<< don't use
set udg_EOT_Event_Dispell_Before = 0 //<<< use this
set udg_EOT_Event_An_EOT_Is_Dispelled = 1 //<<< don't use
set udg_EOT_Event_An_EOT_Is_Dispelled = 0 //<<< use this
set udg_EOT_Event_Dispell_After = 1 //<<< don't use
set udg_EOT_Event_Dispell_After = 0 //<<< use this
call TriggerExecute(udg_EOT_Trigger_Destroy_EOT)
set i = i - 1
endif
endif
endif
endif
set i = i + 1
endloop
set udg_EOT_Param_Force_Destroy = false
set target = null
endfunction
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// This code is the initialization of the system and it's functions.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//This is the initial function.
function InitTrig_EOT_System takes nothing returns nothing
//Create the global variables.
set udg_EOT_Hashtable = InitHashtable()
set udg_EOT_Amount = -1
set udg_EOT_Unique_Id = -1
call EOT_Set_Default_Variables()
//Create the interval timer.
set udg_EOT_Timer = CreateTimer()
//Create the "Create_EOT" function.
//This function does not have to return a boolean.
set udg_EOT_Trigger_Create_EOT = CreateTrigger()
call TriggerAddAction(udg_EOT_Trigger_Create_EOT, function EOT_Create_EOT)
//Create the "Destroy_EOT" function.
//Returns true if destroyed and false if the EOT cannot be found.
set udg_EOT_Trigger_Destroy_EOT = CreateTrigger()
call TriggerAddCondition(udg_EOT_Trigger_Destroy_EOT, Filter(function EOT_Destroy_EOT))
call TriggerAddAction(udg_EOT_Trigger_Destroy_EOT, function EOT_Destroy_EOT)
//Create the "Get_Data" function.
set udg_EOT_Trigger_Get_Data = CreateTrigger()
call TriggerAddCondition(udg_EOT_Trigger_Get_Data, Filter(function EOT_Get_Data))
call TriggerAddAction(udg_EOT_Trigger_Get_Data, function EOT_Get_Data)
//Create the "Save_Data" function.
//This function does not have to return a boolean.
set udg_EOT_Trigger_Save_Data = CreateTrigger()
call TriggerAddAction(udg_EOT_Trigger_Save_Data, function EOT_Save_Data)
//Create the "Remove_EOTs" function.
//This function does not have to return a boolean.
set udg_EOT_Trigger_Remove_EOTs = CreateTrigger()
call TriggerAddAction(udg_EOT_Trigger_Remove_EOTs, function EOT_Remove_EOTs)
endfunction
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// EOT System end
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//TESH.scrollpos=33
//TESH.alwaysfold=0
//EOT
globals
integer udg_EOT_Unique_Id
integer udg_EOT_Index
integer udg_EOT_Amount
boolean udg_EOT_Param_Expire
boolean udg_EOT_Param_Destroy
boolean udg_EOT_Param_Force_Destroy
boolean udg_EOT_Param_Negative
integer udg_EOT_Param_Id
unit udg_EOT_Param_Source
unit udg_EOT_Param_Target
real udg_EOT_Param_Duration
real udg_EOT_Param_Remaining_Duration
real udg_EOT_Param_Interval
real udg_EOT_Param_Remaining_Interval
boolean udg_EOT_Param_Hidden
integer udg_EOT_Param_Buff
integer udg_EOT_Param_Buff_Holder
integer udg_EOT_Param_Buff_Holder_Level
integer udg_EOT_Param_Ability
integer udg_EOT_Param_Ability_Level
integer udg_EOT_Param_Type
integer udg_EOT_Param_Subtype
integer udg_EOT_Param_Subtype2
boolean udg_EOT_Param_Positive
boolean udg_EOT_Param_Can_Dispell
boolean udh_EOT_Param_Is_Passive
effect udg_EOT_Param_Special_Effect
string udg_EOT_Param_Special_Effect_Model
string udg_EOT_Param_Special_Effect_Point
integer array udg_EOT_Id
unit array udg_EOT_Array_Source
unit array udg_EOT_Array_Target
real array udg_EOT_Array_Duration
real array udg_EOT_Array_Remaining_Duration
real array udg_EOT_Array_Interval
real array udg_EOT_Array_Remaining_Interval
boolean array udg_EOT_Array_Hidden
integer array udg_EOT_Array_Buff
integer array udg_EOT_Array_Buff_Holder
integer array udg_EOT_Array_Buff_Holder_Level
integer array udg_EOT_Array_Ability
integer array udg_EOT_Array_Ability_Level
integer array udg_EOT_Array_Type
integer array udg_EOT_Array_Subtype
integer array udg_EOT_Array_Subtype2
boolean array udg_EOT_Array_Positive
boolean array udg_EOT_Array_Can_Dispell
boolean array udh_EOT_Array_Is_Passive
effect array udg_EOT_Array_Special_Effect
string array udg_EOT_Array_Special_Effect_Model
string array udg_EOT_Array_Special_Effect_Point
trigger array udg_EOT_Array_On_Period_Trigger
hashtable udg_EOT_Hashtable
timer udg_EOT_Timer
trigger udg_EOT_Trigger_Create_EOT
trigger udg_EOT_Trigger_Destroy_EOT
trigger udg_EOT_Trigger_Get_Data
trigger udg_EOT_Trigger_Save_Data
trigger udg_EOT_Trigger_Remove_EOTs
real udg_EOT_Event_An_EOT_Is_Created
real udg_EOT_Event_An_EOT_Is_Destroyed
real udg_EOT_Event_An_EOT_Is_Dispelled
real udg_EOT_Event_An_EOT_Has_Expired
real udg_EOT_Event_On_Interval
real udg_EOT_Event_Creation_Before
real udg_EOT_Event_Creation_After
real udg_EOT_Event_Destruction_Before
real udg_EOT_Event_Destruction_After
real udg_EOT_Event_Dispell_Before
real udg_EOT_Event_Dispell_After
real udg_EOT_Event_Expire_Before
real udg_EOT_Event_Expire_After
real udg_EOT_Event_Interval_Before
real udg_EOT_Event_Interval_After
real udg_EOT_Event_Get_Data
real udg_EOT_Event_Save_Data
endglobals
//DOT
globals
real udg_DOT_Damage
attacktype udg_DOT_Attack_Type
damagetype udg_DOT_Damage_Type
endglobals
//TESH.scrollpos=0
//TESH.alwaysfold=0
function DOT_Deal_Damage takes nothing returns boolean
if udg_DOT_Damage == 0. then
return false
endif
call UnitDamageTarget(udg_EOT_Param_Source, udg_EOT_Param_Target, udg_DOT_Damage, true, false, udg_DOT_Attack_Type, udg_DOT_Damage_Type, WEAPON_TYPE_WHOKNOWS)
return false
endfunction
function DOT_Save_Data takes nothing returns boolean
call EOT_Save_Real(-1, udg_DOT_Damage)
call EOT_Save_Integer(-2, ConvertAttackTypeReverse(udg_DOT_Attack_Type))
call EOT_Save_Integer(-3, ConvertDamageTypeReverse(udg_DOT_Damage_Type))
return false
endfunction
function DOT_Get_Data takes nothing returns boolean
set udg_DOT_Damage = EOT_Load_Real(-1)
set udg_DOT_Attack_Type = ConvertAttackType(EOT_Load_Integer(-2))
set udg_DOT_Damage_Type = ConvertDamageType(EOT_Load_Integer(-3))
return false
endfunction
function DOT_Reset_Data takes nothing returns boolean
set udg_DOT_Damage = 0.
set udg_DOT_Attack_Type = ConvertAttackType(0)
set udg_DOT_Damage_Type = ConvertDamageType(0)
return false
endfunction
//===========================================================================
function InitTrig_DOT_Extension takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterVariableEvent(t, "udg_EOT_Event_Interval_After", EQUAL, 0)
call TriggerAddCondition(t, Filter(function DOT_Deal_Damage))
set t = CreateTrigger()
call TriggerRegisterVariableEvent(t, "udg_EOT_Event_Creation_Before", EQUAL, 0)
call TriggerRegisterVariableEvent(t, "udg_EOT_Event_Save_Data", EQUAL, 0)
call TriggerAddCondition(t, Filter(function DOT_Save_Data))
set t = CreateTrigger()
call TriggerRegisterVariableEvent(t, "udg_EOT_Event_Interval_Before", EQUAL, 0)
call TriggerRegisterVariableEvent(t, "udg_EOT_Event_Get_Data", EQUAL, 0)
call TriggerAddCondition(t, Filter(function DOT_Get_Data))
set t = CreateTrigger()
call TriggerRegisterVariableEvent(t, "udg_EOT_Event_Null_Variables", EQUAL, 0)
call TriggerAddCondition(t, Filter(function DOT_Reset_Data))
set t = null
endfunction