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

[Spell] parry spell

Status
Not open for further replies.
Level 17
Joined
Nov 12, 2016
Messages
780
hello everyone i wanted help in making a parry spell i did try to make the spell however i have problems : my base spell was the mountain giants Hardend skin passive abiltiy i noticed that it has a chance setting and its set to 100% to ignore some amount of damage i changed that to 20-25-30 % chance to ignore 70-120-160 damage i seted the ability to unit ability and made 3 copies of it also using a spell book seted to unit ability with 3 levels and made that ability then using a fake ability i made a trigger for the spell book ability to pass the effect to the fake ability and also disabled the spell book ability now the 2nd part is i wanted when this chance comes to effect the ability is casted only its passive well i also made a trigger for ech copied hardend skills i made feom level 1 to 3 to when its casted to give 70-120-160 damage to whoever the ability is used on not only this trigger dosent work but setting this ability out of 100% also dosent work at all so really i didnt do anything at all
please anyone who sees this help me if you can and sorry for bad english :p
 
Level 17
Joined
Nov 12, 2016
Messages
780
Events
unit - A unit Begins Casting an ability
Conditions
(Ability being cast) Equal to parry level 3
Actions
Unit - Cause (Triggering unit) to Damage (Target unit of ability being cast) , Dealing 160 damage of attack type Hero and damage type Normal

^ this is the trigger i sued
 
Level 7
Joined
Jan 23, 2011
Messages
350
Well, your trigger does damage to the target of the ability, if your ability requires no target, then it does nothing

You will need a damage detection system to know when you receive dmg and then deal the parry dmg, will be trying to make the triggs later
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
As Marcos said above. Your trigger only works when the ability is cast. Because hardened skin is a passive ability, there is no way to cast it. Use damage detection system as Marcos suggested, it gives you extra options which is not available in the trigger editor. When units in general take damage, it can detect the damage taken by the units right when the unit takes damage, right before the damage is dealt or right after the damage is dealt. I highly recommend to use Damage Engine by Bribe.

The explanation about how to implement Damage Engine and how to use it is provided in the system description so make sure to read the description and follow the steps carefully. You can simply ask if you're confused at some point. Good luck. :)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Depends if you want Varian's talented or untalented version of Parry. Untalented reduces incoming auto attack damage by a certain fraction so you will need an attack damage detection system and to refund the specified damage fraction of life. Alternatively you could increase armor by the appropriate percentage to increase auto attack EHP such that it equates to the appropriate damage reduction. Since no native in WC3 exists to get current armor, one must track it by looking up all possible armor sources and summing them.

Talented version basically acts as a finite duration damage shield with infinite block amount. In response to a damage event you refund all damage dealt. Since the event fires before the damage is actually dealt you need to make sure the damage will not be fatal and then set the life appropriately after a sub-frame delay. Be aware that setting life works by applying a delta to current life, this can introduce rounding errors for very large amounts of life due to the precision of 32bit float types.
 
Level 17
Joined
Nov 12, 2016
Messages
780
thanks everyone well as i never used damage engine i will take some time to look into this system if i have more questions about the engine that i dont understand i will ask
and Quilnez im might have a hard time with this sudggestion understanding how can i use this as plainly i dont know anything about vjass :(
 
Level 7
Joined
Jan 23, 2011
Messages
350
  • Parry
    • Acontecimientos
      • Partida - DamageEvent becomes Igual a 1.00
    • Condiciones
      • (Level of Piel endurecida for DamageEventTarget) Mayor que 0
      • IsDamageSpell Igual a False
    • Acciones
      • Set Real2 = (Real((Level of Piel endurecida for DamageEventTarget)))
      • Set Real = ((-5.00 x (Real2 x Real2)) + ((65.00 x Real2) + 10.00))
      • Unidad - Cause DamageEventTarget to damage DamageEventSource, dealing Real damage of attack type Conjuros and damage type Normal
Example trigger using the Damage Engine system recommended by Rheiko(best system for gui users)

The formula returns 70 - 120 - 160 for each level of "Piel endurecida" which will be your parry
World-Editor Tutorials Site

If you use your parry with less than 100% chance of blocking, this trigger will not work in the right way
Also, it always deals 70 - 120 - 160 per attack, which is pretty overpowered
If you need to detect the 30% chance, you would need to trigger the parry, removing the damage block from your base ability
Here's the example

  • Parry
    • Acontecimientos
      • Partida - DamageModifierEvent becomes Igual a 1.00
    • Condiciones
      • (Level of Piel endurecida for DamageEventTarget) Mayor que 0
      • IsDamageSpell Igual a False
    • Acciones
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si: Condiciones
          • (Random integer number between 1 and 100) Menor que o igual a 30
        • Entonces: Acciones
          • Set Real2 = (Real((Level of Piel endurecida for DamageEventTarget)))
          • Set Real = ((-5.00 x (Real2 x Real2)) + ((65.00 x Real2) + 10.00))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si: Condiciones
              • DamageEventAmount Mayor que (Real + 3.00)
            • Entonces: Acciones
              • Set DamageEventAmount = (DamageEventAmount - Real)
              • Unidad - Cause DamageEventTarget to damage DamageEventSource, dealing Real damage of attack type Conjuros and damage type Normal
            • Otros: Acciones
              • Unidad - Cause DamageEventTarget to damage DamageEventSource, dealing DamageEventAmount damage of attack type Conjuros and damage type Normal
              • Set DamageEventAmount = 3.00
              • -------- This is the min damage the normal ability blocks --------
        • Otros: Acciones
Watch that the event is different
 
Status
Not open for further replies.
Top