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

Attribute Scaling Non-Damage skills

Status
Not open for further replies.
Level 7
Joined
Oct 20, 2010
Messages
182
Hello, I have a question regarding using Attributes to scale abilities. I'm fairly new to coding as a whole and coding in GUI in the trigger editor also poses a little problem as it gets tedious going through every window trying to find which event/condition/action I want. So I was hoping if someone could help me logic out this simple spell, hopefully, to help me get a base understanding of how to do it in the future.

For example, the spell I am trying to edit is Evasion. How would I go about having the % chance to evade scale off of an Attribute?
 
Level 39
Joined
Feb 27, 2007
Messages
5,012
If you hate the windows you should just learn Lua or JASS right off the bat. They are not hard. You can also avoid some amount of window hell by using many variables in GUI.

There are now ways to set ability fields with triggers so you could just dynamically update the dodge chance periodically. I believe the one you want is called “Set ability real level field”. You then have to pick the right field, and you can see which one is for dodge chance by pressing ctrl+d in the OE while looking at the ability.

Another way would be to use a Damage Detection System and trigger the evasion yourself.
 
Level 7
Joined
Oct 20, 2010
Messages
182
Thank you. And I don't particularly hate it, it's just frustrating searching for certain things, however, I am mostly new to coding so it is much easier than writing it by hand.

I do have a follow-up question and figured I'd ask here then create a whole new thread.
Is there a way to have the "Unit - Damage Area action" not damage allies and the triggering unit? Or is this something I'd need to use a dummy to cast an area spell instead. I'm unfamiliar with using dummies
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
With the editor you need to pick the less logical option, Damage Target, and then use Pick every unit.

  1. Pick every unit (within range, not w/ matching condition.)
  2. if and or, your conditions
  3. Effects!
Ex.
  • Boom
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Channel
    • Actions
      • Set MSlp_Point = (Target point of ability being cast)
      • Set MSlp_Unit[0] = (Triggering unit)
      • Custom script: set bj_wantDestroyGroup=true
      • Unit Group - Pick every unit in (Units within 500.00 of MSlp_Point) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A structure) Equal to False
              • ((Picked unit) is Magic Immune) Equal to False
              • ((Picked unit) is dead) Equal to False
              • ((Picked unit) is an illusion) Equal to False
              • ((Picked unit) is Summoned) Equal to False
              • ((Picked unit) has buff Sleep) Equal to False
            • Then - Actions
              • Set MSlp_Real[0] = ((Real((Intelligence of MSlp_Unit[0] (Include bonuses)))) x 2.50)
              • Unit - Cause MSlp_Unit[0] to damage (Picked unit), dealing (50.00 + MSlp_Real[0]) damage of attack type Spells and damage type Normal
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
      • Custom script: call RemoveLocation(udg_MSlp_Point)

ALSO, here's a nice tutorial!
Overall you can learn by simply exploring, use that test map and see what does what.

Edit: added attribute scaling
 
Last edited:
Level 7
Joined
Oct 20, 2010
Messages
182
Thank you so much. I was messing around in the time it took and I had done something similar but less effective, I picked a unit group and created dummies to cast a fireball at them. This is much smoother, and thank you for showing me an example of the attribute scaling in action.

What are the two custom scripts that are being run here? Everything else makes sense to me but these.
 
Status
Not open for further replies.
Top