| 07-04-2004, 05:56 PM | #1 |
The core of the spell that I'm trying to create is this: Make critical strike a clickable and targetable ability. I've tried to do it in two ways. Number one, I made a dummy spell for my hero, and when my hero casts that spell, I give him the critical strike ability, and order him to attack once the target of the ability being cast. For some reason, it didn't work. So I tried number two. When the spell is cast, I create a dummy unit, and ask the dummy unit to attack once the target of the ability being cast. Again, no luck. I've been trying to figure it out by myself, but I just can't seem to get it to work. Well, what can I say, my kung fu is not powerful. I've tried searching up relevant topics too, but all I can get is how to detect critical strike, and even then people seemed to talk a lot more about bash rather than critical strike. I mean, bash is simpler, because you can order a dummy unit to stormbolt the target. But you can't exactly order a dummy unit to critical strike a unit. Can anyone help out? |
| 07-04-2004, 06:24 PM | #2 |
Since u want a unit 2 appear thats selectable when u use the ability, i would base the ability off of the infernal ability, then delete the model art of the rock comming down and u could also add a death timer on the made unit with this ability, so then u use it and make the infernal or whatever unit is being created from the ability have a really high attack, then u make its aquasiotion range big so it can target from a long distance, then when u create it it would appear and then the unit would aquire its target and go attack and kill it in 1 hit. |
| 07-04-2004, 06:36 PM | #3 |
No no, the gist of my spell is not killing a unit with one hit. It is doing a critical strike to the target of the spell. And I don't want to create another unit that is selectable. I just want my hero to do it himself. The dummy unit that I mentioned in my attempt is just that, a dummy unit, a means to an end. |
| 07-04-2004, 11:57 PM | #4 |
I would do this: You need 4 triggers. The first goes of when your hero is ordered to use the critical strike spell. It adds a custom buff to the hero (Either using triggers or by getting a dummy unit to cast on the hero). At the same time, the crit strike ability is added to the hero. The second trigger cancels the buff and crit strike ability if the hero is ordered to do anything between the time the order is issued and he hits his target. The third trigger removes the buff when the hero attacks the 1st time. The fourth trigger removes the crit strike ability. The buff is used to check if the hero has already attacked one unit. Complicated and can screw up if your unit gets debuffed halfway through, but you could always write in the same thing with variables. |
| 07-05-2004, 08:29 AM | #5 |
Attacks are a difficult thing to work with, because the "takes damage" event is not a generic unit event, and I'm not even sure it has an event response "damaging unit". All you can really work with then are "unit is attacked" things, but those happen when the attack begins, not when it connects with the target. My workaround for this, which worked for the type of spells I was doing but could apply to yours as well, is using attack-based buff abilities (like cold arrows, orb of venom...) They leave a buff behind, and you can use a periodic trigger to keep checking (a few dozen times per second), when the target unit gets that buff, and that way you get a quite accurate time of when damage was dealt. So, when your hero cast the spell ("starts the effect of an ability"), give him a 100% critical strike and a buff-on-attack-giving ability that has no other effect than leaving a buff for a small ammount of time, store the target unit of ability to a variable, order the hero to attack the unit, and activate the periodic trigger that checks the unit stored in the variable for the buff. When the unit has the buff, you know the hero succesfully attacked it, so you can now remove the critical strike and the buff-ability from the hero and turn off the periodic trigger. You need an additional trigger that removes the critical strike if the hero is given another order. |
| 07-05-2004, 10:53 AM | #6 |
Ok, that's pretty complicated. I'll try and see if I can figure it out. |
| 07-05-2004, 01:26 PM | #7 |
I wouldn't advise anyone to have that many periodic triggers checking for buffs. I mean if you're gonna go that far you might aswell just use variables for the whole thing. |
| 07-05-2004, 01:45 PM | #8 |
Clearly, to get an accurate effect, the casting unit must have the critical strike until damage is dealt, and then the critical strike must be removed. The only way to determine accurately when damage is dealt by a specific unit is, to my knowledge, with the method I described. (it is a lot simpler detecting damage done to a specific unit, in that case just use "unit takes damage") Even my method is not momentarily accurate, but only to the margin of the frequency of the periodic trigger. You could do things by estimation, of course; just removing the critical strike after some time, which is estimated to be long enough for the hero to attack, and short enough for the hero not to attack twice. The problem with this is that there are sooo many factors, the movement of the target unit, attack/move speed buffs/debufs, agility-tome crazy hero,... that you are bound to get a failure of the system, either by the hero not being in time to do the critical attack, or by him doing multiple attacks before the critical ability is removed. I have just remembered another important thing, Ez8, if you are doing things with the attack-based buff, there's something you must know: the game does not keep track of buffs on dead units, this means that the periodic trigger will not detect that the unit has been hit by the hero if the unit dies when it's hit. That means that the trigger would consider that the hero is still trying to get to the unit, altrough he would have already dealt the attack by then. This is easily fixed: the periodic trigger must just, besides checking if the unit has the buff, also check if the unit is dead, and in each of these cases, remove the critical strike from the hero. |
| 07-05-2004, 02:25 PM | #9 |
Well, I'm stuffed in more ways than one. >_< I can't even add the critical strike ability to my hero. I'm using this simple trigger for now: Events Unit - Test Hero Begins casting an ability Conditions (Ability being cast) Equal to Critical Blow (Archimonde) Actions Unit - Add Critical Blow Level 1 to Test Hero Test Hero = My hero Critical Blow (Archimonde) = A dummy spell I made, based on Finger of Death, with damage set to 0 Critical Blow Level 1 = Modified Critical Strike. Set to unit ability, percentage chance set to 80%, damage multiplier set to 100, and level set to 1. What the trigger should is when the dummy spell is casted, the modified critcal strike is added to my test hero. But it doesn't even do that. When I cast that spell, nothing happanes. Well, you can see the graphic for FoD, because I didn't remove that, but other than that, nothing else happens. Before I worry about how to detect and remove the critical strike, I first need to be able to ask my hero to do it. And I'm stuck. Where did I go wrong? |
| 07-05-2004, 11:59 PM | #10 |
Since I'm testing this for my own purposes anyways, heres a test map with a working system. You will need the latest version of WEU to do this. This is doen with just two triggers, 1 variable 2 spells and a total of about 10 actions/events/conditions. Was simpler than I thought. This system is slightly buggy though, for one you need an empty skill slot for the crit strike. Superficial, but important. This can be remedied by using buffs instead of a skill to do the special damage. The other thing is that I have not factored in mana cost yet, but that's simple as adding an extra condition and action to the 2nd trigger. Finally there is one thing I cannot solve. After you have crit striked a unit, the next time the hero attacks it will still play the attack,slam animation though the crit strike damage will be gone. Short of simply using units without the attack,slam animation, I don't know how to prevent this. Oh btw, this system is multi-instanceable as long as each player only has 1 unit with the ability. |
| 07-06-2004, 01:37 AM | #11 |
A use an alternative method for this type of thing. Its has a few drawbacks thoguht. 1.it doesnt show the pretty critical strike numbers, but someone else may be able to add that. 2. its not a true double but its like the unit attacked twice 3. you need to use the starting damage of the unit who has the ability as well as the primary attribute and its starting value What I do is make a unit targeting ability with a range of 1, and have it play the attack animation. Then when the spell effect begins I deal damage to the unit. I use Lord Vexorians caster system so it works with bounty. To deal double damage I use the same forumla that blizzard uses. You can find out what it is in the global constants Damage per strength point*primary attibute points(including bonuses) + Random number from units starting min damage to units starting max damage. To have the extra damage happen at the correct time use a wait of the units agility(including bonuses*attack speed bonus per agility. This makes the damage done at pretty close to the same time the unit hits. |
| 07-06-2004, 09:12 AM | #12 |
This is all very confusing. Let me see if I can work something out. |
| 07-07-2004, 02:51 AM | #13 |
I can't even get the basic trigger to fire. Events Unit - Test Hero 0160 <gen> Starts the effect of an ability Conditions (Ability being cast) Equal to critical blow Actions Set CritDamage = (2.00 x (Real((Agility of Test Hero 0160 <gen> (Include bonuses))))) Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) - CritDamage) Can anyone spot what's wrong? |
| 07-07-2004, 09:44 AM | #14 |
couldnt you just have the dummy spell be clickable such as innerfire and change it to the critical strike icon. Then when the spell is cast Event- unit begins casting an ability order the striking unit to attack the targeted unit, after giving him an 100 percent chance critical strike and taking it away after the unit is hit? Event-unit takes damage basicly. Oh and whats wrong is I dont believe its the effect of an ability it begins casting an ability. |
| 07-07-2004, 02:31 PM | #15 |
Miningjrk, you described the exact same methods that were suggested earlier. As for your last sentence, it's worng, "starts the effect of an ability" is exactly the kind of event that we use for this. Ez8, the trigger seems absolutely OK, and your previous triggers were probably ok as well, because I think the problem may be somewhere else. First tell us what spell did you base "critical blow" on? Is it maybe on some autocast ability like searing arrows? If not, if it's based on a regular activated ability, then the only possible reason for it not to work I see is that you have made more "critical blow" abilities and the on on your hero is not the one you reference in your triggers. |
