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

[Spell] Custom spells

Status
Not open for further replies.
Level 10
Joined
Oct 28, 2012
Messages
228
Greetings, I am working on some boss fight and I need your help with two spells. I am using classic triggers and I don't know how can I create these:

1) SPAWN
When: Map initialization
If: (NO CONDITIONS)
Than: Create unit in random region defined by distance AB of unit XY.
(I want to create unit in random point in circle with radius AB arround unit XY)

2) MULTIPLE SHOCKWAVE
When: Unit XY uses shockwave
If: (NO CONDITIONS)
Than: Cast another 2 shockwaves comming from unit XY in random angle
(If unit XY casts shockwave, two another are casted in random angle)

Additional question: Can I create trigger event "If life of unit XY becomes less than 75% (50%, 25% etc.)? I found only "if life of unit XY becomes less than 400/300/200 any number. But I need percentage.

Thanks to all of you ;) :ogre_haosis:
 
Level 12
Joined
Nov 3, 2013
Messages
989
1) Point with polar offset AB distance towards random real from 0 to 359 degrees

Not that to remove leaks you have to have two point variables, one for the unit position and another for the polar offset.

2) create 2 other units without model and locust ability at the same location as the boss. They should either already have the shockwave ability or you give it to them through trigger. Now order them to use this ability, you'll make the target location variable the same way as 1st question.

Extra question: Instead of entering a number click the "function" list and there will be the option to choose "unit - percentage life"
 
Level 10
Joined
Oct 28, 2012
Messages
228
Hey, thank you for your reply. I didn't get the last one. Can you send me a screenshot of this script?

Because all I can create is "Unit XY's life becomes lesser than "Percentage life of unit XY"
But that doesn't do anything, right?

I have another question:
WHEN: Map inizialization
IF: Unit AB is in circle with radius EF arround unit XY
THAN: Nothing happens

(The important is the condition)
 
Level 3
Joined
Nov 22, 2014
Messages
50
Regarding your additional question: No you can't.

You have to check in periodic events like this.

  • Events
    • Time - Every 1.00 seconds of game time
  • Conditions
    • (Percentage life of Boss) Less than or equal to 75.00
  • Actions
    • Yur actions here.
    • Trigger - Turn off (This trigger)
 
Level 12
Joined
Nov 3, 2013
Messages
989
Well in that case just take the max life and multiply it by whatever percentage you want, E.G. "Unit XY's life becomes lesser than XY's max health * 0.25"
 
Status
Not open for further replies.
Top