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

Chain Lightning on Attack

Status
Not open for further replies.
Level 2
Joined
Jul 23, 2007
Messages
15
how can i make a unit have a skill that will cast chain lightning on an attack rather than having it casted?
 
Level 25
Joined
May 11, 2007
Messages
4,651
Use triggers.

A unit is attacked
unit type of attacking unit equal to lighting über powered beast
set tempunit1 = attacking unit
set tempunit2 = attacked unit
unit - issue tempunit1 to chain lighting tempunit2
clear groups.
 
Level 25
Joined
Apr 27, 2008
Messages
2,512
you have two choices:

1- search for the shaman claw item thing from Rexxar campaign. it have an ability that allows you to cast purge when attacking (a % chance) just replace the purge with a chain lightning and fix the chance

2- create a trigger that when attacking there is a % chance to create a dummy, and that dummy cast the chain lightning

the first choice make your ability "Orb Effect"
the second doesn't
 
Level 8
Joined
Aug 3, 2008
Messages
391
This perhaps, is a way to do it:

Create a dummy. Dummies are hidden spell casters. Just base it of a unit, null the model path and add the Locust ability.

Create a passive ability for the attacking unit and make it have no effects. For this case, I'll call it "YourSpell". If you like, you can make it have levels.

Create an ability based on Chain Lightning. This ability will be for "YourDummy". Let's say we call it "DummyChainLightning". If you have added levels to "YourSpell", make sure to add the same amount of levels to "DummyChainLightning". Make sure to make the mana cost to 0.

Operate with the trigger below.


  • Events
    • A unit Is attacked
  • Conditions
    • And - All (Conditions) are true
      • (Unit-type of (Triggering Unit)) Equal to YourUnit
      • (Level of YourSpell for (Triggering Unit)) Greater than or equal to 1
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Random integer number between 1 and 100) Less than or equal to 20
      • Then - Actions
        • Unit - Create YourDummy for (Owner of (Triggering Unit)) at (Position of (Attacked Unit)) facing Default building facing degrees.
        • Unit - Add DummyChainLightning to (Last Created Unit)
        • Unit - Set level of DummyChainLightning for (Last Created Unit) to (Level of YourSpell for (TriggeringUnit))
        • Unit - Order (Last Created Unit) to Orc Far Seer - Chain Lightning (Attacked Unit)
        • Unit - Add a 2.00 second Generic expiration timer to (Last Created Unit)
Summary of the trigger above:
-"Your Ability" will have a 20% chance to create a Dummy at the position of the attacked unit.
-The Dummy will then have the ability "DummyChainLightning" added with the levels set the same as the level of "YourAbility".
-The Dummy will then cast a Chain Lightning at the attacked trigger.
-The Dummy then will die after 2.00 seconds.

May seem hard, but it's better for improving your triggering skills. If you can't get it to work, try Joe's method with the item.
 
Status
Not open for further replies.
Top