Triggered Critical Strike

ZelNaga

New Member
Reaction score
5
Ok so I decided that I wanted to trigger Crit Strike, don't ask why Idk. So as I'm going along everything is going great till I get to the part with the text that reads off how much damage you do. I don't know what to put there for the floating text. Can anyone point me in the right direction?
 

WolfieeifloW

WEHZ Helper
Reaction score
372
You'll need a damage detection system to do this.

I'm pretty sure there's one here on TH.net, use the Search function to try and find it :) .
 

Light Alkmst

New Member
Reaction score
20
Set the Floating Text to display the Damage Dealt with the multiplier casted into a string.

BTW: With the default Critical Strike, it displays the damage with the multiplier before armor. Triggered, it will show the damage after armor.
 

ZelNaga

New Member
Reaction score
5
Ok so I don't know what I'm doing wrong. I've followed the tutorial provided and not only will the floating text not display the correct amount, but the damage also will not work. I've changed the multipier so it would do [damage delt x 1,000,000] so I know that the damage doesn't even wanna do anything. The text does however always display "0!". Help?


My Skill/Trigger (Inner Focus = Crit Strike).

Inner Focus:
The skill's based off Roar and gives you a buff that lasts for 5, 10, 15, 20, & 25 seconds.
Level 1: For a short period of time the Sniper has a 5% chance to do 1.5 times normal damage. Lasts for 5 seconds. Cooldown 40 seconds.
Level 2: For a short period of time the Sniper has a 10% chance to do 2 times normal damage. Lasts for 10 seconds. Cooldown 40 seconds.
Level 3: For a short period of time the Sniper has a 15% chance to do 2.5 times normal damage. Lasts for 15 seconds. Cooldown 40 seconds.
Level 4: For a short period of time the Sniper has a 20% chance to do 3 times normal damage. Lasts for 20 seconds. Cooldown 40 seconds.
Level 5: For a short period of time the Sniper has a 25% chance to do 3.5 times normal damage. Lasts for 25 seconds. Cooldown 40 seconds.


"DamageDealt" = Real
"Loc" = Point

Code:
Inner Focus
    Events
        Unit - A unit Is attacked
    Conditions
        ((Attacking unit) has buff Inner Focus ) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Level of Inner Focus  for (Attacking unit)) x 5) Greater than or equal to (Random integer number between 1 and 100)
            Then - Actions
                Set Loc = (Position of (Attacking unit))
                Set DamageDealt = ((Damage taken) x (1.50 + (0.50 x ((Real((Level of Inner Focus  for (Attacking unit)))) - 1.00))))
                Trigger - Turn off (This trigger)
                Unit - Cause (Attacking unit) to damage (Attacked unit), dealing (DamageDealt - (Damage taken)) damage of attack type Hero and damage type Universal
                Trigger - Turn on (This trigger)
                Floating Text - Create floating text that reads ((String((Integer(DamageDealt)))) + !) at Loc with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                Floating Text - Change (Last created floating text): Disable permanence
                Floating Text - Set the velocity of (Last created floating text) to 15.00 towards 90.00 degrees
                Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
                Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
                Custom script:   call RemoveLocation(udg_Loc)
            Else - Actions


Tutorial.
2.1 A Critical Strike Varient

Note : The Critical Strike Varient affects Spells that deal damages, and also splash attacks.

We will learn how to do a Critical Strike Varient, which has 15% chance to deal 2x to 4x damage (In real, so 2, 3 or 4x like 2,01x, 2,02x..). To do that, we will create an aura based on Brillance Aura that does nothing and has a Custom Buff called Critical Strike.

Here is the code :

Code:
Show Damages
    Events
    Conditions
    Actions
        Set loc = (Position of (Triggering unit))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Damage source) has buff Evasion ) Equal to True
            Then - Actions
                Set RandomInt = (Random real number between 2.00 and 4.00)
                -------- Damage Multiplier --------
                Set CriticalMultiplier = RandomInt
                -------- Random Percentage --------
                Set RandomReal = (Random real number between 0.00 and 100.00)
                -------- Critical Percentage --------
                Set CriticalPercentage = 15.00
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                RandomReal Less than CriticalPercentage
            Then - Actions
                -------- DamageDealt is a real which handles the whole damage dealt --------
                Set DamageDealt = ((Damage taken) x CriticalMultiplier)
                -------- Anti-Infinite Loop --------
                Trigger - Turn off (This trigger)
                Unit - Cause (Damage source) to damage (Triggering unit), dealing (DamageDealt - (Damage taken)) damage of attack type Chaos and damage type Universal
                Trigger - Turn on (This trigger)
                -------- Shows a Red Floating Text --------
                Floating Text - Create floating text that reads ((String((Integer(DamageDealt)))) + !) at loc with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
            Else - Actions
                -------- If No Critical it does a white message --------
                Floating Text - Create floating text that reads ((String((Integer(DamageDealt)))) + !) at loc with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 15.00 towards 90.00 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
 

Lyle.

New Member
Reaction score
32
You'll need a damage detection system to do this.

I'm pretty sure there's one here on TH.net, use the Search function to try and find it :) .

If he has triggered the Critical Strike he should not need a damage detection system. He should know how much he is dealing.

Set your damage to a variable before you deal it, then convert that number to a string and place it in Floating Text.

EDIT: Above Crap is late


Could you also post what the skill is suppose to do? As in damage and chance.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Triggers made at top are bad and leaks. Add chance and attacker to condition is better. The buff is bad too.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Use Damage detection system is good and put chance and ability in the trigger's condition.
 

Nexor

...
Reaction score
74
You don't have to use damage detection system, simply give a disabled spellbook with the critical strike to your hero for some seconds and set the level of the crit strike at the cast.
 

ZelNaga

New Member
Reaction score
5
You don't have to use damage detection system, simply give a disabled spellbook with the critical strike to your hero for some seconds and set the level of the crit strike at the cast.

Wouldn't that use up a slot on the inventory?
 

Sevion

The DIY Ninja
Reaction score
413
Spell book is an "ability" that holds up to 8 more abilities, so the answer to your question is "no".
 

warden13

New Member
Reaction score
32
If you really want it to trigger idk but:
For inner focus ability, you can add a normal critical strike with trigger then remove it after 30 seconds.
 

Fire-Wolf

S.P.D Smoke Pot Daily, Legalize It!
Reaction score
54
I would do what Nexor said. Make a spellbook, put the ability in it, disable it then set it to a variable, then after so many seconds remove. This wont be MUI, but I saw a way to make a MUI wait on The Hive, but you will have to look for it.
 

Light Alkmst

New Member
Reaction score
20
The event Unit is Attacked triggers at the start of the attack, not when it would hit. I'm pretty sure you would need the damage detection system as has been previously stated. There is no Generic Unit Takes Damage event. You would have to substitute with whatever trigger would run when the unit takes damage, and have another trigger that would trigger whenever a unit enters the game to add the Specific Unit Takes Damage event for that unit to the damage-based trigger.
 

ZelNaga

New Member
Reaction score
5
Light Alkmst I love you! <3

It works, sorta. The thing that seems to not be working is the damage multiplier, when it's level 5 it does not do 3.5 times normal damage as it should. Oh, another thing is it seems like after I crit once on the same target, i'll always crit on it until it's dead, is that because I didn't custom script remove DamageDealt? and if so, what do I type for removing a real?
 

jig7c

Stop reading me...-statement
Reaction score
123
you can't remove reals... you might have to setup a more random way of dealing damage...
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top