This system provides users with helpful utilities with regards to creation of illusions as well as the manipulation of many of their aspects.
With this system, you can now create illusions of any type as easily as creating units. This even allows you to create permanent illusions.
Read the script header for more details.
Main Script
JASS:
libraryIllusionEditor/*
*/requires/*
*/UnitDex/*
[[url]http://www.hiveworkshop.com/threads/system-unitdex-unit-indexer.248209/][/url]
*/DamageEvent/*
[[url]http://www.hiveworkshop.com/threads/system-physical-damage-detection.228456/][/url]
*/Table/*
[[url]http://www.hiveworkshop.com/threads/snippet-new-table.188084/][/url]
*/optionalRegisterPlayerUnitEvent/*
[[url]http://www.hiveworkshop.com/threads/snippet-registerplayerunitevent.203338/][/url]
*///! novjass_______________________
| |
| IllusionEditorv1.2b |
| WrittenbyAGD |
|_______________________|
/*
This system gives you freedom and ease in creating illusions. With this, you
can now create illusions of any type as easily as creating units or make an
illusion copy from an already existing unit, with the ability to change many
of their aspects (such as duration, damage dealt, damage recieved, deathSFX,
and hero level) dynamically.
Hint:
- Use zero or any negative value for duration to make a permanent illusion
- Setting a hero illusion's level might cause a change to its proper name
To Import:
- Copy all the neccessary Object Editor data or alternatively use the object merger
- Copy the Damage Engine Trigger category together with the Unit Indexer
- Copy this trigger/trigger category
*/
|=======|
| API |
|=======|
functionCreateIllusiontakesplayerwhichPlayer, integerID, realdur, realdamageDealt, realdamageReceived, realx, realy, realanglereturnsunit/*
- Creates an illusion of type <ID>
*/functionCopyUnittakesplayerwhichPlayer, unitu, realdur, realdamageDealt, realdamageReceived, realx, realy, realanglereturnsunit/*
- Creates an illusion copy of a unit which possesses the same abilities and items as the original unit
*/functionSetIllusionLeveltakesunitu, integerlevel, booleanshowEyeCandyreturnsboolean/*
- Sets the level of the illusion to a desired value and returns boolean value depending on the success of the operation
(Only works if the illusion is a hero and if it was created using this system)
*/functionSetIllusionDurationtakesunitu, realtimereturnsboolean/*
- Sets the duration of the illusion and returns a boolean value depending on the success of the operation
(This only works for illusions created by this system)
*/functionAddIllusionDurationtakesunitu, realextraTimereturnsboolean/*
- Adds an extra duration to an illusion's timed life and returns a boolean value depending on the success of the operation
(This only works for illusions created by this system)
*/functionSetIllusionDamageFactortakesunitu, realfactorreturnsboolean/*
- Sets the damagedealt factor of the illusion and returns a boolean value depending on the success of the operation
(This only works for illusions created by this system)
*/functionSetIllusionReceiveFactortakesunitu, realfactorreturnsboolean/*
- Sets the damagereceivefactor of the illusion and returns a boolean value depending on the success of the operation
(This only works for illusions created by this system)
*/functionShowIllusionDeathEffecttakesunitu, booleanflagreturnsboolean/*
- Sets the illusion's death animation ON/OFF and returns a boolean value depending on the success of the operation
(This only works for illusions created by this system)
*/functionSetIllusionDeathEffecttakesunitu, stringmodelreturnsboolean/*
- Sets the death animation of the illusion and returns a boolean value depending on the success of the operation
(This only works for illusions created by this system)
*/functionGetIllusionRemainingDurationtakesunitureturnsreal/*
- Returns the remaining duration of the illusion
(This will return 0 for illusions not created by this system)
*/functionGetIllusionTotalDurationtakesunitureturnsreal/*
- Returns the duration of the illusion
(This will return 0 for illusions not created by this system)
*/functionGetIllusionDamageFactortakesunitureturnsreal/*
- Returns the damagedealt factor of the illusion
(This will return 0 for illusions not created by this system)
*/functionGetIllusionReceiveFactortakesunitureturnsreal/*
- Returns the damagereceive factor of the illusion
(This will return 0 for illusions not created by this system)
*/functionGetLastIllusiontakesnothingreturnsunit/*
- Returns the last illusion created using this system
*/functionGetIllusionFlagtakesunitureturnsboolean/*
- Checks if the illusion is created by this system or not
*///! endnovjassglobals///////////////////////////// Configuration Section //////////////////////////////////////////////////////////////////////////////////// Rawcode of the item used for creating illusions ///////////////////////////////////////////////////////privateconstantintegerITEM_ID = 'I000'/////////////////////////////////////////////////////// Rawcode of the dummy caster ///////////////////////////////////////////////////////privateconstantintegerDUMMY_ID = 'i001'/////////////////////////////////////////////////////// Illusion timed life check interval ///////////////////////////////////////////////////////privateconstantrealLOOP_INTERVAL = 0.03125/////////////////////////////////////////////////////// Synchronize this value with the duration of //// illusions produced by the the item in the //// object editor so that this system will be able //// to make the neccessary adjustments. //// It would be better to set this value to 3600 //// which is the maximum duration you can put in //// the object editor. But always be reminded that //// everytime you change this value, change also //// that of the object editor's! ///////////////////////////////////////////////////////privateconstantrealITEM_DUR_LIMIT = 5.00/////////////////////////////////////////////////////// The remaining time of the illusion before it //// would be replaced with another one in case the //// desired duration of the illusion is greater //// than what the item could provide ///////////////////////////////////////////////////////privateconstantrealREPLACE_TIME_ALLOWANCE = 0.10/////////////////////////////////////////////////////// The default death animation of the illusions ///////////////////////////////////////////////////////privateconstantstringDEFAULT_DEATH_SFX = "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl"/////////////////////////////////////////////////////// The owning player of the dummy unit ///////////////////////////////////////////////////////privateconstantplayerDUMMY_OWNER = Player(15)
/////////////////////////////////////////////////////// The prefix of the operation error message when //// debug mode is enabled ///////////////////////////////////////////////////////privateconstantstringPREFIX = "Operation Failed: "//////////////////////////// End of Configuration ////////////////////////////endglobals//===== Do not change anything below this line if you're not so sure on what you're doing =====//globalsprivateHashTablehashprivategrouptempGroup = CreateGroup()
privatetriggerdeathEvent = CreateTrigger()
privateintegerindex = 0privateintegertempInt = 0privateintegerusedDeathEvent = 0privateunitillusionprivateunitUprivateunitdummyCasterprivateitemcasterItem// These variables are used to store unit specific data for// each illusion created using this systemprivateintegerarraymaxTargeterCountprivateintegerarrayorderprivateintegerarrayorderTypeprivatebooleanarrayflagprivatebooleanarraycheckprivatebooleanarrayshowDeathprivaterealarraytargPointXprivaterealarraytargPointYprivateunitarrayorderTargetprivatetimerarraylifeTimerprivaterealarrayelapsedprivaterealarraydurationprivaterealarraydamageFactorprivaterealarrayreceiveFactorprivaterealarrayXprivaterealarrayYprivaterealarrayfacingprivateplayerarrayownerprivateunitarraysummonprivatestringarraydeathSFXendglobalsstaticifDEBUG_MODEthenprivatefunctionDebugtakesstringmsgreturnsnothingcallDisplayTimedTextToPlayer( GetLocalPlayer(), 0, 0, 30, "|CFFFFCC00[Illusion Editor]|R " + msg )
endfunctionendifprivatekeywordCopy///////////////////////////////////////////////////// These three functions caches the order of the //// expiring illusion units to be passed to their //// replacements. Similarly when the expiring //// illusion is targeted with an order, the order //// will be redirected to its replacement as well./////////////////////////////////////////////////////privatefunctionReIssueTargetOrdertakesnothingreturnsbooleanlocalunitu = GetOrderedUnit()
localunitt = GetOrderTargetUnit()
localintegeri = GetUnitId( u )
localintegertDex = GetUnitId( t )
localintegerkey = GetHandleId( t )
ifcheck[i] thensetorderType[i] = 1setorderTarget[i] = tendififcheck[tDex] thensetorder[i] = GetUnitCurrentOrder( u )
ifnotflag[i] thenloopsetmaxTargeterCount[tDex] = maxTargeterCount[tDex] + 1ifhash[key].unit[maxTargeterCount[tDex]] == nullthensethash[key].unit[maxTargeterCount[tDex]] = usetflag[i] = truebreakendifendloopendifendifsetu = nullsett = nullreturnfalseendfunctionprivatefunctionReIssuePointOrdertakesnothingreturnsbooleanlocalintegeri = GetUnitId( GetOrderedUnit() )
ifcheck[i] thensetorderType[i] = 2settargPointX[i] = GetOrderPointX()
settargPointY[i] = GetOrderPointY()
endifsetflag[i] = falsereturnfalseendfunctionprivatefunctionReIssueOrdertakesnothingreturnsbooleanlocalintegeri = GetUnitId( GetOrderedUnit() )
ifcheck[i] thensetorderType[i] = 3endifsetflag[i] = falsereturnfalseendfunction/////////////////////////////////////////////////// This function controls the duration of the //// illusions as well as replacing them in case //// their hardcoded lifetime expires before //// meeting the duration desired for them ///////////////////////////////////////////////////privatefunctionAdjustTimedLifetakesnothingreturnsnothinglocaltimert = GetExpiredTimer()
localintegertimerKey = GetHandleId( t )
localunitu = hash[timerKey].unit[0]
localintegerkey = GetHandleId( u )
localintegeri = GetUnitId( u )
localintegerlastOrderlocalunitnewlocalrealtoAddifnotIsUnitType( u, UNIT_TYPE_DEAD ) andu != nullthensetelapsed[i] = elapsed[i] + LOOP_INTERVALifduration[i] < ITEM_DUR_LIMITandduration[i] > 0andelapsed[i] >= duration[i] thencallhash.remove( timerKey )
callRemoveUnit( u )
callDestroyTimer( t )
elseifelapsed[i] >= ITEM_DUR_LIMIT - REPLACE_TIME_ALLOWANCEthensettoAdd = duration[i] - ( ITEM_DUR_LIMIT - REPLACE_TIME_ALLOWANCE )
iftoAdd < 0thensettoAdd = 0endifsetlastOrder = GetUnitCurrentOrder( u )
setnew = Copy.evaluate( owner[i], u, toAdd, damageFactor[i], receiveFactor[i], GetUnitX( u ), GetUnitY( u ), GetUnitFacing( u ) )
//! textmacro REDIRECTDATA takes KEY, NEWLIFE, NEWMANAcallShowUnit( u, false )
callSetWidgetLife( new, $NEWLIFE$ )
callSetUnitState( new, UNIT_STATE_MANA, $NEWMANA$ )
setindex = 0loopsetindex = index + 1setU = hash[$KEY$].unit[index]
settempInt = GetUnitId( U )
ifU != nullandflag[tempInt] thensetflag[tempInt] = falsecallIssueTargetOrderById( U, order[tempInt], new )
endifexitwhenindex > maxTargeterCount[i]
endloopiforderType[i] == 1thencallIssueTargetOrderById( new, lastOrder, orderTarget[i] )
elseiforderType[i] == 2thencallIssuePointOrderById( new, lastOrder, targPointX[i], targPointY[i] )
elseiforderType[i] == 3thencallIssueImmediateOrderById( new, lastOrder )
endififIsUnitSelected( u, GetLocalPlayer() ) thencallSelectUnit( new, true )
endifsetmaxTargeterCount[i] = 0setindex = GetUnitId( new )
setdeathSFX[index] = deathSFX[i]
setshowDeath[index] = showDeath[i]
//! endtextmacro//! runtextmacro REDIRECTDATA( "key", "GetWidgetLife( u )", "GetUnitState( u, UNIT_STATE_MANA )" )callhash.remove( timerKey )
setshowDeath[i] = falsecallRemoveUnit( u )
callDestroyTimer( t )
ifu == illusionthensetillusion = newendifsetnew = nullendifelsecallhash.remove( timerKey )
callRemoveUnit( u )
callDestroyTimer( t )
endifsett = nullsetu = nullendfunction////////////////////// After Creation //////////////////////privatefunctionOnSummontakesnothingreturnsbooleanlocalintegerilocalintegeruDexifGetSummoningUnit() == dummyCasterthenseti = GetUnitId( dummyCaster )
setU = GetTriggerUnit()
setuDex = GetUnitId( U )
setcheck[uDex] = truesetshowDeath[uDex] = truesetduration[uDex] = duration[i]
setdamageFactor[uDex] = damageFactor[i]
setreceiveFactor[uDex] = receiveFactor[i]
setowner[uDex] = owner[i]
setlifeTimer[uDex] = CreateTimer()
setelapsed[uDex] = 0setmaxTargeterCount[uDex] = 0setdeathSFX[uDex] = DEFAULT_DEATH_SFXsethash[GetHandleId( lifeTimer[uDex] )].unit[0] = UcallTimerStart( lifeTimer[uDex], LOOP_INTERVAL, true, functionAdjustTimedLife )
callSetUnitOwner( U, owner[i], true )
callSetUnitFacing( U, facing[i] )
ifIsUnitType( U, UNIT_TYPE_STRUCTURE ) thencallSetUnitPosition( U, X[i], Y[i] )
elsecallSetUnitX( U, X[i] )
callSetUnitY( U, Y[i] )
endifcallTriggerRegisterUnitStateEvent( deathEvent, U, UNIT_STATE_LIFE, LESS_THAN, UNIT_MIN_LIFE )
endifreturnfalseendfunction///////////////////////////////////*****************************////* Usable function for users *////*****************************/////////////////////////////////////! textmacro REPLICATE takes FUNC, TAKE, X, TARGETprivatefunction$FUNC$takesplayerwhichPlayer, $TAKE$, realdur, realdamageDealt, realdamageReceived, realx, realy, realanglereturnsunitlocalintegeri = GetUnitId( dummyCaster )
$X$localunittempUnit = CreateUnit( DUMMY_OWNER, ID, x, y, 0 )
ifdur < 0thensetdur = 0endififdamageDealt < 0thensetdamageDealt = 0endififdamageReceived < 0thensetdamageReceived = 0endifsetX[i] = xsetY[i] = ysetduration[i] = dursetdamageFactor[i] = damageDealtsetreceiveFactor[i] = damageReceivedsetfacing[i] = anglesetowner[i] = whichPlayercallUnitUseItemTarget( dummyCaster, casterItem, $TARGET$ )
$X$callRemoveUnit( tempUnit )
$X$settempUnit = nullreturnUendfunction//! endtextmacro//! runtextmacro REPLICATE( "Create", "integer ID", "", "tempUnit" )//! runtextmacro REPLICATE( "Copy", "unit u", "//", "u" )functionCreateIllusiontakesplayerwhichPlayer, integerID, realdur, realdamageDealt, realdamageReceived, realx, realy, realanglereturnsunitsetillusion = Create( whichPlayer, ID, dur, damageDealt, damageReceived, x, y, angle )
returnillusionendfunctionfunctionCopyUnittakesplayerwhichPlayer, unitu, realdur, realdamageDealt, realdamageReceived, realx, realy, realanglereturnsunitsetillusion = Copy( whichPlayer, u, dur, damageDealt, damageReceived, x, y, angle )
returnillusionendfunctionfunctionSetIllusionLeveltakesunitu, integerlevel, booleanshowEyeCandyreturnsbooleanlocalintegeri = GetUnitId( u )
localintegerlastOrderlocalunittempUnitlocalunitnewlocalrealxlocalrealylocalbooleansuccess = falseifcheck[i] thensetx = GetUnitX( u )
sety = GetUnitY( u )
settempUnit = CreateUnit( DUMMY_OWNER, GetUnitTypeId( u ), x, y, GetUnitFacing( u ) )
ifIsUnitType( tempUnit, UNIT_TYPE_HERO ) thensetlastOrder = GetUnitCurrentOrder( u )
callSetHeroLevel( tempUnit, level, false )
setnew = Copy( owner[i], tempUnit, duration[i], damageFactor[i], receiveFactor[i], x, y, GetUnitFacing( u ) )
setindex = 0loopsetindex = index + 1callUnitAddItemToSlotById( new, GetItemTypeId( UnitItemInSlot( u, index ) ), index )
exitwhenindex == 6endloop//! runtextmacro REDIRECTDATA( "GetHandleId( u )", "GetWidgetLife( u )*GetWidgetLife( new )/GetUnitState( u, UNIT_STATE_MAX_LIFE )", "GetUnitState( u, UNIT_STATE_MANA )*GetUnitState( new, UNIT_STATE_MANA )/GetUnitState( u, UNIT_STATE_MAX_MANA )" )callRemoveUnit( u )
ifshowEyeCandythencallDestroyEffect( AddSpecialEffectTarget( "Abilities\\Spells\\Other\\Levelup\\LevelupCaster.mdl", new, "origin" ) )
endifsetsuccess = truesetnew = nulldebugelsedebugcallDebug( PREFIX + "Specified illusion is not a hero" )
endifcallRemoveUnit( tempUnit )
settempUnit = nulldebugelsedebugcallDebug( PREFIX + "Specified unit is not an illusion created by the system" )
endifreturnsuccessendfunction//! textmacro DEBUG takes Xifnotcheck[GetUnitId( u )] thendebugcallDebug( PREFIX + "Specified unit is not an illusion created by the system" )
$X$returnfalseendif//! endtextmacrofunctionAddIllusionDurationtakesunitu, realextraTimereturnsbooleanlocalintegeri = GetUnitId( u )
//! runtextmacro DEBUG( "" )setduration[i] = duration[i] + extraTimereturntrueendfunctionfunctionSetIllusionDamageFactortakesunitu, realfactorreturnsboolean//! runtextmacro DEBUG( "" )setdamageFactor[GetUnitId( u )] = factorreturntrueendfunctionfunctionSetIllusionReceiveFactortakesunitu, realfactorreturnsboolean//! runtextmacro DEBUG( "" )setreceiveFactor[GetUnitId( u )] = factorreturntrueendfunctionfunctionShowIllusionDeathEffecttakesunitu, booleanflagreturnsboolean//! runtextmacro DEBUG( "" )setshowDeath[GetUnitId( u )] = flagreturntrueendfunctionfunctionSetIllusionDeathEffecttakesunitu, stringmodelreturnsboolean//! runtextmacro DEBUG( "" )setdeathSFX[GetUnitId( u )] = modelreturntrueendfunctionfunctionGetIllusionRemainingDurationtakesunitureturnsreallocalintegeri = GetUnitId( u )
localrealremaining = duration[i] - elapsed[i]
//! runtextmacro DEBUG( "return 0.00//" )ifremaining < 0.00thenreturn0.00endifreturnremainingendfunctionfunctionSetIllusionDurationtakesunitu, realtimereturnsbooleanreturnAddIllusionDuration( u, time - GetIllusionRemainingDuration( u ) )
endfunctionfunctionGetIllusionTotalDurationtakesunitureturnsreal//! runtextmacro DEBUG( "//" )returnduration[GetUnitId( u )]
endfunctionfunctionGetIllusionDamageFactortakesunitureturnsreal//! runtextmacro DEBUG( "//" )returndamageFactor[GetUnitId( u )]
endfunctionfunctionGetIllusionReceiveFactortakesunitureturnsreal//! runtextmacro DEBUG( "//" )returnreceiveFactor[GetUnitId( u )]
endfunctionfunctionGetLastIllusiontakesnothingreturnsunitreturnillusionendfunctionfunctionGetIllusionFlagtakesunitureturnsbooleanreturncheck[GetUnitId( u )]
endfunction////////////////////////////////////////////////// This function adjusts the damage dealt and //// taken by the illusions //////////////////////////////////////////////////privatefunctionDamageAdjustmenttakesnothingreturnsbooleanlocalintegeruDex = GetUnitId( PDDS.source )
localintegertDex = GetUnitId( PDDS.target )
ifcheck[uDex] andcheck[tDex] thensetPDDS.amount = PDDS.amount*damageFactor[uDex]*receiveFactor[tDex]
elseifcheck[uDex] thensetPDDS.amount = PDDS.amount*damageFactor[uDex]
elseifcheck[tDex] thensetPDDS.amount = PDDS.amount*receiveFactor[tDex]
endifreturnfalseendfunction////////////////////////////////////////////////// Registers an illusion death event //////////////////////////////////////////////////privatefunctionRefreshDeathTriggertakesnothingreturnsnothinglocalunitucallGroupEnumUnitsInRect( tempGroup, bj_mapInitialPlayableArea, null )
loopsetu = FirstOfGroup( tempGroup )
exitwhenu == nullcallGroupRemoveUnit( tempGroup, u )
ifcheck[GetUnitId( u )] thencallTriggerRegisterUnitStateEvent( deathEvent, u, UNIT_STATE_LIFE, LESS_THAN, UNIT_MIN_LIFE )
endifendloopendfunction////////////////////////////////////////////////// This function is responsible for hiding or //// showing the illusion's death SFX //////////////////////////////////////////////////privatefunctionOnDeathtakesnothingreturnsbooleanlocalunitu = GetTriggerUnit()
localintegeri = GetUnitId( u )
callShowUnit( u, false )
callhash.remove( GetHandleId( u ) )
ifshowDeath[i] thencallDestroyEffect( AddSpecialEffect( deathSFX[i], GetUnitX( u ), GetUnitY( u ) ) )
endifsetusedDeathEvent = usedDeathEvent + 1ifusedDeathEvent == 20thensetusedDeathEvent = 0callDestroyTrigger( deathEvent )
setdeathEvent = CreateTrigger()
callTriggerAddCondition( deathEvent, Filter( functionOnDeath ) )
callRefreshDeathTrigger()
endifsetu = nullreturnfalseendfunction////////////////////// Initialization //////////////////////privatemoduleMstaticmethodonInittakesnothingreturnsnothingstaticifLIBRARY_RegisterPlayerUnitEventthencallRegisterPlayerUnitEventForPlayer( EVENT_PLAYER_UNIT_SUMMON, functionOnSummon, DUMMY_OWNER )
callRegisterPlayerUnitEvent( EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER, functionReIssueTargetOrder )
callRegisterPlayerUnitEvent( EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER, functionReIssuePointOrder )
callRegisterPlayerUnitEvent( EVENT_PLAYER_UNIT_ISSUED_ORDER, functionReIssueOrder )
elselocaltriggert1 = CreateTrigger()
localtriggert2 = CreateTrigger()
localtriggert3 = CreateTrigger()
localtriggert4 = CreateTrigger()
setindex = 16loopsetindex = index - 1callTriggerRegisterPlayerUnitEvent( t2, Player(index), EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER, null )
callTriggerRegisterPlayerUnitEvent( t3, Player(index), EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER, null )
callTriggerRegisterPlayerUnitEvent( t4, Player(index), EVENT_PLAYER_UNIT_ISSUED_ORDER, null )
exitwhenindex == 0endloopcallTriggerRegisterPlayerUnitEvent( t1, DUMMY_OWNER, EVENT_PLAYER_UNIT_SUMMON, null )
callTriggerAddCondition( t1, Filter( functionOnSummon ) )
callTriggerAddCondition( t2, Filter( functionReIssueTargetOrder ) )
callTriggerAddCondition( t3, Filter( functionReIssuePointOrder ) )
callTriggerAddCondition( t4, Filter( functionReIssueOrder ) )
endifcallTriggerAddCondition( deathEvent, Filter( functionOnDeath ) )
callAddDamageHandler( functionDamageAdjustment )
sethash = HashTable.create()
setcasterItem = CreateItem( ITEM_ID, 0, 10000 )
setdummyCaster = CreateUnit( DUMMY_OWNER, DUMMY_ID, 0, 0, 0 )
callUnitAddItem( dummyCaster, casterItem )
endmethodendmoduleprivatestructSextendsarrayimplementMendstructendlibrary
-------- ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| --------
-------- ||||||||||||||||||||||||||||||||||||||||||||||||| GUI ILLUSION EDITOR GUIDE |||||||||||||||||||||||||||||||||||||||||||||||| --------
-------- ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| --------
-------- First you need to choose what operation you want to do using the system. Like this: --------
Set IE_Operation = IE_CreateIllusion
-------- It can be any from the list below: --------
-------- --------
-------- 1. CreateIllusion - creates an illusion of a certain unit-type. --------
-------- 2. CopyUnit - creates a mirror image of a unit which possesses the same items and abilities --------
-------- as the original unit. --------
-------- 3. SetLevel - sets the level of a hero type illusion to a desired value. --------
-------- 4. SetDuration - sets the total duration of an illusion to a desired value, if the given amount --------
-------- is less than the elapsed time of the illusion, it will be destroyed. --------
-------- 5. AddDuration - adds an extra time to an illusion's duration. --------
-------- 6. SetDamageFactor - sets the damage dealt factor of an illusion. --------
-------- 7. SetReceiveFactor - sets the damage receive factor of an illusion --------
-------- 8. ShowDeathEffect - shows/hides the death effect of an illusion. --------
-------- 9. SetDeathEffect - sets a new special effect to replace the default death effect of an --------
-------- illusion. --------
-------- 10. GetRemainingDuration - gets the remaining duration of an illusion. --------
-------- 11. GetTotalDuration - gets the total duration of an illusion. --------
-------- 12. GetDamageFactor - gets the damage dealt factor of an illusion. --------
-------- 13. GetReceiveFactor - gets the damage receive factor of an illusion. --------
-------- 14. GetFlag - checks if the illusion was created using this system or not. --------
-------- --------
-------- Next, you have to setup all the data necessary for the operation you chose. Below are the --------
-------- list of data needed for each operation (Note that all these have an IE_ prefix): --------
-------- --------
-------- 1. - Owner --------
-------- - UnitType --------
-------- - Duration --------
-------- - DamageDealtFactor --------
-------- - DamageReceiveFactor --------
-------- - Position --------
-------- - Facing --------
-------- --------
-------- 2. - Owner --------
-------- - BaseUnit --------
-------- - Duration --------
-------- - DamageDealtFactor --------
-------- - DamageReceiveFactor --------
-------- - Position --------
-------- - Facing --------
-------- --------
-------- 3. - Illusion --------
-------- - NewLevel --------
-------- - Flag --------
-------- --------
-------- 4, 5. - Illusion --------
-------- - Duration --------
-------- --------
-------- 6. - Illusion --------
-------- - DamageDealtFactor --------
-------- --------
-------- 7. - Illusion --------
-------- - DamageReceiveFactor --------
-------- --------
-------- 8. - Illusion --------
-------- - Flag --------
-------- --------
-------- 9. - Illusion --------
-------- - DeathEffect --------
-------- --------
-------- 10, 11, 12, 13, 14. - Illusion --------
-------- --------
-------- The example we chose is CreateIllusion operation. So as you can see in number 1, we --------
-------- need to setup those variables so now we do: --------
Set IE_Owner = Player 1 (Red)
Set IE_UnitType = Mortar Team
Set IE_Duration = 5.00
Set IE_DamageDealtFactor = 0.35
Set IE_DamageReceiveFactor = 4.00
Set IE_Position = (Center of (Playable map area))
Set IE_Facing = Default building facing
-------- --------
-------- And finally, what we have to do is execute the operation which in this case is very simple. --------
-------- To execute the opertation we have to use this: --------
Do nothing
-------- Easy right? Plus we are also able to add a new functionality to the previously useless --------
-------- <Do nothing> function. ^-^ --------
-------- --------
-------- --------
-------- ======================================================================= --------
-------- --------
-------- --------
-------- ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| --------
-------- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||| CONSTANTS SETTING ||||||||||||||||||||||||||||||||||||||||||||||||||||||||| --------
-------- ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| --------
Set IE_CreateIllusion = 1
Set IE_CopyUnit = 2
Set IE_SetLevel = 3
Set IE_SetDuration = 4
Set IE_AddDuration = 5
Set IE_SetDamageFactor = 6
Set IE_SetReceiveFactor = 7
Set IE_ShowDeathEffect = 8
Set IE_SetDeathEffect = 9
Set IE_GetRemainingDuration = 10
Set IE_GetTotalDuration = 11
Set IE_GetDamageFactor = 12
Set IE_GetReceiveFactor = 13
Set IE_GetFlag = 14
-------- --------
-------- --------
-------- ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| --------
-------- Do not enable the following line. However, they are variable creators so do not delete them. --------
-------- ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| --------
Set IE_Operation = 0
Set IE_NewLevel = 0
Set IE_DamageDealtFactor = 0.00
Set IE_DamageReceiveFactor = 0.00
Set IE_Duration = 0.00
Set IE_Facing = 0.00
Set IE_Illusion = No unit
Set IE_Owner = Player 1 (Red)
Set IE_UnitType = No unit-type
Set IE_BaseUnit = No unit
Set IE_Position = IE_Position
Set IE_Flag = False
Set IE_DeathEffect =
-------- ======================================================================= --------