WHAT THIS SPELL DO:
hello,
===============================================================================================
The Abettor
A hero calls his ally to help him in battle. On casting, some percentage of the life of the summoned unit is dealt as damage to the target. The summoned unit lasts for a period of time. When the target dies, the summoned unit will instantly disappear. Each level, a new stronger unit is summoned. Though the summoned unit is timed, I want it that he (the summoned unit) cand still be controlled by the owner of the summoned unit.
Last: 10/20/30 seconds
Damage Dealt: 15 % life of the summoned unit
Summoned units: Bandit/Rogue/Bandit Lord
===============================================================================================
How to Import:
Just copy the triggers or the folder named "Arbettor" and the variables into your map. You may also want to copy the custom ability in this map into your map.
NOTE:
PLease give credits to me if you use this spell in your map.
thank you,
eubz
===============================================================================================
Thanks to Hanky's Dynamic endixer.
CHANGE LOGS. 1. First version - The summoned unit is ordered to attack the target. He is also summoned just beside the caster. 2. Second version - The damage is triggered, summoned unit is given locust ability so his owner will not be able to control him. Giving him this ability makes the spell awkward and then adding an action to play attack animation for the summoned unit makes it more awkward. Here, I decided to add some more action that, whenever the target unit moves away from the summoned unit, the summoned unit still follows the target. This even makes the spell more awkward. 3. Third version (present version) - Creates the summoned unit just beside the target. Deleted the locust ability so the owner of the summoned unit can control him. The action ordering the summoned unit to attack the target is now deleted (in fact, the summoned unit will always attack the target for all targets of this spell are caster's enemies).
trigger
Arb init
Events
Map initialization
Conditions Actions
-------- ============================================================== -------- -------- =============YOU CAN CONFIGURE THE VALUES BELOW=========== -------- -------- you can configure the damage dealt by the summoned unit. -------- Set Ab_Damage = 25.00 -------- you can configure the time. -------- -------- this is also multiplied by the level of the ability -------- Set Ab_Time = 10.00 -------- ============================================================== -------- -------- configure the damage dealt to the target during the cast -------- Set Ab_damage_percent = 6.67 -------- using 6.67 in damage_percent means 15% -------- -------- the formula is: Timed_Damage[integer] = (((Life of u[integer]) x (Real((Level of Cripple (Neutral Hostile) for caster[integer])))) / damage_percent) -------- -------- so, if life of the summoned unit is 250, multiply that to the level of the ability divided by the damage_percent, that's the real damage dealt to the target unit -------- -------- using this configuration, the damage would be: -------- -------- Level 1 = 35.982008 or just 36 to round this off -------- -------- Level 2 = 59.97001 or 60 -------- -------- Level 3 = 142.4287857 or 142 -------- -------- ============================================================== -------- -------- you can configure the kind of unit to spawn in each level -------- -------- in the object editor, do not forget to configure the food cost and lumber cost of the units to be used here -------- -------- food cost and lumber cost should be set to zero -------- -------- it is also the best to create custom units only for this -------- Set Ab_TimedUnit[1] = Bandit -------- HP = 240 -------- Set Ab_TimedUnit[2] = Rogue -------- HP = 400 -------- Set Ab_TimedUnit[3] = Bandit Lord -------- HP = 950 -------- -------- ============================================================== -------- -------- configure all the special effects -------- Set Ab_SFXCreationPath = Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl Set Ab_SFXRemovePath = Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl Set Ab_TargetSFXPath = Abilities\Spells\Orc\Purge\PurgeBuffTarget.mdl -------- configure the attachment point for the target -------- Set Ab_TargetSFXAttchment = origin -------- ============================================================== -------- Set Ab_Spell = Abettor -------- =============END OF CONFIGURABLES=========== -------- -------- ============================================================== -------- -------- DON'T TOUCH THE ACTION BELOW -------- -------- ============================================================== -------- Set Ab_unit_counter = 1 -------- ============================================================== --------
trigger
Arb create
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Ab_Spell
Actions
-------- DON'T TOUCH THE ACTIONS BELOW -------- Set Ab_size = (Ab_size + 1) If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Ab_size Greater than Ab_maxsize
Then - Actions
Set Ab_index[Ab_size] = Ab_size Set Ab_maxsize = Ab_size
Else - Actions
Set Ab_integer = Ab_index[Ab_size] -------- ========================================================== -------- Set Ab_target[Ab_integer] = (Target unit of ability being cast) Set Ab_caster[Ab_integer] = (Triggering unit) Set Ab_TargetPos = (Position of Ab_target[Ab_integer]) Set Ab_SpawnUnit[Ab_integer] = (Ab_unit_counter x (Level of Abettor for Ab_caster[Ab_integer])) Set Ab_TimedLife[Ab_integer] = (Ab_Time x (Real((Level of Abettor for Ab_caster[Ab_integer])))) Set Ab_caster_position = (Position of Ab_caster[Ab_integer]) Set Ab_u_pos_initial[Ab_integer] = (Ab_TargetPos offset by 100.00 towards (Facing of Ab_caster[Ab_integer]) degrees) -------- ======================================================= -------- Unit - Create 1 Ab_TimedUnit[Ab_SpawnUnit[Ab_integer]] for (Owner of Ab_caster[Ab_integer]) at Ab_u_pos_initial[Ab_integer] facing Default building facing degrees Set Ab_timed_unit[Ab_integer] = (Last created unit) Set Ab_Timed_Damage[Ab_integer] = ((Life of Ab_timed_unit[Ab_integer]) / Ab_damage_percent) Set Ab_DamageReal[Ab_integer] = (Ab_Damage x (Real((Level of Ab_Spell for Ab_caster[Ab_integer])))) Special Effect - Create a special effect at Ab_u_pos_initial[Ab_integer] using Ab_SFXCreationPath Special Effect - Destroy (Last created special effect) Special Effect - Create a special effect attached to the Ab_TargetSFXAttchment of Ab_target[Ab_integer] using Ab_TargetSFXPath Set Ab_target_SFX[Ab_integer] = (Last created special effect) Unit - Cause Ab_caster[Ab_integer] to damage Ab_target[Ab_integer], dealing Ab_Timed_Damage[Ab_integer] damage of attack type Spells and damage type Normal Custom script: call RemoveLocation(udg_Ab_u_pos_initial[udg_Ab_integer]) Custom script: call RemoveLocation(udg_Ab_caster_position) Custom script: call RemoveLocation(udg_Ab_TargetPos) Trigger - Turn on Arb timer <gen> -------- ======================================================= --------
trigger
Arb timer
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
-------- DON'T TOUCH THE ACTIONS BELOW --------
For each (Integer Ab_loop) from 1 to Ab_size, do (Actions)
Loop - Actions
Set Ab_integer = Ab_index[Ab_loop]
Set Ab_u_pos = (Position of Ab_timed_unit[Ab_integer])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
Ab_TimedLife[Ab_integer] Less than or equal to 0.00
(Ab_target[Ab_integer] is dead) Equal to True
(Ab_timed_unit[Ab_integer] is dead) Equal to True
Then - Actions
Special Effect - Create a special effect at Ab_u_pos using Ab_SFXRemovePath
Special Effect - Destroy (Last created special effect)
Special Effect - Destroy Ab_target_SFX[Ab_integer]
Animation - Reset Ab_timed_unit[Ab_integer]'s animation
Unit - Remove Ab_timed_unit[Ab_integer] from the game
Set Ab_index[Ab_loop] = Ab_index[Ab_size]
Set Ab_index[Ab_size] = Ab_integer
Set Ab_size = (Ab_size - 1)
Set Ab_loop = (Ab_loop - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Ab_size Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Else - Actions
Set Ab_TimedLife[Ab_integer] = (Ab_TimedLife[Ab_integer] - 1.00)
Custom script: call RemoveLocation(udg_Ab_u_pos)[/trigger]
Rating - 0.00 (0 votes)
(Hover and click)
Moderator Comments
Useful
Moderator: Pharaoh_
Date: 12th of July, 2012 22:31 (GMT+2)
Jesus! I also use Hanky's dynamic indexing system, but i combine those triggers into one trigger and everything works well... you can see my spells just below this text and see that it's true!
Or maybe we are talking about different things... but i think we aren't because he just sets the variables that can be modified by the user in a separate trigger, while i set them in the trigger where the spell is being casted.
Nevermind, it's not a big problem (if it's a problem at all). Nice spell! :)
Jesus! I also use Hanky's dynamic indexing system, but i combine those triggers into one trigger and everything works well... you can see my spells just below this text and see that it's true!
Or maybe we are talking about different things... but i think we aren't because he just sets the variables that can be modified by the user in a separate trigger, while i set them in the trigger where the spell is being casted.
Nevermind, it's not a big problem (if it's a problem at all). Nice spell! :)
It is more efficient to have them separated. Init only runs once, while spell cast runs every time the spell is cast, and every time it does it will reset those variables.
It is unneeded to merge them.