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

Ability trigger not working Help please

Status
Not open for further replies.
Level 7
Joined
May 15, 2009
Messages
191
I am haveing a problem with a spell/trigger system that I am making. Biggest anoyance is, I don't see the problem.
The ability is based off of Sleep, and is supposed to kill the target at the end of its duration. Problem is, nothing happens when the sleep expires. Also, when the unit is attacked, and the spell removed. The trigger should stop, and the unit should not die.


If anyone can find the flaw of these triggers, I would love some help, thx in advance.
 

Attachments

  • Plagued Sleep Spell.w3x
    15.1 KB · Views: 49
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin o_O

Well well it's doesn't work like you did it XD

Now the problem is since I use vJass, GUI is very confusing for me but I hope I made it correct with this triggers. If someone see this please look over it if it's correct:
  • PS Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Plagued Slumber
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PS_Index1 Equal to 0
        • Then - Actions
          • Trigger - Turn on PS Loop <gen>
        • Else - Actions
      • Set PS_Index1 = (PS_Index1 + 1)
      • Set PS_Index2 = (PS_Index2 + 1)
      • Set PS_Caster[PS_Index2] = (Triggering unit)
      • Set PS_Target[PS_Index2] = (Target unit of ability being cast)
      • Set PS_Time[PS_Index2] = (19.00 - ((Real((Level of (Ability being cast) for PS_Caster[PS_Index2]))) x 2.00))
      • Set PS_Count[PS_Index2] = 0.00
  • PS Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer PS_Index3) from 1 to PS_Index2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (PS_Target[PS_Index3] has buff Plagued Slumber ) Equal to True
            • Then - Actions
              • Set PS_Count[PS_Index3] = (PS_Count[PS_Index3] + 0.03)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PS_Count[PS_Index3] Greater than or equal to PS_Time[PS_Index3]
                • Then - Actions
                  • Unit - Kill PS_Target[PS_Index3]
                  • Custom script: call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl",GetUnitX(udg_PS_Target[udg_PS_Index3]),GetUnitY(udg_PS_Target[udg_PS_Index3])))
                  • Set PS_Index1 = (PS_Index1 - 1)
                • Else - Actions
            • Else - Actions
              • Set PS_Index1 = (PS_Index1 - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PS_Index1 Equal to 0
        • Then - Actions
          • Set PS_Index2 = 0
        • Else - Actions
I tried it, it works and is MUI and MPI .. well I hope XD

Greetings and Peace
Dr. Boom
 

Attachments

  • Plagued Sleep Spell.w3x
    14.7 KB · Views: 43
Level 33
Joined
Mar 27, 2008
Messages
8,035
Rather than checking time, it's best to check buff.
A test map is attached, using only one variable :)
Duration can be set through Sleep ability in Object Editor (which saves map's filesize and performance)
 

Attachments

  • Sleep OVER.w3x
    14.1 KB · Views: 53
Level 16
Joined
May 1, 2008
Messages
1,605
Well, I don't think this work how he wanted it, but possible my understanding of GUI becomes to bad.

I understand it like this, that he puts a unit into sleep (with normal sleep ability). Now players have a certain amount of time you wake this unit up by attacking.
If they don't wake it up in the specified time, then the unit dies.

That's why I created a longer trigger, but possible you are right too - I don't know =S
 
Status
Not open for further replies.
Top