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

Making a Mislead Spell

Status
Not open for further replies.
Level 3
Joined
Nov 15, 2010
Messages
30
Hi I'm trying to make a simple spell that whenever the hero casts it it makes him invisible (just like wind walk) and at the same time it creates a duplicate of him that deals X% damage and takes X% damage (I was using the item spell that makes illusions, but the GUI doesn't have an Order Id that i can make the dummy unit cast it!)

Thanks in advance
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
Since GUI doesn't have an order string for the Illusion ability, you need to use JASS in order to issue the order by id.
  • Custom script: call IssueTargetOrderById(bj_lastCreatedUnit,852274,GetTriggerUnit())
In this example, the last created unit will cast the ability on the triggering unit. 852274 is the order id of the ability.
 
Level 3
Joined
Nov 15, 2010
Messages
30
Since GUI doesn't have an order string for the Illusion ability, you need to use JASS in order to issue the order by id.
  • Custom script: call IssueTargetOrderById(bj_lastCreatedUnit,852274,GetTriggerUnit())
In this example, the last created unit will cast the ability on the triggering unit. 852274 is the order id of the ability.

Im not very familiar with jass, do i just copy that or do i need to make another tirgger with further instructions or its a jass default? (the custom script: call IssueTargetOrderbyID part).

Actually yeah, i think ill just use the item version, give the unit an item and order it to use the item on the caster, much easier i guess.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
If you skip the Inventory + dummy creation, you're gonna need Custom script
If you hate Custom script, well, use Inventory + Dummy =D
Your choice, but I think Custom script has more efficiency as it is in JASS (typing language...)
Right, Maker ?
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
What's so bad about custom script?
Really, it's not that hard to use custom script for this and it's even easier considering that you don't need to make a useless item for a dummy unit to have. Technically, it's even easier to copy since you just need to copy the text instead of having to go through multiple clicking in GUI.

Anyway, I suppose I should have given you the a better example of the trigger:
  • IllusionSpell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Mislead
    • Actions
      • Set TempLoc = (Position of (Triggering unit))
      • Unit - Create 1 DummyUnit for (Triggering player) at TempLoc facing Default building facing degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Item Illusions to (Last created unit)
      • Custom script: call IssueTargetOrderById(bj_lastCreatedUnit,852274,GetTriggerUnit())
      • Custom script: call RemoveLocation(udg_TempLoc)
This would basically cause a dummy unit

Mislead should be a custom ability based off of Wind Walk.
 
Level 3
Joined
Nov 15, 2010
Messages
30
What's so bad about custom script?
Really, it's not that hard to use custom script for this and it's even easier considering that you don't need to make a useless item for a dummy unit to have. Technically, it's even easier to copy since you just need to copy the text instead of having to go through multiple clicking in GUI.

Anyway, I suppose I should have given you the a better example of the trigger:
  • IllusionSpell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Mislead
    • Actions
      • Set TempLoc = (Position of (Triggering unit))
      • Unit - Create 1 DummyUnit for (Triggering player) at TempLoc facing Default building facing degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Item Illusions to (Last created unit)
      • Custom script: call IssueTargetOrderById(bj_lastCreatedUnit,852274,GetTriggerUnit())
      • Custom script: call RemoveLocation(udg_TempLoc)
This would basically cause a dummy unit

Mislead should be a custom ability based off of Wind Walk.

Are those 2 custom scripts default to warcraft or must i create them?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Level 14
Joined
Nov 18, 2007
Messages
1,084
Are those 2 custom scripts default to warcraft or must i create them?
I suppose you're misunderstanding something about Custom Script.
This function basically allows you to have a line of Jass in your trigger.
Unlike the other GUI functions, it only takes in text for the Jass language.

So to do
  • Custom script: call IssueTargetOrderById(bj_lastCreatedUnit,852274,GetTriggerUnit())
scroll down to Custom Script in the function list.
Paste call IssueTargetOrderById(bj_lastCreatedUnit,852274,GetTriggerUnit()) into the text field.

You would do something similar with the other custom script.
 
Status
Not open for further replies.
Top