• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How can I make my Boss cast a Spell?

Status
Not open for further replies.

Yrk

Yrk

Level 6
Joined
Apr 1, 2014
Messages
239
Hi Guys :), I have questions, How can I make my Boss cast a spell?, And How can I make a Damage Area Spell (What I mean is that when my Boss cast a spell there's an Damage Area)
 
Level 11
Joined
Dec 19, 2012
Messages
411
Do you mean modified spell? If you mean modified spell, you may use GUI functions: Issue order unit attack unit/point/no target.

But modified spells are unable to change their base order ID ( except channel ) , so if you have 2 spells which based on the same ability will conflict if the unit has 2 same based spell ( the unit will try to cast 2 spell )

About 2nd question: Use GUI function : Unit - Damage area, but that would required a trigger to work on it.
 
Level 5
Joined
Dec 3, 2012
Messages
117
I use either Autocast abilities, or abilities based on the available abilites in "Issue order unit to "Cast Ability" on target" in the trigger editor

for example, a skill based on Storm Bolt;

  • Throw Stone
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to HEROPlayerHero[(Player number of (Owner of (Attacking unit)))]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Throw Stone (Thief Plat) for (Attacked unit)) Equal to 1
        • Then - Actions
          • Set TEMPInteger = (Random integer number between 1 and 20)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TEMPInteger Equal to 5
            • Then - Actions
              • Unit - Order (Attacked unit) to Human Mountain King - Storm Bolt (Attacking unit)
            • Else - Actions
        • Else - Actions
For the 2nd question; what DD said
 

Yrk

Yrk

Level 6
Joined
Apr 1, 2014
Messages
239
Do you mean modified spell? If you mean modified spell, you may use GUI functions: Issue order unit attack unit/point/no target.

But modified spells are unable to change their base order ID ( except channel ) , so if you have 2 spells which based on the same ability will conflict if the unit has 2 same based spell ( the unit will try to cast 2 spell )

About 2nd question: Use GUI function : Unit - Damage area, but that would required a trigger to work on it.
I think (It's modified), I'll try this , And Thanks
I use either Autocast abilities, or abilities based on the available abilites in "Issue order unit to "Cast Ability" on target" in the trigger editor

for example, a skill based on Storm Bolt;

  • Throw Stone
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to HEROPlayerHero[(Player number of (Owner of (Attacking unit)))]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Throw Stone (Thief Plat) for (Attacked unit)) Equal to 1
        • Then - Actions
          • Set TEMPInteger = (Random integer number between 1 and 20)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TEMPInteger Equal to 5
            • Then - Actions
              • Unit - Order (Attacked unit) to Human Mountain King - Storm Bolt (Attacking unit)
            • Else - Actions
        • Else - Actions
For the 2nd question; what DD said

Thanks :), And I'll try this too
 
Level 28
Joined
Oct 28, 2011
Messages
4,759
I use either Autocast abilities, or abilities based on the available abilites in "Issue order unit to "Cast Ability" on target" in the trigger editor

for example, a skill based on Storm Bolt;

  • Throw Stone
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to HEROPlayerHero[(Player number of (Owner of (Attacking unit)))]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Throw Stone (Thief Plat) for (Attacked unit)) Equal to 1
        • Then - Actions
          • Set TEMPInteger = (Random integer number between 1 and 20)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TEMPInteger Equal to 5
            • Then - Actions
              • Unit - Order (Attacked unit) to Human Mountain King - Storm Bolt (Attacking unit)
            • Else - Actions
        • Else - Actions
For the 2nd question; what DD said

Or instead of ordering unit you can just put the trigger of the custom spell like what I do on my maps.

  • Creeps Abilities
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has an item of type Wizard Staff) Equal to (==) True
          • (Random integer number between 1 and 100) Less than or equal to (<=) 20
        • Then - Actions
          • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Weapons\Bolt\BoltImpact.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set CA_Damage[(Player number of (Owner of (Triggering unit)))] = 120
          • Set CA_Point = (Position of (Triggering unit))
          • Set CA_Group = (Units within 400.00 of CA_Point matching ((((Matching unit) is An Ancient) Equal to (==) False) and ((((Matching unit) is Magic Immune) Equal to (==) False) and ((((Matching unit) is alive) Equal to (==) True) and (((Matching unit) belongs to an enemy of
          • Unit Group - Pick every unit in CA_Group and do (Actions)
            • Loop - Actions
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing CA_Damage[(Player number of (Owner of (Triggering unit)))] damage of attack type Spells and damage type Normal
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • ((Picked unit) is An Ancient) Equal to (==) False
                  • Then - Actions
                    • Set KB2D_Source = (Attacked unit)
                    • Set KB2D_Target = (Attacking unit)
                    • Custom script: set udg_KB2D_TempKey = GetHandleId(udg_KB2D_Target)
                    • Set KB2D_SFX = Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
                    • Set KB2D_Distance = 250.00
                    • Set KB2D_Duration = 0.70
                    • Set KB2D_Loc = (Position of KB2D_Source)
                    • Set KB2D_Offset = (Position of KB2D_Target)
                    • Set KB2D_Angle = (Angle from KB2D_Loc to KB2D_Offset)
                    • Custom script: call ExecuteFunc("ApplyKnockbackEffect")
                    • Custom script: call RemoveLocation(udg_KB2D_Offset)
                    • Custom script: call RemoveLocation(udg_KB2D_Loc)
                  • Else - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • ((Picked unit) is alive) Equal to (==) True
                  • Then - Actions
                    • Floating Text - Create floating text that reads (|c000080c0 + ((String((Integer(CA_Damage[(Player number of (Owner of (Triggering unit)))])))) + |r)) above (Picked unit) with Z offset 0.00, using font size 7.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                    • Floating Text - Set the velocity of (Last created floating text) to 60.00 towards 90.00 degrees
                    • Floating Text - Change (Last created floating text): Disable permanence
                    • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
                    • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
                    • Floating Text - Set the velocity of (Last created floating text) to 60.00 towards 90.00 degrees
                    • Floating Text - Show (Last created floating text) for AllPlayers
                  • Else - Actions
          • Custom script: call RemoveLocation (udg_CA_Point)
          • Custom script: call DestroyGroup (udg_CA_Group)
        • Else - Actions
You can do it like that if the Boss' ability is unique for himself.
 
Status
Not open for further replies.
Top