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

[Trigger] Cast spell

Status
Not open for further replies.
Level 4
Joined
Mar 30, 2013
Messages
69
Friends, I would like to know about some trigger that causes a unit use a skill when you have 15% life remaining.

Thank you. :wink:
 
Level 4
Joined
Mar 30, 2013
Messages
69
I need the unit "0027 steel shark's tooth" use an ability called "submerge" the naga race, but do not give in that action triggers.

  • Tiburon grave de vida
    • Events
      • Unit - Tiburon colmillo de acero 0027 <gen>'s life becomes Less than 15.00
    • Conditions
    • Actions
 
Last edited:
Level 15
Joined
Oct 29, 2012
Messages
1,474
Easy, let's assume first that a player chooses unit from the tavern :
  • Tavern heroes
  • Events
    • Unit - A Unit sold an unit
  • Conditions
  • Actions
    • MyHero = (Sold Unit)
    • Trigger - Add Event ( MyHero's life becomes lesser than ( (Life of (MyHero) x 15) / 100) ) to the trigger ( HP Remaining )
Now here the trigger to do skill, if your skill is based on Storm Bolt, we use 'Order with target (Mountain King - Storm Bolt)', if your spell is based on Target area like Fire Strike we use (Fire Mage - Fire Strike 'point'), if your skill is based on no target ability, for example Warstomp, we use (Tauren Chieften - Warstomp)

Here are many examples :

  • Events
    • === We added the event from the previous trigger, Or you can just put event here and not use previous trigger if you don't have taverns and shit :D ===
  • Conditions
  • Actions
    • Unit - Order (Triggering Unit) to 'Mountain King - Storm Bolt' the unit 'Your Target' == That's example for target unit skill which is based on Storm Bolt
    • Unit - Order (Triggering Unit) to 'Fire Mage - Fire Strike' on 'Area point' == That's for any skill based on Fire Strike for example :D
    • Unit - Order (Triggering Unit) to 'Tauren Chieften - Warstomp' == Here we have no point target or unit target, for example we have spell named 'Gravity' which is based on Warstomp, we use this, but warstomp isn't a good base ability it may cause crash :S
    • Unit - Order (Triggering Unit) to 'Mountain King - Thunder Clap' the unit 'Target' == Another example for unit target base spell, for example we have ability named 'Shenra Tensei' which is based on Thunder clap


Here how your trigger should work for your unit using 15 Life percentage
  • Events
    • Unit - Tiburon colmillo de acero 0027 <gen>'s life becomes Less than ( ((Life of Tiburon colmillo de acero 0027 <gen>)) x 15) / 100 )
  • Conditions
  • Actions
    • Unit - Issue order with no target : Order Tiburon colmillo de acero 0027 <gen> to 'Neutral - Submerge'
Conclusion :
- You can add events from any other trigger if your unit isn't created in the beginning of the game
- For percentage life you should use ( (Life of Unit x 'Your Percentage') / 100) , same with mana and attribute stats ^^
- If you want a unit to use a custom skill, you should issue order him to do the base ability, he will automatically do the custom skill instead of the base one because he doesn't even have the base one haha.


Adios!
 
Status
Not open for further replies.
Top