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

What ability has a gold cost?

Status
Not open for further replies.
Level 3
Joined
Aug 23, 2008
Messages
16
graystuff111, that wasn't really an appropriate answer. :/ Try being a bit less unfriendly... Boosting your post count this way might get your posts simply reseted :S

Repair is an ability that costs gold and lumber in a certain percentage but also Charge Gold and Lumber works too.

The best way is to trigger it as some abilities might not work that way, if you want to create an ability with gold cost.

If you want a spell to actually cost gold, you should tell about the gold cost in the item's description.

To do the triggering of the spell, create an integer variable named as "gold". Then create the following two triggers:

When casting it:
  • Untitled Trigger 002
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to YOUR SPELL
    • Actions
      • Set gold = (Player 1 (Red) Current gold)
      • Player - Set Player 1 (Red) Current gold to (gold - 100)
And a simple check so if the player has less then 100 (or X) gold, then just disable the ability for the player, or re-enable it if he has it above 100.

Dissable
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red)'s Current gold becomes Less than 100.00
    • Conditions
    • Actions
      • Player - Disable SPELL NAME for Player 1 (Red)
Enable:
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red)'s Current gold becomes Greater than or equal to 100.00
    • Conditions
    • Actions
      • Player - Enable SPELL NAME for Player 1 (Red)

EDIT: Ahh, you found it already. Well still, I've explained the gold cost thing for custom spells too :) Cheers
 
Level 3
Joined
Aug 23, 2008
Messages
16
Yea, figured that you did :p I edited my post above :p see? :D
You're lucky to know vJass. I can just terrain and do some gui... foo :<
 
Status
Not open for further replies.
Top