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

[Trigger] Cast spell at random location

Status
Not open for further replies.
Level 3
Joined
Mar 1, 2015
Messages
53
How can I make my hero to cast spell based on breath of fire at random location?

current trigger(which works with breath of fire, but I want to make it work with my spell:

  • Actions
    • Set random = (Random integer number between 0 and 101)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • random Less than or equal to 100
      • Then - Actions
        • Unit - Order (Triggering unit) to Neutral Pandaren Brewmaster - Breath Of Fire (Random point in (Region centered at (Position of (Triggering unit)) with size (100.00, 100.00)))
      • Else - Actions
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Every spell has something called a "use/turn on string", which for breath of fire is something like "breathoffire".

So if you make a custom version of breath of fire for your hero, ordering it to cast breath of fire will make it cast that custom spell, because its use string is still the same as breath of fire.

To cast any spell, just order the unit to cast the spell you based it on.

e.g. if you have an aoe spell with Blizzard as the base, order it to cast blizzard.
 
Level 3
Joined
Mar 1, 2015
Messages
53
yeah I know about the string thing but still it doesn't work.
When I added firebreath to hero it was fine...
Let me note that the custom firebreath is located in spellbook, might that be the case?

  • Actions
    • Set random = (Random integer number between 0 and 101)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • random Less than or equal to 100
      • Then - Actions
        • Unit - Order (Triggering unit) to Neutral Pandaren Brewmaster - Breath Of Fire (Random point in (Region centered at (Position of (Triggering unit)) with size (100.00, 100.00)))
      • Else - Actions
 
Level 3
Joined
Mar 1, 2015
Messages
53
Maybe there's other way to do it?
Something like :
unit starts casting an ability
ability equal to custom breath of fire
actions: order unit to cast spell at random anglee

Is there a way to do it like this?
 
Level 13
Joined
Dec 21, 2010
Messages
541
what's the event?

are you making AI? you want the unit to cast breath of fire at a given time?
*make sure the ability has less cooldown


  • Random Cast
  • Events
    • Time - Every (Math random between 3 and 5) seconds of game time
  • Conditions
  • Actions
    • Set - Point[0] = Position of (Your Hero)
    • Set - Point[1] = (Point[0] offset with 300 towards (random angle)
    • Unit - Order (Your Hero) to Neutral Pandaren Brewmaster - Breath Of Fire at Point[1]
    • Custom script: call RemoveLocation (udg_Point[0])
    • Custom script: call RemoveLocation (udg_Point[1])
 
Status
Not open for further replies.
Top