1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  5. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  6. The 13th Music Contest Poll is up! Vote for the best tracks in this symphony of frost and flame.
    Dismiss Notice
  7. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Attack damage based ability

Discussion in 'World Editor Help Zone' started by SuperBear, Mar 25, 2009.

  1. SuperBear

    SuperBear

    Joined:
    Mar 25, 2009
    Messages:
    12
    Resources:
    0
    Resources:
    0
    Hey, i was wondering if there's any way to create an ability that deals damage based on the unit's current attack damage. I considered either creating illusions of the unit to check attack damage (no good because illusions don't retain buffs) or building an integer by cycling through the buffs the unit has, the items it's carrying and what it's stats are (this would not only be tedious, but i am unsure of the order in which % damage buffs are applied) but neither seemed viable.

    I'd prefer a solution in GUI as i am just beginning to learn JASS, but if the only solution is in JASS then don't hesitate to tell me. I'm decently versed in programming in general and spent some time working with Python (very similar to JASS) but i haven't gotten JASS down as a language of its own yet.
     
  2. chaoslord301

    chaoslord301

    Joined:
    Sep 18, 2007
    Messages:
    105
    Resources:
    0
    Resources:
    0
    Maybe use a Damage Detection System, and when the unit attacks another unit, store the damage into an integer, then when he casts the ability use the integer variable to determine how much damage, this will be reduced by armor and what not, and this is probably not even close to the best way of doing this.

    Maybe only overwrite the integer value if the damage is higher, to get closest to his actual damage output. For example when he levels up.
     
  3. BearMachine

    BearMachine

    Joined:
    Mar 11, 2009
    Messages:
    24
    Resources:
    0
    Resources:
    0
    Another way to do it would be to make a formula that sets an integer to the value of (base damage + dice*die + main attribute of the hero), this should put the integer to the hero's top damage. Oh and if you have changed the constants of attack damage per main attribute you want to change the main attribute of the hero to that number.
     
  4. Maximilianx

    Maximilianx

    Joined:
    Oct 14, 2008
    Messages:
    334
    Resources:
    0
    Resources:
    0
    This wouldn't take into account any items or abilities that are giving the hero +X damage though :/
     
  5. Smiddle

    Smiddle

    Joined:
    Mar 12, 2008
    Messages:
    434
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Suppose we add that into the formula.
     
  6. Maximilianx

    Maximilianx

    Joined:
    Oct 14, 2008
    Messages:
    334
    Resources:
    0
    Resources:
    0
    How exactly? A function that makes checks for each item/ability that would add damage on his map? Of course if his map lacks these, this wouldn't be a problem :p
     
  7. SuperBear

    SuperBear

    Joined:
    Mar 25, 2009
    Messages:
    12
    Resources:
    0
    Resources:
    0
    At this point it looks like the best idea would be a formula that simply calculated a likely attack damage when the ability is cast. It would be tedious but I could probably write a script that just added base damage+main stat and then checked for items with+ damage and modified the number accordingly, as well as checking for buffs that could increase damage. My only problem here is that there are auras which increase attack damage by a %, and i don't know whether those effect the base attack damage or the attack damage after bonuses.

    Edit: Actually i was thinking about Chaoslord's idea and it might also be possible to use an attack damage detection system and then have a number which was the average damage of all his attacks (though there is probably some way to exploit this that can't think of right now)

    Thanks for all the help!
     
    Last edited: Mar 29, 2009