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

Hidden Spellbook Troubleshoot

Status
Not open for further replies.
Level 14
Joined
Oct 18, 2013
Messages
710
Can anyone help me with this spellbook ability I'm trying to trigger? I am trying to have a spellbook that has two passive abilities. The spellbook is a hero ability, primarily because I want to have the passives get stronger as the ability does. I have to triggers for this:

Sharingan
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Sharingan
Actions
Set Hero[2] = (Triggering unit)
Set BonusLevel = (Level of Sharingan for Hero[2])
Set Sharingan[2] = ((Level of Sharingan for Uchiha Avenger 0010 <gen>) x ((Random integer number between 2 and 4) + (Random integer number between 1 and (Level of Sharingan for Hero[2]))))
Set Sharingan[3] = ((Level of Sharingan for Uchiha Avenger 0010 <gen>) x ((Random integer number between 2 and 6) + (Random integer number between 2 and ((2 + (Level of Sharingan for Hero[2])) + 1))))
Trigger - Turn on Sharingan Bonus Level <gen>
Hero - Modify Strength of Hero[2]: Add (Sharingan[2] + 0)
Hero - Modify Agility of Hero[2]: Add (Sharingan[3] + 0)
Animation - Change Uchiha Avenger 0010 <gen>'s animation speed to 140.00% of its original speed
Wait 20.00 seconds
Hero - Modify Strength of Hero[2]: Subtract (Sharingan[2] + 0)
Hero - Modify Agility of Hero[2]: Subtract (Sharingan[3] + 0)
Animation - Change Uchiha Avenger 0010 <gen>'s animation speed to 100.00% of its original speed
Player - Enable Sharingan Bonus for (Owner of Uchiha Avenger 0010 <gen>)
Unit - Remove Sharingan Bonus from Hero[2]



The trigger that is turned on by this one:

Sharingan Bonus Level
Events
Time - Every 0.02 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
BonusLevel Greater than or equal to 2
Then - Actions
Unit - Increase level of Sharingan Bonus for Hero[2]
Set BonusLevel = (BonusLevel - 2)
Else - Actions
Player - Disable Sharingan Bonus for (Owner of Uchiha Avenger 0010 <gen>)
Trigger - Turn off (This trigger)
 

yip

yip

Level 3
Joined
Jan 15, 2014
Messages
69
The spellbook is a hero ability, primarily because I want to have the passives get stronger as the ability does.

Make the hero ability a dummy ability (for example, a useless 'critical strike').

Add a disabled spell book (Guide for spell books here) with your passive abilities (the ones with the actual effects) to your hero.

Have a trigger set the level of the passive abilities to the level of the dummy ability. (It can run every couple of seconds, for example. Just remember to clear the leaks)

Or at least that's what I'd do. I'm not sure if making a spell book into a hero ability works (as I haven't tested it) but I'm pretty sure it doesn't...
 
Level 14
Joined
Oct 18, 2013
Messages
710
Yeah I read that. Okay so you're saying my problem is that the spellbook is a hero ability? I have the ability that acivates the second trigger based off of berserk because I want the caster to gain a speed bonus as well.

edit: I changed it to a unit ability, didn't fix.
 
Last edited:

yip

yip

Level 3
Joined
Jan 15, 2014
Messages
69
Umm, your triggers are a little confusing to me (as to what you want to do, what abilities are based on what, etc).

Can you shed some light into EXACTLY what you want to do? Which ability is the 'Berserk' one? Is the 'Berserk' based ability a hero ability? Or the ability that turns on the spell book's passives?

Or rather, how and where exactly are you using the spellbook?
 
Level 14
Joined
Oct 18, 2013
Messages
710
Sorry, I did explain rather poorly xD Okay:
The first trigger is based off of berserk. The second trigger is turned on when Berserk is used. What I want to happen is for the second trigger to give the unit the invisible spellbook, and also to level it up so that the unit has the critical strike chance I want it to.
 

yip

yip

Level 3
Joined
Jan 15, 2014
Messages
69
I see... So I'm assuming the level of the passive abilities' (critical strike?) in the spellbook should be set to the level of the 'Berserk' ability?

In that case, add the spellbook (unit ability) to the hero when it uses Berserk, and then immediately set the ability levels of the abilities inside the book (not the spellbook itself, the spellbook's level doesn't matter) to the level of Berserk used.

You can have a timer (separate trigger) count until the buff's active time ends to remove the spellbook from the hero. You'll probably need to do some indexing if there is more than one hero with this ability in the map (So that it's MUI).

Is that what you need? I could try to make something similar as an example later if you want.
 
Level 14
Joined
Oct 18, 2013
Messages
710
Nice. and yeah that's basically it. Atm this would be the only unit that would use the ability, but i imagine i would be able to make it work if I decided to give it to another hero later on. If you could make that, that'd be pretty sweet.
 

yip

yip

Level 3
Joined
Jan 15, 2014
Messages
69
  • Berserk Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Berserk
    • Actions
      • Unit - Add Spell Book to (Triggering unit)
      • Unit - Set level of Critical Strike for (Triggering unit) to (Level of Berserk for (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BerserkerInstance Greater than or equal to 10
        • Then - Actions
          • Set BerserkerInstance = 0
        • Else - Actions
          • Set BerserkerInstance = (BerserkerInstance + 1)
      • Set BerserkUnit[BerserkerInstance] = (Triggering unit)
  • Berserk Timer
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 0 to BerserkerInstance, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BerserkTimer[(Integer A)] Greater than or equal to 20
            • Then - Actions
              • Set BerserkTimer[(Integer A)] = 0
              • Unit - Remove Spell Book from BerserkUnit[(Integer A)]
            • Else - Actions
              • Set BerserkTimer[(Integer A)] = (BerserkTimer[(Integer A)] + 1)
So something like this? I'm pretty sleep deprived but I'm almost certain this works (and is "MUI"). If not I'll take a look at it tomorrow!

Berserk would last 20 seconds in this case, and 'Critical Strike' is already in the spell book (which I'm assuming you already disabled).

Variables used:

BerserkTimer (Integer Array)
BerserkUnit (Unit Array)
BerserkerInstance (Integer)
 
Level 14
Joined
Oct 18, 2013
Messages
710
There is kind of a problem with this. The critical strike ability is inside the spellbook. Can you add hero abilities to unit spellbooks and then level them?
 

yip

yip

Level 3
Joined
Jan 15, 2014
Messages
69
Why do you need critical strike to be a hero ability? Make it a unit ability with multiple levels (they'll be set to Berserk's level when it is cast), the only hero ability you need is Berserk... Right?

Or is Berserk supposed to be a unit ability, and you want to be able to manually level up the critical strike? I don't see too much of a point in that if the crit strike is the only ability affected by Berserk that you can level up separately.

(And to answer your question, no, hero abilities don't go in spell books. If you want that, you'd have to have a dummy hero ability level up the unit ability in the spell book when it's trained.)
 
Status
Not open for further replies.
Top