• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Big problem with my spell :\

Status
Not open for further replies.
Level 2
Joined
Mar 29, 2006
Messages
24
I'm making a spell where you channel the ability on the target, and then you drain life of nearby units and give it as rough hp to the target. I made arrays to show some friends the skill and i added the ferivication (no idea how to spell it) to look if it works, but now when i stop the skill while i was channeling, the lightning effects stil happen, even with the if/then/else of Ferification, got 2 triggers:
  • Events
    • Unit - A unit Begins channeling an ability
  • Actions
    • Set Ferivication[(Player number of (Owner of (Casting unit)))] = Yes
    • For each (Integer A) from 1 to 3, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Ferivication[(Player number of (Owner of (Casting unit)))] Equal to No
            • (Percentage life of (Target unit of ability being cast)) Equal to 100.00
          • Then - Actions
            • Unit - Order (Casting unit) to Stop
          • Else - Actions
            • Unit Group - Remove all units of NotanymoreInCastRed[(Player number of (Owner of (Casting unit)))] from NotanymoreInCastRed[(Player number of (Owner of (Casting unit)))]
            • Unit Group - Add (Casting unit) to NotanymoreInCastRed[(Player number of (Owner of (Casting unit)))]
            • Unit Group - Add (Target unit of ability being cast) to NotanymoreInCastRed[(Player number of (Owner of (Casting unit)))]
            • Set Lifegained1sec[(Player number of (Owner of (Casting unit)))] = 0.00
            • Unit Group - Pick every unit in (Random 1 units from (Units within 500.00 of (Position of (Casting unit)) matching ((((Matching unit) is in NotanymoreInCastRed[(Player number of (Owner of (Casting unit)))]) Equal to False) and (((Matching unit) is dead) Equal to False)))) and do (Actions)
              • Loop - Actions
                • Lightning - Destroy Lightningie1[(Player number of (Owner of (Casting unit)))]
                • Unit Group - Add (Picked unit) to NotanymoreInCastRed[(Player number of (Owner of (Casting unit)))]
                • Set Lifegained1sec[(Player number of (Owner of (Casting unit)))] = ((Max life of (Picked unit)) / 50.00)
                • Unit - Set life of (Target unit of ability being cast) to (Lifegained1sec[(Player number of (Owner of (Casting unit)))] + (Life of (Target unit of ability being cast)))
                • Unit - Set life of (Picked unit) to ((Percentage life of (Picked unit)) - 2.00)%
                • Lightning - Create a Drain lightning effect from source (Position of (Casting unit)) to target (Position of (Picked unit))
                • Lightning - Change color of (Last created lightning effect) to (1.00 0.00 0.00) with 9.00 alpha
                • Set Lightningie1[(Player number of (Owner of (Casting unit)))] = (Last created lightning effect)
            • Unit Group - Pick every unit in (Random 1 units from (Units within 500.00 of (Position of (Casting unit)) matching ((((Matching unit) is in NotanymoreInCastRed[(Player number of (Owner of (Casting unit)))]) Equal to False) and (((Matching unit) is dead) Equal to False)))) and do (Actions)
              • Loop - Actions
                • Lightning - Destroy Lightningie1_Copy[(Player number of (Owner of (Casting unit)))]
                • Unit Group - Add (Picked unit) to NotanymoreInCastRed[(Player number of (Owner of (Casting unit)))]
                • Set Lifegained1sec[(Player number of (Owner of (Casting unit)))] = ((Max life of (Picked unit)) / 50.00)
                • Unit - Set life of (Target unit of ability being cast) to (Lifegained1sec[(Player number of (Owner of (Casting unit)))] + (Life of (Target unit of ability being cast)))
                • Unit - Set life of (Picked unit) to ((Percentage life of (Picked unit)) - 2.00)%
                • Lightning - Create a Drain lightning effect from source (Position of (Casting unit)) to target (Position of (Picked unit))
                • Lightning - Change color of (Last created lightning effect) to (1.00 0.00 0.00) with 1.00 alpha
                • Set Lightningie1_Copy[(Player number of (Owner of (Casting unit)))] = (Last created lightning effect)
            • Unit Group - Pick every unit in (Random 1 units from (Units within 500.00 of (Position of (Casting unit)) matching ((((Matching unit) is in NotanymoreInCastRed[(Player number of (Owner of (Casting unit)))]) Equal to False) and (((Matching unit) is dead) Equal to False)))) and do (Actions)
              • Loop - Actions
                • Lightning - Destroy Lightningie1_Copy_2[(Player number of (Owner of (Casting unit)))]
                • Unit Group - Add (Picked unit) to NotanymoreInCastRed[(Player number of (Owner of (Casting unit)))]
                • Set Lifegained1sec[(Player number of (Owner of (Casting unit)))] = ((Max life of (Picked unit)) / 50.00)
                • Unit - Set life of (Target unit of ability being cast) to (Lifegained1sec[(Player number of (Owner of (Casting unit)))] + (Life of (Target unit of ability being cast)))
                • Unit - Set life of (Picked unit) to ((Percentage life of (Picked unit)) - 2.00)%
                • Lightning - Create a Drain lightning effect from source (Position of (Casting unit)) to target (Position of (Picked unit))
                • Lightning - Change color of (Last created lightning effect) to (1.00 0.00 0.00) with 9.00 alpha
                • Set Lightningie1_Copy_2[(Player number of (Owner of (Casting unit)))] = (Last created lightning effect)
            • Unit Group - Pick every unit in (Random 1 units from (Units within 500.00 of (Position of (Casting unit)) matching ((((Matching unit) is in NotanymoreInCastRed[(Player number of (Owner of (Casting unit)))]) Equal to False) and (((Matching unit) is dead) Equal to False)))) and do (Actions)
              • Loop - Actions
                • Lightning - Destroy Lightningie1_Copy_3[(Player number of (Owner of (Casting unit)))]
                • Unit Group - Add (Picked unit) to NotanymoreInCastRed[(Player number of (Owner of (Casting unit)))]
                • Set Lifegained1sec[(Player number of (Owner of (Casting unit)))] = ((Max life of (Picked unit)) / 50.00)
                • Unit - Set life of (Target unit of ability being cast) to (Lifegained1sec[(Player number of (Owner of (Casting unit)))] + (Life of (Target unit of ability being cast)))
                • Unit - Set life of (Picked unit) to ((Percentage life of (Picked unit)) - 2.00)%
                • Lightning - Create a Drain lightning effect from source (Position of (Casting unit)) to target (Position of (Picked unit))
                • Lightning - Change color of (Last created lightning effect) to (1.00 0.00 0.00) with 9.00 alpha
                • Set Lightningie1_Copy_3[(Player number of (Owner of (Casting unit)))] = (Last created lightning effect)
            • Wait 1.00 seconds
  • Events
    • Unit - A unit Stops casting an ability
  • Actions
    • Set Ferivication[(Player number of (Owner of (Casting unit)))] = No
    • Unit Group - Remove all units of NotanymoreInCastRed[(Player number of (Owner of (Casting unit)))] from NotanymoreInCastRed[(Player number of (Owner of (Casting unit)))]
    • Lightning - Destroy Lightningie1[(Player number of (Owner of (Casting unit)))]
    • Lightning - Destroy Lightningie1_Copy[(Player number of (Owner of (Casting unit)))]
    • Lightning - Destroy Lightningie1_Copy_2[(Player number of (Owner of (Casting unit)))]
    • Lightning - Destroy Lightningie1_Copy_3[(Player number of (Owner of (Casting unit)))]
It's messy, I know, but I'm not very good at triggering and I don't understand JASS at all:p.
Help in GUI please :) I want them to stop following me, those lightning when i stop the spell
 
Level 19
Joined
Nov 16, 2006
Messages
2,165
I'm not sure, but try this :

create a custom script and add :

JASS:
call DestroyLightning( udg_Lightningie1 )
call DestroyLightning( udg_Lightningie1_Copy2 )
call DestroyLightning( udg_Lightningie1_Copy3 )

For each new line, a new custom script.

Does that Event actualy respond on the 'stop casting' meanwhile the unit is channeling? .. I'm not sure.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
hmm this is something you cant do with GUI I guess
set etc = Last created lightning effect doesnt work I think
so problem is with (Last Created Lightning Effect)
 
Level 2
Joined
Mar 29, 2006
Messages
24
It did worked when i made it single playered, i just made arrays and now it stops working. Maybe i accidently changed it into a stop casting instead of finished a channel? And I'm quite sure that it does work with stop casting, It stops the lightning, but the next part (the second/third lightning) still comes :(. I think I will try harder with JASS, because I'm a bad learner with Jass ;P
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
dont change add it
both events needed for this kind of trigger as I know

I can teach basics of Jass to everyone take my MSN from profile
you can find me online 2PM-5PM (for GTM +2:00) in weekdays and you cant find me online in weekends

And "local"s of JASS makes lightning effects VERY EASY to use
 
Status
Not open for further replies.
Top