Causing random damage /w random type

Lumograph090

New Member
Reaction score
22
I'm currently working on a hero called Lady Luck, all spells and abilities will be random. They will cause random damage, random buffs/debuffs, affects, etc.

I'm working on one of my spells and I'm just wondering if its possible to use multiple
Trigger:
  • (Random integer number between 1 and 6) Equal to (==) X
in the same ability.

For example this spell is called "Roll of the Dice"

Lady Luck tries her hand at damaging a single target. Rolling her dice and causing damage based on the roll. Damage caused and damage type is based on the outcome of the roll.

Rank 1 - Causes 50 - 125 damage.

Rank 2 - Causes 75 - 225 damage.

Rank 3 - Causes 100 - 325 damage.

Rank 4 - Causes 125 - 425 damage.

Rank 5 - Causes 150 - 525 damage.
Damage type inflicted can be Siege, Normal, Pierce, Magic, Hero, and Chaos.

Here is what I have so far in my Trigger...

Trigger:
  • Roll of the Dice Rank 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Roll of the Dice
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 6) Equal to (==) 1
        • Then - Actions
          • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between 50.00 and 125.00) damage of attack type Normal and damage type Shadow Strike
          • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 6) Equal to (==) 2
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between 50.00 and 125.00) damage of attack type Pierce and damage type Shadow Strike
              • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 6) Equal to (==) 3
                • Then - Actions
                  • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between 50.00 and 125.00) damage of attack type Siege and damage type Shadow Strike
                  • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Random integer number between 1 and 6) Equal to (==) 4
                    • Then - Actions
                      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between 50.00 and 125.00) damage of attack type Magic and damage type Shadow Strike
                      • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Random integer number between 1 and 6) Equal to (==) 5
                        • Then - Actions
                          • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between 50.00 and 125.00) damage of attack type Chaos and damage type Shadow Strike
                          • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
                          • Special Effect - Destroy (Last created special effect)
                        • Else - Actions
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Random integer number between 1 and 6) Equal to (==) 6
                            • Then - Actions
                              • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between 50.00 and 125.00) damage of attack type Hero and damage type Shadow Strike
                              • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
                              • Special Effect - Destroy (Last created special effect)
                            • Else - Actions


Now as far as causing random damage /w a random damage type is easy. But what I'm not quite able to grasp is how to in a single Trigger have a random chance to cause the random damage as well as choose which damage type will be used... Normal, Siege, Hero, Pierce, Magic, Chaos.

Any help would be appreciated =)
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Yes multiple randoms works and just store attack types in a variable with a random int and the damage just use a random int
 

Lumograph090

New Member
Reaction score
22
Yes multiple randoms works and just store attack types in a variable with a random int and the damage just use a random int

1) Would what I have in my OP work correctly? 2) Would you be willing to give me an example of what you're saying? Including what my Variable would look like, etc. :D
 

Sui-cookie

You can change this now in User CP.
Reaction score
49
o_O seems like a stretch... can you just use two simple things?

setting "tempinteger[1]" to a random number of the damage range you want, then setting "tempinteger[2]" to a random number of kinds of attacks there is... each kind of attack with a dummy unit... then increase the attack of the dummy unit by "tempinteger[1]" ? :confused: then making the dummy unit attack the target of spell
 

Lumograph090

New Member
Reaction score
22
o_O seems like a stretch... can you just use two simple things?

setting "tempinteger[1]" to a random number of the damage range you want, then setting "tempinteger[2]" to a random number of kinds of attacks there is... each kind of attack with a dummy unit... then increase the attack of the dummy unit by "tempinteger[1]" ? :confused: then making the dummy unit attack the target of spell

Well, I don't need to use dummy units when I can use
Trigger:
  • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between 50.00 and 125.00) damage of attack type X and damage type Shadow Strike
 

Lumograph090

New Member
Reaction score
22
Well, I don't need to use dummy units when I can use
Trigger:
  • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between 50.00 and 125.00) damage of attack type X and damage type Shadow Strike

bump for answers :banghead:
 

Komaqtion

You can change this now in User CP.
Reaction score
469
I think this should suit your needs:
Trigger:
  • Random Stuff
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Random_Damage[1] = Chaos
      • Set Random_Damage[2] = Normal
      • Set Random_Damage[3] = Pierce
      • Set Random_Damage[4] = Siege
      • Set Random_Damage[5] = Magic
      • Set Random_Damage[6] = Hero


Trigger:
  • Roll of the Dice
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between (((Real((Level of Animate Dead for (Triggering unit)))) + 1.00) x 25.00) and ((100.00 x (Real((Level of Animate Dead for (Triggering unit))))) + 25.00)) damage of attack type Random_Damage[(Random integer number between 1 and 6)] and damage type Shadow Strike
      • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
      • Special Effect - Destroy (Last created special effect)


This merges it to just 3 lines + 6 lines :D
 

Lumograph090

New Member
Reaction score
22
I think this should suit your needs:
Trigger:
  • Random Stuff
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Random_Damage[1] = Chaos
      • Set Random_Damage[2] = Normal
      • Set Random_Damage[3] = Pierce
      • Set Random_Damage[4] = Siege
      • Set Random_Damage[5] = Magic
      • Set Random_Damage[6] = Hero


Trigger:
  • Roll of the Dice
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Random real number between (((Real((Level of Animate Dead for (Triggering unit)))) + 1.00) x 25.00) and ((100.00 x (Real((Level of Animate Dead for (Triggering unit))))) + 25.00)) damage of attack type Random_Damage[(Random integer number between 1 and 6)] and damage type Shadow Strike
      • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
      • Special Effect - Destroy (Last created special effect)


This merges it to just 3 lines + 6 lines :D

Hmm, awesome. However will this Trigger apply the correct damage per level?

Level 1: 50 - 125 damage
Level 2: 75 - 225 damage
Level 3: 100 - 325 damage
Level 4: 125 - 425 damage
Level 5: 150 - 525 damage

Will the Trigger you supplied me with apply the correct damage for each level?

Also, how do I apply the variables correctly for Random_Damage? I can see "Damage Type (damagetype) from the variable list, when I go to set up the Initialization Trigger and set Random_damage = X all i can choose from is Unknown, Normal, Enchanted, Fire, Cold, etc. There is no Chaos, Normal, Pierce, Hero, Magic, Siege.
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
Yes that trigger works for your damage, do the math.
That variable is Attack Type not Damage Type.
 

Lumograph090

New Member
Reaction score
22
Would it be possible to create floating text above the unit showing the actual damage done and damage type caused?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
It's a bit trickier since you can't convert attack-type to string, but this should work:
Trigger:
  • Random Stuff
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Random_Damage[1] = Chaos
      • Set Random_Damage[2] = Normal
      • Set Random_Damage[3] = Pierce
      • Set Random_Damage[4] = Siege
      • Set Random_Damage[5] = Magic
      • Set Random_Damage[6] = Hero
      • Set Atk_Type_String[1] = Chaos
      • Set Atk_Type_String[2] = Normal
      • Set Atk_Type_String[3] = Pierce
      • Set Atk_Type_String[4] = Siege
      • Set Atk_Type_String[5] = Magic
      • Set Atk_Type_String[6] = Hero


Trigger:
  • Roll of the Dice
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Set Temp_Int = (Random integer number between 1 and 6)
      • Set Temp_Atk_Type = Random_Damage[Temp_Int]
      • Set Temp_Real = (((Real((Level of Animate Dead for (Triggering unit)))) + 1.00) x 25.00)
      • Set Temp_Real2 = (((Real((Level of Animate Dead for (Triggering unit)))) x 100.00) + 25.00)
      • Set Temp_Dmg = (Random real number between Temp_Real and Temp_Real2)
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing Temp_Dmg damage of attack type Temp_Atk_Type and damage type Shadow Strike
      • Floating Text - Create floating text that reads ((String(Temp_Dmg)) + ( + (Atk_Type_String[Temp_Int] + ( + damage!)))) above (Target unit of ability being cast) 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 10.00 towards 90.00 degrees
      • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
      • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
      • Special Effect - Destroy (Last created special effect)
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
You don't need those temp reals.
And besides, you messed up on the 2nd real's formula.
(((Real((Level of Animate Dead for (Triggering unit)))) x 100.00) x 25.00) would give 2500 for lvl 1 ^^.

And you might want to add velocity and a lifespan.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Temp_Real's no, not needed but easier to read and confogure ;)

Changed that mistake there XD

Added velocity and lifespawn/fading age ;)
 
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