Warcraft III resources & community, 2003–2006 · archived

Another quick question

6 posts
#1

Another quick question

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!

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
#2
use this action-type: Player - set property

should be sth like this:
Player - Set Gold of Player 1 to (Gold of Player 1 - [how much the spell costs, must be an integer])
#3
DarkShadow
Player - Set Gold of Player 1 to (Gold of Player 1 - [how much the spell costs, must be an integer])

...Um, i didn't understand that! Could you, or someone else plz give me some more information?
#4
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
#5
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!
#6
also if player 2 buys the spell this trigger wont work!


then he doesnt need it