• 🏆 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!

[Solved] Changing visible basic attack of the unit via ability (trigger)

Status
Not open for further replies.
Level 10
Joined
Oct 28, 2012
Messages
228
Hey!

I need to change the basic damage stat for a UNIT in the game via the trigger (probably using modified ability). I also need to make this change visible, either by classic white numbers

274000-d0f5f19c4a3e8c5571cc594b4f706746.jpg


or by the green "buff" numbers behind it.

274001-26574df5f35c3dc786ab05fcb6163f27.jpg


I also need to be able to add or decrease the stat often in the map and it has to be a certain amount of DMG not percentage (such as with command aura).

I've gone through tons of tutorials but never found my problem solved.

Here is the summary in bullet points:
  • Increasing and decreasing BASIC DAMAGE stat for a UNIT (not a HERO)
  • Changing the stat by real numbers, not percentages
  • Changing the stat in the game (not using upgrades)
  • The stat change has to be visible
Thank you for your time! :)

P.S. I tried modified XY-leveled item abilities and they are not visible (meaning the stat, not the icon), nor is the bash ability. Command aura increases the percentage DMG and so forth and so forth.
 

Attachments

  • Dmg.PNG
    Dmg.PNG
    20 KB · Views: 45
  • Dmg2.PNG
    Dmg2.PNG
    25.6 KB · Views: 54
Level 13
Joined
May 10, 2009
Messages
868
If your game version is 1.29 or higher, it's possible to modify a unit's damage amount easily with one of these

  • Unit - Set Base Damage of (Triggering unit) to X for weapon index: 1 // <-- this is probably what you are looking for, though.
  • Unit - Set Dice Number of (Triggering unit) to Y for weapon index: 1
  • Unit - Set Dice Sides of (Triggering unit) to Z for weapon index: 1
 
Level 13
Joined
May 10, 2009
Messages
868
The laziest and easiest way for you would be temporarily add inventory to units, and give a tome with Item Permanent Damage Gain ability, which will increase/decrease their base damage. Or, if you have either JNGP or WEX working for you, then you could give a shot on Bonus Mod system, which makes possible to increase or decrease damage, armor, mana regen, life regen, sight range of any unit.
 
Last edited:
Level 10
Joined
Oct 28, 2012
Messages
228
Hey, thanks for your patience so far :)

I can't use inventory, unfortunately, as it is saved for other things. I've never seen such a tome, can you perhaps give me a direction where should I look?

I have JNPG and would love to use Bonus Mod, but I don't know how to add or decrease the stats - I only create triggers in GUI :/ I've not found simple way how to implement it in my map (i know you're suppose to copy paste the code and then somehow call it) + the attached demo map doesn't work for me, stat's doesn't change.

I've tried to use item ability increase DMG (from the Claws of Attack), but since I need multiple (I tested just two) different abilities adding different amount of DMG, it creates some weird issues when adding the abilities to the hero; sometimes it increase or decrease both abilities, sometimes just one. It's probably connected to the issue that both of them are based at the +1 DMG item ability....
 
Level 13
Joined
May 10, 2009
Messages
868
I can't use inventory, unfortunately, as it is saved for other things.
There's also another way, but it's worse because it orders your units to cast the "Item Permanent Damage Gain" ability, which means your unit will have its current order interrupted. Also, the issue order function must be executed by a native function via Custom Script.

Assume a Footman already has the default Item Permanent Damage Gain ability (AIaa) [+3 damage].
  • Set Unit = Footman 0001 <gen>
  • Custom script: call IssueImmediateOrderById(udg_Unit, 852259)
You could even move the custom script above to a loop in order to make the footman cast the ability multiple times at once.


I have JNPG and would love to use Bonus Mod, but I don't know how to add or decrease the stats - I only create triggers in GUI :/ I've not found simple way how to implement it in my map (i know you're suppose to copy paste the code and then somehow call it) + the attached demo map doesn't work for me, stat's doesn't change.
In the demo map, you have to type: -set attribute value. E.g. -set damage 50.

Also, you have to make sure Object Merger is working in your JNGP if you want to implement BonusMod easily. Try enabling the "BonusMod ObjectMerger" trigger and saving the map. It'll take more time to save it. If no error message is displayed to you during that process, you can implement it into your map successfully. In fact, I suggest that you do it in a blank map, just so you can check if all abilities are being generated for it. Don't forget to close and open the map once you save it; You can't see the new generated abilities in OE right away.

Once all objects were generated in your blank map, disable the "BonusMod ObjectMerger" trigger, and test the system with this custom script:

  • Set Unit = Knight 0032 <gen>
  • Custom script: call UnitSetBonus(udg_Unit, BONUS_DAMAGE, 50)
That would change the knight's bonus damage to 50.

"BONUS_DAMAGE" is a constant defined by the BonusMod.
JASS:
    constant integer BONUS_ARMOR            = 0 // Armor Bonus
    constant integer BONUS_DAMAGE           = 1 // Damage Bonus
    constant integer BONUS_SIGHT_RANGE      = 2 // Sight Range Bonus
    constant integer BONUS_MANA_REGEN       = 3 // Mana Regeneration Bonus (A % value)
    constant integer BONUS_LIFE_REGEN       = 4 // Life Regeneration Bonus (An absolute value)
    constant integer BONUS_HERO_STR         = 5 // Strength Bonus
    constant integer BONUS_HERO_AGI         = 6 // Agility Bonus
    constant integer BONUS_HERO_INT         = 7 // Intelligence Bonus

I've tried to use item ability increase DMG (from the Claws of Attack), but since I need multiple (I tested just two) different abilities adding different amount of DMG, it creates some weird issues when adding the abilities to the hero; sometimes it increase or decrease both abilities, sometimes just one. It's probably connected to the issue that both of them are based at the +1 DMG item ability....

That's weird. It should work normally for both heroes and units.
 
Status
Not open for further replies.
Top