- 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.
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())
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.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.
Although, it would require you some time to import it but it's definitely worth it thanJASS: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())
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:
I highly recommend this way of doing it.
- 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. --------
You'll need a hidden spell immunity and script it, when it starts channeling add it then remove it when stops channeling.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.
|
Ok Thank you so much! Sorry for all the troubles.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)
If using an older patch, just reply as there are ways to easily achieve this but with downsides of course.