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

Ability Configure or Maybe Another Spell Request

Status
Not open for further replies.
Level 13
Joined
Aug 19, 2014
Messages
1,111
Hello guys I wanted to make the Bear Form ability can only be cast if there is another specific unit that is nearby by the Hero. For example the hero is the Footman and he had a Bear Form ability, then there is a rifleman which is the specific unit that is needed to be near to the footman so that the footman can now cast the Bear Form ability and will turn into a bear, the rifleman will then be gone when the footman cast the Bear Form ability. Now when the bear (which the footman turned into) cast the ''Night Elf Form'' ability he will return into a footman and the rifleman will return also. Note that the specific unit (rifleman) must belong to the same player of the Hero in order to cast the ability.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
1. Make a new trigger.
Event: A unit is issued an order with no target
Conditions: (Issued order) equal to (Order(bearform))
Actions:
- Set TempBoolean = false
- Set TempUnit = Triggering Unit
- Set TempLocation = Position of TempUnit
- Custom Script: "set bj_wantDestroyGroup = true"
- Pick every unit in ... range of TempLocation
---- If
------- unit is alive and unittype is equal to ...
---- Then
------- Set TempBoolean = true
- If
---- TempBoolean is equal to false
- Then
---- Custom Script: "call IssueImmediateOrderDelayed(udg_TempUnit, "stop", 0)"
---- Set TempForce = (Player Group(Owner of TempUnit))
---- Cinematic - Clear the screen of text messages for TempForce
---- Game - Display to TempForce the text: "No ... unit is near."
---- Custom Script: "call DestroyForce(udg_TempForce)"
- Custom Script: "call RemoveLocation(udg_TempLocation)"

(You already have the Delayed Order Snippet in your map.)
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
^that

Because when used on heroes the two heroes died and the new hero spawns.

Yup that is correct, so every time you Mount and Dismount a hero will die and will be replace by another one. This hero dying heroes continues each time you used Mount and Dismount ability.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
I'm aware of it working that way, but didn't know that you want this spell for a hero.
Well, the logical thing would be to use an automorph(a morph ability with normal and alternate form switched) to morph one unit, while hiding the other.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Hello guys I wanted to make the Bear Form ability can only be cast if there is another specific unit that is nearby by the Hero.
Event: A unit is issued an order with no target
Conditions: (Issued order) equal to (Order(bearform))
Actions:
- Set TempBoolean = false
- Set TempUnit = Triggering Unit
- Set TempLocation = Position of TempUnit
- Custom Script: "set bj_wantDestroyGroup = true"
- Pick every unit in ... range of TempLocation
---- If
------- unit is alive and unittype is equal to ...
---- Then
------- Set TempBoolean = true
- If
---- TempBoolean is equal to false
- Then
---- Custom Script: "call IssueImmediateOrderDelayed(udg_TempUnit, "stop", 0)"
---- Set TempForce = (Player Group(Owner of TempUnit))
---- Cinematic - Clear the screen of text messages for TempForce
---- Game - Display to TempForce the text: "No ... unit is near."
---- Custom Script: "call DestroyForce(udg_TempForce)"
- Custom Script: "call RemoveLocation(udg_TempLocation)"

(You already have the Delayed Order Snippet in your map.)

Try?
To remove the specific unit, you save the picked unit in the loop to a variable (just next to the "Set TempBoolean = true").
And you remove that unit in the else at the end of the trigger.
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
Try?
To remove the specific unit, you save the picked unit in the loop to a variable (just next to the "Set TempBoolean = true").
And you remove that unit in the else at the end of the trigger.

Hmmm..... I'll try tnx for everything Wietlol :ogre_haosis:
 
Status
Not open for further replies.
Top