• 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.

Triggering Different Levels of Ability?

Status
Not open for further replies.
Level 5
Joined
Jul 13, 2010
Messages
84
I need to make a spell that when activated grants +5str and +5 agility x the level of ability. Ex: Lvl 1: Grants 5str and 5agi when activated. Lvl 5: Grants 25str ang 25agi when activated. How can i do this? rep to whoever helps me!!! :ogre_haosis:
 
Level 11
Joined
Aug 1, 2009
Messages
714
Here are the codes.
  • Add Stats
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Ability being cast) Equal to Add Stats
    • Actions
      • Hero - Modify Strength of (Triggering unit): Add (5 x (Level of Add Stats for (Triggering unit)))
      • Hero - Modify Agility of (Triggering unit): Add (5 x (Level of Add Stats for (Triggering unit)))
      • Hero - Modify Intelligence of (Triggering unit): Add (5 x (Level of Add Stats for (Triggering unit)))
      • Wait 30.00 seconds
      • Hero - Modify Strength of (Triggering unit): Subtract (5 x (Level of Add Stats for (Triggering unit)))
      • Hero - Modify Agility of (Triggering unit): Subtract (5 x (Level of Add Stats for (Triggering unit)))
      • Hero - Modify Intelligence of (Triggering unit): Subtract (5 x (Level of Add Stats for (Triggering unit)))
This is where the
  • Wait 30.00 seconds
Makes the Trigger MUI
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Here are the codes.
  • Add Stats
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Ability being cast) Equal to Add Stats
    • Actions
      • Hero - Modify Strength of (Triggering unit): Add (5 x (Level of Add Stats for (Triggering unit)))
      • Hero - Modify Agility of (Triggering unit): Add (5 x (Level of Add Stats for (Triggering unit)))
      • Hero - Modify Intelligence of (Triggering unit): Add (5 x (Level of Add Stats for (Triggering unit)))
      • Wait 30.00 seconds
      • Hero - Modify Strength of (Triggering unit): Subtract (5 x (Level of Add Stats for (Triggering unit)))
      • Hero - Modify Agility of (Triggering unit): Subtract (5 x (Level of Add Stats for (Triggering unit)))
      • Hero - Modify Intelligence of (Triggering unit): Subtract (5 x (Level of Add Stats for (Triggering unit)))
This is where the
  • Wait 30.00 seconds
Makes the Trigger MUI

Cast the ability at level 1, then level it twice during that 30 second period. Then UR FUXED RLY BAD!

You could store the level, use local variable, shadow a global. Like

Custom script: local integer udg_level = 5 x Level of..for trig unit
Set stats
Wait
Modify attributes of hero: subtract level

Make sure you have "level" variable created in variable editor
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
Why do people never seem to find the integer native that returns the quantity of one of the 3 stats a hero has...

Apply some simple mathematics to it (like a multiplyer and offset) and then just deal the damage to a unit. The unit usually is the spell target in response to starts and effect of an ability or the units from enemy units picked in an area of spell target position.
 
Level 8
Joined
Dec 12, 2010
Messages
280
Maker makes a good point. Using the current trigger if ability is increased in level during the wait time you'll end up receiving negative attibutes. Using a integer variable to set the amount modified removes the bug.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Attribute Boost
    • Actions
      • Set CurrentLevel = ((Level of Attribute Boost for (Triggering unit)) x 5)
      • Hero - Modify Strength of (Triggering unit): Add CurrentLevel
      • Hero - Modify Agility of (Triggering unit): Add CurrentLevel
      • Wait 30.00 game-time seconds
      • Hero - Modify Strength of (Triggering unit): Subtract CurrentLevel
      • Hero - Modify Agility of (Triggering unit): Subtract CurrentLevel
CurrentLevel would be a integer variable.
Attibute Boost would be your ability

This will also reduce the amount of onscreen curse words floating across your screen in multiplayer games :D
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Attribute Boost
    • Actions
      • Custom script: local integer udg_CurrentLevel = GetUnitAbilityLevel( GetTriggerUnit() , 'AHhb' ) * 5
      • Hero - Modify Strength of (Triggering unit): Add CurrentLevel
      • Hero - Modify Agility of (Triggering unit): Add CurrentLevel
      • Wait 30.00 game-time seconds
      • Hero - Modify Strength of (Triggering unit): Subtract CurrentLevel
      • Hero - Modify Agility of (Triggering unit): Subtract CurrentLevel

I fixed the trigger in quotes. It should work correctly now and it's MUI. Just replace the AHhb with the raw code of your ability. To see the raw code, browse the ability and hit Ctrl + d.
 
Status
Not open for further replies.
Top