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

Is it an Condition?

Status
Not open for further replies.
Well, you can do it the long way around:
Create a simple table at map init like this:

  • Init
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set ItemCount = ItemCount + 1
    • Set ItemType[ItemCount] = Wooden Staff
    • Set ItemPower[ItemCount] = 10
    • Set ItemCount = ItemCount + 1
    • Set ItemType[ItemCount] = Spell Robe
    • Set ItemPower[ItemCount] = 50
I think this is obvious... ItemCount is just an integer, ItemType is an item type (duh) and ItemPower is also an integer and it defines the spell power it gives.

Then you can use something like this when a hero acquires an item:

  • Actions
    • For each integer LoopInt from 1 to ItemCount do
      • Loop - Actions
        • If then else - Multiple conditions
          • If - Conditions
            • Item Being Manipulated = ItemType[LoopInt]
          • Then - Actions
            • Set SpellPower[Player number of (Owner of Triggering Unit)] = (SpellPower[Player number of (Owner of Triggering Unit)] + ItemPower[LoopInt])
            • Else - Actions
Okay, I did this without the world editor, I think it's about correct and it should work ^^
(you should obviously also decrease the Spell Power when the item is dropped)
 
Level 10
Joined
Jan 24, 2009
Messages
606
Well, you can do it the long way around:
Create a simple table at map init like this:

  • Init
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set ItemCount = ItemCount + 1
    • Set ItemType[ItemCount] = Wooden Staff
    • Set ItemPower[ItemCount] = 10
    • Set ItemCount = ItemCount + 1
    • Set ItemType[ItemCount] = Spell Robe
    • Set ItemPower[ItemCount] = 50
I think this is obvious... ItemCount is just an integer, ItemType is an item type (duh) and ItemPower is also an integer and it defines the spell power it gives.

Then you can use something like this when a hero acquires an item:

  • Actions
    • For each integer LoopInt from 1 to ItemCount do
      • Loop - Actions
        • If then else - Multiple conditions
          • If - Conditions
            • Item Being Manipulated = ItemType[LoopInt]
          • Then - Actions
            • Set SpellPower[Player number of (Owner of Triggering Unit)] = (SpellPower[Player number of (Owner of Triggering Unit)] + ItemPower[LoopInt])
            • Else - Actions
Okay, I did this without the world editor, I think it's about correct and it should work ^^
(you should obviously also decrease the Spell Power when the item is dropped)
Thanks:p I owe you 2:p
 
Status
Not open for further replies.
Top