• 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.

Remove Items...

Status
Not open for further replies.
Level 4
Joined
Jul 31, 2004
Messages
29
Hey everyone... I need some help with a trigger.

Event:
A Unit enters Region A

Condition:
Unit - (entering unit) is a Hero = True

Action:
Hero - Create Scroll of Townportal and give it to (triggering unit)

Well. That Works... but the Probelm is: If he enters Region A again hes getting another Scroll but i wants him to have only 1 at a Time.
 
but if the hero uses the Scroll? :S
I wants him to have 1 at a Time but not 1 in the whole game.

TWO triggers and add a condition e.g.

  • Item Create
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • ((Entering unit) is A Hero) Equal to True
      • ((Entering unit) has an item of type Scroll of Town Portal) Equal to False
    • Actions
      • Trigger - Turn off (This trigger)
      • Hero - Create Scroll of Town Portal and give it to (Entering unit)
  • Uses Scroll
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Scroll of Town Portal
    • Actions
      • Trigger - Turn on Item Create <gen>
 
Last edited:
TWO triggers and add a condition e.g.

  • Item Create
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • ((Entering unit) is A Hero) Equal to True
      • ((Entering unit) has an item of type Scroll of Town Portal) Equal to False
    • Actions
      • Trigger - Turn off (This trigger)
      • Hero - Create Scroll of Town Portal and give it to (Entering unit)
  • Uses Scroll
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Scroll of Town Portal
    • Actions
      • Trigger - Turn on Item Create <gen>

Even better, just do this
  • Item Create
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • ((Entering unit) is A Hero) Equal to True
      • ((Entering unit) has an item of type Scroll of Town Portal) Equal to False
    • Actions
Trigger - Turn off (This trigger)
  • Hero - Create Scroll of Town Portal and give it to (Entering unit)
 
Even better, just do this
  • Item Create
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • ((Entering unit) is A Hero) Equal to True
      • ((Entering unit) has an item of type Scroll of Town Portal) Equal to False
    • Actions
Trigger - Turn off (This trigger)
  • Hero - Create Scroll of Town Portal and give it to (Entering unit)

The problem with 'Trigger - Turn off (This trigger)' is that the player can have another scroll when he drop the scroll somewhere...

Shadow_Master said '1 at a time'...
 
  • Item System
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to 100
        • Then - Actions
          • Set Item = 0
          • For each (Integer Item_Slot) from 1 to 6, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item level of (Item carried by (Hero manipulating item) in slot (Item_Slot))) Equal to 1
                • Then - Actions
                  • Set Item = (Item + 1)
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Item Greater than 1
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Hero manipulating item)
              • Game - Display to (All players) the text: You can carry only one level 1 item!
            • Else - Actions
        • Else - Actions
Just set scroll level to 100 and it will work for sure!
If you want this for another item change level of that item to 100
((Item level of (Item being manipulated)) Equal to 100)

also
Item Greater than 1
Will change number of items allowed per hero!
 
Status
Not open for further replies.
Top