[Spell] Auto-Casting / Order-string???

Status
Not open for further replies.
Level 7
Joined
Jul 24, 2008
Messages
294
I was wondering if someone could help me out, I am trying to create a unit that does not have a base attack but rather a spell with a short cool down that he would auto cast on 'Attacking Units' or 'Targeted Units'.

I've searched around these forums and tried a few things but cant figure it out. Any advice?
 
What's the spell you have based your custom one on?
If its normal ladder skill you can refer to it via actions. Lets say it's custom chain lightning.
  • Unit - Order Yourunit to Orc - Far Seer: Chain Lightning YourTarget
There are 3 types of actions Unit - Issued an order:
- no target
- target object
- target location

Find the one you need in Unit section actions and from filter select the 'base' ability.
If your spell isn't ladder one (egzample channel) you can always use:
JASS:
// For location
native IssuePointOrder              takes unit whichUnit, string order, real x, real y returns boolean
// Target
native IssueTargetOrder             takes unit whichUnit, string order, widget targetWidget returns boolean
// No target
native IssueImmediateOrder          takes unit whichUnit, string order returns boolean
Ofcourse you can write it with custom scripts in GUI - don't worry.
There is also alternative: you can always replace those functions with 'ById' ones - so instead of 'string' order like: "thunderbolt" you can write the Ids of orders.
JASS:
native IssueTargetOrderById         takes unit whichUnit, integer order, widget targetWidget returns boolean
As you see, instead of 'string' function requires integer variable. If you gonna follow that method this will be usefull for you.
 
Level 7
Joined
Jul 24, 2008
Messages
294
  • Unit - A unit Is attacked
  • (Unit-type of (Triggering unit)) Equal to Fire-Hog
  • Unit - Order (Triggering unit) to Neutral - Firebolt (Attacking unit)
How do I get them to cast a custom spell ID? Like breathoffire=852580
Or Shockwave? none of the original spells in the order-string created by blizzard don't do what i want.
 
Last edited:
Ehh.. shockwave and breathoffire are in ability filter in GUI actions. Go to Unit actions section and find Issue Order Targetting a Point. Shockwave is in: Orc - Tauren Chieftain: Shockwave, and breath within: Neutrals - Pandaren: Breath of Fire.

Using jass functions it's somewhat like:
  • Set tempp = (Target point of ability being cast)
  • Custom script: call IssuePointOrderById(udg_CASTER, 852580, GetLocationX(udg_tempp), GetLocationY(udg_tempp)
  • Custom script: call RemoveLocation(udg_tempp)
Where CASTER is Triggering unit. Ofcourse make proper events and conditions.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
As far as I know, you can't even target a unit if you disabled your Base Attack (unless you make your Base Attack of 1 - 1 range values)

This is same as removing 'Amov' from a unit which is removing "Attack" ability from a unit, makes the unit can't target any unit at all
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I know you can target units with spells but you can't obey this statement:

auto cast on 'Attacking Units' or 'Targeted Units'.
Attacking Units or Target Units is surely referring to a unit that "acquires" target in range
This mechanic only allow when a unit has an Attack Mode Enable.

I was talking based on something that is clearly seen.
 
Status
Not open for further replies.
Top