• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Applying a negative spell resistance.

Status
Not open for further replies.
Level 5
Joined
Mar 24, 2020
Messages
80
Hi guys,

I'm trying to create a spell that reduces an enemy units resistance to spells. I've created an ability that uses an item ability (runed bracers) and made it -1.000 to double the damage from spells.

I've created the below trigger, but am I right to think you shouldn't put 'Waits' in loops?
Is there a better way to do this?

  • Magic Resist Reduction
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Priestess - [|cffffcc00Silence|r]
    • Actions
      • Set VariableSet AttackPoint = (Target point of ability being cast)
      • Set VariableSet SilenceGroup[(Player number of (Owner of (Triggering unit)))] = (Units within 300.00 of AttackPoint matching ((((Triggering unit) is A structure) Equal to False) and (((Picked unit) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True)).)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in SilenceGroup[(Player number of (Owner of (Triggering unit)))] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
            • Then - Actions
              • Unit - Add Spell Damage Weakness (-100%) to (Picked unit)
              • Wait 6.00 game-time seconds
              • Unit - Remove Spell Damage Weakness (-100%) from (Picked unit)
            • Else - Actions
              • Unit - Add Spell Damage Weakness (-100%) to (Picked unit)
              • Wait 10.00 game-time seconds
              • Unit - Remove Spell Damage Weakness (-100%) from (Picked unit)
      • Custom script: call RemoveLocation(udg_AttackPoint)


Thanks!
 
Last edited:
Level 5
Joined
Oct 16, 2007
Messages
67
If you want to keep using your Trigger you can do:
  • Magic Resist Reduction
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Priestess - [|cffffcc00Silence|r]
    • Actions
      • Set VariableSet tmpPoint = (Target point of ability being cast)
      • Set VariableSet SilenceGroup[(Player number of (Owner of (Triggering unit)))] = (Units within 300.00 of tmpPoint matching ((((Matching unit) is A structure) Equal to False) and (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit)).) Equal to True)).)
      • Custom script: call RemoveLocation(udg_tmpPoint)
      • Unit Group - Pick every unit in SilenceGroup[(Player number of (Owner of (Triggering unit)))] and do (Actions)
        • Loop - Actions
          • Unit - Add Spell Weakness to (Triggering unit)
      • Wait 6.00 game-time seconds
      • Unit Group - Pick every unit in SilenceGroup[(Player number of (Owner of (Triggering unit)))] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
            • Then - Actions
              • Unit - Remove Spell Weakness from (Picked unit)
              • Unit Group - Remove (Picked unit) from SilenceGroup[(Player number of (Owner of (Triggering unit)))].
            • Else - Actions
      • Wait 4.00 game-time seconds
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in SilenceGroup[(Player number of (Owner of (Triggering unit)))] and do (Actions)
        • Loop - Actions
          • Unit - Remove Spell Weakness from (Picked unit)
However, FeelsGoodMan is right, with damage engine you could just add the buff normaly and in the Trigger that is executed if your unit is damaged you would multiply the damage. This way the Spell could be cast several times on the same targets without problems!
 
Last edited:
Level 5
Joined
Mar 24, 2020
Messages
80
If you want to keep using your Trigger you can do:
  • Magic Resist Reduction
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Priestess - [|cffffcc00Silence|r]
    • Actions
      • Set VariableSet tmpPoint = (Target point of ability being cast)
      • Set VariableSet SilenceGroup[(Player number of (Owner of (Triggering unit)))] = (Units within 300.00 of tmpPoint matching ((((Matching unit) is A structure) Equal to False) and (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit)).) Equal to True)).)
      • Custom script: call RemoveLocation(udg_tmpPoint)
      • Unit Group - Pick every unit in SilenceGroup[(Player number of (Owner of (Triggering unit)))] and do (Actions)
        • Loop - Actions
          • Unit - Add Spell Weakness to (Triggering unit)
      • Wait 6.00 game-time seconds
      • Unit Group - Pick every unit in SilenceGroup[(Player number of (Owner of (Triggering unit)))] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
            • Then - Actions
              • Unit - Remove Spell Weakness from (Picked unit)
              • Unit Group - Remove (Picked unit) from SilenceGroup[(Player number of (Owner of (Triggering unit)))].
            • Else - Actions
      • Wait 4.00 game-time seconds
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in SilenceGroup[(Player number of (Owner of (Triggering unit)))] and do (Actions)
        • Loop - Actions
          • Unit - Remove Spell Weakness from (Picked unit)
However, FeelsGoodMan is right, with damage engine you could just add the buff normaly and in the Trigger that is executed if your unit is damaged you would multiply the damage. This way the Spell could be cast several times on the same targets without problems!

Thanks for this Lartin.

The damage systems look really good, but I know I am going to need to really learn how they work to use them. And this -100% res is only needed one time so it's not a stack.
 
but I know I am going to need to really learn how they work to use them.
Hmm not really, you already know how to use variables so that's all you need.

Basically the damage system gives you some stuff to work with. It would look like this:

  • Spell Stuff
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to True
    • Actions
      • Set DamageEventAmount = (DamageEventAmount x 1.50)

The event is a "Game - real becomes equal to" event, and this trigger will run every time damage occurs.

The condition is a boolean check that checks if the damage that occurs is spell damage or not.

The action is self explanatory.
 
Level 5
Joined
Mar 24, 2020
Messages
80
Hmm not really, you already know how to use variables so that's all you need.

Basically the damage system gives you some stuff to work with. It would look like this:

  • Spell Stuff
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to True
    • Actions
      • Set DamageEventAmount = (DamageEventAmount x 1.50)

The event is a "Game - real becomes equal to" event, and this trigger will run every time damage occurs.

The condition is a boolean check that checks if the damage that occurs is spell damage or not.

The action is self explanatory.

I will need to have a proper play with it! So I would just need to add new triggers where it would just check as a boolean if the unit is spell damage and whether or not it has a buff? If I wanted to, how would I stack the same buff so it could add more negative spell res?
 
Status
Not open for further replies.
Top