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

===Formula Thread===

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
Hello there, I've created this thread just to gather all the formulas in warcraft 3 trigger script and let's share our knowledge together with the forumers :D


=====GUI=====


Such as, formula/way/method to do an AOE (circle-effect) trigger, do this:
[AOE EFFECT]
  • Unit Group - Pick every unit in (Units within 600.00 of (Center of (Playable map area)) matching (((Triggering unit) is A structure) Equal to True)) and do (Actions)
    • Loop - Actions
      • Unit - Kill (Picked unit)
This is just a purely an example



Remember, I don't care about LEAKS as they are too general to talk in this thread, everyone has different usage/name of the variable, therefore, you should not talk about leaks in there (I mean, just to keep it low, no need to be so serious just in this thread)
Because, this thread only focuses on FORMULA/METHOD to pick unit


Share your other formula, I'll add them in the first post so that other people can come in easily and take that trigger for example
Credits goes to the person who create/CnP that trigger, but remember, to credit to the original author
Format: Trigger + Screenshot


[SINGLE-LINE INSTANT SPELL - millzy]
  • WALL
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set point[1] = (Position of (Triggering unit))
      • Set point[2] = (Target point of ability being cast)
      • Set angle = (Angle from point[1] to point[2])
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set point[3] = (point[1] offset by ((Real((Integer A))) x (800.00 / 5.00)) towards angle degrees)
          • Unit - Create 1 Footman for Player 1 (Red) at point[3] facing angle degrees

[LOOPING MULTI-SHOT DEGREE - defskull]
  • Multi Arrow Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Multi Shot
    • Actions
      • Set CasterLoc = (Position of (Triggering unit))
      • Set TargetLoc = (Target point of ability being cast)
      • Set InitialLoopDegree = ((Facing of (Triggering unit)) - 54.00)
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set InitialLoopDegree = (InitialLoopDegree + 18.00)
          • Set ArrowsLoc = (CasterLoc offset by 50.00 towards InitialLoopDegree degrees)
          • Unit - Create 1 Multi Shot Dummy for (Owner of (Triggering unit)) at ArrowsLoc facing (Angle from CasterLoc to ArrowsLoc) degrees
          • Set ArrowMoveLoc = (ArrowsLoc offset by 1000.00 towards (Facing of (Last created unit)) degrees)
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Move To ArrowMoveLoc
          • Custom script: call RemoveLocation(udg_ArrowsLoc)
          • Custom script: call RemoveLocation(udg_ArrowMoveLoc)
      • Custom script: call RemoveLocation(udg_CasterLoc)
      • Custom script: call RemoveLocation(udg_TargetLoc)
attachment.php

attachment.php



[SINGLE-LINE INTERVAL TRIGGER - millzy]
  • Shadow wave
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shadow Wave
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in SW_group) Equal to 0
        • Then - Actions
          • Trigger - Turn on shadow wave Loop <gen>
        • Else - Actions
      • Set SW_index = (SW_index + 1)
      • Set SW_Hero[SW_index] = (Casting unit)
      • Set SW_Point[1] = (Position of SW_Hero[SW_index])
      • Set SW_Point[2] = (Target point of ability being cast)
      • Set SW_Distance[SW_index] = 0.00
      • Set SW_Reached[SW_index] = 600.00
      • Set SW_Speed[SW_index] = 30.00
      • Set SW_angel[SW_index] = (Angle from SW_Point[1] to SW_Point[2])
      • Custom script: call RemoveLocation(udg_SW_Point[1])
      • Custom script: call RemoveLocation(udg_SW_Point[2])
      • Set SW_caster_p[SW_index] = (Position of SW_Hero[SW_index])
      • Unit - Create 1 dummy shadow for (Owner of (Triggering unit)) at SW_caster_p[SW_index] facing SW_angel[SW_index] degrees
      • Set SW_missle[SW_index] = (Last created unit)
      • Unit Group - Add SW_Hero[SW_index] to SW_group
  • shadow wave Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer SW_Loop) from 1 to SW_index, do (Actions)
        • Loop - Actions
          • Set SW_Distance[SW_Loop] = (SW_Distance[SW_Loop] + SW_Speed[SW_Loop])
          • Set SW_X[1] = (SW_caster_p[SW_Loop] offset by SW_Distance[SW_Loop] towards SW_angel[SW_Loop] degrees)
          • Unit - Move SW_missle[SW_Loop] instantly to SW_X[1], facing SW_angel[SW_Loop] degrees
          • Set SW_Dam_Group[SW_Loop] = (Units within 175.00 of SW_X[1] matching (((Owner of (Matching unit)) Not equal to (Owner of SW_Hero[SW_Loop])) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is in SW_buffers[SW_Loop]) Equal to False))))
          • Unit Group - Pick every unit in SW_Dam_Group[SW_Loop] and do (Actions)
            • Loop - Actions
              • Unit - Create 1 dummy for (Owner of SW_Hero[SW_Loop]) at SW_X[1] facing Default building facing degrees
              • Unit - Add shadow wave dummy to (Last created unit)
              • Unit - Set level of shadow wave dummy for (Last created unit) to (Level of Shadow Wave for SW_Hero[SW_Loop])
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit - Order (Last created unit) to Human Priest - Inner Fire (Picked unit)
              • Unit Group - Add (Picked unit) to SW_buffers[SW_Loop]
          • Custom script: call DestroyGroup(udg_SW_Dam_Group[udg_SW_Loop])
          • Custom script: call RemoveLocation(udg_SW_X[1])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SW_Distance[SW_Loop] Greater than or equal to SW_Reached[SW_Loop]
            • Then - Actions
              • Unit - Kill SW_missle[SW_Loop]
              • Custom script: call RemoveLocation(udg_SW_caster_p[udg_SW_Loop])
              • Unit Group - Pick every unit in SW_buffers[SW_Loop] and do (Actions)
                • Loop - Actions
                  • Unit Group - Remove (Picked unit) from SW_buffers[SW_Loop]
              • Unit Group - Remove SW_Hero[SW_Loop] from SW_group
              • Set SW_Hero[SW_Loop] = No unit
              • Set SW_missle[SW_Loop] = No unit
              • Set SW_Distance[SW_Loop] = 0.00
              • Set SW_angel[SW_Loop] = 0.00
              • Set SW_Speed[SW_Loop] = 0.00
              • Set SW_Reached[SW_Loop] = 0.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in SW_group) Equal to 0
                • Then - Actions
                  • Set SW_index = 0
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions

[EFFECTIVE FORMULA FOR BACKSTAB]
*NEED HELP*


[PICKS UP RECTANGLE/SQUARE UNIT IN FRONT OF CASTER]
*NEED HELP*


[CONE-SHAPED FORMULA/BREATH OF FIRE AREA FORMULA]
*NEED HELP*

[BOOMERANG-LIKE TRIGGER]
*NEED HELP*


[UNIQUE CAMERA FORMULA]
ap0calypse
  • CamZ
    • Events
      • Player - Player 1 (Red) types a chat message containing -zoom as A substring
    • Conditions
    • Actions
      • -------- Maximum Value (Camera can't zoom out further) --------
      • Set MaxValue = 3000.00
      • -------- Minimum Value (Camera can't zoom in further) --------
      • Set MinValue = 500.00
      • -------- Do not change below this line --------
      • For each (Integer A) from 1 to (Length of (Entered chat string)), do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), (Integer A), (Integer A))) Equal to
            • Then - Actions
              • Set Camera_Distance = (Real((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string))))))
            • Else - Actions
      • Camera - Set (Triggering player)'s camera Distance to target to Camera_Distance over 0.20 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Camera_Distance Greater than or equal to MaxValue
        • Then - Actions
          • Camera - Set (Triggering player)'s camera Distance to target to MaxValue over 0.20 seconds
          • Set Camera_Distance = MaxValue
          • Game - Display to (All players matching ((Triggering player) Equal to (Matching player))) for 6.00 seconds the text: |c00ff0000Zoomed ou...
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Camera_Distance Less than or equal to MinValue
            • Then - Actions
              • Camera - Set (Triggering player)'s camera Distance to target to MinValue over 0.20 seconds
              • Set Camera_Distance = MinValue
              • Game - Display to (All players matching ((Triggering player) Equal to (Matching player))) for 6.00 seconds the text: |c00ff0000Zoomed in...
            • Else - Actions
  • Adjust Speed
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set Group = (Units in (Playable map area))
      • Unit Group - Pick every unit in Group and do (Actions)
        • Loop - Actions
          • Set Loc1 = (Position of (Picked unit))
          • Set Loc2 = (TempLoc[1] offset by 100.00 towards (Facing of (Picked unit)) degrees)
          • Custom script: set udg_Real1 = GetLocationZ(udg_Loc1)
          • Custom script: set udg_Real2 = GetLocationZ(udg_Loc2)
          • Custom script: call RemoveLocation(udg_Loc1)
          • Custom script: call RemoveLocation(udg_Loc2)
          • Unit - Set (Picked unit) movement speed to ((Default movement speed of (Picked unit)) + (Real1 - Real2))
      • Custom script: call GroupClear(udg_Group)

mckill2009

  • CAM Lock
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Camera - Lock camera target for Player 1 (Red) to P01_Hero, offset by (0.00, 0.00) using Default rotation
  • Fixed Rotation
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • Camera - Set Player 1 (Red)'s camera Rotation to CAM_Rotation over 0.03 seconds
      • Camera - Set Player 1 (Red)'s camera Distance to target to CAM_Zoom over 0.03 seconds
  • CAM Left Press
    • Events
      • Player - Player 1 (Red) Presses the Left Arrow key
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CAM Right Rotation <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on CAM Left Rotation <gen>
        • Else - Actions
  • CAM Left Release
    • Events
      • Player - Player 1 (Red) Releases the Left Arrow key
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • Trigger - Turn off CAM Left Rotation <gen>
  • CAM Left Rotation
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • Set CAM_Rotation = (CAM_Rotation - 2.00)
  • CAM Right Press
    • Events
      • Player - Player 1 (Red) Presses the Right Arrow key
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CAM Left Rotation <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on CAM Right Rotation <gen>
        • Else - Actions
  • CAM Right Release
    • Events
      • Player - Player 1 (Red) Releases the Right Arrow key
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • Trigger - Turn off CAM Right Rotation <gen>
  • CAM Right Rotation
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • Set CAM_Rotation = (CAM_Rotation + 2.00)
  • CAM Up Press
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CAM Up Zoom In <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on CAM Up Zoom Out <gen>
        • Else - Actions
  • CAM Up Release
    • Events
      • Player - Player 1 (Red) Releases the Up Arrow key
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • Trigger - Turn off CAM Up Zoom Out <gen>
  • CAM Up Zoom Out
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CAM_Zoom Less than or equal to 3000.00
        • Then - Actions
          • Set CAM_Zoom = (CAM_Zoom + 10.00)
        • Else - Actions
  • CAM Down Press
    • Events
      • Player - Player 1 (Red) Presses the Down Arrow key
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CAM Up Zoom Out <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on CAM Up Zoom In <gen>
        • Else - Actions
  • CAM Down Release
    • Events
      • Player - Player 1 (Red) Releases the Down Arrow key
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • Trigger - Turn off CAM Up Zoom In <gen>
  • CAM Up Zoom In
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CAM_Zoom Greater than or equal to 500.00
        • Then - Actions
          • Set CAM_Zoom = (CAM_Zoom - 10.00)
        • Else - Actions

[INSTANT COOL SFX CREATION - Mantis_Style]
  • Circle
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Circle
    • Actions
      • Set Number_of_Effects = 10
      • Set Target_Point = (Target point of ability being cast)
      • For each (Integer A) from 1 to Number_of_Effects, do (Actions)
        • Loop - Actions
          • Set New_Point = (Target_Point offset by 350.00 towards ((360.00 / (Real(Number_of_Effects))) x (Real((Integer A)))) degrees)
          • Special Effect - Create a special effect at New_Point using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation(udg_New_Point)
      • Custom script: call RemoveLocation(udg_Target_Point)
circlel.jpg
[/box]


  • Star
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Star
    • Actions
      • Set Target_Point = (Target point of ability being cast)
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • For each (Integer B) from 1 to 10, do (Actions)
            • Loop - Actions
              • Set New_Point = (Target_Point offset by (30.00 x (Real((Integer B)))) towards ((360.00 / 5.00) x (Real((Integer A)))) degrees)
              • Special Effect - Create a special effect at New_Point using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
              • Special Effect - Destroy (Last created special effect)
              • Custom script: call RemoveLocation(udg_New_Point)
      • Custom script: call RemoveLocation(udg_Target_Point)
starzg.jpg



[INSTANT ELLIPSE/CURVE - Rmx (Mantis_Style)]
  • Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Spell
    • Actions
      • Set Point[0] = (Position of (Triggering unit))
      • Set Point[1] = (Target point of ability being cast)
      • Set Angle = (Facing of (Triggering unit))
      • Set MaxDistance = (Distance between Point[0] and Point[1])
      • Set Constant = 1.45
      • For each (Integer A) from 1 to 30, do (Actions)
        • Loop - Actions
          • Set Distance = ((MaxDistance / 30.00) x (Real((Integer A))))
          • Set Point[2] = (Point[0] offset by Distance towards Angle degrees)
          • Set Point[3] = (Point[2] offset by (Constant x ((MaxDistance - Distance) x (Distance / MaxDistance))) towards (Angle - 90.00) degrees)
          • Set Point[4] = (Point[2] offset by (Constant x ((MaxDistance - Distance) x (Distance / MaxDistance))) towards (Angle + 90.00) degrees)
          • Special Effect - Create a special effect at Point[3] using Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at Point[4] using Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation(udg_Point[2])
          • Custom script: call RemoveLocation(udg_Point[3])
          • Custom script: call RemoveLocation(udg_Point[4])
      • Custom script: call RemoveLocation(udg_Point[0])
      • Custom script: call RemoveLocation(udg_Point[1])
ellipse.jpg



=====JASS=====


[CONTROLLABLE CIRCLE EFFECT - chobibo]
JASS:
//====================================================================================================
//=   StarShapeGenerator by chobibo                                                                  =
//====================================================================================================
library StarShapeGenerator

globals
private constant hashtable  HASHTABLE       = InitHashtable()
private constant integer    HASHKEY_SIDES   = StringHash("sides")
private constant integer    MINIMUM_SIDES   = 5
private constant integer    MAXIMUM_SIDES   = 8
private constant integer    TRIANGLE        = 3
endglobals

private function remove takes nothing returns nothing
    local integer parentkey=GetHandleId(GetExpiredTimer())
    local effect e
    local lightning l
    local integer i=0
    local integer sides=LoadInteger(HASHTABLE,parentkey,HASHKEY_SIDES)
    
    loop
        exitwhen (i==sides)
        set e=LoadEffectHandle(HASHTABLE,parentkey,i)
        set l=LoadLightningHandle(HASHTABLE,parentkey,sides+i)
        call DestroyEffect(e)
        call DestroyLightning(l)
        set i=i+1
    endloop
    
    call FlushChildHashtable(HASHTABLE,parentkey)
    call DestroyTimer(GetExpiredTimer())
    set e=null
    set l=null
endfunction

function StarShapeGenerator_create takes string lightningfxname, string pointfxpath, real centerX, real centerY, real facing, real radius, real duration, integer sides returns nothing
    local real array x
    local real array y
    local effect e
    local lightning l
    local integer i=0
    local integer j=0
    local real angle=facing*3.14159/180
    local timer t=CreateTimer()
    local integer parentkey=GetHandleId(t)
    
    if (sides<MINIMUM_SIDES) then
        set sides=TRIANGLE
    elseif (sides>MAXIMUM_SIDES) then
        set sides=MAXIMUM_SIDES
    endif
    
    loop
        exitwhen (i==sides)
        set x[i]=centerX+Cos(angle)*radius
        set y[i]=centerY+Sin(angle)*radius
        set angle=angle+(2*3.14159/sides)
        set e=AddSpecialEffect(pointfxpath,x[i],y[i])
        call SaveEffectHandle(HASHTABLE,parentkey,i,e)
        set i=i+1
    endloop
    
    set i=0
    
    loop
        exitwhen (i==sides)
        set j=ModuloInteger(i+2,sides)
        set l=AddLightning(lightningfxname,true,x[i],y[i],x[j],y[j])
        call SaveLightningHandle(HASHTABLE,parentkey,sides+i,l)
        set i=i+1
    endloop
    
    call SaveInteger(HASHTABLE,parentkey,HASHKEY_SIDES,sides)
    
    call TimerStart(t,duration,false,function remove)
    set e=null
    set l=null
    set t=null
endfunction

endlibrary
//====================================================================================================



To make a triangle, set the value of sides to 3:
TRIANGLE
attachment.php




To make a pentagram, set the value of sides to 5:
PENTAGRAM
attachment.php





To make a star of David, set the value of sides to 6:
STAR OF DAVID
attachment.php



NOTE: Please share your other knowledge about formula/method in warcraft triggering if you know some of them and it is unique to be shared :D
Also, the part where I wrote the *NOT AVAILABLET YET* sign is actually my problems that I didn't solve it yet or just don't know how to. So, help is needed :D
 

Attachments

  • untitled.JPG
    untitled.JPG
    7.6 KB · Views: 1,042
  • Multi Arrow.JPG
    Multi Arrow.JPG
    67.9 KB · Views: 1,089
Last edited:
Level 15
Joined
Jul 9, 2008
Messages
1,552
here ill paste the triggers for a spell i made a long time ago "shadow wave" that uses a line

a wave of darkness hits the units and adds a buff that decreases armour and attack damage to the units it hits

it is fully MUI

  • Shadow wave
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shadow Wave
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in SW_group) Equal to 0
        • Then - Actions
          • Trigger - Turn on shadow wave Loop <gen>
        • Else - Actions
      • Set SW_index = (SW_index + 1)
      • Set SW_Hero[SW_index] = (Casting unit)
      • Set SW_Point[1] = (Position of SW_Hero[SW_index])
      • Set SW_Point[2] = (Target point of ability being cast)
      • Set SW_Distance[SW_index] = 0.00
      • Set SW_Reached[SW_index] = 600.00
      • Set SW_Speed[SW_index] = 30.00
      • Set SW_angel[SW_index] = (Angle from SW_Point[1] to SW_Point[2])
      • Custom script: call RemoveLocation(udg_SW_Point[1])
      • Custom script: call RemoveLocation(udg_SW_Point[2])
      • Set SW_caster_p[SW_index] = (Position of SW_Hero[SW_index])
      • Unit - Create 1 dummy shadow for (Owner of (Triggering unit)) at SW_caster_p[SW_index] facing SW_angel[SW_index] degrees
      • Set SW_missle[SW_index] = (Last created unit)
      • Unit Group - Add SW_Hero[SW_index] to SW_group
  • shadow wave Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer SW_Loop) from 1 to SW_index, do (Actions)
        • Loop - Actions
          • Set SW_Distance[SW_Loop] = (SW_Distance[SW_Loop] + SW_Speed[SW_Loop])
          • Set SW_X[1] = (SW_caster_p[SW_Loop] offset by SW_Distance[SW_Loop] towards SW_angel[SW_Loop] degrees)
          • Unit - Move SW_missle[SW_Loop] instantly to SW_X[1], facing SW_angel[SW_Loop] degrees
          • Set SW_Dam_Group[SW_Loop] = (Units within 175.00 of SW_X[1] matching (((Owner of (Matching unit)) Not equal to (Owner of SW_Hero[SW_Loop])) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is in SW_buffers[SW_Loop]) Equal to False))))
          • Unit Group - Pick every unit in SW_Dam_Group[SW_Loop] and do (Actions)
            • Loop - Actions
              • Unit - Create 1 dummy for (Owner of SW_Hero[SW_Loop]) at SW_X[1] facing Default building facing degrees
              • Unit - Add shadow wave dummy to (Last created unit)
              • Unit - Set level of shadow wave dummy for (Last created unit) to (Level of Shadow Wave for SW_Hero[SW_Loop])
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit - Order (Last created unit) to Human Priest - Inner Fire (Picked unit)
              • Unit Group - Add (Picked unit) to SW_buffers[SW_Loop]
          • Custom script: call DestroyGroup(udg_SW_Dam_Group[udg_SW_Loop])
          • Custom script: call RemoveLocation(udg_SW_X[1])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SW_Distance[SW_Loop] Greater than or equal to SW_Reached[SW_Loop]
            • Then - Actions
              • Unit - Kill SW_missle[SW_Loop]
              • Custom script: call RemoveLocation(udg_SW_caster_p[udg_SW_Loop])
              • Unit Group - Pick every unit in SW_buffers[SW_Loop] and do (Actions)
                • Loop - Actions
                  • Unit Group - Remove (Picked unit) from SW_buffers[SW_Loop]
              • Unit Group - Remove SW_Hero[SW_Loop] from SW_group
              • Set SW_Hero[SW_Loop] = No unit
              • Set SW_missle[SW_Loop] = No unit
              • Set SW_Distance[SW_Loop] = 0.00
              • Set SW_angel[SW_Loop] = 0.00
              • Set SW_Speed[SW_Loop] = 0.00
              • Set SW_Reached[SW_Loop] = 0.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in SW_group) Equal to 0
                • Then - Actions
                  • Set SW_index = 0
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
 
Last edited:
Level 15
Joined
Jul 9, 2008
Messages
1,552
Is this a shock-wave like spell trigger ?
I mean, an instant pick up units
I believe it is with the Looping
But, thanks, will add those trigger and credits + rep :D

oh ok here it leaks locations tho


  • WALL
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set point[1] = (Position of (Triggering unit))
      • Set point[2] = (Target point of ability being cast)
      • Set angle = (Angle from point[1] to point[2])
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set point[3] = (point[1] offset by ((Real((Integer A))) x (800.00 / 5.00)) towards angle degrees)
          • Unit - Create 1 Footman for Player 1 (Red) at point[3] facing angle degrees
  • Set point[3] = (point[1] offset by ((Real((Integer A))) x (800.00 / 5.00)) towards angle degrees)
details about the numbers
Integer A = this is so the point will set the amount of loops
800 = the total distance (you can use distance between points 1 and 2 but it becomes glitchy when you cast it close to you)
5 = since it loops 5 times its divided by five to make the 5 points the footmen are created (basicly u divide it by how many loops u have)

it will create 5 footmen in a line infrunt of the hero all at the same time (instantly)
 

Attachments

  • line spell (line of footmen).w3x
    16.9 KB · Views: 147
Last edited:
Level 22
Joined
Sep 24, 2005
Messages
4,821
As you can see, the circle is the caster and the 5 straight lines are the arrows
So, what is the formula, then ?

left arrow 1 = Unit Facing - 36
left arrow 2 = Unit Facing - 18
middle arrow = Unit facing
right arrow 1 = Unit Facing + 18
right arrow 2 = Unit Facing +36
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Those aren't really formula's O___O
I was expecting more like "(y * x)/(1+y * x)" (the formula to determine the armor percentage).

Either way, here are a few things I like to add for new people:


Camera zoom trigger:

  • CamZ
    • Events
      • Player - Player 1 (Red) types a chat message containing -zoom as A substring
    • Conditions
    • Actions
      • -------- Maximum Value (Camera can't zoom out further) --------
      • Set MaxValue = 3000.00
      • -------- Minimum Value (Camera can't zoom in further) --------
      • Set MinValue = 500.00
      • -------- Do not change below this line --------
      • For each (Integer A) from 1 to (Length of (Entered chat string)), do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), (Integer A), (Integer A))) Equal to
            • Then - Actions
              • Set Camera_Distance = (Real((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string))))))
            • Else - Actions
      • Camera - Set (Triggering player)'s camera Distance to target to Camera_Distance over 0.20 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Camera_Distance Greater than or equal to MaxValue
        • Then - Actions
          • Camera - Set (Triggering player)'s camera Distance to target to MaxValue over 0.20 seconds
          • Set Camera_Distance = MaxValue
          • Game - Display to (All players matching ((Triggering player) Equal to (Matching player))) for 6.00 seconds the text: |c00ff0000Zoomed ou...
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Camera_Distance Less than or equal to MinValue
            • Then - Actions
              • Camera - Set (Triggering player)'s camera Distance to target to MinValue over 0.20 seconds
              • Set Camera_Distance = MinValue
              • Game - Display to (All players matching ((Triggering player) Equal to (Matching player))) for 6.00 seconds the text: |c00ff0000Zoomed in...
            • Else - Actions
Features:
  • You can set the event to anything you like without having to change any action.
  • You can easily change the minimum / maximum value.

That's about it :p
It's a lot better than most camera commands I see...


Useless thingy that changes the speed of a unit when walking up/down a hill:

  • Adjust Speed
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set Group = (Units in (Playable map area))
      • Unit Group - Pick every unit in Group and do (Actions)
        • Loop - Actions
          • Set Loc1 = (Position of (Picked unit))
          • Set Loc2 = (TempLoc[1] offset by 100.00 towards (Facing of (Picked unit)) degrees)
          • Custom script: set udg_Real1 = GetLocationZ(udg_Loc1)
          • Custom script: set udg_Real2 = GetLocationZ(udg_Loc2)
          • Custom script: call RemoveLocation(udg_Loc1)
          • Custom script: call RemoveLocation(udg_Loc2)
          • Unit - Set (Picked unit) movement speed to ((Default movement speed of (Picked unit)) + (Real1 - Real2))
      • Custom script: call GroupClear(udg_Group)
When walking up a hill, you go slower. When going down, you go faster (both depending on how steep the hill is).
That's all it does :D
You don't need to add this though :|




Well, I also have a stupid calculator, an anti-swear system, a custom regeneration system (starts regenerating when out of combat), ...
Just wanted to know what's allowed here and what's not ^_^

Edit: I guess stupid physics simulators made out of sheer boredom aren't allowed? (figures of Lissajous, systems which create a sine wave, combined waves, changeable gravity constant, ...).
Well, haven't made that much physics things yet... I guess I always found something better to do :/
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
Those aren't really formula's O___O
I was expecting more like "(y * x)/(1+y * x)" (the formula to determine the armor percentage).
Luckily, I wrote "...formula/method" :D
I don't care if it's a formula OR method, both will be applied to this thread

Oh, and thanks for the input !

EDIT:
Well, I edited my first post, what do you think now ?
Me wan teh bumerang formulaz!
 
Level 6
Joined
May 20, 2010
Messages
94
Instant Circle

  • Circle
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Circle
    • Actions
      • Set Number_of_Effects = 10
      • Set Target_Point = (Target point of ability being cast)
      • For each (Integer A) from 1 to Number_of_Effects, do (Actions)
        • Loop - Actions
          • Set New_Point = (Target_Point offset by 350.00 towards ((360.00 / (Real(Number_of_Effects))) x (Real((Integer A)))) degrees)
          • Special Effect - Create a special effect at New_Point using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation(udg_New_Point)
      • Custom script: call RemoveLocation(udg_Target_Point)
circlel.jpg



Instant Star

  • Star
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Star
    • Actions
      • Set Target_Point = (Target point of ability being cast)
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • For each (Integer B) from 1 to 10, do (Actions)
            • Loop - Actions
              • Set New_Point = (Target_Point offset by (30.00 x (Real((Integer B)))) towards ((360.00 / 5.00) x (Real((Integer A)))) degrees)
              • Special Effect - Create a special effect at New_Point using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
              • Special Effect - Destroy (Last created special effect)
              • Custom script: call RemoveLocation(udg_New_Point)
      • Custom script: call RemoveLocation(udg_Target_Point)
starzg.jpg
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Making star-shaped effects.

Ok the final edit, this function can create some effects; like a triangle, pentagram or the star of David.
JASS:
//====================================================================================================
//=     StarShapeGenerator by chobibo                                                                  =
//====================================================================================================
library StarShapeGenerator

globals
private constant hashtable  HASHTABLE       = InitHashtable()
private constant integer    HASHKEY_SIDES   = StringHash("sides")
private constant integer    MINIMUM_SIDES   = 5
private constant integer    MAXIMUM_SIDES   = 8
private constant integer    TRIANGLE        = 3
endglobals

private function remove takes nothing returns nothing
    local integer parentkey=GetHandleId(GetExpiredTimer())
    local effect e
    local lightning l
    local integer i=0
    local integer sides=LoadInteger(HASHTABLE,parentkey,HASHKEY_SIDES)
    
    loop
        exitwhen (i==sides)
        set e=LoadEffectHandle(HASHTABLE,parentkey,i)
        set l=LoadLightningHandle(HASHTABLE,parentkey,sides+i)
        call RemoveSavedHandle(HASHTABLE,parentkey,i)
        call RemoveSavedHandle(HASHTABLE,parentkey,sides+i)
        call DestroyEffect(e)
        call DestroyLightning(l)
        set i=i+1
    endloop
    
    call FlushChildHashtable(HASHTABLE,parentkey)
    call DestroyTimer(GetExpiredTimer())
    set e=null
    set l=null
endfunction

function StarShapeGenerator_create takes string lightningfxname, string pointfxpath, real centerX, real centerY, real facing, real radius, real duration, integer sides returns nothing
    local real array x
    local real array y
    local effect e
    local lightning l
    local integer i=0
    local integer j=0
    local real angle=facing*3.14159/180
    local timer t=CreateTimer()
    local integer parentkey=GetHandleId(t)
    
    if (sides<MINIMUM_SIDES) then
        set sides=TRIANGLE
    elseif (sides>MAXIMUM_SIDES) then
        set sides=MAXIMUM_SIDES
    endif
    
    loop
        exitwhen (i==sides)
        set x[i]=centerX+Cos(angle)*radius
        set y[i]=centerY+Sin(angle)*radius
        set angle=angle+(2*3.14159/sides)
        set e=AddSpecialEffect(pointfxpath,x[i],y[i])
        call SaveEffectHandle(HASHTABLE,parentkey,i,e)
        set i=i+1
    endloop
    
    set i=0
    
    loop
        exitwhen (i==sides)
        set j=ModuloInteger(i+2,sides)
        set l=AddLightning(lightningfxname,true,x[i],y[i],x[j],y[j])
        call SaveLightningHandle(HASHTABLE,parentkey,sides+i,l)
        set i=i+1
    endloop
    
    call SaveInteger(HASHTABLE,parentkey,HASHKEY_SIDES,sides)
    
    call TimerStart(t,duration,false,function remove)
    set e=null
    set l=null
    set t=null
endfunction

endlibrary
//====================================================================================================


* You need to use NewGen for this to be usable.
  • CreatePentagon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Channel
    • Actions
      • Set TempLoc = (Position of (Triggering unit))
      • -------- Initialize the variables required for the star shape --------
      • -------- DRAM is the Siphon Mana lightning --------
      • Set LIGHTNING_FX = DRAM
      • Set POINT_FX = Abilities\Spells\Other\Drain\ManaDrainCaster.mdl
      • Set CasterX = (X of TempLoc)
      • Set CasterY = (Y of TempLoc)
      • Set CasterFace = (Facing of (Triggering unit))
      • Set StarRadius = 250.00
      • Set StarDuration = 15.00
      • -------- PENTAGRAM is equivalent to 5 --------
      • Set StarSides = PENTAGRAM
      • -------- Create the star shape --------
      • Custom script: call StarShapeGenerator_create(udg_LIGHTNING_FX,udg_POINT_FX,udg_CasterX,udg_CasterY,udg_CasterFace,udg_StarRadius,udg_StarDuration,udg_StarSides)
      • Custom script: call RemoveLocation(udg_TempLoc)




To make a triangle, set the value of sides to 3:
TRIANGLE
attachment.php


To make a pentagram, set the value of sides to 5:
PENTAGRAM
attachment.php


To make a star of David, set the value of sides to 6:
STAR OF DAVID
attachment.php

 

Attachments

  • Triangle.JPG
    Triangle.JPG
    25.8 KB · Views: 1,541
  • Pentagram.JPG
    Pentagram.JPG
    28.6 KB · Views: 2,604
  • StarOfDavid.JPG
    StarOfDavid.JPG
    33 KB · Views: 1,676
Last edited:
Level 29
Joined
Mar 10, 2009
Messages
5,016
CAMERA Lock Rotation and Zoom In/Out using arrow keys...
Im using this one for the update my Dungeon Assault project...

WARNING: Long Trigger


  • CAM Lock
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Camera - Lock camera target for Player 1 (Red) to P01_Hero, offset by (0.00, 0.00) using Default rotation
  • Fixed Rotation
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • Camera - Set Player 1 (Red)'s camera Rotation to CAM_Rotation over 0.03 seconds
      • Camera - Set Player 1 (Red)'s camera Distance to target to CAM_Zoom over 0.03 seconds
  • CAM Left Press
    • Events
      • Player - Player 1 (Red) Presses the Left Arrow key
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CAM Right Rotation <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on CAM Left Rotation <gen>
        • Else - Actions
  • CAM Left Release
    • Events
      • Player - Player 1 (Red) Releases the Left Arrow key
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • Trigger - Turn off CAM Left Rotation <gen>
  • CAM Left Rotation
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • Set CAM_Rotation = (CAM_Rotation - 2.00)
  • CAM Right Press
    • Events
      • Player - Player 1 (Red) Presses the Right Arrow key
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CAM Left Rotation <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on CAM Right Rotation <gen>
        • Else - Actions
  • CAM Right Release
    • Events
      • Player - Player 1 (Red) Releases the Right Arrow key
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • Trigger - Turn off CAM Right Rotation <gen>
  • CAM Right Rotation
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • Set CAM_Rotation = (CAM_Rotation + 2.00)
  • CAM Up Press
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CAM Up Zoom In <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on CAM Up Zoom Out <gen>
        • Else - Actions
  • CAM Up Release
    • Events
      • Player - Player 1 (Red) Releases the Up Arrow key
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • Trigger - Turn off CAM Up Zoom Out <gen>
  • CAM Up Zoom Out
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CAM_Zoom Less than or equal to 3000.00
        • Then - Actions
          • Set CAM_Zoom = (CAM_Zoom + 10.00)
        • Else - Actions
  • CAM Down Press
    • Events
      • Player - Player 1 (Red) Presses the Down Arrow key
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CAM Up Zoom Out <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on CAM Up Zoom In <gen>
        • Else - Actions
  • CAM Down Release
    • Events
      • Player - Player 1 (Red) Releases the Down Arrow key
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • Trigger - Turn off CAM Up Zoom In <gen>
  • CAM Up Zoom In
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • (CAM Lock <gen> is on) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CAM_Zoom Greater than or equal to 500.00
        • Then - Actions
          • Set CAM_Zoom = (CAM_Zoom - 10.00)
        • Else - Actions
 
Last edited:
Level 22
Joined
Sep 24, 2005
Messages
4,821
defskull, could you please remove the first script I posted, The controllable circle effect, cause its useless lol, post the new one I posted instead.
 
Level 9
Joined
Dec 26, 2010
Messages
475
Ok the final edit, this function can create some effects; like a triangle, pentagram or the star of David.
JASS:
//====================================================================================================
//=  StarShapeGenerator                                                                              =
//====================================================================================================

function MakeStarShape takes string lightningfxname, string pointfxpath, real centerX, real centerY, real facing, real radius, integer sides returns nothing
    local real array x
    local real array y
    local effect array e
    local lightning array l
    local integer i=0
    local integer j=0
    local real angle=facing*3.14159/180
    
    loop
        exitwhen (i==sides)
        set x[i]=centerX+Cos(angle)*radius
        set y[i]=centerY+Sin(angle)*radius
        set angle=angle+(2*3.14159/sides)
        set e[i]=AddSpecialEffect(pointfxpath,x[i],y[i])
        set i=i+1
    endloop
    
    set i=0
    
    loop
        exitwhen (i==sides)
        set j=ModuloInteger(i+2,sides)
        set l[i]=AddLightning(lightningfxname,true,x[i],y[i],x[j],y[j])
        set i=i+1
    endloop
    
endfunction

//====================================================================================================



To make a triangle, set the value of sides to 3:
TRIANGLE
attachment.php




To make a pentagram, set the value of sides to 5:
PENTAGRAM
attachment.php





To make a star of David, set the value of sides to 6:
STAR OF DAVID
attachment.php

hello, can you please make it in triggers because i cant find JASS and i dont know how to use JASS, Thanks :) :ogre_haosis:
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Sorry, but I don't know how to do it in GUI. You could call the function via the custom script action, if you want to use it.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
  • sample
    • Events
    • Conditions
    • Actions
      • Custom script: call function StarShapeGenerator_create(lightningfxname,pointfxpath,centerX,centerY, facing, radius,duration,sides)
Oh, you need newgen to be able to use the updated code, I'm already using vjass.
 
Level 6
Joined
May 20, 2010
Messages
94
Instant Ellipse/Curves

  • Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Spell
    • Actions
      • Set Point[0] = (Position of (Triggering unit))
      • Set Point[1] = (Target point of ability being cast)
      • Set Angle = (Facing of (Triggering unit))
      • Set MaxDistance = (Distance between Point[0] and Point[1])
      • Set Constant = 1.45
      • For each (Integer A) from 1 to 30, do (Actions)
        • Loop - Actions
          • Set Distance = ((MaxDistance / 30.00) x (Real((Integer A))))
          • Set Point[2] = (Point[0] offset by Distance towards Angle degrees)
          • Set Point[3] = (Point[2] offset by (Constant x ((MaxDistance - Distance) x (Distance / MaxDistance))) towards (Angle - 90.00) degrees)
          • Set Point[4] = (Point[2] offset by (Constant x ((MaxDistance - Distance) x (Distance / MaxDistance))) towards (Angle + 90.00) degrees)
          • Special Effect - Create a special effect at Point[3] using Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at Point[4] using Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation(udg_Point[2])
          • Custom script: call RemoveLocation(udg_Point[3])
          • Custom script: call RemoveLocation(udg_Point[4])
      • Custom script: call RemoveLocation(udg_Point[0])
      • Custom script: call RemoveLocation(udg_Point[1])
ellipse.jpg

I guess you could do it with X/Y coordinates and Sine/Cosine aswell. Curved movements should work the same way, you just need to increase "Distance" periodically. I think Rmx used this in one of his spells.
 
Last edited:
Level 9
Joined
Dec 26, 2010
Messages
475
hey guys can you someone change this to trigger thanks!
Ok the final edit, this function can create some effects; like a triangle, pentagram or the star of David.
JASS:
//====================================================================================================
//=   StarShapeGenerator by chobibo                                                                  =
//====================================================================================================
library StarShapeGenerator

globals
private constant hashtable  HASHTABLE       = InitHashtable()
private constant integer    HASHKEY_SIDES   = StringHash("sides")
private constant integer    MINIMUM_SIDES   = 5
private constant integer    MAXIMUM_SIDES   = 8
private constant integer    TRIANGLE        = 3
endglobals

private function remove takes nothing returns nothing
    local integer parentkey=GetHandleId(GetExpiredTimer())
    local effect e
    local lightning l
    local integer i=0
    local integer sides=LoadInteger(HASHTABLE,parentkey,HASHKEY_SIDES)
    
    loop
        exitwhen (i==sides)
        set e=LoadEffectHandle(HASHTABLE,parentkey,i)
        set l=LoadLightningHandle(HASHTABLE,parentkey,sides+i)
        call DestroyEffect(e)
        call DestroyLightning(l)
        set i=i+1
    endloop
    
    call FlushChildHashtable(HASHTABLE,parentkey)
    call DestroyTimer(GetExpiredTimer())
    set e=null
    set l=null
endfunction

function StarShapeGenerator_create takes string lightningfxname, string pointfxpath, real centerX, real centerY, real facing, real radius, real duration, integer sides returns nothing
    local real array x
    local real array y
    local effect e
    local lightning l
    local integer i=0
    local integer j=0
    local real angle=facing*3.14159/180
    local timer t=CreateTimer()
    local integer parentkey=GetHandleId(t)
    
    if (sides<MINIMUM_SIDES) then
        set sides=TRIANGLE
    elseif (sides>MAXIMUM_SIDES) then
        set sides=MAXIMUM_SIDES
    endif
    
    loop
        exitwhen (i==sides)
        set x[i]=centerX+Cos(angle)*radius
        set y[i]=centerY+Sin(angle)*radius
        set angle=angle+(2*3.14159/sides)
        set e=AddSpecialEffect(pointfxpath,x[i],y[i])
        call SaveEffectHandle(HASHTABLE,parentkey,i,e)
        set i=i+1
    endloop
    
    set i=0
    
    loop
        exitwhen (i==sides)
        set j=ModuloInteger(i+2,sides)
        set l=AddLightning(lightningfxname,true,x[i],y[i],x[j],y[j])
        call SaveLightningHandle(HASHTABLE,parentkey,sides+i,l)
        set i=i+1
    endloop
    
    call SaveInteger(HASHTABLE,parentkey,HASHKEY_SIDES,sides)
    
    call TimerStart(t,duration,false,function remove)
    set e=null
    set l=null
    set t=null
endfunction

endlibrary
//====================================================================================================



To make a triangle, set the value of sides to 3:
TRIANGLE
attachment.php




To make a pentagram, set the value of sides to 5:
PENTAGRAM
attachment.php





To make a star of David, set the value of sides to 6:
STAR OF DAVID
attachment.php

 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Edit: Defskull, uhh... the speed trigger is for UNITS walking up/down a cliff? xD
I know, it's useless (that's why I said you didn't have to add it).

I'll go create the backstab/boomering in GUI, if it's taking too long then I'll go do it in JASS.

hey guys can you someone change this to trigger thanks!
Dude, seriously?

First of all: he DOES use "triggers".
JASS is the ACTUAL coding warcraft using, GUI (the thing you call "triggers") is a simplified version to make it easier to learn.

This is what you need to do:

1) Download JNGP (GIYF).
2) Copy/paste the script to the map header (see screeny below).
3) Activate the function by using the custom script chobibo gave you.

Screeny:

copypaste.jpg


Done! You can now use that function with GUI (and please, call it GUI, not "triggers").
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
Yeah sorry about that
I really am looking for the most suitable title but it ended up "formula"
So guys, moderator, can change the thread title to a bit more suitable ?
Like Triggering Technique or Methods of Triggering ?
You name it, just change it to a suitable one
Formula can be used such as chobibo's trigger creating a star-shaped and all
That is also considered as formula
 
Level 9
Joined
Dec 26, 2010
Messages
475
Edit: Defskull, uhh... the speed trigger is for UNITS walking up/down a cliff? xD
I know, it's useless (that's why I said you didn't have to add it).

I'll go create the backstab/boomering in GUI, if it's taking too long then I'll go do it in JASS.


Dude, seriously?

First of all: he DOES use "triggers".
JASS is the ACTUAL coding warcraft using, GUI (the thing you call "triggers") is a simplified version to make it easier to learn.

This is what you need to do:

1) Download JNGP (GIYF).
2) Copy/paste the script to the map header (see screeny below).
3) Activate the function by using the custom script chobibo gave you.

Screeny:

copypaste.jpg


Done! You can now use that function with GUI (and please, call it GUI, not "triggers").

OMG :ogre_frown: :ogre_frown: :ogre_frown: it doesn't work, can you provide a map?
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
I have two solutions for detecting backstabbing, the first one uses trigonometric functions, and the other one using if blocks.

JASS:
function IsAttackBackstab takes unit attacker, unit victim returns boolean
    local real x1=GetUnitX(victim)
    local real y1=GetUnitY(victim)
    
    local real x2=GetUnitX(attacker)
    local real y2=GetUnitY(attacker)
    
    local real victimFacing=GetUnitFacing(victim)*3.14159/180
    local real attackAngle=Atan2(y2-y1,x2-x1)
    
    set attackAngle=Acos(Cos(attackAngle-victimFacing))
    
    return (attackAngle*180/3.14159)>120
endfunction

function IsAttackBackstab takes unit attacker, unit victim returns boolean
    local real x1=GetUnitX(victim)
    local real y1=GetUnitY(victim)
    
    local real x2=GetUnitX(attacker)
    local real y2=GetUnitY(attacker)
    
    local real victimFacing=GetUnitFacing(victim)
    local real attackAngle=Atan2(y2-y1,x2-x1)*180/3.14159
        
    if (attackAngle<0) then
        set attackAngle=attackAngle+360
    endif
    set attackAngle=attackAngle-victimFacing
    if (attackAngle<0) then
        set attackAngle=attackAngle+360
    endif
    
    return (attackAngle>120) and (attackAngle<240)
endfunction


*You need a boolean variable, in this case the variable's identifier is IsBackstabbing
  • Backstab Attack
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Custom script: set udg_IsBackstabbing=IsAttackBackstab(GetAttacker(),GetTriggerUnit())
      • If (IsBackstabbing Equal to True) then do (Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl) else do (Skip remaining actions)
      • Set IsBackstabbing = False



attachment.php

The footman is backstabbing the elven worker.
 

Attachments

  • Backstab.JPG
    Backstab.JPG
    25.3 KB · Views: 445
Last edited:
Level 11
Joined
May 31, 2008
Messages
698
Boomerang thing
MUI and everything.
The boomerang returns to the location it was thrown from, not to the caster.
But i could probly make it go back to the caster too if you want xD

  • booooomerang init
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Booooomerang
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • index Less than or equal to (<=) 100
        • Then - Actions
          • Set index = (index + 1)
        • Else - Actions
          • Set index = 0
      • Set temploc[0] = (Position of (Triggering unit))
      • Set temploc[1] = (Target point of ability being cast)
      • Set indbool[index] = True
      • Set backbool[index] = False
      • Set maxdist[index] = 1400.00
      • Set outwarddist[index] = 250.00
      • Set acceleration[index] = 980.00
      • Set acceleration2[index] = ((outwarddist[index] / maxdist[index]) x acceleration[index])
      • Set acceleration2[index] = (acceleration2[index] x 4.00)
      • Set offsetpoint[index] = (Position of (Triggering unit))
      • Set startloc[index] = (Position of (Triggering unit))
      • Set angle[index] = (Angle from temploc[0] to temploc[1])
      • Set angle2[index] = (angle[index] + 90.00)
      • Unit - Create 1 boomerang for (Owner of (Triggering unit)) at temploc[0] facing angle[index] degrees
      • Set boooomerang[index] = (Last created unit)
      • Unit - Turn collision for (Last created unit) Off
      • Unit - Move (Last created unit) instantly to temploc[0]
      • Set velocity[index] = (Square root(((2.00 x acceleration[index]) x maxdist[index])))
      • Set velocity2[index] = (Square root(((2.00 x acceleration2[index]) x outwarddist[index])))
      • Set time[index] = 0.00
      • Set time2[index] = 0.00
      • Custom script: call RemoveLocation(udg_temploc[0])
      • Custom script: call RemoveLocation(udg_temploc[1])
      • Unit - Order (Triggering unit) to Stop
  • boooooomerang
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to 100, do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • indbool[(Integer A)] Equal to (==) True
            • Then - Actions
              • Set A = (Integer A)
              • Set offsetpoint[A] = (startloc[A] offset by ((velocity[A] x time[A]) - ((0.50 x acceleration[A]) x (time[A] x time[A]))) towards angle[A] degrees)
              • Set temploc[0] = (offsetpoint[A] offset by ((velocity2[A] x time2[A]) - ((0.50 x acceleration2[A]) x (time2[A] x time2[A]))) towards angle2[A] degrees)
              • Unit - Move boooomerang[A] instantly to temploc[0]
              • Set time[A] = (time[A] + 0.03)
              • Set time2[A] = (time2[A] + 0.03)
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Distance between offsetpoint[A] and startloc[A]) Greater than or equal to (>=) (maxdist[A] - 0.00)
                  • Then - Actions
                    • Set backbool[A] = True
                    • Set time2[A] = 0.00
                    • Set angle2[A] = (angle2[A] + 180.00)
                  • Else - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • backbool[A] Equal to (==) True
                  • Then - Actions
                    • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (Distance between offsetpoint[A] and startloc[A]) Less than or equal to (<=) 50.00
                      • Then - Actions
                        • Set indbool[A] = False
                        • Unit - Kill boooomerang[A]
                        • Custom script: call RemoveLocation(udg_startloc[udg_A])
                      • Else - Actions
                  • Else - Actions
              • Custom script: call RemoveLocation(udg_offsetpoint[udg_A])
              • Custom script: call RemoveLocation(udg_temploc[0])
            • Else - Actions




And i think for backstab maybe you could just do this?:

  • Backstab
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Multiple ConditionsAnd - All (Conditions) are true
            • Conditions
              • (Facing of (Attacking unit)) Greater than or equal to (>=) ((Facing of (Attacked unit)) - 30.00)
              • (Facing of (Attacking unit)) Less than or equal to (<=) ((Facing of (Attacked unit)) + 30.00)
        • Then - Actions
          • Unit - Cause (Attacking unit) to damage (Attacked unit), dealing 100.00 damage of attack type Normal and damage type Normal
          • Special Effect - Create a special effect attached to the overhead of (Attacked unit) using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
        • Else - Actions
idk if it could be that simple tho :p

EDIT:
I tried out the backstab and it works most of the time, but for some reason it bugs sometimes and doesnt work.
 

Attachments

  • boooomerang.w3x
    21.1 KB · Views: 81
Level 22
Joined
Sep 24, 2005
Messages
4,821
If the victim unit's facing angle is 0 degrees, reducing it would produce a negative number, GetUnitFacing does not return negative values. If the attacker's facing angle is 361 it should qualify to do a back-stab damage to the victim, but 0-30 is -30 and comparing if 361 is less than -30 would yield the boolean value false.
 
Level 9
Joined
Dec 26, 2010
Messages
475
Hey def, do you need this? ^_^

  • Black Moon Slash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Black Moon Slash
    • Actions
      • Set IchigoBlackMoonSlash_Unit[0] = (Triggering unit)
      • Set IchigoBlackMoonSlash_Unit[1] = (Target unit of ability being cast)
      • Set IchigoBlackMoonSlash_Point[0] = (Position of IchigoBlackMoonSlash_Unit[0])
      • Set IchigoBlackMoonSlash_Point[1] = (Position of IchigoBlackMoonSlash_Unit[1])
      • Set IchigoBlackMoonSlash_Real[0] = 0.00
      • Unit - Pause IchigoBlackMoonSlash_Unit[1]
      • Unit - Make IchigoBlackMoonSlash_Unit[1] Invulnerable
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Black Moon Slash for IchigoBlackMoonSlash_Unit[0]) Equal to 1
        • Then - Actions
          • Set IchigoBlackMoonSlash_Real[1] = 700.00
          • Set IchigoBlackMoonSlash_Real[1] = (IchigoBlackMoonSlash_Real[1] + ((Real((Agility of IchigoBlackMoonSlash_Unit[0] (Exclude bonuses)))) x 2.00))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Black Moon Slash for IchigoBlackMoonSlash_Unit[0]) Equal to 2
            • Then - Actions
              • Set IchigoBlackMoonSlash_Real[1] = 800.00
              • Set IchigoBlackMoonSlash_Real[1] = (IchigoBlackMoonSlash_Real[1] + ((Real((Agility of IchigoBlackMoonSlash_Unit[0] (Exclude bonuses)))) x 2.00))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Black Moon Slash for IchigoBlackMoonSlash_Unit[0]) Equal to 3
                • Then - Actions
                  • Set IchigoBlackMoonSlash_Real[1] = 900.00
                  • Set IchigoBlackMoonSlash_Real[1] = (IchigoBlackMoonSlash_Real[1] + ((Real((Agility of IchigoBlackMoonSlash_Unit[0] (Exclude bonuses)))) x 2.00))
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Black Moon Slash for IchigoBlackMoonSlash_Unit[0]) Equal to 4
                    • Then - Actions
                      • Set IchigoBlackMoonSlash_Real[1] = 1000.00
                      • Set IchigoBlackMoonSlash_Real[1] = (IchigoBlackMoonSlash_Real[1] + ((Real((Agility of IchigoBlackMoonSlash_Unit[0] (Exclude bonuses)))) x 2.00))
                    • Else - Actions
      • For each (Integer A) from 1 to 24, do (Actions)
        • Loop - Actions
          • Set IchigoBlackMoonSlash_Real[0] = (IchigoBlackMoonSlash_Real[0] + 15.00)
          • Set IchigoBlackMoonSlash_Point[2] = (IchigoBlackMoonSlash_Point[1] offset by 700.00 towards IchigoBlackMoonSlash_Real[0] degrees)
          • Unit - Create 1 Ichigo Black Moon Slash Dummy for (Owner of IchigoBlackMoonSlash_Unit[0]) at IchigoBlackMoonSlash_Point[2] facing IchigoBlackMoonSlash_Point[1]
      • Wait 1.20 seconds
      • Set IchigoBlackMoonSlash_UnitGroup[0] = (Units of type Ichigo Black Moon Slash Dummy)
      • Unit Group - Pick every unit in IchigoBlackMoonSlash_UnitGroup[0] and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Undead Dreadlord - Carrion Swarm IchigoBlackMoonSlash_Point[1]
      • Wait 1.00 seconds
      • Special Effect - Create a special effect at IchigoBlackMoonSlash_Point[1] using war3mapImported\NewDirtEXNofire.mdx
      • Special Effect - Destroy (Last created special effect)
      • Set IchigoBlackMoonSlash_UnitGroup[1] = (Units of type Ichigo Black Moon Slash Dummy)
      • Unit Group - Pick every unit in IchigoBlackMoonSlash_UnitGroup[1] and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Custom script: call DestroyGroup(udg_IchigoBlackMoonSlash_UnitGroup[0])
      • Custom script: call DestroyGroup(udg_IchigoBlackMoonSlash_UnitGroup[1])
      • Custom script: call RemoveLocation(udg_IchigoBlackMoonSlash_Point[0])
      • Custom script: call RemoveLocation(udg_IchigoBlackMoonSlash_Point[1])
      • Custom script: call RemoveLocation(udg_IchigoBlackMoonSlash_Point[2])
      • Unit - Unpause IchigoBlackMoonSlash_Unit[1]
      • Unit - Make IchigoBlackMoonSlash_Unit[1] Vulnerable
 

Attachments

  • BlackMoonSlash.PNG
    BlackMoonSlash.PNG
    1.4 MB · Views: 130
Hey def, do you need this? ^_^

  • Black Moon Slash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Black Moon Slash
    • Actions
      • Set IchigoBlackMoonSlash_Unit[0] = (Triggering unit)
      • Set IchigoBlackMoonSlash_Unit[1] = (Target unit of ability being cast)
      • Set IchigoBlackMoonSlash_Point[0] = (Position of IchigoBlackMoonSlash_Unit[0])
      • Set IchigoBlackMoonSlash_Point[1] = (Position of IchigoBlackMoonSlash_Unit[1])
      • Set IchigoBlackMoonSlash_Real[0] = 0.00
      • Unit - Pause IchigoBlackMoonSlash_Unit[1]
      • Unit - Make IchigoBlackMoonSlash_Unit[1] Invulnerable
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Black Moon Slash for IchigoBlackMoonSlash_Unit[0]) Equal to 1
        • Then - Actions
          • Set IchigoBlackMoonSlash_Real[1] = 700.00
          • Set IchigoBlackMoonSlash_Real[1] = (IchigoBlackMoonSlash_Real[1] + ((Real((Agility of IchigoBlackMoonSlash_Unit[0] (Exclude bonuses)))) x 2.00))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Black Moon Slash for IchigoBlackMoonSlash_Unit[0]) Equal to 2
            • Then - Actions
              • Set IchigoBlackMoonSlash_Real[1] = 800.00
              • Set IchigoBlackMoonSlash_Real[1] = (IchigoBlackMoonSlash_Real[1] + ((Real((Agility of IchigoBlackMoonSlash_Unit[0] (Exclude bonuses)))) x 2.00))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Black Moon Slash for IchigoBlackMoonSlash_Unit[0]) Equal to 3
                • Then - Actions
                  • Set IchigoBlackMoonSlash_Real[1] = 900.00
                  • Set IchigoBlackMoonSlash_Real[1] = (IchigoBlackMoonSlash_Real[1] + ((Real((Agility of IchigoBlackMoonSlash_Unit[0] (Exclude bonuses)))) x 2.00))
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Black Moon Slash for IchigoBlackMoonSlash_Unit[0]) Equal to 4
                    • Then - Actions
                      • Set IchigoBlackMoonSlash_Real[1] = 1000.00
                      • Set IchigoBlackMoonSlash_Real[1] = (IchigoBlackMoonSlash_Real[1] + ((Real((Agility of IchigoBlackMoonSlash_Unit[0] (Exclude bonuses)))) x 2.00))
                    • Else - Actions
      • For each (Integer A) from 1 to 24, do (Actions)
        • Loop - Actions
          • Set IchigoBlackMoonSlash_Real[0] = (IchigoBlackMoonSlash_Real[0] + 15.00)
          • Set IchigoBlackMoonSlash_Point[2] = (IchigoBlackMoonSlash_Point[1] offset by 700.00 towards IchigoBlackMoonSlash_Real[0] degrees)
          • Unit - Create 1 Ichigo Black Moon Slash Dummy for (Owner of IchigoBlackMoonSlash_Unit[0]) at IchigoBlackMoonSlash_Point[2] facing IchigoBlackMoonSlash_Point[1]
      • Wait 1.20 seconds
      • Set IchigoBlackMoonSlash_UnitGroup[0] = (Units of type Ichigo Black Moon Slash Dummy)
      • Unit Group - Pick every unit in IchigoBlackMoonSlash_UnitGroup[0] and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Undead Dreadlord - Carrion Swarm IchigoBlackMoonSlash_Point[1]
      • Wait 1.00 seconds
      • Special Effect - Create a special effect at IchigoBlackMoonSlash_Point[1] using war3mapImported\NewDirtEXNofire.mdx
      • Special Effect - Destroy (Last created special effect)
      • Set IchigoBlackMoonSlash_UnitGroup[1] = (Units of type Ichigo Black Moon Slash Dummy)
      • Unit Group - Pick every unit in IchigoBlackMoonSlash_UnitGroup[1] and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Custom script: call DestroyGroup(udg_IchigoBlackMoonSlash_UnitGroup[0])
      • Custom script: call DestroyGroup(udg_IchigoBlackMoonSlash_UnitGroup[1])
      • Custom script: call RemoveLocation(udg_IchigoBlackMoonSlash_Point[0])
      • Custom script: call RemoveLocation(udg_IchigoBlackMoonSlash_Point[1])
      • Custom script: call RemoveLocation(udg_IchigoBlackMoonSlash_Point[2])
      • Unit - Unpause IchigoBlackMoonSlash_Unit[1]
      • Unit - Make IchigoBlackMoonSlash_Unit[1] Vulnerable

Bad trigger... first this:

Set IchigoBlackMoonSlash_Real[1] = 900.00
Set IchigoBlackMoonSlash_Real[1] = (IchigoBlackMoonSlash_Real[1] + ((Real((Agility of IchigoBlackMoonSlash_Unit[0] (Exclude bonuses)))) x 2.00))

why set it two times? when its just the same as this:

Set IchigoBlackMoonSlash_Real[1] = (900 + ((Real((Agility of IchigoBlackMoonSlash_Unit[0] (Exclude bonuses)))) x 2.00))


next, it uses waits... (rendered the spell not MUI)

then you use lots of array variables when you just use about 2 indexes per array...

This thread is to help others find the correct triggers they need so the triggers posted here should be as good as it can be...
 
Level 9
Joined
Dec 26, 2010
Messages
475
Bad trigger... first this:

Set IchigoBlackMoonSlash_Real[1] = 900.00
Set IchigoBlackMoonSlash_Real[1] = (IchigoBlackMoonSlash_Real[1] + ((Real((Agility of IchigoBlackMoonSlash_Unit[0] (Exclude bonuses)))) x 2.00))

why set it two times? when its just the same as this:

Set IchigoBlackMoonSlash_Real[1] = (900 + ((Real((Agility of IchigoBlackMoonSlash_Unit[0] (Exclude bonuses)))) x 2.00))


next, it uses waits... (rendered the spell not MUI)

then you use lots of array variables when you just use about 2 indexes per array...

This thread is to help others find the correct triggers they need so the triggers posted here should be as good as it can be...
that spell is from anime so it doesn't need to be mui :D
 
I know its from anime (the power of Zangetsu)... as I said

This thread is to help others find the correct triggers they need, so I THINK the triggers posted here should be as good as it can be... so as long as it can be MUI, make it MUI... its to help them learn how to do things MUI...



I just pointed out some of the things that can be improved on your code so that you can learn... but if you really don't want to learn, then its fine with me...
 
Level 9
Joined
Dec 26, 2010
Messages
475
I know its from anime (the power of Zangetsu)... as I said

This thread is to help others find the correct triggers they need, so I THINK the triggers posted here should be as good as it can be... so as long as it can be MUI, make it MUI... its to help them learn how to do things MUI...
eh, how about this? ^_^

  • Black Moon Slash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Black Moon Slash
    • Actions
      • Set IchigoBlackMoonSlash_Unit[0] = (Triggering unit)
      • Set IchigoBlackMoonSlash_Unit[1] = (Target unit of ability being cast)
      • Set IchigoBlackMoonSlash_Point[0] = (Position of IchigoBlackMoonSlash_Unit[1])
      • Set IchigoBlackMoonSlash_Real[0] = 0.00
      • Unit - Pause IchigoBlackMoonSlash_Unit[1]
      • Unit - Make IchigoBlackMoonSlash_Unit[1] Invulnerable
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Black Moon Slash for IchigoBlackMoonSlash_Unit[0]) Equal to 1
        • Then - Actions
          • Set IchigoBlackMoonSlash_Real[1] = (700.00 + ((Real((Agility of IchigoBlackMoonSlash_Unit[0] (Exclude bonuses)))) x 2.00))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Black Moon Slash for IchigoBlackMoonSlash_Unit[0]) Equal to 2
            • Then - Actions
              • Set IchigoBlackMoonSlash_Real[1] = (800.00 + ((Real((Agility of IchigoBlackMoonSlash_Unit[0] (Exclude bonuses)))) x 2.00))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Black Moon Slash for IchigoBlackMoonSlash_Unit[0]) Equal to 3
                • Then - Actions
                  • Set IchigoBlackMoonSlash_Real[1] = (900.00 + ((Real((Agility of IchigoBlackMoonSlash_Unit[0] (Exclude bonuses)))) x 2.00))
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Black Moon Slash for IchigoBlackMoonSlash_Unit[0]) Equal to 4
                    • Then - Actions
                      • Set IchigoBlackMoonSlash_Real[1] = (1000.00 + ((Real((Agility of IchigoBlackMoonSlash_Unit[0] (Exclude bonuses)))) x 2.00))
                    • Else - Actions
      • For each (Integer A) from 1 to 24, do (Actions)
        • Loop - Actions
          • Set IchigoBlackMoonSlash_Real[0] = (IchigoBlackMoonSlash_Real[0] + 15.00)
          • Set IchigoBlackMoonSlash_Point[1] = (IchigoBlackMoonSlash_Point[0] offset by 700.00 towards IchigoBlackMoonSlash_Real[0] degrees)
          • Unit - Create 1 Ichigo Black Moon Slash Dummy for (Owner of IchigoBlackMoonSlash_Unit[0]) at IchigoBlackMoonSlash_Point[1] facing IchigoBlackMoonSlash_Point[0]
      • Wait 1.20 seconds
      • Set IchigoBlackMoonSlash_UnitGroup[0] = (Units of type Ichigo Black Moon Slash Dummy)
      • Unit Group - Pick every unit in IchigoBlackMoonSlash_UnitGroup[0] and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Undead Dreadlord - Carrion Swarm IchigoBlackMoonSlash_Point[0]
      • Wait 1.00 seconds
      • Special Effect - Create a special effect at IchigoBlackMoonSlash_Point[0] using war3mapImported\NewDirtEXNofire.mdx
      • Special Effect - Destroy (Last created special effect)
      • Unit - Cause IchigoBlackMoonSlash_Unit[0] to damage IchigoBlackMoonSlash_Unit[1], dealing IchigoBlackMoonSlash_Real[1] damage of attack type Spells and damage type Normal
      • Set IchigoBlackMoonSlash_UnitGroup[1] = (Units of type Ichigo Black Moon Slash Dummy)
      • Unit Group - Pick every unit in IchigoBlackMoonSlash_UnitGroup[1] and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Custom script: call DestroyGroup(udg_IchigoBlackMoonSlash_UnitGroup[0])
      • Custom script: call DestroyGroup(udg_IchigoBlackMoonSlash_UnitGroup[1])
      • Custom script: call RemoveLocation(udg_IchigoBlackMoonSlash_Point[0])
      • Custom script: call RemoveLocation(udg_IchigoBlackMoonSlash_Point[1])
      • Unit - Unpause IchigoBlackMoonSlash_Unit[1]
      • Unit - Make IchigoBlackMoonSlash_Unit[1] Vulnerable
 
well still not MUI and is better if you just use different variables rather than arrays since you just use about 2-3 of the indexes...

I know its not really needed but its better if you will learn how to do it and its a good practice to always make things MUI...


I think we're going off-topic, we can just use VMs if you want to continue...
 
Level 9
Joined
Dec 26, 2010
Messages
475
well still not MUI and is better if you just use different variables rather than arrays since you just use about 2-3 of the indexes...

I know its not really needed but its better if you will learn how to do it and its a good practice to always make things MUI...


I think we're going off-topic, we can just use VMs if you want to continue...
lol, the reason why i have WAITS because i want to make it really nice.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
dont-feed-the-troll.jpg



Does anyone have experience with .gif creation? I think they would be really awesome for showing movements, but I can't find a good way to make them.
I turned some of my spells into GIF's.
I recorded them with HyperCam and then converted the video's to an animated gif by using VidGIF.

Here are a few examples:

cleavingchargenew.gif

splitmissnew.gif

tactdism2new.gif
 
Status
Not open for further replies.
Top