1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Help me!

Discussion in 'Triggers & Scripts' started by Sclammerz, Jul 2, 2015.

  1. Sclammerz

    Sclammerz

    Joined:
    Apr 12, 2014
    Messages:
    1,707
    Resources:
    3
    Skins:
    1
    Maps:
    2
    Resources:
    3
    Hello. So, here's my problem how can I order a unit to cast a item base ability. More specifically I want a unit to cast a ability based on Scroll of Haste. Tried searching on google didn't help me much. So, help me out! :)
     
  2. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    26,189
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Only possible with direct JASS script (custom script) and must be done using order ID and not order string.
    Nestharus made this to help.
    Code (vJASS):

    library ORDER
    globals
        //strange ones at bottom
        public constant integer OFFSET=851970
       
        public constant integer absorb=852529
        public constant integer acidbomb=852662
        public constant integer acolyteharvest=852185
        public constant integer AImove=851988
        public constant integer ambush=852131
        public constant integer ancestralspirit=852490
        public constant integer ancestralspirittarget=852491
        public constant integer animatedead=852217
        public constant integer antimagicshell=852186
        public constant integer attack=851983
        public constant integer attackground=851984
        public constant integer attackonce=851985
        public constant integer attributemodskill=852576
        public constant integer auraunholy=852215
        public constant integer auravampiric=852216
        public constant integer autodispel=852132
        public constant integer autodispeloff=852134
        public constant integer autodispelon=852133
        public constant integer autoentangle=852505
        public constant integer autoentangleinstant=852506
        public constant integer autoharvestgold=852021
        public constant integer autoharvestlumber=852022
        public constant integer avatar=852086
        public constant integer avengerform=852531
        public constant integer awaken=852466
        public constant integer banish=852486
        public constant integer barkskin=852135
        public constant integer barkskinoff=852137
        public constant integer barkskinon=852136
        public constant integer battleroar=852099
        public constant integer battlestations=852099
        public constant integer bearform=852138
        public constant integer berserk=852100
        public constant integer blackarrow=852577
        public constant integer blackarrowoff=852579
        public constant integer blackarrowon=852578
        public constant integer blight=852187
        public constant integer blink=852525
        public constant integer blizzard=852089
        public constant integer bloodlust=852101
        public constant integer bloodlustoff=852103
        public constant integer bloodluston=852102
        public constant integer board=852043
        public constant integer breathoffire=852580
        public constant integer breathoffrost=852560
        public constant integer build=851994
        public constant integer burrow=852533
        public constant integer cannibalize=852188
        public constant integer carrionscarabs=852551
        public constant integer carrionscarabsinstant=852554
        public constant integer carrionscarabsoff=852553
        public constant integer carrionscarabson=852552
        public constant integer carrionswarm=852218
        public constant integer chainlightning=852119
        public constant integer channel=852600
        public constant integer charm=852581
        public constant integer chemicalrage=852663
        public constant integer cloudoffog=852473
        public constant integer clusterrockets=852652
        public constant integer coldarrows=852244
        public constant integer coldarrowstarg=852243
        public constant integer controlmagic=852474
        public constant integer corporealform=852493
        public constant integer corrosivebreath=852140
        public constant integer coupleinstant=852508
        public constant integer coupletarget=852507
        public constant integer creepanimatedead=852246
        public constant integer creepdevour=852247
        public constant integer creepheal=852248
        public constant integer creephealoff=852250
        public constant integer creephealon=852249
        public constant integer creepthunderbolt=852252
        public constant integer creepthunderclap=852253
        public constant integer cripple=852189
        public constant integer curse=852190
        public constant integer curseoff=852192
        public constant integer curseon=852191
        public constant integer cyclone=852144
        public constant integer darkconversion=852228
        public constant integer darkportal=852229
        public constant integer darkritual=852219
        public constant integer darksummoning=852220
        public constant integer deathanddecay=852221
        public constant integer deathcoil=852222
        public constant integer deathpact=852223
        public constant integer decouple=852509
        public constant integer defend=852055
        public constant integer detectaoe=852015
        public constant integer detonate=852145
        public constant integer devour=852104
        public constant integer devourmagic=852536
        public constant integer disassociate=852240
        public constant integer disenchant=852495
        public constant integer dismount=852470
        public constant integer dispel=852057
        public constant integer divineshield=852090
        public constant integer doom=852583
        public constant integer drain=852487
        public constant integer dreadlordinferno=852224
        public constant integer dropitem=852001
        public constant integer drunkenhaze=852585
        public constant integer earthquake=852121
        public constant integer eattree=852146
        public constant integer elementalfury=852586
        public constant integer ensnare=852106
        public constant integer ensnareoff=852108
        public constant integer ensnareon=852107
        public constant integer entangle=852147
        public constant integer entangleinstant=852148
        public constant integer entanglingroots=852171
        public constant integer etherealform=852496
        public constant integer evileye=852105
        public constant integer faeriefire=852149
        public constant integer faeriefireoff=852151
        public constant integer faeriefireon=852150
        public constant integer fanofknives=852526
        public constant integer farsight=852122
        public constant integer fingerofdeath=852230
        public constant integer firebolt=852231
        public constant integer flamestrike=852488
        public constant integer flamingarrows=852174
        public constant integer flamingarrowstarg=852173
        public constant integer flamingattack=852540
        public constant integer flamingattacktarg=852539
        public constant integer flare=852060
        public constant integer forceboard=852044
        public constant integer forceofnature=852176
        public constant integer forkedlightning=852586
        public constant integer freezingbreath=852195
        public constant integer frenzy=852561
        public constant integer frenzyoff=852563
        public constant integer frenzyon=852562
        public constant integer frostarmor=852225
        public constant integer frostarmoroff=852459
        public constant integer frostarmoron=852458
        public constant integer frostnova=852226
        public constant integer getitem=851981
        public constant integer gold2lumber=852233
        public constant integer grabtree=852511
        public constant integer harvest=852018
        public constant integer heal=852063
        public constant integer healingspray=852664
        public constant integer healingward=852109
        public constant integer healingwave=852501
        public constant integer healoff=852065
        public constant integer healon=852064
        public constant integer hex=852502
        public constant integer holdposition=851993
        public constant integer holybolt=852092
        public constant integer howlofterror=852588
        public constant integer humanbuild=851995
        public constant integer immolation=852177
        public constant integer impale=852555
        public constant integer incineratearrow=852670
        public constant integer incineratearrowoff=852672
        public constant integer incineratearrowon=852671
        public constant integer inferno=852232
        public constant integer innerfire=852066
        public constant integer innerfireoff=852068
        public constant integer innerfireon=852067
        public constant integer instant=852200
        public constant integer invisibility=852069
        public constant integer lavamonster=852667
        public constant integer lightningshield=852110
        public constant integer load=852046
        public constant integer loadarcher = 852142
        public constant integer loadcorpse=852050
        public constant integer loadcorpseinstant=852053
        public constant integer locustswarm=852556
        public constant integer lumber2gold=852234
        public constant integer magicdefense=852478
        public constant integer magicleash=852480
        public constant integer magicundefense=852479
        public constant integer manaburn=852179
        public constant integer manaflareoff=852513
        public constant integer manaflareon=852512
        public constant integer manashieldoff=852590
        public constant integer manashieldon=852589
        public constant integer massteleport=852093
        public constant integer mechanicalcritter=852564
        public constant integer metamorphosis=852180
        public constant integer militia=852072
        public constant integer militiaconvert=852071
        public constant integer militiaoff=852073
        public constant integer militiaunconvert=852651
        public constant integer mindrot=852565
        public constant integer mirrorimage=852123
        public constant integer monsoon=852591
        public constant integer mount=852469
        public constant integer mounthippogryph=852143
        public constant integer move=851986
        public constant integer nagabuild=852467
        public constant integer neutraldetectaoe=852023
        public constant integer neutralinteract=852566
        public constant integer neutralspell=852630
        public constant integer nightelfbuild=851997
        public constant integer orcbuild=851996
        public constant integer parasite=852601
        public constant integer parasiteoff=852603
        public constant integer parasiteon=852602
        public constant integer patrol=851990
        public constant integer phaseshift=852514
        public constant integer phaseshiftinstant=852517
        public constant integer phaseshiftoff=852516
        public constant integer phaseshifton=852515
        public constant integer phoenixfire=852481
        public constant integer phoenixmorph=852482
        public constant integer poisonarrows=852255
        public constant integer poisonarrowstarg=852254
        public constant integer polymorph=852074
        public constant integer possession=852196
        public constant integer preservation=852568
        public constant integer purge=852111
        public constant integer rainofchaos=852237
        public constant integer rainoffire=852238
        public constant integer raisedead=852197
        public constant integer raisedeadoff=852199
        public constant integer raisedeadon=852198
        public constant integer ravenform=852155
        public constant integer recharge=852157
        public constant integer rechargeoff=852159
        public constant integer rechargeon=852158
        public constant integer rejuvination=852160
        public constant integer renew=852161
        public constant integer renewoff=852163
        public constant integer renewon=852162
        public constant integer repair=852024
        public constant integer repairoff=852026
        public constant integer repairon=852025
        public constant integer replenish=852542
        public constant integer replenishlife=852545
        public constant integer replenishlifeoff=852547
        public constant integer replenishlifeon=852546
        public constant integer replenishmana=852548
        public constant integer replenishmanaoff=852550
        public constant integer replenishmanaon=852549
        public constant integer replenishoff=852544
        public constant integer replenishon=852543
        public constant integer request_hero=852239
        public constant integer requestsacrifice=852201
        public constant integer restoration=852202
        public constant integer restorationoff=852204
        public constant integer restorationon=852203
        public constant integer resumebuild=851999
        public constant integer resumeharvesting=852017
        public constant integer resurrection=852094
        public constant integer returnresources=852020
        public constant integer revenge=852241
        public constant integer revive=852039
        public constant integer roar=852164
        public constant integer robogoblin=852656
        public constant integer root=852165
        public constant integer sacrifice=852205
        public constant integer sanctuary=852569
        public constant integer scout=852181
        public constant integer selfdestruct=852040
        public constant integer selfdestructoff=852042
        public constant integer selfdestructon=852041
        public constant integer sentinel=852182
        public constant integer setrally=851980
        public constant integer shadowsight=852570
        public constant integer shadowstrike=852527
        public constant integer shockwave=852125
        public constant integer silence=852592
        public constant integer sleep=852227
        public constant integer slow=852075
        public constant integer slowoff=852077
        public constant integer slowon=852076
        public constant integer smart=851971
        public constant integer soulburn=852668
        public constant integer soulpreservation=852242
        public constant integer spellshield=852571
        public constant integer spellshieldaoe=852572
        public constant integer spellsteal=852483
        public constant integer spellstealoff=852485
        public constant integer spellstealon=852484
        public constant integer spies=852235
        public constant integer spiritlink=852499
        public constant integer spiritofvengeance=852528
        public constant integer spirittroll=852573
        public constant integer spiritwolf=852126
        public constant integer stampede=852593
        public constant integer standdown=852113
        public constant integer starfall=852183
        public constant integer stasistrap=852114
        public constant integer steal=852574
        public constant integer stomp=852127
        public constant integer stoneform=852206
        public constant integer stop=851972
        public constant integer submerge=852604
        public constant integer summonfactory=852658
        public constant integer summongrizzly=852594
        public constant integer summonphoenix=852489
        public constant integer summonquillbeast=852595
        public constant integer summonwareagle=852596
        public constant integer tankdroppilot=852079
        public constant integer tankloadpilot=852080
        public constant integer tankpilot=852081
        public constant integer taunt=852520
        public constant integer thunderbolt=852095
        public constant integer thunderclap=852096
        public constant integer tornado=852597
        public constant integer townbelloff=852083
        public constant integer townbellon=852082
        public constant integer tranquility=852184
        public constant integer transmute=852665
        public constant integer unavatar=852087
        public constant integer unavengerform=852532
        public constant integer unbearform=852139
        public constant integer unburrow=852534
        public constant integer uncoldarrows=852245
        public constant integer uncorporealform=852494
        public constant integer undeadbuild=851998
        public constant integer undefend=852056
        public constant integer undivineshield=852091
        public constant integer unetherealform=852497
        public constant integer unflamingarrows=852175
        public constant integer unflamingattack=852541
        public constant integer unholyfrenzy=852209
        public constant integer unimmolation=852178
        public constant integer unload=852047
        public constant integer unloadall=852048
        public constant integer unloadallcorpses=852054
        public constant integer unloadallinstant=852049
        public constant integer unpoisonarrows=852256
        public constant integer unravenform=852156
        public constant integer unrobogoblin=852657
        public constant integer unroot=852166
        public constant integer unstableconcoction=852500
        public constant integer unstoneform=852207
        public constant integer unsubmerge=852605
        public constant integer unsummon=852210
        public constant integer unwindwalk=852130
        public constant integer vengeance=852521
        public constant integer vengeanceinstant=852524
        public constant integer vengeanceoff=852523
        public constant integer vengeanceon=852522
        public constant integer volcano=852669
        public constant integer voodoo=852503
        public constant integer ward=852504
        public constant integer waterelemental=852097
        public constant integer wateryminion=852598
        public constant integer web=852211
        public constant integer weboff=852213
        public constant integer webon=852212
        public constant integer whirlwind=852128
        public constant integer windwalk=852129
        public constant integer wispharvest=852214
       
        public constant integer scrollofspeed=852285
        public constant integer cancel=851976
        public constant integer moveslot1=852002
        public constant integer moveslot2=852003
        public constant integer moveslot3=852004
        public constant integer moveslot4=852005
        public constant integer moveslot5=852006
        public constant integer moveslot6=852007
        public constant integer useslot1=852008
        public constant integer useslot2=852009
        public constant integer useslot3=852010
        public constant integer useslot4=852011
        public constant integer useslot5=852012
        public constant integer useslot6=852013
        public constant integer skillmenu=852000
        public constant integer stunned=851973

        public constant integer instant1=851991      //?
        public constant integer instant2=851987      //?
        public constant integer instant3=851975      //?
        public constant integer instant4=852019      //?
    endglobals
    endlibrary
     


    From that we can see...
    Code (vJASS):

        public constant integer scrollofspeed=852285
     

    Hence the custom script to issue the order.
    Code (vJASS):

    call IssueImmediateOrderById(udg_regunit, 852285)
     

    This line uses a global variable "regunit" of type unit to specify who the order is issued to. Set it before using that line of custom script in a GUI trigger.
     
  3. Sclammerz

    Sclammerz

    Joined:
    Apr 12, 2014
    Messages:
    1,707
    Resources:
    3
    Skins:
    1
    Maps:
    2
    Resources:
    3
    Many thanks. Dr. Super Good I'll try and test it out. :)
     
  4. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,638
    Resources:
    3
    Spells:
    3
    Resources:
    3
    "Hero - Use Item"
    Not working?
     
  5. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    26,189
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Not what he is after?
    To clarify. He has an item ability, made it a unit/hero ability and gave it to a unit for casting from the command card (or whatever). Order strings do not exists for such abilities.

    Wand of Illusion is a famous example where people want to create mirror images of units without going through the debuff cycle and invulnerability that Mirror Image does. If one has a dummy unit with it you cannot cast it without using an order ID. The order ID is also not immediately obvious, in fact the only way to obtain it is either through experimental testing (printing the order ID in game while manually casting from the command card) or by debugging the game code (reverse engineering).