1. Head to the 33rd Modeling Contest Poll and drink to your heart's desire.
    Dismiss Notice
  2. Choose your means of doom in the 17th Mini Mapping Contest Poll.
    Dismiss Notice
  3. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  4. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  5. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  6. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  7. 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.

Attribute Based Hero Spells

Discussion in 'Requests' started by DemonHunterGI, Mar 1, 2018.

  1. DemonHunterGI

    DemonHunterGI

    Joined:
    Feb 24, 2018
    Messages:
    71
    Resources:
    0
    Resources:
    0
    I need some help in making attribute based hero spells.For example

    StormBolt
    Events
    Unit - A unit Finishes casting an ability
    Conditions
    (Ability being cast) Equal to Storm Bolt
    Actions
    Set Strength = (Strength of (Casting unit) (Include bonuses))
    Set Convert = (Real(Strength))
    Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Convert x 5.00) damage of attack type Spells and damage type Normal
    or

    AoE Heal
    Events
    Unit - A unit Begins casting an ability
    Conditions
    (Ability being cast) Equal to Mass Heal
    Actions
    Set Inteligence = (Intelligence of (Casting unit) (Include bonuses))
    Set Convert = (Real(Inteligence))
    Set UnitGroup = (Units within 600.00 of (Target point of ability being cast) matching ((Owner of (Matching unit)) Equal to (Owner of (Triggering unit))))
    Game - Display to (All players) the text: (Currently Casting: + (Name of (Ability being cast)))
    Unit Group - Pick every unit in UnitGroup and do (Unit - Set life of (Picked Unit) to ((Life of (Picked unit)) + (Convert x 4.00)))
    Unit Group - Pick every unit in UnitGroup and do (Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl)
    Special Effect - Destroy (Last created special effect)
    Custom script: call DestroyGroup(udg_UnitGroup)

    I'm confused about how to make these to scale for 10 levels (without making 10 different spells) so I can use them for my heroes.For example first level deals 0.50 x STR , second level deals 0.75 X STR and so on.Thanks !
     
  2. Daffa

    Daffa

    Joined:
    Jan 30, 2013
    Messages:
    8,206
    Resources:
    31
    Packs:
    1
    Maps:
    9
    Spells:
    18
    Tutorials:
    3
    Resources:
    31
    In the integer, there's Unit - Level of Ability for Unit.
     
  3. Watcher

    Watcher

    Joined:
    Aug 31, 2011
    Messages:
    87
    Resources:
    0
    Resources:
    0
    You can try with this things, which I used in my map.

    Basically u set up the integer variable, in my case "Set hadra_level = (0 + (Learned skill level))"

    Setup

    • Patriarch bonus skill
      • Events
        • Unit - A unit Learns a skill
      • Conditions
        • (Learned Hero Skill) Equal to Locus of Hadra
      • Actions
        • Set hadra_level = (0 + (Learned skill level))



    Then u create the formula for your spell, in my case "(((15.00 x (Real(hadra_level)))" (part of the formula in which variable is used)

    Execution

    • Mana Refresh
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Triggering unit) Equal to patrirarch
        • (Random integer number between 1 and 100) Less than or equal to 50
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Ability being cast) Equal to Locus of Hadra
          • Then - Actions
            • Unit - Set mana of patrirarch to ((Mana of patrirarch) + (((15.00 x (Real(hadra_level))) + 60.00) / 2.00))
            • Special Effect - Create a special effect at (Position of patrirarch) using Abilities\Spells\Undead\ReplenishMana\ReplenishManaCasterOverhead.mdl
            • Special Effect - Destroy (Last created special effect)
          • Else - Actions

     
  4. Daffa

    Daffa

    Joined:
    Jan 30, 2013
    Messages:
    8,206
    Resources:
    31
    Packs:
    1
    Maps:
    9
    Spells:
    18
    Tutorials:
    3
    Resources:
    31
    I find that unnecessary, as you can easily retrieve an ability's level directly.
     
  5. Watcher

    Watcher

    Joined:
    Aug 31, 2011
    Messages:
    87
    Resources:
    0
    Resources:
    0
    Most probably yes, I triggered it cause I used a little complicated system of that so I needed a value stored in variable.
     
  6. DemonHunterGI

    DemonHunterGI

    Joined:
    Feb 24, 2018
    Messages:
    71
    Resources:
    0
    Resources:
    0
    Where exactly should I put it ? I am confused
     
  7. Watcher

    Watcher

    Joined:
    Aug 31, 2011
    Messages:
    87
    Resources:
    0
    Resources:
    0
    • Set strenght_dmg = ((Strength of (Casting unit) (Include bonuses)) x (Level of Death Coil for (Casting unit)))


    When u declare the variable in this case (strenght_dmg) you can pick Arithmetic which is a function that offers you basic mathematical operations (+,-,*,/), then you pick each value, one is hero attribute (str, agi, int) and second is level of your ability for example death coil.

    And yeah in future try to post your triggers in ["trigger"]["/trigger"] brackets without (""). :D
     
  8. DemonHunterGI

    DemonHunterGI

    Joined:
    Feb 24, 2018
    Messages:
    71
    Resources:
    0
    Resources:
    0
    Thanks , can I use the Strength and Convert variables for every spell I make ? Will it cause trouble ?
     
  9. DemonHunterGI

    DemonHunterGI

    Joined:
    Feb 24, 2018
    Messages:
    71
    Resources:
    0
    Resources:
    0
    By the way, what about spells with cone effect ? How can I make it work since Unit - Cause (Triggering unit) to damage (Target unit of ability being cast) isn't an option.
     
  10. Watcher

    Watcher

    Joined:
    Aug 31, 2011
    Messages:
    87
    Resources:
    0
    Resources:
    0
    I think it will cause problems, cause if you have 2 triggers using the same variable, but different declaration, one will override another. Although you can use for example: Your Strenght variable only and only if u use it in a triggered spells that you will use with only one hero-type.

    Try using Damage Area instead of Damage Target, if it doesn't work try with Unit Group and damage each target individually.
     
  11. DemonHunterGI

    DemonHunterGI

    Joined:
    Feb 24, 2018
    Messages:
    71
    Resources:
    0
    Resources:
    0
    What about Firelord's Incinerate explosion damage ? Can it be made to deal attribute based damage ?
     
  12. Watcher

    Watcher

    Joined:
    Aug 31, 2011
    Messages:
    87
    Resources:
    0
    Resources:
    0
    It can't be triggered that way, but you can make it if unit dies while having that Buff you can Unit Group targets close to him and damage them with attribute based damage.

    Or you can use dummy ability to damage that Unit Group.
     
  13. DemonHunterGI

    DemonHunterGI

    Joined:
    Feb 24, 2018
    Messages:
    71
    Resources:
    0
    Resources:
    0
    • Incinerate Explode
      • Events
        • Unit - A unit Dies
      • Conditions
        • ((Dying unit) has buff Incinerate) Equal to True
      • Actions
        • Set IncinerateGroup = (Units within 300.00 of (Position of (Dying unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True))
        • Unit Group - Pick every unit in IncinerateGroup and do (Unit - Cause (Killing unit) to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal)
        • Custom script: call DestroyGroup (udg_IncinerateGroup)

    Could you tell me what should I change here because it doesn't do any explosion damage.
    I can change the damage to be attribute based , but for now the normal 500 explosion damage doesn't seem to work :([/trigger]
     
  14. millzy

    millzy

    Joined:
    Jul 9, 2008
    Messages:
    1,540
    Resources:
    6
    Maps:
    5
    Spells:
    1
    Resources:
    6
    i believe the issue is dying units cant have buffs

    this will take alot of work to do messing around with unit groups and to also ull need to know the hero that the incinerate buff belongs to to get the right attributes to deal damage