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

Spell Books

Status
Not open for further replies.
Level 3
Joined
Mar 2, 2008
Messages
62
set the "Share Spell Cooldown" value in the spell book ability to True. then itll automatically exit whenever any spell from it is used.
 
Level 15
Joined
Aug 18, 2007
Messages
1,390
Set mana cost to 0, and a trigger like this:

  • Gold Cost
  • Events
    • Unit - starts the effect of an abillity
  • Conditions
    • (Abillity being cast) equal to (Your abilliy)
  • Actions
    • If All conditions are true then do (then actions) else do (else actions)
      • If - Conditions
        • Player - Current gold of (Owner of (triggering unit) greater than or equal to <the gold cost of your abillity
      • Then - Actions
        • Do nothing
      • Else - Actions
        • Unit - Issue (Triggering Unit) to Stop
        • Game - Display to (Player group(Triggering Player)) the message Not enough gold for 30 seconds
 
Level 3
Joined
Apr 24, 2005
Messages
61
I'm told 'do nothing' leaks, and besides that's where you'd want whatever effects the spell should have.

Making the unit stop serves no need as far as I can see.

Lastly, color code the tool tip so that it'd be clear to the player that the spell would cost gold instead of mana.
 
Level 3
Joined
Apr 24, 2005
Messages
61
I'm thinking that he wouldn't want a regular spell to cost gold, meaning that it would probably be a spell with triggered effects, besides the gold cost, which is why the spell effects would go where do nothing is.

Also, correct me if I'm wrong, but doesn't "starts the effect of an ability" happen after the ability is cast, rendering unit - stop useless (unless the spell is channaled)?

Of course, if he just wants the spell to be regular but with a gold cost the thing you outlined would be fine.
 
Level 15
Joined
Aug 18, 2007
Messages
1,390
Lord of Sausage is right. Starts the effect of ability is possibly the best way to reference when a unit starts casting an ability. I use it all the time for triggered effects, and Lord of Sausage is really great with triggers, so you're in good hands in that regard XD.

Yay! first time someone says im good with triggers :p
have a rep for the nice comment :D
 
Level 3
Joined
Aug 1, 2007
Messages
27
Well, Lord of Sausage may be great with triggers, but he's not completely right.

If you use:
  • Events
    • Unit - A unit starts the effect of an abillity
You won't be able to avoid the unit using mana to cast the spell.

In this case, Lord of Sausage, your spell has no mana cost, but when i
reread Shendoo2's question, I couldn't find a part where he talks about
goldcost instead of manacost (tell me, if I got something wrong).

So I think you should use:
  • Events
    • Unit - A unit begins casting an ability
  • Conditions
    • Ability Comparison - (Ability being cast) equal to [your ability]
  • Actions
    • If All conditions are true then do (then actions) else do (else actions)
      • If - Conditions
        • Player - Current gold of (Owner of (triggering unit)) greater than or equal to [goldcost of your spell]
      • Then - Actions
        • Player - Add -[goldcost of your spell] to Player 1 (Red)'s Current gold
      • Else - Actions
        • Unit - Issue (Triggering Unit) to Stop
        • Game - Display to (Player group(Triggering Player)) the message Not enough gold for 30 seconds
Don't miss the " - " to negate the gold given to the owner of the casting unit.

~I3obo~
 
Last edited:
Level 21
Joined
Aug 21, 2005
Messages
3,699
I'm told 'do nothing' leaks, and besides that's where you'd want whatever effects the spell should have.

Whoever told you that must have been smoking something.

"do nothing" actually does "something", namely putting a new function on the call-stack, but nothing that affects gameplay happens. Therefor, you shouldn't use do nothing because it slows down your computer without actually doing something. But it has nothing to do with leaks.
 
Level 3
Joined
Aug 1, 2007
Messages
27
Well, here's the trigger I tested it with.

  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
  • Actions
    • Unit - Issue (Triggering Unit) to Stop
I tested all standard heroes, and every single spell applied manacost (but
not cooldown, what I never said).

And yes, there is a problem if you add a 0.01 wait.
The problem is that the hero just cast the spell normally, like he did
without the trigger.

Please guys, don't post such theories without testing them.

~I3obo~
 
Level 2
Joined
Dec 19, 2007
Messages
20
Spell Book Closing
Events
Unit - A unit Finishes casting an ability
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Spell Book) for (Triggering unit)) Greater than 0
Then - Actions
Unit - Remove Spellbook from (Triggering unit)
Unit - Add Spellbook to (Triggering unit)
Else - Actions
 
Level 3
Joined
Apr 24, 2005
Messages
61
Whoever told you that must have been smoking something.

"do nothing" actually does "something", namely putting a new function on the call-stack, but nothing that affects gameplay happens. Therefor, you shouldn't use do nothing because it slows down your computer without actually doing something. But it has nothing to do with leaks.

Thanks for clarifying it.. <3 clarifications.
 
Level 4
Joined
Jun 19, 2007
Messages
107
Uhm guys

Why the hell did someone add
  • Actions
  • Game - Display to (Player group(Triggering Player)) the message Not enough gold for 30 seconds
How do you know that? It cannot be put into the trigger because it will never be right? How do you think the trigger know how much gold he has and at what rate he gets gold. Even if you adjusted that it would still always go straight to hell, you just cant do that! Otherwise nice scripts/triggers.
 
Last edited:
Level 4
Joined
Jun 19, 2007
Messages
107
I saw the whole thing, but I just can't understand why someone added that to the end? I won't say loud what I think of that part of the trigger. I told you that the trigger as a whole was nice, but that line aint. Don't you see it?
 
Status
Not open for further replies.
Top