Using powerups with normal units

warden13

New Member
Reaction score
32
Hello. How to make normal units use powerups? Currently, only heroes can use them. Thanks.
 

warden13

New Member
Reaction score
32
They have an inventory. When you try to use you get an error like : unable to use powerups.
 

Justice

New Member
Reaction score
5
No no he tries to say "when i try to use the item, message appears "unable to use powerups"
 

Faust

You can change this now in User CP.
Reaction score
123
Needs a few custom script lines:

Trigger:
  • Custom Script: if UnitAddAbility(<Your Unit>, '<rawcode of the ability called inventory>') == true then
    • GUI: Add whatever item to your unit
    • Custom Script: UnitRemoveAbility(<Your Unit>, '<rawcode of the ability called inventory>')
    • Custom Script: else
    • GUI: Add whatever item to your unit
    • Custom Script: endif


It adds inventory to a unit, and doesn't remove it from a unit that already has it.
The inventory ability must let the unit use powerups
 

Justice

New Member
Reaction score
5
Let me i'll show you

Trigger:
  • Mana Crystal
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to |cFF008000Mana Crystal|r
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has an item of type Gloves of the Magi) Equal to True
          • ((Triggering unit) has an item of type Circlet of Nobility) Equal to True
        • Then - Actions
          • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdl
          • Item - Remove (Item carried by (Triggering unit) of type Gloves of the Magi)
          • Item - Remove (Item carried by (Triggering unit) of type Circlet of Nobility)
          • Hero - Create Mana Crystal and give it to (Triggering unit)
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: |cffff0000You don't...
          • Player - Add 1300 to (Triggering player) Current gold


Non-Hero units must run this trigger.
Trigger:
  • (Item-type of (Item being manipulated)) Equal to |cFF008000Mana Crystal|r
This item have a powerup ability with "use automatically when acquired"
 

warden13

New Member
Reaction score
32
In my map, all items are powerups. So you can buy them even if your inventory is full. Basically if you buy Claws of Attack PowerUp, It adds you Claws of attack item. But it does not work with carrier units.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top