1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  5. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  6. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  7. The results are out! Check them out.
    Dismiss Notice
  8. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  9. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Dark Lightning 2.32

Submitted by Flame_Phoenix
This bundle is marked as approved. It works and satisfies the submission rules.
Ok guys, this is another one of my spell for the spell Olympics. Although I am totally sure I can't win against Anitarf nor Griffen (my freaking Nemesis) I still think this is a spell people should see and I believe some of you may even like it.
The code is well commented, and I feel a system can be explored from the code. Unlike many other spells, I prepared this code for the user, this means the user is not limited only to the SETUP part, I also want the user to enter the code's core so he can also learn from my code and mainly make even better lightning spells. This is mainly why my code has many methods and why it is so divided, so people can actually use an easy and efficient "Divide and Conquer" strategy. This makes sections of the code easier to change.
I would really like to see this spell approved, it is my first working lightning spell, and it passed nearly through hell to make it work for Olympics.
I just feel bad I actually delivered a not perfect version of this spell... The Math formula is not what I exactly pretended, but it was what I could do with the time I had.
Please enjoy and be nice on comments, I put a lot of effort into making this spell for you, the user.

This spell belongs to my project
Castle vs Castle Flame Edition and I hope you all enjoy it.


Credits:
This time I feel forced to tell explicitly the people who helped me making this spell. Note that without them this spell would have not been possible to make. Thx to Anitarf and Pyrogasm, both of them wasted many hours seeing my code, I can never thank them enough for what they did. I would also like to thank Daelin for his outdated, but useful math formulas and to Deaod as well.

Description:
A JESP spell that allows the user to create lightning spells with any model he desires. In this sample, the caster sends a dark projectile which will damage enemy units and heal the caster by the amount of damage they received. If an enemy unit dies due this ability, it will return as an Undead to aid the caster, unless it is a summon or a hero.

Requirements:
- Jass NewGen Pack (uses vJASS)
- TimerUtils

History:
change log

History
Versions 1.0, 1.2, 1.3, 1.4:
- This versions all had different approaches to try solving the same problem "How to make a lightning spell ?" but they all proved either to be inefficient or to fail
- Yes, I actually remade from zero the spell 3 times (without counting with version 1.0)

Version 1.5:
- First release to the spell Olympics
- Math formula improved
- Removed a useless timer
- Cleaned and commented the code

Version 1.6:
- The Math formula for damage reduction was still, wrong, so now it is corrected and now most things work as they should

Version 1.7:
- Code optimizations
- Fixed a glitch with the dummy unit, now it actually dies

Version 1.8:
- Made the function Targets easier to use
- Now the code has its own algorithm and re uses groups
- Added new function SetProjectile
- Many other minor code fixes and updates were done
- Added Anitarf to the credits

Version 1.9
- Changed the model of the missile to make it look better and now it works with flying units by changing its flying height properly
- Now the missile always faces the direction of the victim
- Improved the map and the terrain
- Changed the algorithm for picking units, now he picks close units to the target
- Now the effects appear on the units
- Now I also preload the units missile and the dummy

Version 2.0
- Now the abilities for the dummy unit are also preloaded
- Replaced SetUnitPosition with SetUnitX and SetUnitY, now the spell is faster!


Version 2.1
- Replaced some variables in order to make the preloading of the dummy unit faster.
- Cleaned the code and deleted old comments and code fragments as well as eliminated the "data = this" laziness

Version 2.2
- Now the code really works well with 1 single timer. Thx Pyrogasm and Anitarf!
- This spell would have not been possible without the people on the credits, Anitarf, Daelin, Deaod and Pyrogasm, thx to you all!

Version 2.3:
- Fixed a leak in method NextTarget
- Moved the timer code to the struct
- Transformed some of the SETUP functions into constants
- Fixed a spelling mistake , replaced TIMER_CICLE, by TIMER_CYCLE
- Added JESP document

Version 2.31:
- Fixed the tooltips of the spell

Version 2.32:
- Updated for patch 1.24


Keywords:
Lightning, Dark Lightning, chain, undead, life steal, summon target, CCFE
Contents

Dark Lightning (Map)

Reviews
Moderator
21:08, 9th Feb 2009 Hanky: Advice: 5 points are the highest rating and 1 point is the lowest rating. Documentation: 5 Visual Effects: 5 Triggering: 5 Idea: 5 Total: [img][img][img][img][img] Well a really well done spell, I like...
  1. 21:08, 9th Feb 2009
    Hanky:
    Evaluation

    Rating Points
    Advice: 5 points are the highest rating and 1 point is the lowest rating.

    Documentation: 5
    Visual Effects: 5
    Triggering: 5
    Idea: 5

    Total:
    [​IMG][​IMG][​IMG][​IMG][​IMG]


    Rating Comment

    Well a really well done spell, I like the idea that died units get revived as undead. The script seems to be neat I don't see any flaws there. The documentation is as always well done. Well I see no reason to not approve this. I just can highly recommend to use this spell if you are searching something like this.


    Advice: If you didn't understood my rating or if you maybe have questions because you don't know how to fix bugs or leaks etc. You can always send a private message to me. I will answer as soon I got time.
     
  2. Traxamillion

    Traxamillion

    Joined:
    Sep 14, 2007
    Messages:
    1,388
    Resources:
    5
    Models:
    1
    Icons:
    3
    Tutorials:
    1
    Resources:
    5
    This spell is quite awesome.

    +rep
     
  3. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    Wow, thx a lot for comment and rep+ !!
    It really motivates me to keep trying making new spells =)
    +rep as answer too =P
     
  4. Traxamillion

    Traxamillion

    Joined:
    Sep 14, 2007
    Messages:
    1,388
    Resources:
    5
    Models:
    1
    Icons:
    3
    Tutorials:
    1
    Resources:
    5
    Yes, keep them coming especailly if they will be of this calibur.
     
  5. -Berz-

    -Berz-

    Joined:
    Mar 5, 2008
    Messages:
    3,203
    Resources:
    123
    Icons:
    111
    Packs:
    1
    Skins:
    1
    Spells:
    10
    Resources:
    123
    Wow, this is a nice spell, thou special effect could be done better, its good :D

    Hope you make more =)
     
  6. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    I don't import effects into my submission maps, in fact I believe that was a rule in THW some time ago. Anyway, I am glad you like it =)
    I will surely be submitting more =)
     
  7. -Berz-

    -Berz-

    Joined:
    Mar 5, 2008
    Messages:
    3,203
    Resources:
    123
    Icons:
    111
    Packs:
    1
    Skins:
    1
    Spells:
    10
    Resources:
    123
    I didn't meant imported special effects :p

    I would try orb of anahilation as missile and hmm...something purple, death and decay(but it would be to small I guess)

    Dunno :p

    I usually try almost every effect(depends of the spell type) than i select the most fitting one =)
     
  8. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    Sometimes I have bad taste to choose effects and I must ask for opinions. This projectile is an opinion, the first one was pretty bad =P
     
  9. nerovesper

    nerovesper

    Joined:
    Sep 29, 2008
    Messages:
    614
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    This is quite a good spell. But many can't relate to Jass.
    This would be great for me if it was GUI.
    Unfortunately I don't have the attention span to learn from this. xD

    Anyways 4.5/5 for the spell. ^^
     
  10. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    HA, even yo if you are a newb GUIer, do not worry !
    This spell has a SETUP section. This means that you don't need to know JASS to change it !
    Btw, this deserves 5/5 =P
    Thx for rep+ and comment =)
     
  11. Dynasti

    Dynasti

    Joined:
    Oct 18, 2007
    Messages:
    877
    Resources:
    4
    Maps:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    4
    Heh, nice spell I must say, you did a great job :D

    I would give it a 5/5 for the overall coding etc. But my personal rating is 4/5 because I think there is something missing.

    :p
     
  12. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    Let me guess, is it eye candy ?? (lol) I just lack suggestions for that =P
    Well, the code is not as good as it could, but it is pretty efficient, I agree =D

    Thx for comment =P
     
  13. nerovesper

    nerovesper

    Joined:
    Sep 29, 2008
    Messages:
    614
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    Can you make one like this in GUI? I was gonna try but then I got lazy. xD
     
  14. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    The reason why I moved out to JASS, and then vJASS; it's because spells like this are not possible to make in GUI.
    In the other hand, even when possible, they are not feasible or lose a lot of details.
    I am sorry, I can't make this in GUI.
    However if you need help implementing this spell, I will be happy to help you.
     
  15. nerovesper

    nerovesper

    Joined:
    Sep 29, 2008
    Messages:
    614
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    Its ok, I know that GUI sucks. But maybe someday I can get rid of my laziness and move on the JASS. Laziness is the real enemy here. LOL! xD

    Anyways thanks ^^
     
  16. redscores

    redscores

    Joined:
    Aug 9, 2006
    Messages:
    2,160
    Resources:
    12
    Maps:
    5
    Spells:
    6
    Template:
    1
    Resources:
    12
    Eh... I could do that with ease in GUI...

    Nothing hard about...
     
  17. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    Go ahead and GL