| 04-14-2010, 06:09 PM | #1 |
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 |
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 |
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 |
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 |
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 |
To know if a hero/unit has a passive ability, just check if that ability's level is different from 0. |
