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

[Trigger] Ability change

Status
Not open for further replies.
Level 3
Joined
Apr 2, 2006
Messages
28
I get fatal error when the hero gets less than 50% hp:
BattleOrders - int variable
Offense, defense - abilities

Unit- HERO takes damage

(percentage life of HERO) less than 50.00

Set BattleOrders = level of Offense for triggering unit
Unit - remove Offense from triggering unit
Unit - add defense to triggering unit
Unit -set level of Defense for triggering unit to BattleOrders
_____________________________________________________________

Also this ability teleports hero units when it shouldnt:

Pick every unit in (region) matching ((picked unit is a hero ) equal to false) and do (actions)
Move (picked unit) instantly to (random point in region2)
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Add/remove ability do not work that way for hero skills.
Removing will make the skill level 0 but it will still be in the learn section.
Adding will add it as level 1.
Instead of using remove than add, just add a Engineering upgrade based ability(remove the attachment/buff in the object editor) which should replace offense with defense. In the other data fields about abilities leave those that are.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
((picked unit is a hero ) equal to false)
Should be ((matching unit is a hero ) equal to false)
 
Status
Not open for further replies.
Top