HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Adding Additional Hero Spells?

04-14-2010, 06:09 PM#1
The Druidinator
Hello everyone in the forums!
I'm working on a custom campaign that I will post here later on for feedback, but for the moment I'm wondering if it's possible to add extra spells to a Hero unit, in midgame. Not as in make it learn an existing skill, but adding something new through triggers.
This is part of my plan for the map, but after a little triggering around I'm unsure if it can be done. What I am looking for is to remove one of the 4 original ones by buying an using an item, that also teaches a new spell to replace the old one. In that way, you would be able to have 8 spells in total, but a visit to a shop would be needed to swap, giving the player a tactical choice and flexibility. Also, a Tome of Retraining is for sale to simplify things.
A second solution that I've though of would be using Robo-Goblin, adding a second Hero form. But that would give a new dimension of balancing cooldowns on the transform (imagine switching around and using two Ultimates in a row).

Also, as a second issue, I am trying to create a passive spell that would add a stacking attack speed buff to the Hero that would ultimately turn into a flurry of blows. What I can't seem to get working though, is how to make it proc to start off. As I use Bash as a base, GUI doesn't register it as an Ability Being Cast. I thought of using a randomly generated % for it, but then it would need to check if the Hero has the passive spell, and I can't seem to find a way to check it.
I would be very grateful for help on any of my two issues, it would be a great help. Thank you on forehand!
04-14-2010, 06:29 PM#2
Rao Dao Zao
As far as I'm aware, you can't hot-swap hero abilities like that.

The closest you can get is using Engineering Upgrade to let the player choose an initial skill-set, by using it on Channel-based dummy abilities with the same number of levels; you just add the Engineering Upgrade ability and then disable it.

The problem is that when changing the abilities, Engineering Upgrade doesn't seem to update some properties (or something like that), so if you try to hot-swap two completely different abilities then you'll get a horrible mish-mash of both. Channel can only be swapped for any ability because it's special; otherwise you can only interchange versions of the same ability just like the original ability intends.

Or you could do magic with spell-books if they don't have to be proper hero abilities, but I', not familiar with spell-book-related buggery.

For your second problem, you could try an Orb ability causing an auto-cast of some dummy ability you can have an event for.
04-14-2010, 06:29 PM#3
Michael Peppers
For the second one use a periodic timer that checks if the hero has that skill and at which level it is, then add a skill based on the Gloves of Speed item ability, with multiple levels to increase the attack speed bonus.
Probably you already know that there's an hardcoded limit to how much fast attacks can be.

Cheers.


Nevermind, I misunderstood the question. =P
04-14-2010, 06:55 PM#4
Anitarf
The second ability is tricky, since it requires you to increase attack speed in increments and remove the bonus after a certain duration. I would use DamageEvent to detect when attacks hit, then use BonusMod to increase the attack speed gradually with each attack. Then I would keep a timer running for each unit with this ability activated that would get reset whenever the unit dealt damage, but if it wasn't reset on time and expired then the attack speed bonus would be removed from the unit. Of course, the easiest way to tie all this together is with a vJass struct which I would have to associate with the unit in some way.
04-19-2010, 06:26 AM#5
The Druidinator
To start off with, I'm really thankfull to all those who took time to help me, I actually didn't expect help that fast. Been gone for a couple days due to heavy school work though.

On the front of switching Hero skills in midgame, I think I'm dropping it or saving it for last, as it's a bit too advanced for me. I though of using spell books, yes, but they only have one rank of an ability and you need o be constantly carrying around the item.

On the proc-based spell, I found a way to work around my problems. I can truthfully confess that vJass is something I've never been able to grasp, I'm a GUIer. Using an Orb ability though didn't seem to work (I take it you pointed to Orb of Annihilation or something along those lines, at least that was what I tried). So I created a trigger that activates when the spell is learned, that gives a 20% chance when the unit who has the spell (it doesn't check for that though, it simply checks for Hero unit type) and spawns a dummy unit with a 10 sec expiration. It also then buffs the Hero, and on the way counts all of these dummies owned (Charges for the ability) and then gives a proper rank of 6 versions of Bloodlust. Will post the trigger once I can get acces to my map again.
04-19-2010, 11:47 AM#6
Michael Peppers
To know if a hero/unit has a passive ability, just check if that ability's level is different from 0.
04-25-2010, 08:23 PM#7
The Druidinator
As this post has pretty much served its purpose, I just felt like posting the trigger I used to solve my problem, and to see if you people think there are ways to improve it (besides the obvious, such as that if the unit with hthe buff has the buff dispelled, the Charge count doesn't reset, and that it currently only has one rank). The Attacking unit in the trigger, the Underworld Rager, is the unit who has the ability.

Trigger:
Unyelding Rage
Collapse Events
Unit - A unit Is attacked
Collapse Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
(Unit-type of (Attacking unit)) Equal to Underworld Rager
(Owner of (Attacked unit)) Not equal to Player 1 (Red)
(Owner of (Attacked unit)) Not equal to Player 3 (Teal)
(Random percentage) Greater than or equal to 75.00
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
RageCharge Equal to 3.00
Collapse Then - Actions
Unit - Remove Unyelding Rage (Dummy) buff from (Attacking unit)
Unit - Create 1 Dummy Caster for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Unit - Add Rage 4 (Dummy) to (Last created unit)
Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Attacking unit)
Unit - Create 1 Unyelding Rage Charge for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees
Unit - Add a 12.00 second Generic expiration timer to (Last created unit)
Trigger - Turn off (This trigger)
Wait 2.50 seconds
Trigger - Turn on (This trigger)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
RageCharge Equal to 2.00
Collapse Then - Actions
Set RageCharge = 3.00
Unit - Remove Unyelding Rage (Dummy) buff from (Attacking unit)
Unit - Create 1 Dummy Caster for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Unit - Add Rage 3 (Dummy) to (Last created unit)
Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Attacking unit)
Unit - Create 1 Unyelding Rage Charge for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees
Unit - Add a 12.00 second Generic expiration timer to (Last created unit)
Trigger - Turn off (This trigger)
Wait 2.50 seconds
Trigger - Turn on (This trigger)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
RageCharge Equal to 1.00
Collapse Then - Actions
Set RageCharge = 2.00
Unit - Remove Unyelding Rage (Dummy) buff from (Attacking unit)
Unit - Create 1 Dummy Caster for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Unit - Add Rage 2 (Dummy) to (Last created unit)
Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Attacking unit)
Unit - Create 1 Unyelding Rage Charge for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees
Unit - Add a 12.00 second Generic expiration timer to (Last created unit)
Trigger - Turn off (This trigger)
Wait 2.50 seconds
Trigger - Turn on (This trigger)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
RageCharge Equal to 0.00
Collapse Then - Actions
Set RageCharge = 1.00
Unit - Remove Unyelding Rage (Dummy) buff from (Attacking unit)
Unit - Create 1 Dummy Caster for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Unit - Add Rage 1 (Dummy) to (Last created unit)
Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Attacking unit)
Unit - Create 1 Unyelding Rage Charge for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees
Unit - Add a 12.00 second Generic expiration timer to (Last created unit)
Trigger - Turn off (This trigger)
Wait 2.50 seconds
Trigger - Turn on (This trigger)
Collapse Else - Actions
Do nothing

And this one controls the lasting of the buff:
Trigger:
Rage Decay
Collapse Events
Unit - A unit Dies
Collapse Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
(Unit-type of (Dying unit)) Equal to Unyelding Rage Charge
(Number of living Unyelding Rage Charge units owned by (Owner of (Dying unit))) Equal to 1
Collapse Actions
Set RageCharge = 0.00

And this one enables the ability trigger once learned. I know, a little unsofisticated, but it works by my current standards.

Trigger:
Rage Activation
Collapse Events
Unit - A unit Learns a skill
Collapse Conditions
(Learned Hero Skill) Equal to Unyelding Rage
Collapse Actions
Trigger - Turn on Unyelding Rage <gen>
Trigger - Turn on Rage Deactivation <gen>
Trigger - Turn off (This trigger)