Oninuva
You can change this now in User CP.
- Reaction score
- 221
Oninuva’s Guide to Attribute Based Spells
Attribute based spells save a lot of time when you need a lot of ranks for spells. They do damage according to your level. It’s also great for RPG’s. If you ever played an RPG you might have noticed that some skills do damage based on one’s attribute points.
First to explain the attributes, Strength is normally used for melee heroes. Agility is mainly for ranged heroes and intelligence is for magic based heroes.
Index
- One Target Melee - Storm Bolt
- Indigence - AoE Healing Ability
- De Buff - Curse
- Custom Abilities
One Target Melee - Storm Bolt
Let’s start off by making a melee one target skill. Create a new skill based on Storm Bolt. Set these stats to the following:
Levels – 1
Cast Range – 50
Damage – 0
Set the others to anything your hearts desire!
Now go into the trigger editor and make a new trigger.
Code:
StormBolt
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Storm Bolt
Actions
Set Strength = (Strength of (Casting unit) (Include bonuses))
Set Convert = (Real(Strength))
Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Convert x 5.00) damage of attack type Spells and damage type Normal
Strength – Integer (Default Value 1)
Convert – Real
We need the Integer to store the attribute level of the unit and Real to convert an integer so we can use it as a damage. The other good thing about using 100% triggered spells are that you can even add special effects and more!
Inteligence - AoE Healing Ability
Now you will learn how to make AoE Heal Spells.
Make a new spell based on Flame Strike.
Set all damages to 0 and make the levels one. Then set delete the effect. Change target allowed to Allied and Self.
Now make this trigger.
Code:
AoE Heal
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Mass Heal
Actions
Set Inteligence = (Intelligence of (Casting unit) (Include bonuses))
Set Convert = (Real(Inteligence))
Set UnitGroup = (Units within 600.00 of (Target point of ability being cast) matching ((Owner of (Matching unit)) Equal to (Owner of (Triggering unit))))
Game - Display to (All players) the text: (Currently Casting: + (Name of (Ability being cast)))
Unit Group - Pick every unit in UnitGroup and do (Unit - Set life of (Picked Unit) to ((Life of (Picked unit)) + (Convert x 4.00)))
Unit Group - Pick every unit in UnitGroup and do (Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl)
Special Effect - Destroy (Last created special effect)
Custom script: call DestroyGroup(udg_UnitGroup)
The Finished Product Will Look Like
De Buff - Curse
Next we are going to make a de-buff, curse. It will cause a unit to miss based on the casting units inteligence divided by 10. This will require two triggers. One for the casting of the trigger and one for the actual effect. To start make a skill based on curse and set the chance to miss to 0.
Then create this trigger:
Code:
Curse
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Curse
Actions
Set Inteligence = (Intelligence of (Casting unit) (Include bonuses))
Set Convert = (Real(Inteligence))
Game - Display to (All players) the text: (Currently Casting: + (Name of (Ability being cast)))
Trigger - Turn on Curse Effect <gen>
Wait 60.00 seconds
Trigger - Turn off Curse Effect <gen>
Inteligence - Integer
Convert - Real
Then create the effect of the spell:
Code:
Curse Effect
Events
Unit - A unit Is attacked
Conditions
(Attacking unit) Equal to Cursed
Actions
Set Integer = (Random integer number between 1 and 100)
Set Convert = (Real((Inteligence / 10)))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Integer Less than or equal to (Integer(Convert))
Then - Actions
Unit - Order Cursed to Stop
Else - Actions
Note: You must set this trigger to [ ] Initially On. Uncheck it.
An explanation of this spell is, say a hero has 20 inteligence. It casts the spell curse. Then everytime the unit attacks it will have a 2% chance to miss. Note: The values can be easily changed by setting how much the inteligence is divided by.
Custom Abilities
Now time to learn how to make your own spells based on attributes. First off you need to figure out a formula. Examples are:
Str * 3 = Damage
Agi * 12 = Range
Int / 2 = Miss Chance
You can use the following operations: (+, -, *, and /) - Addition, Subtraction, Multiplication, and Dividing. The two most common used one are multipling and dividing. So first I will teach damage spells.
Create a spell based off a blizzard skill. I recommend:
- Stormbolt (One Target, Melee or Ranged)
- Flame Strike (AoE)
- Thunder Clap (AoE, Slow, Stun)
- Chain Lighting (Multi-Target, Selected)
Those are good and easy to manipulate skills. You need to create a few variables (Str, Agi, and Int) those are all Integers. Then create (convert) real, (unit) unit, (point) point, and (unitg) unit-group.