1. Melee Mapping contest #3 - Poll is up! Vote for the best 4v4 melee maps!
    Dismiss Notice
  2. The 30th edition of the Modeling Contest is finally up! The Portable Buildings need your attention, so come along and have a blast!
    Dismiss Notice
  3. We have a new contest going on right now! Join the 11th Music Contest! You are to make a Cinematic modern sound-track for this contest, so come and compete with other people for fun.
    Dismiss Notice

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

Discussion in 'World Editor Help Zone' started by Wayshan, Dec 15, 2018.

  1. Wayshan

    Wayshan

    Joined:
    Oct 28, 2012
    Messages:
    90
    Resources:
    0
    Resources:
    0
    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

    [​IMG]

    or by the green "buff" numbers behind it.

    [​IMG]

    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.
     

    Attached Files:

  2. BloodSoul

    BloodSoul

    Joined:
    May 10, 2009
    Messages:
    678
    Resources:
    2
    Spells:
    2
    Resources:
    2
    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
     
  3. Wayshan

    Wayshan

    Joined:
    Oct 28, 2012
    Messages:
    90
    Resources:
    0
    Resources:
    0
    Unfortunately not. Cause Blizzard didn't create translations and for my region it downloads automatically the German version. Any idea how to get it done with the old editor?
     
  4. BloodSoul

    BloodSoul

    Joined:
    May 10, 2009
    Messages:
    678
    Resources:
    2
    Spells:
    2
    Resources:
    2
    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: Dec 15, 2018
  5. Wayshan

    Wayshan

    Joined:
    Oct 28, 2012
    Messages:
    90
    Resources:
    0
    Resources:
    0
    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....
     
  6. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    934
    Resources:
    9
    Tools:
    1
    Maps:
    2
    Spells:
    5
    Tutorials:
    1
    Resources:
    9
    Such tomes are in Items - Powerup. There is life, damage, str, agi, int.
     
  7. BloodSoul

    BloodSoul

    Joined:
    May 10, 2009
    Messages:
    678
    Resources:
    2
    Spells:
    2
    Resources:
    2
    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.


    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.
    Code (vJASS):

        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
     


    That's weird. It should work normally for both heroes and units.
     
  8. Wayshan

    Wayshan

    Joined:
    Oct 28, 2012
    Messages:
    90
    Resources:
    0
    Resources:
    0
    Ah, ok, got it, thank you for your time, gentlemen! :) + rep and marking as solved