• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] How to make a unit cast spell?

Status
Not open for further replies.
You mean order unit to cast a spell? If i misunderstood you, appologize.
Depending on type of spell (no target/target/target as point) use action Unit - Issue Order (...)

There are 5 types:
Issue Order Targeting a Unit
Issue Order Targeting a Point
Issue Order Targeting a Destructible
Issue Order Targeting a Item
Issue Order No Target

Choose action that fits best your spell.

After you chose action that fits best your spell, in filter for abilities choose the ability(id) your spell is based on.
So if you want unit to cast Chainlightning, use: Orc - Far Seer - Chain Lightning:
  • Unit - Order (Triggering unit) to Orc Far Seer - Chain Lightning (Target unit of ability being cast)
You have to know from what race/unit/spell given spell is based on.

Now best to base on channel ability, but remember about base order id field. It enables you to give unit multiple Channel-based abilities and they wont bug, and work together fine. Additionaly channel has various options so its freat as base for most spells. Remember to set follow through time to 0, or if you want a animation just to 1-1,5sec.

help4z.png
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
There are 3 types of Spell-casting Type
1. Target Unit
2. Target Ground
3. Instant

Target Unit
It would be based from a spell that requires you to target a unit, for it to work. For example, Storm Bolt.

Target Ground
This spell-target requires you to target a ground/region/location. For example, Death and Decay.

Instant
A spell that will activate instantly (instantly means, if the spell has no Casting Time or Channeling Time), right after it is casted and do not require any target method. For example, Roar.


Next, we're gonna talk about "Base Order ID"
Every spells has their own ID, which the trigger will understands what spell should the unit cast when it is ordered by trigger
For instance, if you base your spell from Chain Lightning. To order your unit to cast Chain Lightning (triggerly, of course), you should use this trigger:

  • Unit - Order (Triggering unit) to Orc Far Seer - Chain Lightning (Target unit of ability being cast)
Trigger above shows that your unit will cast Chain Lightning towards a targeted unit (base your spell from a Target Unit spell. You see the Orc Far Seer - Chain Lightning ? That line acts as Base Order ID which will order your unit to cast a spell that is related to that ID. If you base your spell from a Storm Bolt, it will be like this:

  • Unit - Order (Triggering unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
You see the changes towards the Human Mountain King - Storm Bolt ? That's the Base Order ID. The same principle applied to Target Ground and Instant.

Next, if you want to know what is your spell's Base Order ID, simply:
1. Go to Object Editor
2. Abilities tab
3. Pick any spell
4. Check the Text - Order String - Use/Turn On

If you choose Storm Bolt as your base ability, that field will show thunderbolt, is it ?
Well, a spell that is thunderbolt is related to the action of this trigger:

  • Unit - Order (Triggering unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
So, any spell with thunderbolt as Base Order ID will be activated by the Human Mountain King - Storm Bolt Action Order.

Next, Channel ability.
1. Go to Object Editor
2. Abilities tab
3. Press CTRL + F
4. Type "Channel"
5. Press CTRL + G
6. You will get the "Channel" ability on list (the red-fist icon)

This spell is unique that Blizzard made and you can change its Base Order ID to anything you want ! For other spell such as Chain Lightning or Roar, you can't change its Base Order ID (eventhough you change it via Object Editor, but the fact the spell will retain its old Base Order ID). Only Channel can change its Base Order ID (and some other spell such as Charge Gold And Lumber). To change the "Channel" Base Order ID, scroll to the field that says "Data - Base Order ID", and change it to whatever Base Order ID you want.

For example, if you change the Base Order from channel (this is default Base Order ID for this spell) to thunderbolt, what would the action be, to trigger the unit to cast the spell ?
Yes, it's the:

  • Unit - Order (Triggering unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
 
Look at the order string of the ability...

Target Unit
JASS:
call IssueTargetOrder(CASTER, "chainlightning", TARGET

Target Ground
JASS:
call IssuePointOrder(CASTER, "flamestrike", x, y)

No target/Instant
JASS:
call IssueImmediateOrder(CASTER, "howlofterror")

OR you could use orderbyID

IssueTargetOrderById
IssuePointOrderById
IssueImmediateOrderById


JASS:
    constant integer	OID_absorb	 =	852529
    constant integer	OID_acolyteharvest	 =	852185
    constant integer	OID_AImove	 =	851988
    constant integer	OID_ambush	 =	852131
    constant integer	OID_ancestralspirit	 =	852490
    constant integer	OID_ancestralspirittarget	 =	852491
    constant integer	OID_animatedead	 =	852217
    constant integer	OID_antimagicshell	 =	852186
    constant integer	OID_attack	 =	851983
    constant integer	OID_attackground	 =	851984
    constant integer	OID_attackonce	 =	851985
    constant integer	OID_attributemodskill	 =	852576
    constant integer	OID_auraunholy	 =	852215
    constant integer	OID_auravampiric	 =	852216
    constant integer	OID_autodispel	 =	852132
    constant integer	OID_autodispeloff	 =	852134
    constant integer	OID_autodispelon	 =	852133
    constant integer	OID_autoentangle	 =	852505
    constant integer	OID_autoentangleinstant	 =	852506
    constant integer	OID_autoharvestgold	 =	852021
    constant integer	OID_autoharvestlumber	 =	852022
    constant integer	OID_avatar	 =	852086
    constant integer	OID_avengerform	 =	852531
    constant integer	OID_awaken	 =	852466
    constant integer	OID_banish	 =	852486
    constant integer	OID_barkskin	 =	852135
    constant integer	OID_barkskinoff	 =	852137
    constant integer	OID_barkskinon	 =	852136
    constant integer	OID_battleroar	 =	852599
    constant integer	OID_battlestations	 =	852099
    constant integer	OID_bearform	 =	852138
    constant integer	OID_berserk	 =	852100
    constant integer	OID_blackarrow	 =	852577
    constant integer	OID_blackarrowoff	 =	852579
    constant integer	OID_blackarrowon	 =	852578
    constant integer	OID_blight	 =	852187
    constant integer	OID_blink	 =	852525
    constant integer	OID_blizzard	 =	852089
    constant integer	OID_bloodlust	 =	852101
    constant integer	OID_bloodlustoff	 =	852103
    constant integer	OID_bloodluston	 =	852102
    constant integer	OID_board	 =	852043
    constant integer	OID_breathoffire	 =	852580
    constant integer	OID_breathoffrost	 =	852560
    constant integer	OID_build	 =	851994
    constant integer	OID_burrow	 =	852533
    constant integer	OID_cannibalize	 =	852188
    constant integer	OID_carrionscarabs	 =	852551
    constant integer	OID_carrionscarabsinstant	 =	852554
    constant integer	OID_carrionscarabsoff	 =	852553
    constant integer	OID_carrionscarabson	 =	852552
    constant integer	OID_carrionswarm	 =	852218
    constant integer	OID_chainlightning	 =	852119
    constant integer	OID_channel	 =	852600
    constant integer	OID_charm	 =	852581
    constant integer	OID_cloudoffog	 =	852473
    constant integer	OID_clusterrockets	 =	852652
    constant integer	OID_coldarrows	 =	852244
    constant integer	OID_coldarrowstarg	 =	852243
    constant integer	OID_controlmagic	 =	852474
    constant integer	OID_corporealform	 =	852493
    constant integer	OID_corrosivebreath	 =	852140
    constant integer	OID_coupleinstant	 =	852508
    constant integer	OID_coupletarget	 =	852507
    constant integer	OID_creepanimatedead	 =	852246
    constant integer	OID_creepdevour	 =	852247
    constant integer	OID_creepheal	 =	852248
    constant integer	OID_creephealoff	 =	852250
    constant integer	OID_creephealon	 =	852249
    constant integer	OID_creepthunderbolt	 =	852252
    constant integer	OID_creepthunderclap	 =	852253
    constant integer	OID_cripple	 =	852189
    constant integer	OID_curse	 =	852190
    constant integer	OID_curseoff	 =	852192
    constant integer	OID_curseon	 =	852191
    constant integer	OID_cyclone	 =	852144            
    constant integer	OID_darkconversion	 =	852228
    constant integer	OID_darkportal	 =	852229
    constant integer	OID_darkritual	 =	852219
    constant integer	OID_darksummoning	 =	852220
    constant integer	OID_deathanddecay	 =	852221
    constant integer	OID_deathcoil	 =	852222
    constant integer	OID_deathpact	 =	852223
    constant integer	OID_decouple	 =	852509
    constant integer	OID_defend	 =	852055
    constant integer	OID_detectaoe	 =	852015
    constant integer	OID_detonate	 =	852145
    constant integer	OID_devour	 =	852104
    constant integer	OID_devourmagic	 =	852536
    constant integer	OID_disassociate	 =	852240
    constant integer	OID_disenchant	 =	852495
    constant integer	OID_dismount	 =	852470
    constant integer	OID_dispel	 =	852057
    constant integer	OID_divineshield	 =	852090
    constant integer	OID_doom	 =	852583
    constant integer	OID_drain	 =	852487
    constant integer	OID_dreadlordinferno	 =	852224
    constant integer	OID_dropitem	 =	852001
    constant integer	OID_drunkenhaze	 =	852585
    constant integer	OID_earthquake	 =	852121
    constant integer	OID_eattree	 =	852146
    constant integer	OID_elementalfury	 =	852586
    constant integer	OID_ensnare	 =	852106
    constant integer	OID_ensnareoff	 =	852108
    constant integer	OID_ensnareon	 =	852107
    constant integer	OID_entangle	 =	852147
    constant integer	OID_entangleinstant	 =	852148
    constant integer	OID_entanglingroots	 =	852171
    constant integer	OID_etherealform	 =	852496
    constant integer	OID_evileye	 =	852105
    constant integer	OID_faeriefire	 =	852149
    constant integer	OID_faeriefireoff	 =	852151
    constant integer	OID_faeriefireon	 =	852150
    constant integer	OID_fanofknives	 =	852526
    constant integer	OID_farsight	 =	852122
    constant integer	OID_fingerofdeath	 =	852230
    constant integer	OID_firebolt	 =	852231
    constant integer	OID_flamestrike	 =	852488
    constant integer	OID_flamingarrows	 =	852174
    constant integer	OID_flamingarrowstarg	 =	852173
    constant integer	OID_flamingattack	 =	852540
    constant integer	OID_flamingattacktarg	 =	852539
    constant integer	OID_flare	 =	852060
    constant integer	OID_forceboard	 =	852044
    constant integer	OID_forceofnature	 =	852176
    constant integer	OID_forkedlightning	 =	852587
    constant integer	OID_freezingbreath	 =	852195
    constant integer	OID_frenzy	 =	852561
    constant integer	OID_frenzyoff	 =	852563
    constant integer	OID_frenzyon	 =	852562
    constant integer	OID_frostarmor	 =	852225
    constant integer	OID_frostarmoroff	 =	852459
    constant integer	OID_frostarmoron	 =	852458
    constant integer	OID_frostnova	 =	852226
    constant integer	OID_getitem	 =	851981
    constant integer	OID_gold2lumber	 =	852233
    constant integer	OID_grabtree	 =	852511
    constant integer	OID_harvest	 =	852018
    constant integer	OID_heal	 =	852063
    constant integer	OID_healingward	 =	852109
    constant integer	OID_healingwave	 =	852501
    constant integer	OID_healoff	 =	852065
    constant integer	OID_healon	 =	852064
    constant integer	OID_hex	 =	852502
    constant integer	OID_holdposition	 =	851993
    constant integer	OID_holybolt	 =	852092
    constant integer	OID_howlofterror	 =	852588
    constant integer	OID_humanbuild	 =	851995
    constant integer	OID_immolation	 =	852177
    constant integer	OID_impale	 =	852555
    constant integer	OID_inferno	 =	852232
    constant integer	OID_innerfire	 =	852066
    constant integer	OID_innerfireoff	 =	852068
    constant integer	OID_innerfireon	 =	852067
    constant integer	OID_instant	 =	852200
    constant integer	OID_invisibility	 =	852069
    constant integer	OID_lightningshield	 =	852110
    constant integer	OID_load	 =	852046
    constant integer	OID_loadarcher	 =	852142
    constant integer	OID_loadcorpse	 =	852050
    constant integer	OID_loadcorpseinstant	 =	852053
    constant integer	OID_locustswarm	 =	852556
    constant integer	OID_lumber2gold	 =	852234
    constant integer	OID_magicdefense	 =	852478
    constant integer	OID_magicleash	 =	852480
    constant integer	OID_magicundefense	 =	852479
    constant integer	OID_manaburn	 =	852179
    constant integer	OID_manaflareoff	 =	852513
    constant integer	OID_manaflareon	 =	852512
    constant integer	OID_manashieldoff	 =	852590
    constant integer	OID_manashieldon	 =	852589
    constant integer	OID_massteleport	 =	852093
    constant integer	OID_mechanicalcritter	 =	852564
    constant integer	OID_metamorphosis	 =	852180
    constant integer	OID_militia	 =	852072
    constant integer	OID_militiaconvert	 =	852071
    constant integer	OID_militiaoff	 =	852073
    constant integer	OID_militiaunconvert	 =	852651
    constant integer	OID_mindrot	 =	852565
    constant integer	OID_mirrorimage	 =	852123
    constant integer	OID_monsoon	 =	852591
    constant integer	OID_mount	 =	852469
    constant integer	OID_mounthippogryph	 =	852143
    constant integer	OID_move	 =	851986
    constant integer	OID_nagabuild	 =	852467
    constant integer	OID_neutraldetectaoe	 =	852023
    constant integer	OID_neutralinteract	 =	852566
    constant integer	OID_neutralspell	 =	852630
    constant integer	OID_nightelfbuild	 =	851997
    constant integer	OID_orcbuild	 =	851996
    constant integer	OID_parasite	 =	852601
    constant integer	OID_parasiteoff	 =	852603
    constant integer	OID_parasiteon	 =	852602
    constant integer	OID_patrol	 =	851990
    constant integer	OID_phaseshift	 =	852514
    constant integer	OID_phaseshiftinstant	 =	852517
    constant integer	OID_phaseshiftoff	 =	852516
    constant integer	OID_phaseshifton	 =	852515
    constant integer	OID_phoenixfire	 =	852481
    constant integer	OID_phoenixmorph	 =	852482
    constant integer	OID_poisonarrows	 =	852255
    constant integer	OID_poisonarrowstarg	 =	852254
    constant integer	OID_polymorph	 =	852074
    constant integer	OID_possession	 =	852196
    constant integer	OID_preservation	 =	852568
    constant integer	OID_purge	 =	852111
    constant integer	OID_rainofchaos	 =	852237
    constant integer	OID_rainoffire	 =	852238
    constant integer	OID_raisedead	 =	852197
    constant integer	OID_raisedeadoff	 =	852199
    constant integer	OID_raisedeadon	 =	852198
    constant integer	OID_ravenform	 =	852155
    constant integer	OID_recharge	 =	852157
    constant integer	OID_rechargeoff	 =	852159
    constant integer	OID_rechargeon	 =	852158
    constant integer	OID_rejuvenation	 =	852160
    constant integer	OID_renew	 =	852161
    constant integer	OID_renewoff	 =	852163
    constant integer	OID_renewon	 =	852162
    constant integer	OID_repair	 =	852024
    constant integer	OID_repairoff	 =	852026
    constant integer	OID_repairon	 =	852025
    constant integer	OID_replenish	 =	852542
    constant integer	OID_replenishlife	 =	852545
    constant integer	OID_replenishlifeoff	 =	852547
    constant integer	OID_replenishlifeon	 =	852546
    constant integer	OID_replenishmana	 =	852548
    constant integer	OID_replenishmanaoff	 =	852550
    constant integer	OID_replenishmanaon	 =	852549
    constant integer	OID_replenishoff	 =	852544
    constant integer	OID_replenishon	 =	852543
    constant integer	OID_request_hero	 =	852239
    constant integer	OID_requestsacrifice	 =	852201
    constant integer	OID_restoration	 =	852202
    constant integer	OID_restorationoff	 =	852204
    constant integer	OID_restorationon	 =	852203
    constant integer	OID_resumebuild	 =	851999
    constant integer	OID_resumeharvesting	 =	852017
    constant integer	OID_resurrection	 =	852283 // was 852094
    constant integer	OID_returnresources	 =	852020
    constant integer	OID_revenge	 =	852241
    constant integer	OID_revive	 =	852039
    constant integer	OID_roar	 =	852164
    constant integer	OID_robogoblin	 =	852656
    constant integer	OID_root	 =	852165
    constant integer	OID_sacrifice	 =	852205
    constant integer	OID_sanctuary	 =	852569
    constant integer	OID_scout	 =	852181
    
    // mine custom
    constant integer	OID_scrollofspeed	 =	852285
    
    constant integer	OID_selfdestruct	 =	852040
    constant integer	OID_selfdestructoff	 =	852042
    constant integer	OID_selfdestructon	 =	852041
    constant integer	OID_sentinel	 =	852182
    constant integer	OID_setrally	 =	851980
    constant integer	OID_shadowsight	 =	852570
    constant integer	OID_shadowstrike	 =	852527
    constant integer	OID_shockwave	 =	852125
    constant integer	OID_silence	 =	852592
    constant integer	OID_sleep	 =	852227
    constant integer	OID_slow	 =	852075
    constant integer	OID_slowoff	 =	852077
    constant integer	OID_slowon	 =	852076
    constant integer	OID_soulpreservation	 =	852242
    constant integer	OID_spellshield	 =	852571
    constant integer	OID_spellshieldaoe	 =	852572
    constant integer	OID_spellsteal	 =	852483
    constant integer	OID_spellstealoff	 =	852485
    constant integer	OID_spellstealon	 =	852484
    constant integer	OID_spies	 =	852235
    constant integer	OID_spiritlink	 =	852499
    constant integer	OID_spiritofvengeance	 =	852528
    constant integer	OID_spirittroll	 =	852573
    constant integer	OID_spiritwolf	 =	852126
    constant integer	OID_stampede	 =	852593
    constant integer	OID_standdown	 =	852113
    constant integer	OID_starfall	 =	852183
    constant integer	OID_stasistrap	 =	852114
    constant integer	OID_steal	 =	852574
    constant integer	OID_stomp	 =	852127
    constant integer	OID_stoneform	 =	852206
    constant integer	OID_stop	 =	851972
    constant integer	OID_submerge	 =	852604
    constant integer	OID_summonfactory	 =	852658
    constant integer	OID_summongrizzly	 =	852594
    constant integer	OID_summonphoenix	 =	852489
    constant integer	OID_summonquillbeast	 =	852595
    constant integer	OID_summonwareagle	 =	852596
    constant integer	OID_tankdroppilot	 =	852079
    constant integer	OID_tankloadpilot	 =	852080
    constant integer	OID_tankpilot	 =	852081
    constant integer	OID_taunt	 =	852520
    constant integer	OID_thunderbolt	 =	852095
    constant integer	OID_thunderclap	 =	852096
    constant integer	OID_tornado	 =	852597
    constant integer	OID_townbelloff	 =	852083
    constant integer	OID_townbellon	 =	852082
    constant integer	OID_tranquility	 =	852184
    constant integer	OID_unavatar	 =	852087
    constant integer	OID_unavengerform	 =	852532
    constant integer	OID_unbearform	 =	852139
    constant integer	OID_unburrow	 =	852534
    constant integer	OID_uncoldarrows	 =	852245
    constant integer	OID_uncorporealform	 =	852494
    constant integer	OID_undeadbuild	 =	851998
    constant integer	OID_undefend	 =	852056
    constant integer	OID_undivineshield	 =	852091
    constant integer	OID_unetherealform	 =	852497
    constant integer	OID_unflamingarrows	 =	852175
    constant integer	OID_unflamingattack	 =	852541
    constant integer	OID_unholyfrenzy	 =	852209
    constant integer	OID_unimmolation	 =	852178
    constant integer	OID_unload	 =	852047
    constant integer	OID_unloadall	 =	852048
    constant integer	OID_unloadallcorpses	 =	852054
    constant integer	OID_unloadallinstant	 =	852049
    constant integer	OID_unpoisonarrows	 =	852256
    constant integer	OID_unravenform	 =	852156
    constant integer	OID_unrobogoblin	 =	852657
    constant integer	OID_unroot	 =	852166
    constant integer	OID_unstableconcoction	 =	852500
    constant integer	OID_unstoneform	 =	852207
    constant integer	OID_unsubmerge	 =	852605
    constant integer	OID_unsummon	 =	852210
    constant integer	OID_unwindwalk	 =	852130
    constant integer	OID_vengeance	 =	852521
    constant integer	OID_vengeanceinstant	 =	852524
    constant integer	OID_vengeanceoff	 =	852523
    constant integer	OID_vengeanceon	 =	852522
    constant integer	OID_voodoo	 =	852503
    constant integer	OID_ward	 =	852504
    constant integer	OID_waterelemental	 =	852097
    constant integer	OID_wateryminion	 =	852598
    constant integer	OID_web	 =	852211
    constant integer	OID_weboff	 =	852213
    constant integer	OID_webon	 =	852212
    constant integer	OID_whirlwind	 =	852128
    constant integer	OID_windwalk	 =	852129
    constant integer	OID_wispharvest	 =	852214
    constant integer	OID_acidbomb	 =	852662
    constant integer	OID_chemicalrage	 =	852663
    constant integer	OID_healingspray	 =	852664
    constant integer	OID_transmute	 =	852665
    constant integer	OID_lavamonster	 =	852667
    constant integer	OID_soulburn	 =	852668
    constant integer	OID_volcano	 =	852669
    constant integer	OID_cancel	 =	851976
    constant integer	OID_moveslot1	 =	852002
    constant integer	OID_moveslot2	 =	852003
    constant integer	OID_moveslot3	 =	852004
    constant integer	OID_moveslot4	 =	852005
    constant integer	OID_moveslot5	 =	852006
    constant integer	OID_moveslot6	 =	852007
    constant integer	OID_useslot1	 =	852008
    constant integer	OID_useslot2	 =	852009
    constant integer	OID_useslot3	 =	852010
    constant integer	OID_useslot4	 =	852011
    constant integer	OID_useslot5	 =	852012
    constant integer	OID_useslot6	 =	852013
    constant integer	OID_smart	 =	851971
    constant integer	OID_skillmenu	 =	852000
 
Status
Not open for further replies.
Top