- Joined
- Jun 20, 2012
- Messages
- 195
I'm working on this spell and I call it "Body-link Magic".
This is what the spell does:
The caster invokes a powerful spell to a target hero which results to the target feeling the senses of the caster, each time the caster takes damage, the targeted hero also takes a portion of the total damage taken by the caster as damage to itself. Lasts 20 seconds.
Level 1 - 35% of the damage taken.
Level 2 - 55% of the damage taken.
Level 3 - 75% of the damage taken.
*here are the triggers:
Body-link Magic Cast
Body-link Magic Interval
Body-link Magic Damage Event
*I haven't found any errors with this triggers, but I would like to know the comments of those who a are a lot experienced than me specially that I have only recently learned about hashtables.
I'll give +REP to those who could tell me my mistakes and how I can improve this...THANKS !!
This is what the spell does:
The caster invokes a powerful spell to a target hero which results to the target feeling the senses of the caster, each time the caster takes damage, the targeted hero also takes a portion of the total damage taken by the caster as damage to itself. Lasts 20 seconds.
Level 1 - 35% of the damage taken.
Level 2 - 55% of the damage taken.
Level 3 - 75% of the damage taken.
*here are the triggers:
Body-link Magic Cast
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Body-link Magic
-
Actions
- Set BMagic_Target = (Target unit of ability being cast)
- Set BMagic_Timer = 20.00
- Set BMagic_ReturnPercentage = (0.15 + (0.20 x (Real((Level of (Ability being cast) for (Triggering unit))))))
- Hashtable - Save Handle OfBMagic_Target as 0 of (Key (Triggering unit)) in BMagic_Hash
- Hashtable - Save BMagic_Timer as 1 of (Key (Triggering unit)) in BMagic_Hash
- Hashtable - Save BMagic_ReturnPercentage as 2 of (Key (Triggering unit)) in BMagic_Hash
- Unit Group - Add (Triggering unit) to BMagic_CasterGroup
- Trigger - Turn on Bodylink Magic Interval <gen>
- Player - Disable Body-link Magic for (Owner of (Triggering unit))
- Player - Disable Body-link Magic Book for (Owner of BMagic_Target)
- Unit - Add Body-link Magic (Caster) to (Triggering unit)
- Unit - Set level of Body-link Magic (Caster) for (Triggering unit) to (Level of (Ability being cast) for (Triggering unit))
- Unit - Add Body-link Magic Book to BMagic_Target
- Unit - Set level of Body-link Magic (Target) for BMagic_Target to (Level of (Ability being cast) for (Triggering unit))
Body-link Magic Interval
-
Events
- Time - Every 1.00 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in BMagic_CasterGroup and do (Actions)
-
Loop - Actions
- Set BMagic_Target = (Load 0 of (Key (Picked unit)) in BMagic_Hash)
- Set BMagic_Timer = (Load 1 of (Key (Picked unit)) from BMagic_Hash)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- BMagic_Timer Greater than 0.00
-
Then - Actions
- Hashtable - Save (BMagic_Timer - 1.00) as 1 of (Key (Picked unit)) in BMagic_Hash
-
Else - Actions
- Unit - Remove Body-link Magic (Caster) from (Picked unit)
- Unit - Remove Body-link Magic (Caster) buff from (Picked unit)
- Unit - Remove Body-link Magic Book from BMagic_Target
- Unit - Remove Body-link Magic (Target) buff from BMagic_Target
- Player - Enable Body-link Magic for (Owner of (Picked unit))
- Hashtable - Clear all child hashtables of child (Key (Picked unit)) in BMagic_Hash
- Unit Group - Remove (Picked unit) from BMagic_CasterGroup
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in BMagic_CasterGroup) Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
-
If - Conditions
-
Loop - Actions
-
Unit Group - Pick every unit in BMagic_CasterGroup and do (Actions)
Body-link Magic Damage Event
-
Events
- Game - GDD_Event becomes Equal to 0.00
-
Conditions
- (GDD_DamagedUnit is in BMagic_CasterGroup) Equal to True
- (GDD_DamageSource belongs to an enemy of (Owner of GDD_DamagedUnit)) Equal to True
-
Actions
-
Unit Group - Pick every unit in BMagic_CasterGroup and do (Actions)
-
Loop - Actions
- Set BMagic_Target = (Load 0 of (Key (Picked unit)) in BMagic_Hash)
- Set BMagic_ReturnPercentage = (Load 2 of (Key (Picked unit)) from BMagic_Hash)
- Set BMagic_DamageDealt = (GDD_Damage x BMagic_ReturnPercentage)
- Unit - Cause GDD_DamagedUnit to damage BMagic_Target, dealing BMagic_DamageDealt damage of attack type Spells and damage type Magic
- Set BMagic_DamageDealt = 0.00
-
Loop - Actions
-
Unit Group - Pick every unit in BMagic_CasterGroup and do (Actions)
I'll give +REP to those who could tell me my mistakes and how I can improve this...THANKS !!