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

[Trigger] Need Help [hidden=trigger][/hidden]

Status
Not open for further replies.
Level 3
Joined
Feb 9, 2008
Messages
63
Need Help :C

hello...
im working on a spell for my map and i run into some sort of problems along the way and im hoping someone would help...the spell im working at is a passive spell that (supposedly) goes like multicast in dota (i know its probably been ask a lot of times)
and for those who dont play dota-Multicast is a passive spell that gives your hero a certain chance to cast a spell again

heres my trigger
  • Multicast Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set M_C_Spell = Bash awe
      • Set M_C_Dummy = Dummy Unit
  • Multicast Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Level of M_C_Spell for (Triggering unit)) Greater than 0
      • (Random integer number between 1 and 100) Less than or equal to (25 + (5 x (Level of M_C_Spell for (Triggering unit))))
    • Actions
      • Set M_C_Index = (M_C_Index + 1)
      • -------- --------
      • -------- --------
      • Set M_C_Caster[M_C_Index] = (Triggering unit)
      • Set M_C_Point[M_C_Index] = (Position of M_C_Caster[M_C_Index])
      • Set M_C_Target[M_C_Index] = (Target unit of ability being cast)
      • Set M_C_DummySpell[M_C_Index] = (Ability being cast)
      • Set M_C_Order[M_C_Index] = (Current order of M_C_Caster[M_C_Index])
      • -------- --------
      • Set M_C_Counter[M_C_Index] = 0
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • M_C_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on Multicast Loop <gen>
        • Else - Actions
  • Multicast Loop
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • For each (Integer M_C_Integer) from 1 to M_C_Index, do (Actions)
        • Loop - Actions
          • -------- --------
          • Set M_C_Counter[M_C_Integer] = (M_C_Counter[M_C_Integer] + 1)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • M_C_Counter[M_C_Integer] Equal to 2
            • Then - Actions
              • Unit - Create 1 M_C_Dummy for (Owner of M_C_Caster[M_C_Integer]) at M_C_Point[M_C_Integer] facing Default building facing degrees
              • Set M_C_Dummy2[M_C_Integer] = (Last created unit)
              • Unit - Add a 2.00 second Generic expiration timer to M_C_Dummy2[M_C_Integer]
              • Unit - Add M_C_DummySpell[M_C_Integer] to M_C_Dummy2[M_C_Integer]
              • Unit - Set level of M_C_DummySpell[M_C_Integer] for M_C_Dummy2[M_C_Integer] to (Level of M_C_Spell for M_C_Caster[M_C_Integer])
              • Set M_C_Chance2 = (Random integer number between 1 and (Level of M_C_Spell for M_C_Caster[M_C_Integer]))
              • -------- Text to see if it works --------
              • Floating Text - Create floating text that reads (String((M_C_Chance2 + 1))) above M_C_Caster[M_C_Integer] with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
              • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
              • -------- Text to see if it works --------
              • For each (Integer A) from 1 to M_C_Chance2, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Playable map area) contains M_C_Point[M_C_Integer]) Equal to True
                    • Then - Actions
                      • Custom script: call IssuePointOrderByIdLoc( udg_M_C_Dummy2[udg_M_C_Integer], udg_M_C_Order[udg_M_C_Integer], udg_M_C_Point[udg_M_C_Integer] )
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • M_C_Target[M_C_Integer] Not equal to No unit
                    • Then - Actions
                      • -------- --------
                      • Custom script: call IssueTargetOrderById( udg_M_C_Dummy2[udg_M_C_Integer], udg_M_C_Order[udg_M_C_Integer], udg_M_C_Target[udg_M_C_Integer] )
                      • Custom script: call IssueImmediateOrderById( udg_M_C_Dummy2[udg_M_C_Integer], udg_M_C_Order[udg_M_C_Integer] )
                    • Else - Actions
              • -------- --------
              • Custom script: call RemoveLocation(udg_M_C_Point[udg_M_C_Integer])
              • -------- --------
              • Set M_C_Point[M_C_Integer] = M_C_Point[M_C_Index]
              • Set M_C_Dummy2[M_C_Integer] = M_C_Dummy2[M_C_Index]
              • Set M_C_Caster[M_C_Integer] = M_C_Caster[M_C_Index]
              • Set M_C_Counter[M_C_Integer] = M_C_Counter[M_C_Index]
              • Set M_C_Index = (M_C_Index - 1)
              • Set M_C_Integer = (M_C_Integer - 1)
              • -------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • M_C_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
  • Testing Purposes
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Unit-type of (Casting unit)) Equal to Dummy Unit
    • Actions
      • Game - Display to (All players) for 12.00 seconds the text: (String((Level of (Ability being cast) for (Casting unit))))
little bit of explanation about my spell:
if Bash is learned the and the unit cast a spell it should give a "x" chance to cast it again
level 1 - x chance to cast a spell again
level 2 - x chance to cast a spell once. x chance to cast a spell 2 times
level 3 - x chance to cast a spell once. x chance to cast a spell 2 times. x chance to cast a spell 3 times


so heres the problems:
1.it works but win no interval between the spells example: i cast thunder clap and multicast gives a dummy unit chance to cast it again for 3 more times after i cast...the dummy cast thunder clap 3 times at one instance without interval...how do i solve this?

2.whenever i cast a point targeted spell (shockwave for expample) the dummy cast it towards the center of the map (not sure on this one but as long as i doesn't cast it towards the direction the player intented its no go)

ive attach my test map so that anyone could test it and see if there are more errors im not aware yet
View attachment TESTING.w3x
 
Last edited:
Level 7
Joined
Mar 6, 2006
Messages
282
1.) You need another timer for every interval. Maybe like a 1 shot timer and another trigger catches the expire, and continues with the indexed variables. The last trigger in the chain of timers would have to be the one to de-index a cast of Multicast.

2.) You set your point to the position of your caster, so he's always casting point spells on himself:

  • Set M_C_Point[M_C_Index] = (Position of M_C_Caster[M_C_Index])
I think you mean this:

  • Set M_C_Point[M_C_Index] = (Target point of ability being cast)
 
Level 3
Joined
Feb 9, 2008
Messages
63
1.) You need another timer for every interval. Maybe like a 1 shot timer and another trigger catches the expire, and continues with the indexed variables. The last trigger in the chain of timers would have to be the one to de-index a cast of Multicast.

how do i make one?

  • Set M_C_Point[M_C_Index] = (Position of M_C_Caster[M_C_Index])
i really intended it to be like this to ensure that there will be no conflict in the casting range :D
 
Status
Not open for further replies.
Top