I am not sure I understand the issue correctly, but here are a few notes regarding casting spells:
#1: Targeting
You have the following types of spells in regards to targeting:
- Spells with no target: You click the spell and the unit casts it
- Examples: Starfall, Berserk, Avatar, Bear Form
- Spells targeting an object: These spells require you to select a target object on which the spell will be cast
- The target object can be unit, item, destructible (e.g. tree)
- Examples: Storm Bolt, Inner Fire, Frost Nova, Cyclone
- Spells targeting a point: These spells require you to select a location on which the spell will be cast
- Most spells usually have a targeting circle of various width to show you the area of effect of the spell
- Examples: Blizzard, Rain of Fire, Cloud, Healing Ward
To find out to which category your custom spell belongs to is as easy as starting the map and manually ordering your unit to cast the spell and watching what you have to target.
To order unit to cast a spell via triggers, you have the following trigger actions that match the categories above:
- Spells with no target:
- Action name: 'Unit - Issue Order With No Target'
- Example:
-
Unit - Order DummyUnit to Night Elf Priestess Of The Moon - Starfall.
- Spells targeting an object:
- Action names:
- 'Unit - Issue Order Targeting A Unit'
- 'Unit - Issue Order Targeting A Destructible'
- 'Unit - Issue Order Targeting An Item'
- Example:
-
Unit - Order DummyUnit to Human Priest - Inner Fire (Picked unit)
- Spells targeting a point:
- Action name: 'Unit - Issue Order Targeting A Point'
- Example:
-
Unit - Order DummyUnit to Human Archmage - Blizzard (Target point of ability being cast)
Most summoning spells are 'No target' spells. As such, you have to 'Issue Order With No Target'.
#2: Spell's order
Each spell has an order. It is the order that you have to specify in the trigger actions mentioned earlier, you cannot specify the custom spell itself.
Warcraft has a pre-defined list of orders and these are hardcoded in the abilities. The following is important to understand:
- You cannot add your own orders
- For default abilities it's obvious what the order is (since in triggers the order matches the ability's name)
- Custom spells inherit the order from the ability you based your custom spell off.
As an example, let's say I have created a 'Summon
Air Elemental' spell which is based off Archmage's 'Summon Water Elemental' spell.
To order dummy unit to cast the spell via triggers, you would have to execute the following set of actions:
-
Unit - Add Summon Air Elemental to DummyUnit //only required if the dummy unit does not have the ability
-
Unit - Order DummyUnit to Human Archmage - Summon Water Elemental.
If my custom spell was based off Far Seer's Feral Spirit, then that's what I would have to order:
-
Unit - Order DummyUnit to Orc Far Seer - Feral Spirit.
The only exception to this rule is the 'Channel' spell (and any spell based off it) where you can specify the order (but this only allows you to specify an existing order, you cannot create a new one).