Chance on hit?

Dahcniell

New Member
Reaction score
0
Hi im working on an enfo and i have some similar spells that i dont know how to do:(. I want them to have a chance on hit to do for examlpe, cast Thunder Clamp. Would be happy if anyone could show me how to make an chance on hit spell.
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
You'll an integer variable. And a base spell which gives a buff. And also the thunder clap and stuff would have to be created.

Then begin the trigger with something like

Trigger:
  • Events
    • Unit - A unit is attacked


Conditions would be

Trigger:
  • Conditions
    • Attacking unit has your skill's buff


Then you'll have to do something like this.

Trigger:
  • Actions
    • Set integer variable = Random number between X,X
      • If/Then/Else
        • If - condition
          • Integer variable is greater than XX
        • Then - Actions
          • Set TempPoint to position of triggering unit
          • Unit - Create dummy unit at TempPoint
          • call RemoveLocation (udg_TempPoint)
          • Unit - Give expiration timer to last created unit
          • Unit - Add thunderclap/etc. to last created unit
          • Unit - Set level of thunderclap/etc. to last created unit
          • Unit - Issue order (Base spell name)
          • Else - Actions


Sorry, its freehand.
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
Hey

Here you go, a great damage detection system for your map, very easy to use and GUI friendly http://www.thehelper.net/forums/showthread.php?t=137957

When you integrate it into your map, all you have to do is make a trigger like this:

Trigger:
  • Thundering Hit
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of Ability for GDD_DamageSource) Greater than 1
    • Actions
      • Set TempInt = (Random integer number between 1 and 100)
      • Set TempPoint = (Unit Position of GDD_DamagedUnit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempInt Less than or equal to 10
        • Then - Actions
          • Create a dummy Unit at TempPoint
          • Add Thunder Clap to last created unit
          • Add 2 second generic expiration timer to last created unit
          • Order last created unit to Thunderclap
        • Else - Actions


This ability will make it have 10% chance, when a unit strikes (damages, not simply attacks to avoid abuse) that a thunderclap effect will take place ^^

Any more questions feel free to ask ^^

It's a bit freehanded, but it's the trigger ^^


Edit:
Trigger:
  • Events
    • Unit - A unit is attacked

This can cause abuse if the player keeps pressing the S key (stop). That's why i suggest use the damage detection system
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
That leaks, you'll have to add this in after the creation of the dummy unit. Its a custom script.

Trigger:
  • call RemoveLocation (udg_TempPoint)
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
Yep, i forgot about the leak, Make sure you add the custom script ^^

Working together for best results skyblade? ^^
 

Bogrim

y hello thar
Reaction score
154
You don't need to specify a variable for a random number. You also don't have to use an If Then Else action. You do need a damage detection system like Nenad linked.
Trigger:
  • Your Trigger
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Random integer number between 1 and 10) Equal to (Level of (Your passive ability) for GDD_DamageSource)
    • Actions
      • Set Temp_Location = (Position of GDD_DamagedUnit)
      • Unit - Create 1 (Dummy Unit) for (Owner of GDD_DamageSource) at Temp_Location facing Default building facing degrees
      • Unit - Add Thunder Clap to (Last created unit)
      • Unit - Set level of Thunder Clap for (Last created unit) to (Level of (Your passive ability) for GDD_DamageSource)
      • Unit - Add 2.00 seconds Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Human Mountain King - Thunderclap
      • Custom Script: call RemoveLocation(udg_Temp_Location)
 

Dyslexia://

New Member
Reaction score
13
...If it's on hit you don't even need triggers. = =;

Look up the Orb of Lightning, there's a skill called Item Purge or something like that.
What it does is adds a {insert-number-here}% to cast {insert-spell-here} on every attack. Make it a unit spell and tada your done.
 

Dahcniell

New Member
Reaction score
0
I have find the item spell but it doesnt cast the spell. It's look like he does.

And how do i do:
Set Temp_Location = (Position of GDD_DamagedUnit)
 

BcBoy

Active Member
Reaction score
6
For singletarget procs this might work...

Trigger:
  • Actions
    • Set Temp_Location = ((Position of (Target unit of issued order)) offset by (0.00, 0.00))
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top