HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

A problem with Critical Strike... I can do this in other manner?

05-23-2006, 11:20 PM#1
GALLED
Hello everybody

I'm trying to make a spell called "Deadly Charge", with drukenhaze of base spell. The spell makes the casters twice his movespeed and order him to attack the target, when the caster attack the target (once only) deal a critical strike (2/2.75/3.5/4.25). So the spell is:


Charge
Code:
Events 

Unit - Units starts the effect of an ability

Conditions

Ability being cast equal to Deadly Charge

Actions

Unit Group - Add Casting unit to ChargersGroup
Unit - Add Critical Strike (Dummy) to casting unit
Unit - Set level of Critical Strike (Dumy) to level of Deadly Charge of Casting unit
Unit - Add SpeedburstAbility(Dummy) to casting unit
Unit - Add specialeffect(dummy) to casting unit
Unit - Order casting unit to attack target unit being cast
Trigger - Turn on ChargeChange <gen>
Trigger - Turn on ChargeStop <gen>

ChargeChange
Code:
Events:
Unit is issued order with target a object

Conditions:
Ordered unit is in ChargersGroup is true
Issued order Not equal to Order(attack) or Issued order Not equal to Order(drunkenhaze)

Actions
Unit - Remove Critical Strike (Dummy) to casting unit
Unit - Remove SpeedburstAbility(Dummy) to casting unit
Unit - Remove specialeffect(dummy) to casting unit
Unit Group - Remove Casting unit to ChargersGroup

ChargeStop
Code:
Events:
Unit is attacked

Conditions:
Attacking unit is in ChargersGroup is true

Actions
Wait 1.50 seconds
Unit - Remove Critical Strike (Dummy) to casting unit
Unit - Remove SpeedburstAbility(Dummy) to casting unit
Unit - Remove specialeffect(dummy) to casting unit
Unit Group - Remove Casting unit to ChargersGroup

Well the spell works the first time, but the next times only add SpeedburstAbility(Dummy). What happens? Somebody can help me?

Thanks in advance.
05-23-2006, 11:34 PM#2
st33m
Why dont you just have the trigger ChargeChange with no events and just make it run it instead of that. I think that might work better, but I'm not sure. Other than that, I have no idea.
05-24-2006, 12:12 AM#3
Rising_Dusk
Personally, I would simulate the entire thing.
I would cause the caster to run to the target unit, then pause it, play the attack slam animation, create the critical strike text tag, detect his base damage, multiply it by a factor and deal it to the target.

That probably sounded like a bunch of mumbo jumbo, though.
Let me clarify.

Trigger:
Deadly Charge
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to DeadlyCharge
Collapse Actions
Set DeadlyChargeCaster = (Casting unit)
Set DeadlyChargeTarget = (Target unit of ability being cast)
Selection - Remove DeadlyChargeCaster from selection for (Owner of DeadlyChargeCaster)
Custom script: call UnitAddAbility(udg_DeadlyChargeCaster, 'Aloc')
Unit - Order DeadlyChargeCaster to Attack DeadlyChargeTarget

Then the other periodic trigger...
Trigger:
Deadly Charge Finisher
Collapse Events
Time - Every 0.10 seconds of game time
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Distance between (Position of DeadlyChargeCaster) and (Position of DeadlyChargeTarget)) Less than or equal to 50.00
(DeadlyChargeTarget is dead) Equal to True
Collapse Actions
Unit - Pause DeadlyChargeCaster
Animation - Play DeadlyChargeCaster's attack slam animation
Floating Text - Create floating text that reads (|cffcc0000 + ((String(WhateverDamage)) + |r)) at (Position of DeadlyChargeCaster) with Z offset WhateverHeight, using font size 10.00, color (WhateverRed%, WhateverBlue%, WhateverGreen%), and 0.00% transparency
-------- Do Some Other Text Tag Stuff --------
Unit - Cause DeadlyChargeCaster to damage DeadlyChargeTarget, dealing WhateverDamage damage of attack type Hero and damage type Normal
Custom script: call UnitRemoveAbility(udg_DeadlyChargeCaster, 'Aloc')
Set DeadlyChargeCaster = No unit
Set DeadlyChargeTarget = No unit

I really don't know the values for the critical strike text tag offhand, but you can find it in the MiscData file or by asking around.
Also, there are other things you'd need to set for the text tag that I didn't include (Doing it in jass would be easier!!).

You'll also notice I didn't include the damage. You can detect a hero's damage simply by getting the average of it's base damage and adding based on primary attribute; if you want you can detect damage boosting items too.

There would be lots of ways to optimize it, I just figured I'd give you a rough outline of a method you could use to make the spell. ^_^

But yeah, that's mostly it.
05-24-2006, 12:21 AM#4
GALLED
Thanks!!!

But i dont understand these part of the detect the damage of the hero (or unit, i want to make this MUI) with items and auras and so on.

And... "Aloc" are my Speedburst and specialeffect abilities???

Hmmm and in JASS, how i can do this in JASS??
05-24-2006, 01:46 AM#5
Kingtofu
Quote:
Originally Posted by GALLED
Thanks!!!

But i dont understand these part of the detect the damage of the hero (or unit, i want to make this MUI) with items and auras and so on.

And... "Aloc" are my Speedburst and specialeffect abilities???

Hmmm and in JASS, how i can do this in JASS??

Assuming his triggers work, just convert it to custom text.
05-24-2006, 02:31 AM#6
Rising_Dusk
My triggers would work, but I just threw in random variables, I didn't actually calculate anything.

And do note that the way I wrote it was the way I see it being done (Which is identical to your method save the execution).

'Aloc' is the locust ability.
I stuck that on there so you couldn't order the caster to do anything else while he's running to the target.
There are other ways, sure, but I felt it would have a nice flow effect this way.

Also, do note the way I did it I didn't even add critical strike to the caster hero.
To add special effects you would just do...
Special Effect - Add Special Effect <string> to unit <unit>
Special Effect - Destroy (last created special effect)

Also, I'm guessing MUI means Multi Instanceable, in which case I would do it in jass.
Jass would look a lot different, would work better, but would require you to understand what's going on.

If you'd like some help with the jass, try writing it and then I'll check it over for you.
Personally, it does noone any good if someone writes the code for a spell for you and you don't understand what's going on in it.
So yeah.
05-24-2006, 01:48 PM#7
Soultaker
You should know that you can't remove 'Aloc', so that would cause the hero to be unselectable, untargetable and invulnerable after the first use of the ability.

Btw. You don't have to use Custom Script to add/remove 'Aloc', you can just take the ability 'Locust'.

- Soultaker
05-24-2006, 02:56 PM#8
The)TideHunter(
Aloc is removable by pausing and unpausing the unit that has the ability.
Pausing and unpausing resets the unit, it will be exactly the same as it started of as

EDIT: Please use trigger tags and not code tags for triggers GALLED
05-25-2006, 04:11 AM#9
GALLED
Ok sorry.

Mmmm how i can damage the target with the attack of the caster in "whateverdamage" to simulate the critical strike ability???
05-25-2006, 07:06 AM#10
The)TideHunter(
Trigger:
Unit - Cause (Some Unit) to damage (Some Unit), dealing (Some Damage) of attack type Meele and damage type Normal
05-25-2006, 10:24 PM#11
GALLED
Yep, but this damage is a valor that i will put?

I want that the casters damages the target with this attack damage.
05-26-2006, 08:02 AM#12
Rising_Dusk
Quote:
Btw. You don't have to use Custom Script to add/remove 'Aloc', you can just take the ability 'Locust'.

Just to make a note on that...
In GUI, you are not allowed to add 'Locust' with the...

Unit - Add Ability

...function. For some reason it simply does not ever show up in the provided list when you attempt to add it.
That's why I used jass to add it, since well... You can.

And yes, with regards to what Tide posted, you can use a variable for that damage.