• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] Gain 10% strength permently - stackable devotion aura

Status
Not open for further replies.
Level 3
Joined
Mar 15, 2015
Messages
53
I want to make a spell like: gain 10% strength, then after 25 seconds, remove the bonus. But it didn't work.

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Accretion
  • Actions
    • Set A_unit = (Casting unit)
    • Unit - Set life of A_unit to ((Life of A_unit) - ((Life of A_unit) x ((Real((Level of Accretion for A_unit))) x 0.08)))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Acc_duration Equal to 0.00
      • Then - Actions
        • Trigger - Turn on Acc Loop <gen>
      • Else - Actions
    • Set Acc_duration = 25.00
    • Set A_Str = ((Strength of A_unit (Include bonuses)) x (1 / 10))
    • Hero - Modify Strength of A_unit: Add A_Str
    • Special Effect - Create a special effect attached to the weapond of A_unit using Abilities\Weapons\SludgeMissile\SludgeMissile.mdl
    • Set A_Seff = (Last created special effect)
  • Acc Loop
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • Set Acc_duration = (Acc_duration - 0.30)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • Acc_duration Less than or equal to 0.00
              • (A_unit is alive) Equal to False
        • Then - Actions
          • Set Acc_duration = 0.00
          • Hero - Modify Strength of A_unit: Subtract A_Str
          • Special Effect - Destroy A_Seff
          • Trigger - Turn off (This trigger)
        • Else - Actions
Yeah and how to make devotion aura stackable, i want to make a spell create ward that holds negative devotion aura, more wards more armor decrease.
Thanks for helping me out ^^
EDIT: fail thread name :v i mean temporary, sorry and i don't know how to change it bleh
 
Level 11
Joined
Jan 23, 2015
Messages
788
You need to make A_Str Real variable, and I think it still won't work, cause I think you need to add an item ability with 300 levels with 0.1 str for every level, and set the level according to how much Strength you need.
To subtract, disable the ability.
 
Level 3
Joined
Mar 15, 2015
Messages
53
Thanks for the advice anyways :D but can you explain why it not working? I got a little bit curious :p maybe if i understand then i can solve it out
 
Level 12
Joined
May 22, 2015
Messages
1,051
1 / 10 will become 0.1. But since it is an integer, it automatically truncates everything after the decimal. It becomes 0. You can fix it by making A_Str a real variable (you will have to cast it to an integer when you modify the hero's strength).

There shouldn't be a problem with it except that it will truncate the value (if you have 19 strength - 1.9 bonus strength - and cast the ability, you gain only 1 strength) and doesn't show the bonus as a bonus - it will just show the base strength as a higher value.
 
Status
Not open for further replies.
Top