• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] Battle Roar based on stats

Status
Not open for further replies.
Level 2
Joined
May 23, 2018
Messages
13
Can somebody please help me how to increase damage and armor based on a hero's stats whenever Battle Roar is casted?


  • War Cry Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to War Cry
    • Actions
      • Set Unit_WC_Caster = (Casting unit)
      • Set Integer_WC_SpellLevel = (Level of War Cry for Unit_WC_Caster)
      • Set Point_WC_Caster = (Position of Unit_WC_Caster)
      • Set Real_WC_Damage = ((Real((Agility of Unit_WC_Caster (Include bonuses)))) x ((2.00 x (Real(Integer_WC_SpellLevel))) - 1.00))
      • Set Real_WC_Armor = ((Real((Agility of Unit_WC_Caster (Include bonuses)))) x (0.10 x (Real(Integer_WC_SpellLevel))))
      • Set UnitGroup_WC_Targets = (Units within 450.00 of Point_WC_Caster)
      • Unit Group - Pick every unit in UnitGroup_WC_Targets and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A structure) Equal to False
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) belongs to an enemy of (Owner of Unit_WC_Caster)) Equal to False
            • Then - Actions
              • Unit - Set Base Damage of (Picked unit) to ((Base Damage of (Picked unit) for weapon index 1) + (Integer(Real_WC_Damage))) for weapon index: 1
              • Unit - Set Armor of (Picked unit) to ((Armor of (Picked unit)) + Real_WC_Armor)
            • Else - Actions
      • Custom script: call DestroyGroup (udg_UnitGroup_WC_Targets)
      • Custom script: call RemoveLocation (udg_Point_WC_Caster)


Only that I don't know how to return an affected units original damage and armor when the buff is gone.
 
Level 13
Joined
Oct 12, 2016
Messages
769
Well. You could use triggers like that, then you'll have to store each unit affected into a unit group per cast, and store their attack with defense values per units, and put it on a timer... Doable, but a lot of work.

Alternatively, what's the highest amount the stat can go?
You could make the Battle Roar's level be based off a factor of the stat and go from there.
Mind you, this is a bad idea if you go over 20+ levels for an ability's level. This will cause your map to have INSANELY LONG save times from the object data and MASSIVE loading times.

An example of what I did:
The maximum stat any hero could have was 90. I decided to increase ability power by stats with a factor of 5 (90 / 5 = 18), so I made the ability have 18 levels.
Whenever the hero manipulates an item, gains a level, or learns a skill, I set the level of their abilities according to their stats.
Let's say the hero has 20 strength. 20 / 5 = 4, so the ability's level is set to 4.
 
Status
Not open for further replies.
Top