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

Need a spell

Status
Not open for further replies.
Level 24
Joined
Aug 1, 2013
Messages
4,657
Nice :D

Do you have any triggering experience?

I am thinking about making an "Arrow Rain" special effect, powered by my missile system that you can use then.
Ofcourse I can make numberless configurables, but I hate them and they are kind of useless when you come to real stuff.
 
Level 3
Joined
Nov 24, 2015
Messages
19
Nice :D

Do you have any triggering experience?

I am thinking about making an "Arrow Rain" special effect, powered by my missile system that you can use then.
Ofcourse I can make numberless configurables, but I hate them and they are kind of useless when you come to real stuff.

about my triggering expereience i only can do cinematics.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Sorry for being a bit slow on this, but I didn't get it to work completely because I had a glitch in my missile system which would make this impossible...
But if I am to create a new version of it, why not fix other stuff with it as well right?
That ended up me wanting to have "IsUnitInRectangle" for rectangular detection instead of circle detection (that almost everyone uses) and that ended up me talking with Nestharus about his "IsPointInRectangle" snippet (which he said was bugged somehow) which leaves me building my own "IsPointInRectangle" function, which made me building Polygon2D...
Long story short, I was kind of distracted :D

But I said I would make something so why not?

  • Arrow Rain Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Arrow Rain
    • Actions
      • Set TempUnit = (Triggering unit)
      • -------- - --------
      • Custom script: call CreateMissileRain(udg_TempUnit, 70, GetSpellTargetLoc(), 200, "Abilities\\Weapons\\Arrow\\ArrowMissile.mdl")
      • -------- - --------
      • Set CMS_StartingHeight = 1000.00
      • Set CMS_StartingLocation = (Target point of ability being cast)
      • Set CMS_StartingPitch = -90.00
      • Set CMS_StartingSource = TempUnit
      • Set CMS_StartingSpeed = 500.00
      • Set CMS_StartingType = 12345
      • -------- - --------
      • Custom script: set udg_TempInteger = CMS_CreateMissile()
      • -------- - --------
      • Set CMS_Param_IsFlying[TempInteger] = True
      • Set CMS_Param_Gravity[TempInteger] = (-45.00 x 0.03)
      • Set CMS_Param_MaxDuration[TempInteger] = 10.00
      • Special Effect - Create a special effect attached to the origin of CMS_Param_Missile[TempInteger] using Abilities\Weapons\Arrow\ArrowMissile.mdl
      • Set CMS_Param_Effect[TempInteger] = (Last created special effect)
      • -------- - --------
      • Set ArrowRain_AreaOfEffect[CMS_Param_Index[TempInteger]] = 200.00
      • Set ArrowRain_Damage[CMS_Param_Index[TempInteger]] = 150.00
First, it makes "70" missiles around the "target location of ability being cast" with a "200" radius.
The missiles will have "Abilities\Weapons\Arrow\ArrowMissile.mdl" as model.
This can all be changed to your preferences but if you are unfamiliar with variables inside custom script functions, then you should definately try something out.
(The unit variable is simply a unit to prevent the owner of the missiles (units as well) be null... which makes no missiles at all.)

For the remaining part of the trigger, that is all basic stuff of the missile system.
You set the starting properties right (StartingType is important).
Then you create a new missile and store it's array index in an integer variable.
Then you set some stuff specificly for the main missile. (Main missile is going to make the onDestroy/onDamage event and stores some data.)

The last two variables are specifically for arrow rains.
Both variables must be arrays so they can be used for multiple arrow rains at once (MUI).
The index that you use for the variables is the "Param_Index" of the missile.
(The only two variables that I made are area of effect and damage but you can make more yourself.)
(Be aware that changing the AreaOfEffect variable here does not change the AoE of the missiles so you have to set the value in the custom script at the top to the same value.)

The other trigger:
  • Arrow Rain OnDamage
    • Events
      • Game - CMS_Event_Missile_Destroyed becomes Equal to 0.00
    • Conditions
      • CMS_Param_Type[CMS_Index] Equal to 12345
    • Actions
      • Set TempLocation = (Position of CMS_Param_Missile[CMS_Index])
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within ArrowRain_AreaOfEffect[CMS_Param_Index[CMS_Index]] of TempLocation) and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempUnit is A structure) Equal to False
              • (TempUnit belongs to an enemy of (Owner of CMS_Param_Missile[CMS_Index])) Equal to True
              • (TempUnit is dead) Equal to False
            • Then - Actions
              • Unit - Cause CMS_Param_Source[CMS_Index] to damage TempUnit, dealing ArrowRain_Damage[CMS_Param_Index[CMS_Index]] damage of attack type Pierce and damage type Normal
            • Else - Actions
      • Custom script: call RemoveLocation(udg_TempLocation)
Runs when the main missile is destroyed.
The condition makes sure that the missile is from the arrow rain by checking if the type is the same. (That is why it is important. Also never set this value to 0... just don't.)

Here, I pick all units in AoE range and check if they are alive enemy units.
Then I deal damage to those units.
(Always care for leaks ofcourse.)
The CMS_Index is the index of the missile that was destroyed.

If you have problems setting the data to your preferences or having issues importing the triggers, then just yell... somewhere.
(When importing the triggers, make sure that you also import the custom units and abilities and set the CMS Configuration properly.)
 

Attachments

  • Arrow Rain.w3x
    106.4 KB · Views: 40
Last edited:
Status
Not open for further replies.
Top