# Big problem with my spell :\

Status
Not open for further replies.

#### hugotje

Level 2
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.
Help in GUI please I want them to stop following me, those lightning when i stop the spell

#### Xarwin

Level 19
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.

#### Need_O2

Level 19
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)

#### hugotje

Level 2
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

#### Need_O2

Level 19
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.

Replies
2
Views
423
Replies
3
Views
628
Replies
1
Views
425
Replies
4
Views
790
Replies
28
Views
2K