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 haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Rubbed the right way, the genie is out of its lamp! The 12th Concept Art Contest Results have been announced.
    Dismiss Notice
  4. The Lich King has a new champion. The results for the 19th Icon Contest are here!
    Dismiss Notice
  5. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  6. 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.

[Spell] Increase attack damage base on range or movement speed

Discussion in 'World Editor Help Zone' started by Norris, Mar 19, 2020.

  1. Norris

    Norris

    Joined:
    Mar 1, 2020
    Messages:
    18
    Resources:
    0
    Resources:
    0
    I want to make some passive spells like

    - increase attack damage base on 10% range of attacking unit
    or increase attack damage base on 10% movement speed of attacking unit

    I think we will use Damage Engine. But how to make it increase to 15/20/25% depend on level of ability.
    Thank you.
     
  2. map designer

    map designer

    Joined:
    May 2, 2011
    Messages:
    993
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Hello,

    just to make it clear: there are two possibilities here:
    1. give bonus = 10% of maximum Attack range of attacking unit
    2. give bonus = 10% of the distance between attacking unit and Target unit at the instance of the attack (this can be more than max attack range if unit is running away, or less if unit is in melee range of the attacker)
    which one of those you want?

    also, yes you are right. Damage Detection System can be used to solve it. in fact, the movement speed % bonus will be very easy to code.
    im not sure about the attack range. (I forgot if there is trigger function that pulls the attack range of attacking unit, but im sure there is one to get movespeed.)
     
  3. DoomBlade

    DoomBlade

    Joined:
    Feb 5, 2018
    Messages:
    135
    Resources:
    0
    Resources:
    0
    You can get attack range, with the new "get unit real field"
    • Set VariableSet AttackRange = (Unit: DamageEventSource's Weapon Real Field: Attack Range ('ua1m') at Index:0)
     
  4. map designer

    map designer

    Joined:
    May 2, 2011
    Messages:
    993
    Resources:
    1
    Maps:
    1
    Resources:
    1
    hmmmm, also
    did this post get drafted?
    yes but maybe he only has 1.26 like me
     
  5. DoomBlade

    DoomBlade

    Joined:
    Feb 5, 2018
    Messages:
    135
    Resources:
    0
    Resources:
    0
    Well how could I possibly know what version is he using. :)

    He asked if it's possible and I gave an option how to do it.
     
  6. Norris

    Norris

    Joined:
    Mar 1, 2020
    Messages:
    18
    Resources:
    0
    Resources:
    0
    Yes, I only has 1.24e.
    And I just want a skill like Enchantress Impetus (Dota), passive.
    I also don't know how to do it => maximum Attack range of attacking unit :cute:
    So... Thank you :cute: Hope your reply


    Thank, but i just want to increase attack damage. Is that increase range :razz:
     
  7. DoomBlade

    DoomBlade

    Joined:
    Feb 5, 2018
    Messages:
    135
    Resources:
    0
    Resources:
    0
    I can't remember all the functions available in 1.24e. But here is a trigger that should work in that version.
    It is just a quick draft to give you an idea how you could do it :)

    Thread
    • Impetus
      • Events
        • Unit - A unit Is attacked
      • Conditions
        • (Unit-type of (Attacking unit)) Equal to Rifleman
      • Actions
        • -------- A quick draft on how to do it --------
        • Set VariableSet Loc1 = (Position of (Attacking unit))
        • -------- ------------ --------
        • Set VariableSet Loc2 = (Position of (Triggering unit))
        • -------- ------------ --------
        • Set VariableSet Distance = (Distance between Loc1 and Loc2)
        • -------- ------------ --------
        • Set VariableSet Damage = (Distance x 0.10)
        • -------- ------------ --------
        • Unit - Cause (Attacking unit) to damage (Triggering unit), dealing Damage damage of attack type Spells and damage type Normal
        • -------- ------------ --------
        • Floating Text - Create floating text that reads (+ + (String((Integer(Damage))))) above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        • Floating Text - Change (Last created floating text): Disable permanence
        • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
        • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
        • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
        • -------- --->Remove Leaks<--- --------
        • Custom script: call RemoveLocation (udg_Loc1)
        • Custom script: call RemoveLocation (udg_Loc2)
     
  8. map designer

    map designer

    Joined:
    May 2, 2011
    Messages:
    993
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Becareful, Impetus in dota
    1. Checks distance between attacker and target at the time the attack projectile reaches the target,
    2. NOT the distance when the projectile is launched.

    DDS system can do this.
    your trigger will look like this:
    Set TemporaryPoint01 = Position of DamageSource
    Set TemporaryPoint02 = Position of Target
    Set Distance = Distance between 2 points (Point01 and Point02)
    Cause DamageSource to Damage Target with (YourBonus X Distance).

    Your trigger should be working now.
    All that remains is to remove leaks if any exists.



    That actually seems good to remove leaks. Be careful However, this isnt exactly like impetus. I think it is better to use DDS in this case.
    let me quote myself
    I think what @DoomBlade did was 2-) not 1-)
    his trigger seems just fine. its up for @Norris to decide how exactly he wants the ability to work
     
  9. DoomBlade

    DoomBlade

    Joined:
    Feb 5, 2018
    Messages:
    135
    Resources:
    0
    Resources:
    0
    Yea it is easy to change this to DDS.
    I just gave a quick example. :)
     
  10. Norris

    Norris

    Joined:
    Mar 1, 2020
    Messages:
    18
    Resources:
    0
    Resources:
    0
    Thank you, both of you. I tried it and I have a problem.
    Looks like damage was caused before the projectile touched the target. I don't know why and how to fix it

    • Untitled Trigger 005
      • Events
        • Unit - A unit Is attacked
      • Conditions
        • (Unit-type of (Attacking unit)) Equal to Archmage
      • Actions
        • Set Location = (Position of DamageEventSource)
        • Set Location2 = (Position of (Attacked unit))
        • Set DamageByRangeDistance = (Integer((Distance between Location and Location2)))
        • Set DamageByRangeDamage = (DamageByRangeDistance x 1)
        • Unit - Cause (Attacking unit) to damage (Triggering unit), dealing (Real(DamageByRangeDamage)) damage of attack type Spells and damage type Normal
        • Custom script: call RemoveLocation (udg_Location)
        • Custom script: call RemoveLocation (udg_Location2)
     
  11. DoomBlade

    DoomBlade

    Joined:
    Feb 5, 2018
    Messages:
    135
    Resources:
    0
    Resources:
    0
    Change the event to "DamageEvent becomes equal to 1.00 --> found under game value of real variable.

    Also change Location2 = Position of DamageEventTarget

    Also change the damage part to cause DamageEventSource to deal X damage to DamageEventTarget.
     
  12. Norris

    Norris

    Joined:
    Mar 1, 2020
    Messages:
    18
    Resources:
    0
    Resources:
    0
    still not working. I attached the map
     

    Attached Files:

  13. DoomBlade

    DoomBlade

    Joined:
    Feb 5, 2018
    Messages:
    135
    Resources:
    0
    Resources:
    0
    Seems like you are missing the config file.
    Maybe the owner of the tool could help you on this one.

    I added a working damage engine from my map to your map and it still didn't work.
    It works on my map tho.

    @Bribe
     
  14. Norris

    Norris

    Joined:
    Mar 1, 2020
    Messages:
    18
    Resources:
    0
    Resources:
    0
    That is a bad new. Thanks anyway
     
  15. map designer

    map designer

    Joined:
    May 2, 2011
    Messages:
    993
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Do not use Bribe system. Its only for 1.32 and above

    Instead, use that of @looking_for_help

    You can use of bribe if some older version compatable with 1.24



    I used LFH and it worked with me just fine
     
    Last edited: Mar 26, 2020 at 3:36 PM
  16. Norris

    Norris

    Joined:
    Mar 1, 2020
    Messages:
    18
    Resources:
    0
    Resources:
    0
    It crash when I use PDD
    When Dark Ranger attack. It crash immediately

    • PDD Damage By Ranage
      • Events
        • Game - PDD_damageEventTrigger becomes Equal to 1.00
      • Conditions
        • (Unit-type of PDD_source) Equal to Dark Ranger
      • Actions
        • Set Location = (Position of PDD_source)
        • Set Location2 = (Position of PDD_target)
        • Set DamageByRangeDistance = (Integer((Distance between Location and Location2)))
        • Set DamageByRangeDamage = (DamageByRangeDistance x 1)
        • Unit - Cause PDD_source to damage PDD_target, dealing (Real(DamageByRangeDamage)) damage of attack type Spells and damage type Normal
        • Custom script: call RemoveLocation (udg_Location)
        • Custom script: call RemoveLocation (udg_Location2)
     

    Attached Files:

  17. map designer

    map designer

    Joined:
    May 2, 2011
    Messages:
    993
    Resources:
    1
    Maps:
    1
    Resources:
    1
    thats wierd.

    its says there that recommended version is 1.21b, and I also got it to work even in 1.26. it should work in 1.24 as well.


    just to double check, did you follow the How to implement instructions?

    why dont you try and download that Physical Damage Detection for GUI v1.3.0.0 and meddle with that map itself, see if its working there, and then move it to your map?

    my guess is that you havent moved it to your map properly, but thats a guess. (maybe variables were not created while you copy)

    first try your code on LFH map and if its not working there, then there is something is wrong with the code, if its working there, then it hasnt been moved properly.


    Edit: so basically your mession now is to download LFH Physical Damage Detection for GUI v1.3.0.0 and check if your code works there perfectly or not.
    if its working fine then import it to your map.

    I see you probably have downloaded it already.
    LFH wrote notes about life drain. I hope you are not using that for the damage.
     
    Last edited: Mar 27, 2020 at 3:19 AM
  18. Norris

    Norris

    Joined:
    Mar 1, 2020
    Messages:
    18
    Resources:
    0
    Resources:
    0
    It seems like I had to update my warcraft 3. Hope my map compatible and everything alright.
     
  19. map designer

    map designer

    Joined:
    May 2, 2011
    Messages:
    993
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I have version switcher which switches between 1.26, 1.25 and 1.24 (you can find it if you search DotA utilites)

    but its certainly weird. I am not expecting this to be version issue.

    Be sure to back-up your warcraft before you use this.

    Also, go post in LFH thread, he might be able to help you.
     
    Last edited: Mar 27, 2020 at 4:58 AM
  20. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,154
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Damage Engine 3.8 should be able to work from versions 1.24 and up. I had saved it on version 1.29 but that shouldn't matter as there hadn't been new natives used in the script that would disrupt compatibility.