Need Help With: Custom Stat Triggers

Blood_Wraith

New Member
Reaction score
2
I want the stats to work like this:

Note: I'm trying to make the max unit attack damage 9999. As well as Max HP will be 9999 for the Heroes controlled by the players (not every unit)
IE: Unit's Base Damage is Greater than 9999, set (Triggering Unit's) Base Damage to 9999. Same with Max HP.

Strength: Used as an Integer for Hero's Base Damage. IE Hero has 255 Strength, it would be (Hero Strength) X 6 = 1530

Agility: Each point adds a certain percentage to evade (applies to all units) Example: My Agility stat is 255, the chance to evade should be roughly 25.5%. This could probably be achieved using a system similar to THIS

Intelligence: Does nothing, is used as an Integer for spell triggers

HP: Every time a Hero levels up, they get their Max HP modified. Example: Unit levels up, Set (Triggering Unit) Max HP to Max HP of (Triggering Unit) + 5%

Mana: Pretty much the same thing for HP, but for Mana

This shouldn't be too hard to accomplish, I just don't know how to modify a unit's max HP/Mana and Base Damage. And also the Evasion trigger.

Side note: There doesn't seem to be any Item Permanent Armor gain abilities, need trigger for settings a unit's armor.
 

Blood_Wraith

New Member
Reaction score
2
Bump. Oh come on, I know you guys know how to trigger at least half of that stuff, in fact, you people most likely know how to do every part of it, except for the Evasion part of course. While it's fairly easy to modify damage like in the example trigger up there, it's hard to modify an ability like that, especially with values of point.whatever.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
for the evasion part you would need Weep's GDD
and it would be something like this:
Trigger:
  • Evasion
    • Events
      • Game - GDDEvent becomes equal to 0.00
    • Conditions
    • Actions
      • Set Dice = random real between 0.00 and 100.00
      • If then else
        • If
          • Dice is less then or equal to (Real(Agility of (Triggering Unit))/100)
        • Then
          • Unit - Set life of (Triggering Unit) = Life of (Triggering Unit) + GDD_Damage
        • Else
 

Ayanami

칼리
Reaction score
288
Here's a quick system I wrote. It's in vJASS though and didn't include the evasion part as that can be coded easily with the method shown above. Usage is very simple.

Trigger:
  • Actions
    • Set TempUnit = <Some Unit>
    • Custom script: call CustomStat.register(udg_TempUnit)


As long as you register the unit, it will automatically update everything for you.

To import, simply copy the "System" trigger folder to your map. Save your map then close and re-open it. Then delete the "Objects" trigger. All the necessary abilities required will be made for you automatically. After that, you can take a look at the configuration part at the top of the "Custom Stat" trigger.
 

Attachments

  • Custom Stat.w3x
    23 KB · Views: 202

Blood_Wraith

New Member
Reaction score
2
How would an Evasion trigger depending on the Hero's Agility, be implemented with the link above? I'm very confused here. Okay so, how about I create this generic dodge trigger for now, at least help me finish that:

Trigger:
  • Dodge Test
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set Dodge_Chance = (Random integer number between 1 and 10)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Dodge_Chance Less than or equal to 3
        • Then - Actions
          • Unit - Add Dodge to (Triggering unit)
          • Wait 0.50 seconds
          • Unit - Remove Dodge from (Triggering unit)
        • Else - Actions


That trigger works pretty good. All units (at least for this trigger) have roughly a 30% chance to dodge.

When a unit is attacked, the trigger fires RIGHT before the unit takes damage, and it gives the triggering unit 100% evasion for a short time. This will be a problem with ranged units, for when the missile takes more then half a second to reach its target (unlikely) but you get the general feel of how my trigger works. Now I just need to know how to base it on (Every point of Agility = 0.01 chance to dodge)

Also how do I make an ability invisible? (AKA not display in the button menu)
 

Ayanami

칼리
Reaction score
288
If you really want to be accurate on the evasion, you would need to code your own damage system. An alternative is to "dodge" by blocking the damage taken. However, this would mean the evasion would apply to any form of damage, even spells.

Just take your agility of the hero and multiply it by 0.1 (or divide by 10), store this value (will call it Dodge). Then, Dodge_Chance should be random number between 1 and 100. You then compare if Dodge_Chance is less than Dodge, do your actions.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
you can make an ability "invisible" by adding it to a spell book then using the following action for the spellbook:
Trigger:
  • Player - Disable (Spellbook ability) for (Owner of (Triggering unit))
 

Blood_Wraith

New Member
Reaction score
2
Okay this should work:

Trigger:
  • Dodge
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set Dodge = ((Agility of (Triggering unit) (Include bonuses)) / 10)
      • Set Dodge_Chance = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Dodge_Chance Less than or equal to Dodge
        • Then - Actions
          • Unit - Add Dodge to (Triggering unit)
          • Wait 0.25 seconds
          • Unit - Remove Dodge from (Triggering unit)
        • Else - Actions


Is that right? I tested it and it seems to work fine. So with 255 Agility, I should have a 25.5% chance to Evade, correct?
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
the problem i could see is when a buncha units attack 1 unit, like 20/sec, which is easily possible if you get a buildup of neutrals, there is a high chance that you dodge multiple attacks
 

Blood_Wraith

New Member
Reaction score
2
Of course, I saw this when making a bunch of units attack the Hero at once, he dodged multiple attacks even know he was only supposedly supposed to dodge one of their attacks. That's a pretty small problem if the max chance to dodge is 25.5%, I'll learn to live with it.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
You should use weeps dds like I recommended... in my first response... u can get an exact dodge that works well
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
meh, unless they are triggered, but i cant think of a single spell i couldnt trigger cept MAYBE locust swarm, and thats with gui, if i were to use Jass (although im still nubby with jass) then fuggetabowdit
 

TheLegend

New Member
Reaction score
10
just add into else Unit - Remove Dodge from ... This would remove the dodge when the unit is attacked again and fails to trigger its dodge. This would however cause the previous dodge to disappear on the attack which is in fact realistic. If you get hit by an enemy you cant dodge the other in the same 0.25 seconds, you have to recover those 0.25 seconds.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
Using orb effects, it is quite possible to differentiate attack damage from spell damage. Simply check if the unit has a orb-specific buff and remove it. In the same trigger you then block the damage taken, and create "miss" floating text at the damaging unit's position. Evasion simulated.
 

vypur85

Hibernate
Reaction score
803
> I should have a 25.5% chance to Evade, correct?
You'd have to convert the Agility into Real values and then do the division. Otherwise, it will not be accurately captured as 25.5% (but 25% instead). If you don't mind the accuracy, then it's all good.

> It's not the best solution.
Exactly.

> it is quite possible to differentiate attack damage
It's gonna be a headache. :)


meh, unless they are triggered, but i cant think of a single spell i couldnt trigger cept MAYBE locust swarm, and thats with gui, if i were to use Jass (although im still nubby with jass) then fuggetabowdit
?
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
if you trigger a spell you can simply create a boolean: spell damage
where if true, the damage dealt was spell damage, if not then its not, then set it to false every time a unit deals spell damage (since i assume physical damage will be dealt at a higher frequency)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top