Attribute-scaling abilities?

Xialian

Member
Reaction score
8
How do I make a spell that does for example four times my hero's agility in damage or passively adds that damage to basic attacks? I've been struggling with this for a while and I can't seem to get any further :(
 

thorhunter

You can change this now in User CP.
Reaction score
32
Set integer value = Hero attribute x 4;
Unit - Damage unit dealing -convert (integer to real (integer value))- damage

As for your passive ability, you need to give your unit some sort of damage ability eg. 'Item - damage bonus' that has numerous level and periodically check whether level f this ability equals hero's attribute, if not, set it to value equal to your attribute. I like to use some additional integer variable that remembers the level of an ability rather than checking level of an ability, since the check is really heavy computingwise.
 

Xialian

Member
Reaction score
8
Can you give me an example of a spell doing damage with attributes? As I said, I'm fairly bad at this, and would appreciate so much help making my heroes advanced :D
 

thorhunter

You can change this now in User CP.
Reaction score
32
Trigger:
  • Slash Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Slash
    • Actions
      • Animation - Play (Triggering unit)'s attack animation
      • Set Temp_Point = (Position of (Triggering unit))
      • Set Temp_Group = (Units within 280.00 of Temp_Point matching (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit))) Equal to True))
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • Set TempG[1] = (Strength of (Triggering unit) (Include bonuses))
      • Set TempG[2] = (Agility of (Triggering unit) (Include bonuses))
      • Set TempG[3] = ((((Level of WWeaponDamageBonus x10 for (Triggering unit)) - 1) x 10) + ((Level of WWeaponDamageBonus x1 for (Triggering unit)) - 1))
      • Set TempReal = (1.00 + (1.00 + ((Real((TempG[1] + TempG[2]))) x 0.10)))
      • Set TempReal = (TempReal x (Real(TempG[3])))
      • Set TempReal = (TempReal + (Real((2 x TempG[1]))))
      • Set TempReal = (TempReal x 0.80)
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (Real(Temp_Integer[1])) damage of attack type Normal and damage type Normal
            • Else - Actions
      • Custom script: call DestroyGroup (udg_Temp_Group)
 

Xialian

Member
Reaction score
8
How does most of that work? I don't get the "TempG[3] = ((((Level of WWeaponDamageBonus x10 for (Triggering Unit)) - 1) x 10) + ((Level of WWeaponDamageBonus x1 for (Triggering Unit)) - 1))" and so on... Also, I don't know how to post my thing so far, but I've made it like this:

Events
Unit - A unit Starts the effect of an ability
Conditions
(Unit-type of (Triggering unit)) Equal to Hyperassassin (that's his name :D)
Actions
Set HAAgi = (Agility of (Triggering unit) (Include bonuses))
 

thorhunter

You can change this now in User CP.
Reaction score
32
The lines you mentioned should be no concern to you, they sorta refer to an abstract attribute i created for the purpose of my map, this trigger is just copied from there and I didn't remove it for the sake of further calculations (I actually should). The example you posted will work, but remember to specify what ability is being cast.
 

Xialian

Member
Reaction score
8
Yeah, of course I will meantion him as the casting unit :p
But how do I multiply the value (his agility attribute) and convert it to damage? The first thing you mentioned was quite confusing...
 

thorhunter

You can change this now in User CP.
Reaction score
32
Just use it as arithmetic function when setting variable. If you want to use this value to damage unit, theres 'unit - damage unit' function where you sepcify damage type (present in trigger I posted), damage source and damage target. Depending on what kind of ability it is there are various means to detect the unit.
 

Xialian

Member
Reaction score
8
The ability is meant to function like Storm Bolt (but was used for an Omnislash-like ability, which I copied from this website, fixed it with a cooldown (I learn!!)) and chose Firebolt because it does the same thing, but is a different ability.
So basically, it's a point and shoot ability.
 

thorhunter

You can change this now in User CP.
Reaction score
32
Well, the difficulty is that the moment you enter the field of any triggered damage, in most cases it will follow up with the need of triggering the whole thing. In your case, stormbolt isn't the most friendly one to deal with because of varied delay between cast and effect so you'll need to go through the process of triggering whole abilities :). You could go easy with it and make damage instant, if that doesn't make a difference.

Come to think of it, there is an easier way to go around this actually. It involves creating a dummy unit that will cast the spell for you, this way you can easily trigger spells that are just altered versions of warcraft vanilla spells.
 

Xialian

Member
Reaction score
8
I'm gonna split the trigger into 6 later (6 levels), but so far it looks like this:
Unit - A unit Starts the effect of an ability

(Ability being cast) Equal to Shuriken [Q]
(Level of Shuriken [Q] for (Triggering unit)) Equal to 1
(Unit-type of (Triggering unit)) Equal to Hyperassassin

Set HAAgi = (Agility of (Triggering unit) (Include bonuses))
Set AgiComb = (HAAgi x 3)
Set TDMGShu1 = (AgiComb + 30)

Do you spot any problems so far?
 

Xialian

Member
Reaction score
8
I really do not know how to use dummy units. If that's the only way, how do they work?
 

thorhunter

You can change this now in User CP.
Reaction score
32
You can use one variable instead of 3. If missle speed doesn't bother you then set it in your object editor to maximum - either stormbolt or firebolt work. You don't need to split the trigger into 6, unless you're using very different formulas. Even then, you can use 'if then else statement (multiple conditions)' for your trigger. Also, theres still no damage unit function included.
 

Xialian

Member
Reaction score
8
Gah, this is confusing. I think this editor is way too advanced for my head right now, hah. I would love a faster way of chatting right now, that would be a lot easier. I'm not very familiar with the "else", if it can do that thing you just described, will look into it, but I've always used separate triggers when it comes to levels.
 

thorhunter

You can change this now in User CP.
Reaction score
32
Trigger:
  • ST
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Slash
    • Actions
      • Set Temp_int = (30 + (4 x (Agility of (Triggering unit) (Include bonuses))))
      • Set Temp_int = (Temp_int x (Level of Slash for (Triggering unit)))
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Real(Temp_int)) damage of attack type Spells and damage type Normal
 

thorhunter

You can change this now in User CP.
Reaction score
32
You can use same variable. In fact, you could do all calculations in one line of code.
 

Xialian

Member
Reaction score
8
"Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 500.00 damage of attack type Spells and damage type Normal."
I saw that it said something else than 500 in your message, how do I make mine say the same? I can choose variables, but no attack-related ones will be available options when I try.

Edit: Found it, it was the "real" variable, but it can't be set as the same value as my "TDMGShu = (AgiComb + 30)"
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top