• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

What am I doing wrong with this?

Status
Not open for further replies.
Level 12
Joined
Dec 2, 2016
Messages
733
First question before my issues, how do you check what color a player is who triggered an event, like buying an item, unit etc.


And


I'm trying to create an item, that when you have it gives you gold each minute.

This what I have currently.



  • Buy Urn
    • Events
      • Unit - Vampire Items Merchant 0002 <gen> Sells an item (from shop)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Sold Item)) Equal to Urn of Dracula
          • (Unit-type of (Triggering unit)) Equal to Dracula
        • Then - Actions
          • Set BrownURN = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Sold Item)) Equal to Urn of Dracula
          • (Unit-type of (Triggering unit)) Equal to Dracula
        • Then - Actions
          • Set DGURN = True
        • Else - Actions

  • Urn Income Code
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BrownURN Equal to True
        • Then - Actions
          • Player - Add 25 to Player 12 (Brown) Current gold
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DGURN Equal to True
        • Then - Actions
          • Player - Add 25 to Player 11 (Dark Green) Current gold
        • Else - Actions

Doesn't seem to be working.
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
Buying unit refers to the unit, that is buying the item.
  • (Unit-type of (Buying unit)) Equal to Footman
Instead of a variable for each player, you could use an array.


You right now only check if the item is bought. Can your item be dropped?
If yes you should use acquires/loses an item.


How do you want your item to stack?
Only once per player, once per hero with the item, for each item you buy?
 
Level 11
Joined
May 16, 2016
Messages
730
I'm trying to create an item, that when you have it gives you gold each minute.
In the "PICK ITEM" trigger:
PERIODIC TIMER: Every XX sec. unit gains gold. I set 10 sec. you can increase to 60 sec.
ITEM GIVE GOLD: Each item in the hero's inventory gives xx gold. I set 1. you can set your value.
 

Attachments

  • Item gives the gold every minute.w3x
    15.3 KB · Views: 21
Status
Not open for further replies.
Top