Spellpack 10 of my Spells!

I

IKilledKEnny

Guest
10 of my Spells! Tutorial
~By IKilledKEnny


Q&A

Q: What is this?
A: This is an article where I have posted 10 of my abilities that I have made in different maps.

Q: Then why do you call it a tutorial?
A: Because:
1. I’m going to explain each of the 10 spells step by step.
2. I chose spells that I think you could learn from, not the most eye candy spells.

Q: How did you choose spells?
A: I chose spells that are;
1. Not too simple.
2. Not too complicated / long.
3. Spells that you might learn something from.
4. Spells that might interest you enough to put them in your maps.

Q: Are those spells downloadable?
A: Yes, I attached a map at the end of the tutorial with all the spells; you may download it and do with it what ever you want. You don’t have to give me credits.

Q: Then why did you post it if you don’t want credits?
A. It’s not that I don’t want, but it’s really that I don’t care about it, just a hobby of mine. If I can help you all why not? Oh and there of course reputation thing (Don’t feel like you have to give it to me!! Just want to be honest :) ).

Q: Should I know anything before downloading the spells?
A: Yes! Lots of things!
1. Spells are NOT balanced, they all come from different maps, heros and such.
2. The spells themselves (Not the triggers that activate them) are very basic, no icons, mana cost and such, I wanted to let you edit it to see whatever suits you best.
3. Few of the custom spells are based on the same basic spells for example I got at least 2 spells that are based on storm bolt. One hero can’t have 2 custom spells based on the same spell thus be careful! Go to Text > Name > Right Click > Reset Selected Field to Default, to check on what the spell is based on.
4. I have triggered the spell like you have 12 players, which is the maximum number, so you don’t need to worry about that. But few spells might not work if there are serval units owned by the same player that can use them, so spells are made more to hero arenas or something like that, less to regular units.
5. If you have any problems you may always send me a PM or an E-mail at [email protected].

Q: Who is this tutorial for?
A: Well it’s certainly not for very new people, I’ll talk on few things that are a little advanced that might confuse new members, assuming they will understand it….

Q: Ok, I’ll give it a shot if you insist, anything else?
A: Well nothing really, I would love to hear any comment you have negative or positive, just please note that I spent a lot of time on this. Please Report any bugs.

*Please Note*: English is my second language, but I do use ‘Word’ and dictionary so the tutorial should be readable.

*Please Note*: This is a pretty long tutorial; you do not have to read every chapter because every chapter is talking about a whole new ability.

Spell Num 1: Reflect

What this spell will do is once you have cast it upon yourself if someone will cast a spell on you, you would learn it, and you would be able to use it, until time is up or until you use it once.

*Please Note*: This is the longest, most complicated spell I’ll talk about, you may want to read this as the last chapter, I put it as first chapter just to get your brain to start working.

Code:
Reflect 1 Set
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Reflect 
    Actions
        Unit - Set the custom value of (Casting Unit) to 2
        Wait ((Real((Level of Reflect  for (Casting unit)))) x 30.00) seconds
        Unit - Set the custom value of (Casting) to 1
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ReflectBoolean[(Player number of (Owner of (Casting unit)))] Equal to True
            Then - Actions
                Unit - Remove ReflectAbility[(Player number of (Owner of (Casting unit)))] from (Casting unit)
                Unit - Add Reflect  to (Casting unit)
                Unit - Set level of Reflect  for (Casting unit) to ReflectLevelInteger[(Player number of (Owner of (Target unit of ability being cast)))]
            Else - Actions

Ok the event is a unit starts the effect of an ability, thus when a unit finishes casting an ability the event it met, if the ability is Reflect (our ability) then move on to the actions.
Custom value has absolutely no effect to the game, but it allows us to put integers to units. So we’ll the custom value as Boolean, 2 is yes, 1 (default) is no. Now we are going to wait the level of the ability Reflect to our unit times 30 seconds.

After we waited this time we’ll set the custom value of the unit to 1, saying, times is up nothing will happen until you re-cast the spell. Now we check if the ReflectBoolean is true (we will define this variable later on). If it is we remove an ability which we defined as ReflectAbility (again, will be defined later) and will add Reflect ability to our casting unit as well as setting the ability’s level to integer variable which we will, again, define later.

If you did not understand this re-read it or send me a PM.

Let’s move on to our second Trigger.

Code:
Reflect 2 Trigger
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Unit-type of (Target unit of ability being cast)) Equal to <<Hero>>
        (Custom value of (Target unit of ability being cast)) Equal to 2
    Actions
        Set ReflectAbility[(Player number of (Owner of (Target unit of ability being cast)))] = (Ability being cast)
        Set ReflectLevelInteger[(Player number of (Owner of (Target unit of ability being cast)))] = (Level of Reflect  for (Target unit of ability being cast))
        Unit - Remove Reflect  from (Target unit of ability being cast)
        Unit - Add ReflectAbility[(Player number of (Owner of (Target unit of ability being cast)))] to (Target unit of ability being cast)
        Unit - Set level of ReflectAbility[(Player number of (Owner of (Target unit of ability being cast)))] for (Target unit of ability being cast) to (Level of ReflectAbility[(Player number of (Owner of (Target unit of ability being cast)))] for (Casting unit))
        Unit - Set the custom value of (Casting unit) to 1
        Set ReflectBoolean[(Player number of (Owner of (Target unit of ability being cast)))] = True

Again the event is a unit casts an ability. Now if the target of the spell was our hero (the hero that can use reflect) and it’s custom value is equal to 2 then we can proceed. Remember we talked about 3 variables in the first Trigger that we didn’t know what are they? After reading this Trigger we’ll know. :)

So let’s start reading the actions, we set the variable ReflectAbility (with array of owner of target unit of ability being cast) to the ability being cast. Now we set ReflectLevelInteger (again same array) to the level of reflect. Now remember we did it the first Trigger this: ?

Code:
      Unit - Remove ReflectAbility[(Player number of (Owner of (Casting unit)))] from (Casting unit)
                Unit - Add Reflect  to (Casting unit)
                Unit - Set level of Reflect  for (Casting unit) to ReflectLevelInteger[(Player number of (Owner of (Target unit of ability being cast)))]

Now it makes more sense, right? Let’s move on. We remove reflect from our unit and we add to it the ability that someone just cast on it! We are also setting the level of the ability was just learned to be equal to the level of the ability that was cast on us! So for example if unit X casts on our hero Storm Bolt level 4 our hero now knows storm bolt level 4!

And now we set the custom value of our unit to 1 (so the ability won’t be overwritten) and ReflectBoolean to True. After knowing this re-read Trigger 1. it should be completely clear to you now, if not re-read all the chapter until now or PM me.

Now here is the last Trigger

Code:
Reflect 3 Stop
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to ReflectAbility[(Player number of (Owner of (Casting unit)))]
    Actions
        Unit - Remove ReflectAbility[(Player number of (Owner of (Casting unit)))] from (Triggering unit)
        Unit - Add Reflect  to (Casting unit)
        Unit - Set level of Reflect  for (Casting unit) to ReflectLevelInteger[(Player number of (Owner of (Target unit of ability being cast)))]
        Unit - Set the custom value of (Casting unit) to 2
        Set ReflectBoolean[(Player number of (Owner of (Target unit of ability being cast)))] = False

Now, again the same event, the condition is, if the spell in ReflectAbility (remember that variable from the second Trigger? Check it again if you don’t) then what we’ll do is this; we remove ReflectAbility from our hero, add reflect to it and set reflect’s level to ReflectLevelInteger (again check Trigger 2 if you do not remember). And now we set the custom value of our hero to 2, meaning if the time (first Trigger) isn’t up yet the same thing will happen again once someone will cast spell on us.

Well that’s it, I hope you understand it, it’s very hard complicated, spell (assuming you are not AceHart / SFilip / Sooda / Chocobo and so on :p ) and if you understood it, you can be proud of yourself, you will understand the rest of the spell for sure.

Spell Num 2: Fear

I saw few requests for Fear ability and anyway I like it, so I thought I’ll just add this one to my tutorial. Don’t worry, only 1 Trigger in this 1 (long one though :p ). Ok this Spell will pick up to 10 units and will make them run to random directions for number of seconds.

Code:
Fear 1
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Fear 
    Actions
        Set FearCastingPoint = (Position of (Casting unit))
        Set FearGroup = (Units within 600.00 of FearCastingPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Owner of (Matching unit)) is an enemy of (Owner of (Casting unit))) Equal to True))))        
        Set FearCount = 0
        Unit Group - Pick every unit in FearGroup and do (Actions)
            Loop - Actions
                Set FearCount = (FearCount + 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        FearCount Less than or equal to 10
                    Then - Actions
                        Set FearUnit[FearCount] = (Picked unit)
                        Set FearPlayer[FearCount] = (Owner of FearUnit[FearCount])
                        Unit - Change ownership of FearUnit[FearCount] to Neutral Passive and Change color
                        Set FearOrderPoint = ((Position of FearUnit[FearCount]) offset by 1000000000.00 towards (Random angle) degrees)
                        Unit - Order FearUnit[FearCount] to Move To FearOrderPoint
                        Set FearPoint = (Position of (Picked unit))
                        Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Undead\DeathCoil\DeathCoilMissile.mdl
                        Set FearSE[FearCount] = (Last created special effect)
                        Floating Text - Create floating text that reads Feared!! above (Picked unit) with Z offset 0.00, using font size 8.00, color (10.00%, 20.00%, 100.00%), and 0.00% transparency
                        Floating Text - Change (Last created floating text): Disable permanence
                        Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
                    Else - Actions
        Wait 1.00 seconds
        For each (Integer A) from 1 to FearCount, do (Actions)
            Loop - Actions
                Special Effect - Destroy FearSE[(Integer A)]
        Wait ((Real((Level of Corrupt  for (Casting unit)))) x 4.00) seconds
        For each (Integer A) from 1 to FearCount, do (Actions)
            Loop - Actions
                Unit - Change ownership of FearUnit[(Integer A)] to FearPlayer[(Integer A)] and Change color
        Unit Group - Remove all units from FearGroup
        Custom script:   call RemoveLocation (udg_FearPoint)
        Custom script:   call RemoveLocation (udg_FearCastingPoint)

Again our very nice event (in almost every spell Trigger you would use this event). Our condition is ability being cast equal to fear. If the event is met as well as the condition the actions will happen, let’s check them out.

First we are setting FearCastingPoint variable to the position of our casting unit. Then we define FearGroup as all units that are not buildings, not dead, and not controlled by an ally of the player that owns the casting unit which are up to 600 (feet??) from our casting unit. We also set FearCount to 0.

After we got those 3 variables we are going to pick every unit that is in FearGroup. We increase FearCount by 1 and then we check if FearCount in less then 11 (less then or equal to 10). If it is we proceed, if not we do nothing because we want to limit the number of unit to 10. No we set FearUnit (array of FearCount, this is VERY important) to picked unit. We also set FearPlayer (FearCount array) to the owner of FearUnit[(current)FearCount]. We change the ownership of the picked unit to natural passive.

Now we want to order the unit to move to random direction so we set FearOrderPoint to position of picked unit offset by 100000000 (something like that…), which means very far a way from unit, and we make it in random angle of unit. No we order the picked unit to move to that point. Also to make the spell a little nicer we’ll add special effect and floating text by doing so:

We set FearPoint to position of unit and create there special effect (Abilities\Spells\Undead\DeathCoil\DeathCoilMissile.mdl ) set it as a variable (FearSE[FearCount]) and a nice little floating text that reads ‘Feared!!’. After a second and a half the text will be destroyed.

After that we wait a second and we pick every integer between 1 and the FearCount we reached. We then destroy special effect FearSE[Integer A]. Integer A replaces FearCount in this Trigger.
After that we wait another 4 seconds time level of fear for casting unit and then we do this:

We again pick every integer between 1 and FearCount and we do:

Change Owner of FearUnit[FearCount] to FearPlayer[FearCount], which will simply make all units effected by fear to be controlled again by there original owner. And then we also order them to stop running because they are not scared any more.

*Side Note*: We changed all the units’ owners to natural passive to prevent the owners of the feared units to simple order them to stop.

Good, we understood this spell (if not, again re-read / PM :) )let’s move on to the next exiting spell!

Spell Num 3: Bombing

This spell can be made just in one Trigger but just to ease things up I separated it to 2 different Triggers.

Code:
Bombing 1 Create
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Bombing 
    Actions
        Game - Display to (All players) the text: ((Name of (Ability being cast)) +  Will initiate in 60 seconds)
        Wait 60.00 seconds
        Game - Display to (All players) the text: ((Name of (Ability being cast)) +  Has initiated!)
        Set BombingCastingPoint = (Target point of ability being cast)
        Set BombingUnitsGroup = (Units within 500.00 of BombingCastingPoint)
        Set BombingCastingUnit = (Casting unit)
        For each (Integer A) from 1 to 15, do (Actions)
            Loop - Actions
                Set BombingBombsPoints = (BombingCastingPoint offset by (Random real number between 0.00 and 500.00) towards (Random angle) degrees)
                Unit - Create 1 Bomb (Dummy) for Player (Owner of (BombingCastingUnit)) at BombingBombsPoints facing Default building facing degrees
                Unit Group - Add (Last created unit) to BombingBombsGroup
        Trigger - Run Bombing 2 Damage <gen> (checking conditions)

Same event, same type of conditions, Ability being cast equal to <<Our Ability>> (bombing). Now we tell all players that bombing will initiate in 1 minute, wait one minute and tell all players that bombing has starts. (You could delete those 3 lines, but then this ability would REALLY be too strong).

Now we set 3 variables:
BombingCastingPoint: Where we ordered bombing to occur.
BombingUnitsGroup: All units which are up too 500 (again, feet??) from BombingCastingPoint.
BombingCastingUnit: Our casting hero!


Now for each integer between 1-15 (thus 15 times)
We set BombingBombsPoints to BombingCastingPoint offset by random number between 0-500 and random angle (thus random point that it’s is distance to BombingCastingPoint is no more then 500). And then we create a bomb (dummy unit with locust, thus it’s can’t be targeted by anyone) at that point for the owner of casting unit. We do that 15 times. We do that only to make the ability look realistic. Now we add the unit (the bomb) to BombingBombsPoints and run the second Trigger (again we could make it only one Trigger but it easier to understand if we’ll split it to 2 triggers.)

*Side Note*: Bomb (dummy) are flying units, we’ll make them fall down so it would like a plane is dropping bombs at a certain location.

Code:
Bombing 2 Damage
    Events
    Conditions
    Actions
        Unit Group - Pick every unit in BombingBombsGroup and do (Actions)
            Loop - Actions
                Animation - Change (Picked unit) flying height to 1.00 at 600.00
        Wait 1.60 seconds
        Unit Group - Pick every unit in BombingBombsGroup and do (Actions)
            Loop - Actions
                Unit - Kill (Picked unit)
        Unit Group - Remove all units from BombingBombsGroup
        Unit Group - Pick every unit in BombingUnitsGroup and do (Actions)
            Loop - Actions
                Set BombingDamage = (Random integer number between ((Level of Bombing for BombingCastingUnit) x 150) and ((Level of Reflect  for BombingCastingUnit) x 300))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked) is A Hero) Equal to True
                    Then - Actions
                        Unit - Cause (BombingCastingUnit) to damage (Picked unit), dealing ((Real(BombingDamage)) / 2.00) damage of attack type Siege and damage type Normal
                    Else - Actions
                        Unit - Cause (BombingCastingUnit) to damage (Picked unit), dealing (Real(BombingDamage)) damage of attack type Siege and damage type Normal
        Unit Group - Remove all units from BombingBombsGroup
        Unit Group - Remove all units from BombingUnitsGroup
        Custom script:   call RemoveLocation(udg_BombingCastingPoint)
        Custom script:   call RemoveLocation(udg_BombingBombsPoints)

Now we order all units in BombingBombsGroup (remember the little dummy units that looks like bombs) to fall at a pretty high rate, and once they reached the ground (I calculated it… They will reach after 1.6666666… seconds 1.6 / 1.66 is a good timing wait) so after 1.6 seconds we again pick all units in BombingBombsGroup and we kill them, they would look exactly like they fall and exploded one they hit the ground.

Now to the damaging part! We set BombingDamage to random integer between level of bombing for BombingCastingnit X 150 and level of bombing X 300. Now if we’ll deal to units that damage and to heros half of that damage (we don’t want to make this ability too good!)

And that’s it! ability is ready! Minute after activating this ability 15 bombs will fall to the ground and will explode once they reach it, dealing damage to all units by them. This ability is certainly nice to watch. :D

Skill Num 4: Corrupt

Hard abilities are over! Rest of the abilities are MUCH easier, and shorter, if you understood the first three spells rest of the tutorial would be much easier for you.

Ok what corrupt should do is pretty simple, if a hero got that, whenever a unit dies by him after few seconds it will be revived to aid him. The higher the ability’s level is there better unit you would get.

*Side Note*: I based unit that will create on knights and I didn’t change them AT ALL expect for the names.

Code:
Corrput 1 Set
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        Set CorruptUnitTypeInteger = 1
        Set CorruptUnitType[CorruptUnitTypeInteger] = Lesser Zombie 1
        Set CorruptUnitTypeInteger = (CorruptUnitTypeInteger + 1)
        Set CorruptUnitType[CorruptUnitTypeInteger] = Lesser Zombie 2
        Set CorruptUnitTypeInteger = (CorruptUnitTypeInteger + 1)
        Set CorruptUnitType[CorruptUnitTypeInteger] = Lesser Zombie 3
        Set CorruptUnitTypeInteger = (CorruptUnitTypeInteger + 1)
        Set CorruptUnitType[CorruptUnitTypeInteger] = Lesser Zombie 4
        Set CorruptUnitTypeInteger = (CorruptUnitTypeInteger + 1)
        Set CorruptUnitType[CorruptUnitTypeInteger] = Lesser Zombie 5

What we did here is simple we set UnitType variable with array of 5 (array should be equal to number of levels you plan to make the ability) and we set each variable to different unit type.

Now we move on. :)

Code:
Corrupt 2 Trigger
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Set CorruptUnitGroup = (Units of type Zombie)
        Set CorruptDiePoint = (Position of (Dying unit))
        Unit Group - Pick every unit in CorruptUnitGroup and do (Actions)
            Loop - Actions
                Set CorruptHeroPoint = (Position of (Picked unit))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Owner of (Killing unit)) is an ally of (Owner of (Picked unit))) Equal to True
                        (Level of Corrupt  for (Picked unit)) Greater than or equal to 1
                        (Integer((Distance between CorruptDiePoint and CorruptHeroPoint))) Less than or equal to ((Level of Corrupt  for (Picked unit)) x 150)
                    Then - Actions
                        Set CorruptUnit = (Picked unit)
                        Custom script:   call RemoveLocation(udg_CorruptHeroPoint)
                    Else - Actions
                        Custom script:   call RemoveLocation(udg_CorruptHeroPoint)
                        Custom script:   call RemoveLocation(udg_CorruptDiePoint)
                        Skip remaining actions
        Wait (10.00 - (Real((Level of Corrupt  for (Picked unit))))) seconds
        Unit - Create 1 CorruptUnitType[(Level of Corrupt  for CorruptUnit)] for (Owner of CorruptUnit) at CorruptDiePoint facing Default building facing degrees
        Custom script:   call RemoveLocation(udg_CorruptDiePoint)
        Unit Group - Remove all units from CorrputUnitGroup

Event is different this time!! Unit dies. No conditions. Now we set corruptUnitGroup to all units of type zombie (say it’s our hero’s name). We set CorruptDiePoint to the position of dying unit. No we pick all units in CorruptUnitGroup and we set CorruptHeroPoint to picked unit point. Now we check 3 things.

1. Owner of killing unit is ally of owner of zombie.
2. If the zombie learned corrupt already,
3. If the range between the picked unit and dying unit is the less 150 X level of corrupt for picked unit.

If all of these are true then we set CorruptUnit to the picked unit, if at least one thing is not true then we skip remaining actions. Assuming all 3 conditions are true (thus we didn’t skip remaining actions) we wait 10 seconds minus level of corrupt ability, and then we create CorruptUnitType[Level of Corrupt for CorruptUnit] at the position of the dying unit.

Well that was piece of cake compare to the other spells, right? Let’s move on!

Spell Num 5: Report

The ability report would allow you to have few regions viewable permanently. However you may only have number of these regions equal to the level of your report ability

Code:
Report 1
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Report 
    Actions
        Set ReportPoint = (Target point of ability being cast)
        Unit - Create 1 Dummy (Report) for (Owner of (Casting unit)) at ReportPoint facing Default building facing degrees
        Set ReportUnit[((Number of units in ReportUnitGroup) + 1)] = (Last created unit)
        Unit Group - Add (Last created unit) to ReportUnitGroup
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in ReportUnitGroup) Greater than (Level of Report for (Casting unit))
            Then - Actions
                Unit - Remove ReportUnit[1] from the game
                Unit Group - Remove ReportUnit[1] from ReportUnitGroup
                For each (Integer A) from 2 to 5, do (Actions)
                    Loop - Actions
                        Set ReportUnit[((Integer A) - 1)] = ReportUnit[(Integer A)]
            Else – Actions 
       Custom script:   call RemoveLocation(udg_ReportPoint)

Same event, same condition. Now to the actions! We set ReportPoint to where we cast the spell and then we create Dummy (Report) unit for owner of casting unit. Now we set ReportUnit (array of number of units in ReportUnitGroup + 1 ) and then add that unit to ReportUnitGroup. Now if the number of units in ReportUnitGroup is bigger then the level of report of the casting unit the we kill ReportUnit[1] (oldest one created) and we make all ReportUnit’s arrays go one back (thus ReportUnit[2] will be now ReportUnit[1] and so on).

And that’s another spell completed!! I hope you enjoy the tutorial so far. :p

Spell Num 6: Turn to Tree

This Trigger will turn a unit into tree, making it unattackable but the unit could effect the game at all during the time it is a tree.

*Side Note*: What we’ll do is simply create a new tree and move the target of spell being cast to another region so create a region somewhere in the game which is pretty well hidden to use this ability.

Code:
Turn to Tree 1
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Turn to Tree 
    Actions
        Set T2TPoint[2] = (Center of Region 000 <gen>)
        Set T2TT = (Target unit of ability being cast)
        Set T2TPoint[1] = (Position of T2TT)
        Set T2TPlayer = (Owner of T2TT)
        Selection - Clear selection for T2TPlayer
        Unit - Move T2TT instantly to T2TPoint[2]
        Unit - Change ownership of T2TT to Neutral Hostile and Change color
        Destructible - Create a Summer Tree Wall at T2TPoint[1] facing (Random angle) with scale 1.00 and variation 0
        Destructible - Make (Last created destructible) Invulnerable
        Set T2TDes = (Last created destructible)
        Wait ((Real((Level of Corrupt  for (Casting unit)))) + 7.00) seconds
        Destructible - Remove T2TDes
        Unit - Change ownership of T2TT to T2TPlayer and Change color
        Unit - Move T2TT instantly to T2TPoint[1]
        Selection - Select T2TT for T2TPlayer
        Custom script:   call RemoveLocation(udg_T2TPoint[1])
        Custom script:   call RemoveLocation(udg_T2TPoint[2])

*Snore* Same events and same conditions. Ok we set T2TPoint[2] center of a region (read the side note above the Trigger). T2TT is target of ability being cast. T2TPoint[1] is position of T2TT and T2Tplayer is Owner of T2TT. We clear selection for T2TPlayer we move T2TT to T2TPoint and we change the owner of T2TT to natural hostile. After that we create a tree at T2TPoint[1] and then we make it unattackable + setting T2TDes to that tree. Then we wait level of Turn to Tree for casting unit + 7 seconds and then we Remove T2TDes make T2TT belong now to T2TPlayer move T2TT to T2TPoint[1] and lastly select T2TT for T2TPlayer.

Those spells just get easier and easier, right?

Spell Num 7: Thunder Storm

Again we reach a spell which is a little hard, but I’m sure you could understand this one as well.

Code:
Thunder Storm 1
    Events
         A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Thunder Storm 
    Actions
        Set ThunderStormCount = 0
        Set ThunderStormCastingPoint = (Position of (Casting unit))
        Set ThunderStormUnitGroup = (Units within 350.00 of ThunderStormCastingPoint matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A Structure) Equal to False) and ((Owner of (Casting unit)) Not equal to (Owner of (Matching unit))))))
        Unit Group - Pick every unit in ThunderStormUnitGroup and do (Actions)
            Loop - Actions
                Set ThunderStormCount = (ThunderStormCount + 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ThunderStormCount Less than or equal to 6
                    Then - Actions
                        Set ThunderStormPoint = (Position of (Picked unit))
                        Special Effect - Create a special effect at ThunderStormPoint using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
                        Set ThunderStormSE[ThunderStormCount] = (Last created special effect)
                        Set ThunderStormDamage = (Random integer number between (((Level of Thunder Storm  for (Casting unit)) x 50) - 15) and (((Level of Thunder Storm  for (Casting unit)) x 75) - 10))
                        Unit - Cause (Casting unit) to damage (Picked unit), dealing (Real(ThunderStormDamage)) damage of attack type Chaos and damage type Lightning
                        Floating Text - Create floating text that reads (String(ThunderStormDamage)) above (Picked unit) with Z offset 0.00, using font size 8.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                        Floating Text - Change (Last created floating text): Disable permanence
                        Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
                    Else - Actions
        Wait 1.00 seconds
        For each (Integer A) from 1 to ThunderStormCount, do (Actions)
            Loop - Actions
                Special Effect - Destroy ThunderStormSE[(Integer A)]
        Unit Group - Remove all units from ThunderStormUnitGroup
        Custom script:   call RemoveLocation (udg_ThunderStormPoint)
        Custom script:   call RemoveLocation (udg_ThunderStormCastingPoint)

This is Trigger is similar to our fear spell. Set ThunderStormCount to 0, ThunderStormCastingPoint position of casting unit, set ThunderStormUnitGroup to all units which are not building, alive and not owned by owner of casting unit. Then we pick every unit in ThunderStormUnitGroup and increase ThunderStormCount by 1. if ThunderStormCount is less then 7 we do the rest of the loop actions. We set ThunderStormPoint to be the position of the unit, and then we create special effect on that point. Then we calculate damage (between level of ability X 50 – 15 and level of ability X 76 – 10) and we deal it to the picked unit as well as creating floating text that will tell us how much damage we caused. We set the special effect as ThunderStormSE[ThunderStormCount].

After a second we choose each integer between 1 and ThunderStormCount and we destroy ThunderStrom[Integer A].

Spell Num 8: PickPocket

In this ability you still gold from units, and even items after you learned level 3 of that ability.

Code:
PickPocket 1
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to PickPocket 
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of PickPocket  for (Casting unit)) Greater than or equal to 3
            Then - Actions
                Set PickPocketPercent = (Random integer number between 1 and 2)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        PickPocketPercent Equal to 1
                    Then - Actions
                        Player - Add ((Level of PickPocket  for (Casting unit)) x -50) to (Owner of (Target unit of ability being cast)) Current gold
                        Player - Add ((Level of PickPocket  for (Casting unit)) x 50) to (Owner of (Casting unit)) Current gold
                    Else - Actions
                        Hero - Drop (Item carried by (Target unit of ability being cast) in slot (Random integer number between 1 and 6)) from (Target unit of ability being cast)
                        Hero - Create (Item-type of (Last dropped item)) and give it to (Casting unit)
                        Item - Remove (Last dropped item)
            Else - Actions
                Player - Add ((Level of PickPocket  for (Casting unit)) x -50) to (Owner of (Target unit of ability being cast)) Current gold
                Player - Add ((Level of PickPocket  for (Casting unit)) x 50) to (Owner of (Casting unit)) Current gold

If level of PickPocket is less then 3 then the owner of target unit of ability being it cast will lose level of PickPocket X -50 and owner of casting unit will get level of PickPocket X 50. If the level of PickPocket is equal to 3 or more but our target is not a hero same thing will happen. If it is a hero we will choose random number between 1 and 2. if the number is 1, again the same thing will happen, if it’s 2 then the casting unit will still 1 item from the target unit of ability being cast (it’s not 100% sure that he’ll get it! Read the trigger carefully).

Spell Num 9: Mind Control

Ever wanted to control one’s mind? Yup then you are reading about the right spell!

Code:
Mind Control 1
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Mind Control 
        MindControlBoolean[(Player number of (Owner of (Casting unit)))] Equal to False
    Actions
        Set MindControlBoolean[(Player number of (Owner of (Casting unit)))] = True
        Set MindControlPlayer[(Player number of (Owner of (Casting unit)))] = (Owner of (Target unit of ability being cast))
        Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Casting unit)) and Change color
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering unit) is A Hero) Equal to True
            Then - Actions
                Wait ((Real((Level of Mind Control  for (Casting unit)))) + 4.00) seconds
            Else - Actions
                Wait ((Real((Level of Mind Control  for (Casting unit)))) + 7.00) seconds
        Unit - Change ownership of (Target unit of ability being cast) to MindControlPlayer[(Player number of (Owner of (Casting unit)))] and Change color
        Wait 45.00 seconds
        Set MindControlBoolean[(Player number of (Owner of (Casting unit)))] = False

Only exceptional condition is MindControlBoolean[Player number of owner of casting unit] is equal to false.

As the first action we set MindControlBoolean to true. We set MindControlPlayer to owner of target unit of ability being cast. Then we change the owner of the target to the owner of the casting unit. If the target is a hero we wait 4 seconds + level of mind control, if it’s a regular unit we control over it 7 + level of mind control. After that waiting time we change again the owner of the unit to MindControlPlayer, we wait 45 seconds and set MindControlBoolean to true.

Spell Num 10: Skilled Hit

The hero strikes using all his skills causing damage equal to his strength + Agility + intellect X level of ability.

Code:
Skilled Hit 1
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Skilled Hit 
    Actions
        Set SkillHitAGI = (Agility of (Casting unit) (Include bonuses))
        Set SkillHitINT = (Intelligence of (Casting unit) (Include bonuses))
        Set SkillHitSTR = (Strength of (Casting unit) (Include bonuses))
        Set SkillHitSum = ((SkillHitAGI + SkillHitINT) + (SkillHitSTR x (Level of Skilled Hit  for (Casting unit))))
        Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing (Real(SkillHitSum)) damage of attack type Normal and damage type Normal

*Side Note*: I know I could make the whole trigger in 1 line, but did it his way just to keep things clean.

So we set SkillHitAgi to hero’s agility SkillHitINT to hero’s intellect and SkillHitSTR to hero’s strength. Then we set SkillHitSum to SkillHitAGI + SkillHitINT + SkillHitSTR X level of Skilled Hit for casting unit, and then we deal that damage to the target of the ability.





Well that’s my tutorial, I hope you learned something for it, I know it’s too long for you to enjoy, but still. :D

Feel free to download the map, please comment / report on bugs!

~IKilledKEnny~
 

Attachments

  • 10 Best Spells IMO. FREE!!.w3x
    33 KB · Views: 492

Master

Thou shall be helped by...The Black Adder!
Reaction score
72
>[/color]
Fix that.

Don't use much coloring text, it makes the eyes hurt.
And, if they are all spells, why do you consider it a tutorial and not a spell pack? :D

Apart from these, it is very good on first sight.
 
I

IKilledKEnny

Guest
>[/color]
Fix that.

Don't use much coloring text, it makes the eyes hurt.
And, if they are all spells, why do you consider it a tutorial and not a spell pack? :D

Apart from these, it is very good on first sight.

Fixed, thanks! Did you read Q&A? I explained there why I call it a tutorial.

Edit: And about the colors, this is a ver long tutorial, I wanted to make it more colorful and not only plain text.
 

Master

Thou shall be helped by...The Black Adder!
Reaction score
72
Yes.
But it is better called a spell pack. Your own decision, though :)
 
S

Sunny_D

Guest
ok, well first i want to mention that those light colors are really painful. change them to darker colors. such a small contrast is very hard to read!

anyway, you should mention that the most spells are not MUI, what means you could only have them on single-player maps... you should at least mention that, cz some people will take that spell on the multiplayer map and then wonder why nothing works. ;)

now to the spells, i think they are useful and they are different. many people will find it helpful to see how - basically - those spells are built. and its described well and has a clear structure although it lacks clearness at some points...

overall a well done basic tutorial about some spells :)
 

Master

Thou shall be helped by...The Black Adder!
Reaction score
72
>ok, well first i want to mention that those light colors are really painful. such a small contrast can only be good for blind people... =p
Q-F-T.
Feel free to download the map, please comment / report on bugs!

Q: Are those spells downloadable?
A: Yes, I attached a map at the end of the tutorial with all the spells; you may download it and do with it what ever you want. You don’t have to give me credits.
Erm, what map?
 
I

IKilledKEnny

Guest
Darn, I knew I forgot somthing.... Posting map right now!!

And Sunny_D, these spells should work (although few of them new slight twists) with more then 1 player playing. Thanks for comments, I'll work also on deleting colors, I thought they'll add...
 
S

Sunny_D

Guest
you sure? because im not... i see many long waits between single actions. in my eyes they are not MUI... for example bombing, reflect and mind control... but well, thats only my opinion... ;)
 
I

IKilledKEnny

Guest
I'm sorry, but what do you mean in long waits? Yes bombing should take a minute until the bombs actually land, and mindcontrol should have long cooldown becuase it's a very strong ability. do you mean it simply won't work when serval players are playing, or it just won't fit? Everywhere needed I put array [12] (like 12 different variables / triggers).

Those spell won't work though if you have 2 units that can cast one of those spells, lots need to be changed to do that.
 
S

Sunny_D

Guest
Code:
Bombing 1 Create
....
        Game - Display to (All players) the text: ((Name of (Ability being cast)) +  Will initiate in 60 seconds)
[B]        Wait 60.00 seconds[/B]
        Game - Display to (All players) the text: ((Name of (Ability being cast)) +  Has initiated!)
        Set BombingCastingPoint = (Target point of ability being cast)
        Set BombingUnitsGroup = (Units within 500.00 of BombingCastingPoint)
[B]        Set BombingCastingUnit = (Casting unit)[/B]
....

i dont see an array here :)

if the spell is casted, and within those 60 seconds another one casts it?

EDIT:

Those spell won't work though if you have 2 units that can cast one of those spells, lots need to be changed to do that.

well, thats what i actually meant with non-MUI, lol :p
 

Master

Thou shall be helped by...The Black Adder!
Reaction score
72
7. ThunderStorm
>Begins casting
Starts the effect ;)
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
i didnt read all the spells cuz i dont have time but they are realy good i liked some of them :D
+Rep when i will be able to... :p
 
I

IKilledKEnny

Guest
Bump, I worked hours on this, more feedback will be appreciated.
 
G

GUNDAM

Guest
Those are really nice. Im not awesome with triggers/abilities or anything, so your tutorial really helped me out to understand what each thing did. Although I still dont understand perfectly, it did help me at least a bit. Anyway I think I'll use some of those spells in a map.

Ty for your work dude, it is awesome.
 
I

IKilledKEnny

Guest
Those are really nice. Im not awesome with triggers/abilities or anything, so your tutorial really helped me out to understand what each thing did. Although I still dont understand perfectly, it did help me at least a bit. Anyway I think I'll use some of those spells in a map.

Ty for your work dude, it is awesome.


Thanks so much for your nice comment! I appreciate that. :) Please DO send me a PM if you don't understand, I would be happy to answer you as well as editting the explanation so it would be clearer.
 

Chocobo

White-Flower
Reaction score
409
Code:
Reflect 1 Set
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Reflect 
    Actions
        Unit - Set the custom value of [B](Learning Hero)[/B] to 2
        Wait ((Real((Level of Reflect  for (Casting unit)))) x 30.00) seconds
        Unit - Set the custom value of [B](Learning Hero)[/B] to 1
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ReflectBoolean[(Player number of (Owner of (Casting unit)))] Equal to True
            Then - Actions
                Unit - Remove ReflectAbility[(Player number of (Owner of (Casting unit)))] from (Casting unit)
                Unit - Add Reflect  to (Casting unit)
                Unit - Set level of Reflect  for (Casting unit) to ReflectLevelInteger[(Player number of (Owner of (Target unit of ability being cast)))]
            Else - Actions

Learning hero? No learning hero there.
 
I

IKilledKEnny

Guest
Code:
Reflect 1 Set
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Reflect 
    Actions
        Unit - Set the custom value of [B](Learning Hero)[/B] to 2
        Wait ((Real((Level of Reflect  for (Casting unit)))) x 30.00) seconds
        Unit - Set the custom value of [B](Learning Hero)[/B] to 1
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ReflectBoolean[(Player number of (Owner of (Casting unit)))] Equal to True
            Then - Actions
                Unit - Remove ReflectAbility[(Player number of (Owner of (Casting unit)))] from (Casting unit)
                Unit - Add Reflect  to (Casting unit)
                Unit - Set level of Reflect  for (Casting unit) to ReflectLevelInteger[(Player number of (Owner of (Target unit of ability being cast)))]
            Else - Actions

Learning hero? No learning hero there.


Fixing, my bad, typo mistake. :( Thanks for spotting it!
 
G

GUNDAM

Guest
Thanks so much for your nice comment! I appreciate that. :) Please DO send me a PM if you don't understand, I would be happy to answer you as well as editting the explanation so it would be clearer.

Np.

Anyway just saying. Ty and I pretty much got it down cuz of the map attatchment. tyvm.
 

Tom Jones

N/A
Reaction score
437
I like the idea, however documentation would perhaps have been a better description, than tutorial.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top