• 🏆 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!

ability with %

Status
Not open for further replies.
Level 7
Joined
Dec 18, 2008
Messages
400
Do you mean some kind of "chance on hit" spell?

This is a triggered spell.
Random number between 1 and 100 (for instance) is equal to 15 or lower.
Then do....
Deal 2,5*Agility of hero.

This was a plain example of what i think you mean, but im not sure.
 
Level 11
Joined
Jun 20, 2009
Messages
880
This spell works like critical strike. It has 25% chance to work.

  • One
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Critical Strike
    • Actions
      • Set FirePunchLearned[(Player number of (Owner of (Triggering unit)))] = true
  • Two
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • FirePunchLearned[(Player number of (Owner of (Attacking unit)))] Equal to true
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than 25
        • Then - Actions
          • Unit - Cause (Attacking unit) to damage (Attacked unit), dealing 500.00 damage of attack type Spells and damage type Normal
        • Else - Actions
PS. +rep please :D
 
Copy and paste an ability based off Bash. Then, let's say that you want a Shockwave to be cast with chance, upon attacking.
  • Trigger1
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in (Playable Map Area)) and do (Actions)
      • Loop - Actions
        • Trigger - Add to Trigger3 <gen> the event (Unit - (Picked unit) takes damage)
  • Trigger2
  • Events
    • Unit - A unit enters (Playable Map Area)
  • Conditions
  • Actions
    • Trigger - Add to Trigger3 <gen> the event (Unit - (Triggering unit) takes damage)
  • Trigger3
  • Events
  • Conditions
    • (Level of Custom Bash for (Damage source)) Greater than 0
  • Actions
    • Set Point1 = (Position of (Damage source))
    • Unit - Create 1 dummy for (Owner of (Damage source)) at Point1 facing default building degrees
    • Unit - Add Shockwave (dummy) to (Last created unit)
    • Unit - Set level of Shockwave (dummy) for (Last created unit) to (Level of Custom Bash for (Damage source))
    • Custom script: call IssueTargetOrder (GetLastCreatedUnit(), "shockwave", GetTriggerUnit())
    • Custom script: call RemoveLocation (udg_Point1)
You can also try the ability "Orb of Lightning (New)", up to the effect you want to add.
 
Level 4
Joined
Jan 3, 2009
Messages
64
Pharaoh, i didnt understood your trigger, your trigger doesnt involve "chances". It just cast shockwave when a unit recieves a damage ( i think). Right?
 
Status
Not open for further replies.
Top