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

Change base dmg and atk speed?

Level 5
Joined
Aug 2, 2015
Messages
69
Howdy,
Once you change a units base dmg, is there noway to lower it again?
And why doesnt atk speed change as requested?
(This is actually two diffrent triggers, I just simplified it here)

  • Reset 1
    • Events
      • Player - Player 1 (Red) types a chat message containing k1 as An exact match
    • Conditions
    • Actions
      • Unit - Set Base Damage of Gallegos 0236 <gen> to 3360 for weapon index: 0
      • Unit - Set Attack Interval of Gallegos 0236 <gen> to 1.00 for weapon index: 1
      • Unit - Set Base Damage of Gallegos 0236 <gen> to 2036 for weapon index: 0
      • Unit - Set Base Damage of Gallegos 0236 <gen> to 2036 for weapon index: 1
      • Unit - Set Attack Interval of Gallegos 0236 <gen> to 1.60 for weapon index: 1
 
Level 24
Joined
Feb 27, 2019
Messages
833
"Once you change a units base dmg, is there noway to lower it again?"
I dont see any problem with this specific action. Can you give an example?
"And why doesnt atk speed change as requested?"
Theres a lot of broken natives pertaining this sort of thing. This native appears to be "partially" working. I had to first set the attack index of either 1 or 2 to a value and then set index 0 to the desired value. Consecutive values could be set using index 0. The behaviour probably varies depending on ones version of the game. I used a hero unit for the testing.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,872
Index 0 = Weapon 1
Index 1 = Weapon 2

All of these work exactly as intended as far as I recall. If you want to "reset" a unit's base damage then cache that value:
  • Events
    • Unit - A unit Enters (Playable map area)
  • Conditions
  • Actions
    • Set Variable Base_Damage_Wpn_1[(Custom value of (Triggering unit))] = (Base Damage of (Triggering unit)) for weapon index: 0
    • Set Variable Base_Damage_Wpn_2[(Custom value of (Triggering unit))] = (Base Damage of (Triggering unit)) for weapon index: 1
Then re-apply it at a later time using the variable. This example would require a Unit Indexer to work since a unit's custom value is 0 by default.
 
Level 5
Joined
Aug 2, 2015
Messages
69
"Once you change a units base dmg, is there noway to lower it again?"
I dont see any problem with this specific action. Can you give an example?"And why doesnt atk speed change as requested?"
Once Ive set dmg to 3360 it stays so even after 2036 trigger.
And what about atk speed? that trigger does nothing atm?
I want the unit to have tempory berserk rage
hmm maybe easier to give it the berserker buff?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,872
And what about atk speed? that trigger does nothing atm?
I want the unit to have tempory berserk rage
hmm maybe easier to give it the berserker buff?
Both of these functions work.

However, for some stupid reason they prevent you from setting the Weapon Index for Attack Interval to 0.

You'll need to use a Variable or Arithmetic to bypass this amazing "feature":
  • Press Escape To Test
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Unit - Set Base Damage of Paladin 0000 <gen> to (Execution count of (This trigger)) for weapon index: 0
      • Unit - Set Attack Interval of Paladin 0000 <gen> to (2.20 - ((Real((Execution count of (This trigger)))) x 0.05)) for weapon index: (1 - 1)
      • Game - Display to (All players) for 3.00 seconds the text: Attack Cooldown:
      • Game - Display to (All players) for 3.00 seconds the text: (String((Attack Interval of Paladin 0000 <gen> for weapon index 0.)))
Keep in mind that these are the base values you're modifying. Abilities like Bloodlust and Command Aura don't actually change these values. Instead, they use these base values in their formulas to determine the minimum/maximum attack damage and attack cooldown.

For a triggered % increase to attack speed I recommend using the Set Ability Field actions on something like the Item Attack Speed Bonus ability. Better yet, use a system that does all of this hard work for you:
 

Attachments

  • Base Damage Test.w3m
    17.2 KB · Views: 5
Last edited:
Level 24
Joined
Feb 27, 2019
Messages
833
I am actually gorilla enrage rn. I was experiencing another issue

First test the attached map right away and use ESC to try to apply attack interval. It wont work.
Enable the set variable trigger, test again and use ESC to try to apply attack interval. It will work.

It appears pre-placed units cant be referenced with their gg_unit_XXX_#### reference unless they are referenced in a certain way anywhere else even if that other place of reference doesnt even run
 

Attachments

  • preplaced reference bug.w3m
    17 KB · Views: 3
Last edited:
Level 5
Joined
Aug 2, 2015
Messages
69
So this is my trigger...
  • Enrage Gallegos
    • Events
      • Unit - A unit owned by Player 21 (Coal) Is attacked
    • Conditions
      • (Triggering unit) Equal to Unit
      • (Percentage life of Unit) Less than or equal to 10.00
    • Actions
  • [QUOTE]>>> Trigger - Turn off (This trigger)<<<<[/QUOTE]
    • Wait 1.00 seconds
    • Special Effect - Create a special effect attached to the chest of Unit using Abilities\Spells\Orc\Bloodlust\BloodlustTarget.mdl
    • Set VariableSet BLKal = (Last created special effect)
    • Unit - Set Base Damage of Unit to (Execution count of (This trigger)) for weapon index: 0
    • Unit - Set Attack Interval of Unit to (1.70 - ((Real((Execution count of (This trigger)))) - 0.70)) for weapon index: (1 - 1)
    • Game - Display to (All players) for 2.00 seconds the text: |cffff0000K|r|cfffc...
    • Game - Display to (All players) for 3.00 seconds the text: Attack Cooldown:
    • Game - Display to (All players) for 3.00 seconds the text: (String((Attack Interval of Unit for weapon index 0.)))
    • Unit - Set Base Damage of Unit to ((Execution count of (This trigger)) + 1300) for weapon index: 0
    • Trigger - Turn off Enrage Strövar <gen> (these are same rly just diffrent unit)
    • Trigger - Run Enrage Strövar <gen> (ignoring conditions)
Now I encountered another issue, how can this trigger keep on triggering with turn off? I belive it started after installing Uncle's unit index (no blame), but cant tell for 100% sure
Unit keep on getting interval bonus, swinging like never before (lolz) and other trigger has a sound that goes into a loop, spamming my ears off :grin:
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,872
Are you sure you want to be using the (Exeuction count) of the trigger? I used that in my example because it was an easy way to have an Integer that changes each time the trigger ran. I imagine you want to provide your own values.

Anyway, the Unit Indexer can't interact with your other triggers or break an Event. I imagine you're either experiencing a Reforged bug, or you're turning the trigger back on, or you're failing to turn the trigger off in the first place.

Regardless, you can always use a Boolean variable to prevent the trigger from running:
  • Conditions
    • Enrage_Is_Disabled Equal to False
  • Actions
    • Set Variable Enrage_Is_Disabled = True
 
Top