• 🏆 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!

Another quick question

Status
Not open for further replies.
Level 8
Joined
Jul 3, 2004
Messages
404
In this trigger a player buys a spell. But the spell costs money. So how do i do this???
This is how the trigger looks like right now!

Code:
Avatar
    Events
        Dialog - A dialog button is clicked for Human_Spell_Next
    Conditions
        (Clicked dialog button) Equal to Avatar
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering player) Equal to Player 1 (Red)
            Then - Actions
                Unit - Add Blizzard to HeroPlayer_1
            Else - Actions
 
Level 13
Joined
May 5, 2004
Messages
1,330
btw made a mistake, use this action, much easier

To your "Then-Actions", you add a trigger called "Player - Add Property" (simply search the list for it)
You can select which property you wanna add, e.g. add a specific value to the players current gold.

Should look like this:

Player - Add 200 to player 1's current gold
 
Level 8
Joined
Jul 9, 2004
Messages
405
Player - Set Gold of Player 1 to (Gold of Player 1 - [how much the spell costs, must be an integer])

say the book costed 250 gold? it would look like this:

Player -
Set Gold of Player 1 to (Gold of Player 1 - 250)

say u have 500 gold? then simpler would be this

Player -
Set gold of player 1 to 500 - 250 = 250

when he said [how much spell cost blah blah] he mainly just meant the cost of the spell eg. 250 really easy to understand once u get used to it

also if player 2 buys the spell this trigger wont work!
 
Status
Not open for further replies.
Top