Dealing Double Damage with a trigger

Dark_Phoenix

New Member
Reaction score
3
Code:
Critical Strikes
    Events
        Unit - A unit Is attacked
    Conditions
        ((Attacking unit) is A Hero) Equal to True
    Actions
        Set CritInteger = (Random integer number between 0 and 100)
        Set CritInteger2 = (Agility of (Attacking unit) (Include bonuses))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((CritInteger2 / 30) + 5) Less than or equal to CritInteger
            Then - Actions
                Unit - Cause (Attacking unit) to damage (Attacked unit), dealing [B](Damage taken)[/B] damage of attack type Hero and damage type Normal
            Else - Actions
                Do nothing
Probably not right.

Is there a way to have a unit deal damage equal to its normal attack to a unit in a trigger?
 

Glaivesrit

New Member
Reaction score
8
well one way to do it that works (forgive me for no WE)

Events:
Unit - A unit Is attacked
Condtions
((Attacking unit) is A Hero) Equal to True
Actions
Pick a random integer between (x and y, any values here) if number ((equal to or less than etc.)) damage (attacking unit) for X

you can also alter the dmg bonus of atts i think to try to balance it
 

Vassilev

New Member
Reaction score
39
You need to use this trigger for registering damage events.

Code:
TRIGGER NAME
    Events
        Unit - A unit Is attacked
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering unit) is in TempGroup) Equal to False
                Level of ability for Attacking unit of Critical Strike is > 0
            Then - Actions
                Unit Group - Add (Triggering unit) to TempGroup
                Trigger - Add to TRIGGER NAME 2 <gen> the event (Unit - (Triggering unit) Takes damage)
Else - Actions


Code:
TRIGGER NAME 2
Events
Conditions
Actions
 Set CritInteger = (Random integer number between 0 and 100)
        Set CritInteger2 = (Agility of (Attacking unit) (Include bonuses))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((CritInteger2 / 30) + 5) Less than or equal to CritInteger
            Then - Actions
                Unit - Cause (Attacking unit) to damage ([B]Triggering unit[/B]), dealing (Damage taken) damage of attack type Hero and damage type Normal
            Else - Actions
                Do nothing

You dont need to use attacked unit, it is a function used to call Triggering unit. This should work fine..
 

FireBladesX

Eating my wings!
Reaction score
123
You need to use this trigger for registering damage events.

Code:
 Set CritInteger = (Random integer number between 0 and 100)
        Set CritInteger2 = (Agility of (Attacking unit) (Include bonuses))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((CritInteger2 / 30) + 5) Less than or equal to CritInteger
            Then - Actions
                Unit - Cause ([COLOR="Red"]Attacking unit[/COLOR]) to damage ([B]Triggering unit[/B]), dealing (Damage taken) damage of attack type Hero and damage type Normal
            Else - Actions
                Do nothing

You dont need to use attacked unit, it is a function used to call Triggering unit. This should work fine..

Just thinking, few points:
Couldn't that potentially hit a unit multiple times? Also, I don't know if using attacking unit will work. Damage source for the event takes damage.

Also, another side note: the more agility, the less chance to crit? It balances things, I guess.
Side note # 2: Floating texts? <3
 

Vassilev

New Member
Reaction score
39
Damage source for the event takes damage.

Ah yes, that is true :p

Code:
 Set CritInteger = (Random integer number between 0 and 100)
        Set CritInteger2 = (Agility of ([B]Damage source[/B]) (Include bonuses))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((CritInteger2 / 30) + 5) Less than or equal to CritInteger
            Then - Actions
                Unit - Cause ([B]Damage source[/B]) to damage (Triggering unit), dealing (Damage taken) damage of attack type Hero and damage type Normal
            Else - Actions
                Do nothing
 

Dark_Phoenix

New Member
Reaction score
3
Just thinking, few points:
Couldn't that potentially hit a unit multiple times? Also, I don't know if using attacking unit will work. Damage source for the event takes damage.

Also, another side note: the more agility, the less chance to crit? It balances things, I guess.
Side note # 2: Floating texts? <3

Actually decided to make a different system for crit, but here it is:
Code:
Critical Strikes
    Events
        Unit - A unit Is attacked
    Conditions
        ((Attacking unit) is A Hero) Equal to True
    Actions
        Set CritInteger = (Random integer number between 0 and 100)
        Set CritInteger2 = (((Agility of (Attacking unit) (Include bonuses)) / 30) + 5)
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                If ((Item-type of (Item carried by (Attacking unit) in slot (Integer A))) Equal to Dark Orb) then do (Set CritInteger2 = (CritInteger2 + 10)) else do (Do nothing)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                CritInteger2 Greater than or equal to CritInteger
            Then - Actions
                Unit - Cause (Attacking unit) to damage (Attacked unit), dealing (Real(((((Hero level of (Attacking unit)) + (Strength of (Attacking unit) (Include bonuses))) + (Agility of (Attacking unit) (Include bonuses))) + (Intelligence of (Attacking unit) (Include bonuses))))) damage of attack type Hero and damage type Normal
                Floating Text - Create floating text that reads Critical! above (Attacked unit) 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 - Change the lifespan of (Last created floating text) to 2.00 seconds
                Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
                Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
            Else - Actions
                Do nothing

Yes floating texts<3
 

vypur85

Hibernate
Reaction score
803
Actually, it's best to use the code posted in Post#3. Damage taken event is more useful than 'A unit is attacked' event. With the code in Post#6, the event can be fired when the stop button is being spammed.

Also, it should be noted that the code in Post#3 will include spell damage.


Code:
TRIGGER NAME 2
Events
Conditions
Actions
 [B]Trigger - Turn off (This trigger)[/B]
 Set CritInteger = (Random integer number between 0 and 100)
        Set CritInteger2 = (Agility of (Attacking unit) (Include bonuses))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((CritInteger2 / 30) + 5) Less than or equal to CritInteger
            Then - Actions
                Unit - Cause (Damage source) to damage (Triggering unit), dealing (Damage taken) damage of attack type Hero and damage type Normal
            Else - Actions
 [B]Trigger - Turn on (This trigger)[/B]
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • 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 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