Spell Help

Heyaheya321

New Member
Reaction score
0
Hey im trying to make this new spell i have never tried before. I want the spell, once learned to spawn a unit (figured that out) but then give the hero a book of spells that will be commands for this unit. The commands i want is, Defensive so the unit will attack when hero or it is attacked. Offensive, it just goes wild and attacks. Passive which will make the unit attack when ordered. Lastly i want a command that will be revive and the hero will stand there for like 10 seconds and then the unit will revive. How do i do this?? Please help with basic E/C/A (event condition action) format : ) thanks
 

LoveTD's

New Member
Reaction score
34
Hey im trying to make this new spell i have never tried before. I want the spell, once learned to spawn a unit (figured that out) but then give the hero a book of spells that will be commands for this unit. The commands i want is, Defensive so the unit will attack when hero or it is attacked. Offensive, it just goes wild and attacks. Passive which will make the unit attack when ordered. Lastly i want a command that will be revive and the hero will stand there for like 10 seconds and then the unit will revive. How do i do this?? Please help with basic E/C/A (event condition action) format : ) thanks

You could make a spellbook with all the things you want and giving it to the hero and make new triggers that when an ability is started then it would do sokmething, i'm sure there are some functions of it...:D
 

Heyaheya321

New Member
Reaction score
0
More specific

can i get something more specific, i know there are functions that do that, i have tried that i just need help how to do all those
 
Z

Zell

Guest
1.) In your trigger detecting the learning of the ability, add a line to add a custom Spell Book to the unit (it's an item ability). You'll need to look at "Data - Spell List" and add your commands (Aggressive, Passive, etc) and "Data - Maximum Spells" so that you can actually add 4 of them.

After you create the "summoned" unit (or if it's based off Summon Water Elemental or whatever), set the unit to a variable (I will use Unit_Summon for this example) with "Set Unit_Summon to (Last created unit)". If it is based off a summon spell, set the event to "A unit is summoned" and use "Event Response - Summoned Unit" in the Set Variable line. Also, set the casting unit to a variable we'll call Unit_Caster. You'll also need a Point_Caster point variable and a Integer_Loop integer variable. Finally, create a Region the size of the area you wish this summoned unit to roam in (it must be a square, and while a radius would be better, that's not an option here). Call it RegionSummon.

2.) The triggers! You'll need 4.
Code:
Set UnitSummon Behaviour
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Ability being cast) Equal to "Offensive"
            Then - Actions
                Trigger - Turn on Offensive <gen>
                Trigger - Run Offensive <gen> (ignoring conditions)
                Trigger - Turn off Defensive <gen>
                Trigger - Turn off Defensive Attack <gen>
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Ability being cast) Equal to "Defensive"
            Then - Actions
                Trigger - Turn on Defensive <gen>
                Trigger - Turn on Defensive Attack <gen>
                Trigger - Run Defensive <gen> (ignoring conditions)
                Trigger - Turn off Offensive <gen>
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Ability being cast) Equal to "Passive"
            Then - Actions
                Unit - Order Unit_Summon to Stop
                Trigger - Turn off Offensive <gen>
                Trigger - Turn off Defensive <gen>
                Trigger - Turn off Defensive Attack <gen>
            Else - Actions
The following 3 triggers must be "Initially Off" (uncheck the box):
Code:
Offensive
    Events
    Conditions
    Actions
        For each (Integer Integer_Loop) from 1 to 2, do (Actions)
            Loop - Actions
                Set Point_Caster = (Position of Unit_Caster)
                Region - Center RegionSummon <gen> on Point_Caster
                Unit - Order Unit_Summon to Attack-Move To (Random point in RegionSummon <gen>)
                Custom script:   call RemoveLocation (udg_Point_Caster)
                Wait 4.00 game-time seconds
                Set Integer_Loop = (Integer_Loop - 1)

Defensive
    Events
    Conditions
    Actions
        For each (Integer Integer_Loop) from 1 to 2, do (Actions)
            Loop - Actions
                Unit - Order Unit_Summon to Follow Unit_Caster
                Wait 4.00 game-time seconds
                Set Integer_Loop = (Integer_Loop - 1)

Defensive Attack
    Events
        Unit - A unit Is attacked
    Conditions
        (Attacked unit) Equal to Unit_Caster
    Actions
        Trigger - Turn off Defensive <gen>
        Unit - Order Unit_Summon to Attack (Attacking unit)
        Wait until ((Integer((Life of (Attacking unit)))) Equal to 0), checking every 1.00 seconds
        Trigger - Turn on Defensive <gen>
        Trigger - Run Defensive <gen> (ignoring conditions)

3.) Now it's your turn to create your revival spell. Make me proud.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top