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

Help in % Chance to Cast Spells

Status
Not open for further replies.
Level 3
Joined
Jun 25, 2006
Messages
32
Hello. I was wondering, how do you make a unit have a chance to cast a spell when it attacks? For example, a Hero has a 35% chance to cast Chain Lightning when he attacks. Please also include how to increase its chance per level. Thanks :)
 
Level 7
Joined
Nov 12, 2005
Messages
299
no triggers needed here :)
find the ability Orb of Lightning (New).
Data - Chance To Hit Heroes/Summons/Units would be the chance to cast.
Data - Effect Ability is the ability the unit will have a x% chance to cast.
set Data - Enabled Attack Index to 0 (you dont want it to have an orb-like effect). also remove everything from Art - Missile Art, Art - Special and Art - Target to remove the orb attachments.
now one last thing to do is set Stats - Item Ability to false and Stats - Hero Ability to true. i believe you know how to make more levels and larger chance per level now.
 
Level 13
Joined
Jun 22, 2004
Messages
783
You can also trigger it if you like

First of all whenever a units gets damage make sure that you set a variable that checks the ability level
  • Set AbilityLevel = (Level of "your ability" for attacked unit)
The we can start to let it have a change to do the spell upon 100%
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • AbilityLevel less then to "max levels of your ability"
    • Then - Actions
      • Set Chance = (Random integer number between 1 and 100)
    • Else - Actions
Now we need to get it to the amount of percent
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ability equal to 1
      • Chance Less than or equal to 35
    • Then - Actions
      • "Let your attacking unit cast a spell in here"
    • Else - Actions
 
Level 13
Joined
Jun 22, 2004
Messages
783
Well the easiest way is not always the best, with triggers you can enhance abilities quite good, and you can often get them too look totally refreshing or much better than the old version.
It's more work, but I would say quality>quantity and thats what counts to the people that are gonna play it ;).
 
Level 7
Joined
Nov 12, 2005
Messages
299
true but...hmm is there any point in discussing this in the first place? :p
in my oppinion...if you dont have to use a trigger then dont. but if you need something you must trigger...well then just do it i suppose.
 
Status
Not open for further replies.
Top