• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Random chance on attack.

Status
Not open for further replies.
Level 5
Joined
Nov 21, 2014
Messages
151
So I don't actually think this is possible because there is no unit specific events that says "unit deals damage" but I'll explain it anyway.

I would want my hero to have an ability with 3 levels that at level 1 spawns a unit, level 2 too and level 3 too, (like 20% on hit) but the unit gets stronger the higher the level is (this isn't hard to do, the hard to do part is the 20% on hit" I can't figure out a way to do this... Please help! :goblin_cry:
 
Level 5
Joined
Nov 21, 2014
Messages
151
Use a damage detection system and use a random integer between 1 and 100, then check if its below your %, if it is, do your wanted actions.

Can you help me out on the damage detection part? I never got that stuff, is it just a trigger (how I've seen it in maps) or a program?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Try this instead.

The only flaw to this approach is that the chance won't trigger if the unit engages enemy units on-sight (Acquisition Range, without any player-order).

As long as the player order the unit to attack/attack-move/etc, the chance should be okay.

You can change the chance at the Object Editor -> Abilities Tab -> Orb of Lightning (new) Custom -> Data - Chance To Hit Heros/Summons/Units

Currently, the chance is set to 100%.


EDIT:
Apparently you can only use target-unit type of spells :(
 
Level 17
Joined
Dec 11, 2014
Messages
2,004
It's easy:

  • Da Trigger
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
    • Actions
      • -------- Between 1 and 100 works too but I'm too lazy to change it to "bigger or equal to" --------
      • Set TempInt = (Random integer number between 1 and 5)
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • TempInt Equal to (==) 1
          • Then - Actions
            • -------- Wanna make it spawn at the damage source? Just change it to GDD_DamageSource --------
            • Set Temp_P = (Position of GDD_DamagedUnit)
            • -------- Change the footman to what you like --------
            • Unit - Create 1 Footman for (Owner of GDD_DamageSource) at Temp_P facing Default building facing (270.0) degrees
            • Custom script: call RemoveLocation(udg_Temp_P) //Yeahhhh no leaks
          • Else - Actions
 
Level 5
Joined
Nov 21, 2014
Messages
151
It's easy:

  • Da Trigger
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
    • Actions
      • -------- Between 1 and 100 works too but I'm too lazy to change it to "bigger or equal to" --------
      • Set TempInt = (Random integer number between 1 and 5)
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • TempInt Equal to (==) 1
          • Then - Actions
            • -------- Wanna make it spawn at the damage source? Just change it to GDD_DamageSource --------
            • Set Temp_P = (Position of GDD_DamagedUnit)
            • -------- Change the footman to what you like --------
            • Unit - Create 1 Footman for (Owner of GDD_DamageSource) at Temp_P facing Default building facing (270.0) degrees
            • Custom script: call RemoveLocation(udg_Temp_P) //Yeahhhh no leaks
          • Else - Actions

Hi there! Let's just say it worked like a charm! it worked perfectly I wanted the 1/5 only to happen to a unit called "Doom Lord" so that's what's at the conditions :), also I "nerfed" it to 1/10. Now only one thing remains, how do I make it that you only have it once you unlock the ability, and how do I make multiple levels interact with it? (Just changing the unit summoned to a stronger one) The attachements includes the trigger I have right now. (The one you told me to make) tyvm so far! :thumbs_up::thumbs_up:

EDIT: figured it out my self, gave my ability give a buff (different for each level) and add a condition for damagesource to require that buff and then changed the buff for the other levels. Thanks for helping me!
 

Attachments

  • trigger.PNG
    trigger.PNG
    18.9 KB · Views: 105
Last edited:
Level 17
Joined
Dec 11, 2014
Messages
2,004
~making it

EDIT:
First of all, take a look here. Might help you later :wink:

Second, take a look to the demo map. It has all you need.
You might get an error. something like this: "This map was saved by a more recent version of the editor. Continue?", something like that. Don't mind and go on.
 

Attachments

  • Doom Spell.w3x
    29.3 KB · Views: 63
Last edited:
Level 5
Joined
Nov 21, 2014
Messages
151
~making it

EDIT:
First of all, take a look here. Might help you later :wink:

Second, take a look to the demo map. It has all you need.
You might get an error. something like this: "This map was saved by a more recent version of the editor. Continue?", something like that. Don't mind and go on.

Uuhhmm.. Didn't you see my edit? Sorry man but I already sort of made it my self .. So you don't have to make it for me if you haven't already. sorry :/
 
Status
Not open for further replies.
Top