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

Enhancing Anti Magic Shell spell

Status
Not open for further replies.
Level 9
Joined
Apr 22, 2020
Messages
430
Hey guys do any of you know how to make the anti magic shell have a bonus life regeration and plus armor? Of course when casted on a unit.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
If you're using the latest patches. (except for 1.30 below of course)
You can easily do that in two custom script lines using this system: New Bonus v1.7
Particularly on its utilities variant, these functions are made for convenience.
JASS:
        function AddUnitBonusTimed takes unit u, integer bonus_type, real amount, real duration returns nothing
            -> Add the specified amount for the specified bonus type for unit for a duration
            -> Example: call AddUnitBonusTimed(GetTriggerUnit(), BONUS_ARMOR, 13, 10.5)

        function LinkBonusToBuff takes unit u, integer bonus_type, real amount, integer buffId returns nothing
            -> Links the bonus amount specified to a buff or ability. As long as the unit has the buff or
            -> the ability represented by the parameter buffId the bonus is not removed.
            -> Example: call LinkBonusToBuff(GetTriggerUnit(), BONUS_ARMOR, 10, 'B000')
 
        function LinkBonusToItem takes unit u, integer bonus_type, real amount, item i returns nothing
            -> Links the bonus amount specified to an item. As long as the unit has that item the bonus is not removed.
            -> Note that it will work for items with the same id, because it takes as parameter the item object.
            -> Example: call LinkBonusToItem(GetManipulatingUnit(), BONUS_HEALTH_REGEN, 0.55, GetManipulatedItem())
Although, it would require you some time to import it but it's definitely worth it than
the other solutions one may provide. (since this is 'all-in-one' package of bonuses you can ask for)

If older patches, you may use OE abilities that manipulates armor and regeneration with matching the
duration of that magic shell and cast them manually to the target via dummies in the casting event,
since these features you're asking for enhancing a standard ability can only be done with Trigger Editor.

EDIT:

Demo:
  • Enhanced Anti Magic Shell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Anti-magic Shell
    • Actions
      • Custom script: call LinkBonusToBuff( GetSpellTargetUnit() , BONUS_HEALTH_REGEN , 2.5 , 'B000' )
      • Custom script: call LinkBonusToBuff( GetSpellTargetUnit() , BONUS_ARMOR , 5.0 , 'B000' )
      • -------- Anti-Magic Shell now provides +2.5 health regeneration and +5.0 armor as long as the buff 'B000' remains on the unit. --------
I highly recommend this way of doing it.
 
Last edited:
Level 9
Joined
Apr 22, 2020
Messages
430
If you're using the latest patches. (except for 1.30 below of course)
You can easily do that in two custom script lines using this system: New Bonus v1.7
Particularly on its utilities variant, these functions are made for convenience.
JASS:
        function AddUnitBonusTimed takes unit u, integer bonus_type, real amount, real duration returns nothing
            -> Add the specified amount for the specified bonus type for unit for a duration
            -> Example: call AddUnitBonusTimed(GetTriggerUnit(), BONUS_ARMOR, 13, 10.5)

        function LinkBonusToBuff takes unit u, integer bonus_type, real amount, integer buffId returns nothing
            -> Links the bonus amount specified to a buff or ability. As long as the unit has the buff or
            -> the ability represented by the parameter buffId the bonus is not removed.
            -> Example: call LinkBonusToBuff(GetTriggerUnit(), BONUS_ARMOR, 10, 'B000')
 
        function LinkBonusToItem takes unit u, integer bonus_type, real amount, item i returns nothing
            -> Links the bonus amount specified to an item. As long as the unit has that item the bonus is not removed.
            -> Note that it will work for items with the same id, because it takes as parameter the item object.
            -> Example: call LinkBonusToItem(GetManipulatingUnit(), BONUS_HEALTH_REGEN, 0.55, GetManipulatedItem())
Although, it would require you some time to import it but it's definitely worth it than
the other solutions one may provide. (since this is 'all-in-one' package of bonuses you can ask for)

If older patches, you may use OE abilities that manipulates armor and regeneration with matching the
duration of that magic shell and cast them manually to the target via dummies in the casting event,
since these features you're asking for enhancing a standard ability can only be done with Trigger Editor.

EDIT:

Demo:
  • Enhanced Anti Magic Shell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Anti-magic Shell
    • Actions
      • Custom script: call LinkBonusToBuff( GetSpellTargetUnit() , BONUS_HEALTH_REGEN , 2.5 , 'B000' )
      • Custom script: call LinkBonusToBuff( GetSpellTargetUnit() , BONUS_ARMOR , 5.0 , 'B000' )
      • -------- Anti-Magic Shell now provides +2.5 health regeneration and +5.0 armor as long as the buff 'B000' remains on the unit. --------
I highly recommend this way of doing it.
Oh Cool! Thank you so much! And can i ask one more thing? How do i make a hero immune to spells while channeling the stampede ability and remove that immunity once the hero finishes channeling the stampede ability.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
How do i make a hero immune to spells while channeling the stampede ability and remove that immunity once the hero finishes channeling the stampede ability.
You'll need a hidden spell immunity and script it, when it starts channeling add it then remove it when stops channeling.
I'll show you an example of it later when I get home. (Or someone else may already provide you with this or other ways)
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
If you're using a latest patch so:
  • Stampede Begins
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Stampede
    • Actions
      • Unit - Add Spell Immunity to (Triggering unit)
      • -------- Thanks to the developers, they provided us with this function which is only available in recent patches: --------
      • Unit - For (Triggering unit), Ability Spell Immunity, Hide ability: True
  • Stampede Stops
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Stampede
    • Actions
      • Unit - Remove Spell Immunity from (Triggering unit)
stampede-with-spell-immunity-gif-gif.358850
If using an older patch, just reply as there are ways to easily achieve this but with downsides of course.
 
Level 9
Joined
Apr 22, 2020
Messages
430
If you're using a latest patch so:
  • Stampede Begins
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Stampede
    • Actions
      • Unit - Add Spell Immunity to (Triggering unit)
      • -------- Thanks to the developers, they provided us with this function which is only available in recent patches: --------
      • Unit - For (Triggering unit), Ability Spell Immunity, Hide ability: True
  • Stampede Stops
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Stampede
    • Actions
      • Unit - Remove Spell Immunity from (Triggering unit)
stampede-with-spell-immunity-gif-gif.358850
If using an older patch, just reply as there are ways to easily achieve this but with downsides of course.
Ok Thank you so much! Sorry for all the troubles.
 
Status
Not open for further replies.
Top