wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > vJass Spells
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 12-24-2009, 10:52 PM   #1
Deaod
User
 
Join Date: Jan 2007
Posts: 541

Submissions (11)

Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)

Send a message via ICQ to Deaod Send a message via MSN to Deaod
Default Disciple of Life Spellpack

Well, heres a little spellpack i started 12 hours before the deadline of the fourth hero contest. Needless to say that i didnt finish until today. Its still missing the item, but whatever.

I am proud to present to you the Disciple of Life, a supporting hero with a bit of a nuke side.

The spells themselves are rather unoriginal, i admit. Then again, i havent seen many submissions using DamageModifiers yet, so these may be a good demonstration.

First off: I used custom icons, because none of the Blizzard ones fit decently (imo). One of those icons is from WoW, i take permission as a given for that icon.
As for the other three icons, heres the permission:
Hidden information:
Click image for larger version

Name:	Permission_DiscipleOfLife_01.JPG
Views:	204
Size:	54.7 KB
ID:	49967
Click image for larger version

Name:	Permission_DiscipleOfLife_02.JPG
Views:	94
Size:	27.2 KB
ID:	49968


These spells use:
Credits

- KelThuzad for the icons of Prolonged Life, Smiting Zeal and Reverse Damage
- Blizzard Entertainment for the icon of Seed of Life
- Anitarf for SpellEvent, Stack, DamageEvent and DamageModifiers
- Rising_Dusk for GroupUtils and IntuitiveBuffSystem
- grim001 for AutoIndex and AbilityPreload
- Captain_Griffen for LightLeaklessDamageDetect
- TriggerHappy187 for TimedHandles
- Vexorian for JassHelper, Table and TimerUtils
- Pipedream for Grimoire
- Pitzermike and MindWorX for JassNewGenPack



Changelog

25/12/2009 - Version 1.0.0
- initial release

28/12/2009 - Version 1.0.1
- multiple bugfixes to all abilities
- Prolonged life now restores to exactly the amount specified in the settings, not to the amount specified plus the units current life
- multiple Reverse Damage instances on the same unit stack (correctly) now, and dont overwrite each other.
- multiple instances of Prolonged Life on the same unit overwrite each other now. The instance with the highest level now stays on the unit.
- all spells based on buffs correctly terminate now if the unit was killed by KillUnit() (or some other way of killing a unit without damaging it).

25/01/2011 - Version 1.1.0
- made TimedHandles an optional requirement
- moved array setup functions into one function
- removed periodic checks for buffs, ProlongedLife and ReverseDamage will now leak a spell instance (which also is an instance of DamageModifier) when the user removes or kills a unit with an active instance of the spell.
- SeedOfLife now has more calibration options eg. a chance to trigger or healing a fraction of the damage dealt to the target of the spell.
- more/better documentation
- few more minor changes

28/01/2011 - Version 1.2.0
- Seed of Life, Prolonged Life and Reverse Damage are now the same spell, configured differently.
- Smiting Zeal now supports enforcing the mana cost. It will not trigger if the caster cant pay the additional cost, if you configured it accordingly.
- Reverse Damage now has a minimum damage, damage dealt to the target of this spell must be greater than or equal to 20.

08/02/2011 - Version 1.2.1
- fixed a bug with how chances are handled, the spells should actually work now.






And here are the spells:

Seed of Life

Learn Tooltip

Infuses the target with the seed of life. Units around it get healed whenever the target takes damage.
Lasts 7 seconds.

Level 1 - Units in a 200 radius get healed by 15 HP.
Level 2 - Units in a 275 radius get healed by 20 HP.
Level 3 - Units in a 350 radius get healed by 25 HP.

Mana Cost: 60/75/90
Cooldown: 10/10/10


Expand Spell Code:



Prolonged Life

Learn Tooltip

Prolongs the target units life once over the next 8 seconds.

Level 1 - Restores 10% of the targets maximum health.
Level 2 - Restores 20% on the targets maximum health.
Level 3 - Restores 30% on the targets maximum health.

Mana Cost: 100/120/140
Cooldown: 5/5/5


Expand Spell Code:



Smiting Zeal

Learn Tooltip

Every time the hero casts a spell, all unit surrounding the target point get damaged. Drains 20 additional Mana Points with every cast.

Level 1 - Damages for 2 times the hero's intelligence.
Level 2 - Damages for 3 times the hero's intelligence.
Level 3 - Damages for 4 times the hero's intelligence.


Expand Spell Code:



Reverse Damage

Learn Tooltip

Surrounds the target unit with a shield which reverses the next damage greater than 20 within 5 seconds the unit would receive and instead heals the unit for the same amount.
Maximum reversed damage is 100.

Mana Cost: 25
Cooldown: 2


Expand Spell Code:
Attached Images
File Type: jpg DiscipleOfLife_01.jpg (544.3 KB, 395 views)
Attached Files
File Type: w3x DiscipleOfLight_1.2.1.w3x (338.1 KB, 164 views)
__________________

Last edited by Deaod : 02-08-2011 at 03:12 PM. Reason: Updated to 1.2.1
Deaod is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 12-25-2009, 01:28 AM   #2
Kam
User
 
Kam's Avatar
 
Join Date: Jan 2004
Posts: 465

Kam will become famous soon enough (32)Kam will become famous soon enough (32)

Default

Nice spells, I like the idea of a support damage hero.

The seed of life was my favorite.
__________________
Beyond the Throne: Tides of Darkness

I need help with AI for my project, please post if you are interested.
Kam is offline   Reply With Quote
Old 12-28-2009, 02:00 PM   #3
Deaod
User
 
Join Date: Jan 2007
Posts: 541

Submissions (11)

Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)

Send a message via ICQ to Deaod Send a message via MSN to Deaod
Default

Version 1.0.1

Just noticed that another extension to the Hero Contest was granted. This is really unfortunate.
__________________

Last edited by Deaod : 12-28-2009 at 07:27 PM.
Deaod is offline   Reply With Quote
Old 02-04-2010, 08:22 PM   #4
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,075

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

All/most spells:
  • The way you code the buff using a WC3 buff spell and then checking periodically if it is still there is very inelegant. An entirely triggered buff would be preferred.
  • TimedHandles could be made into an optional requirement.
  • The redundancy in the calibration section is a bit excessive. Either make your calibration array-based or function-based, not both.
  • If you make it array-based, there is no need for each property to have its own calibration function.
  • The spell documentation should state that the base spell is expected to be a single target buff spell (or whatever it is expected to be). Just naming two constants AID and BID is not particularly descriptive. In general, the calibration sections could use better documentation.
  • The spells are quite simple.

Seed of Life:
  • u!=s.target This should not be a part of the calibration function, but a part of the code, since the unit does in fact get healed, you just do it through the damage modifier instead of through the GroupEnum. (there is no particular reason for this complication, though)

Prolonged Life:
  • Considering you cleanup the damage modifier in the damage callback anyway, the whole periodic checking is not really needed.

Smiting Zeal:
  • Here is where I think function-based calibration beats array-based: it makes it easy for the user to either have attribute-based or absolute damage values simply by editing the formula. In your case, as long as the caster is a hero, the calibration only allows attribute-based damage.

Reverse damage:
  • Considering you cleanup the damage modifier in the damage callback anyway, the whole periodic checking is not really needed.
__________________
Anitarf is offline   Reply With Quote
Old 02-04-2010, 09:50 PM   #5
Deaod
User
 
Join Date: Jan 2007
Posts: 541

Submissions (11)

Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)

Send a message via ICQ to Deaod Send a message via MSN to Deaod
Default

Quote:
The way you code the buff using a WC3 buff spell and then checking periodically if it is still there is very inelegant. An entirely triggered buff would be preferred.
My thinking was that native WC3 buffs can be purged, something you cant do with auras (Tornado Slow Aura is the base for triggered buffs, right?)Will be done

Quote:
TimedHandles could be made into an optional requirement.
What do you mean, coding the delayed destruction myself?

Quote:
The redundancy in the calibration section is a bit excessive. Either make your calibration array-based or function-based, not both.
I know a lot of people prefer function calibration. I just wanted to make transition between each way easier. Ill move all SetUp functions into a single one, though.

Quote:
The spell documentation should state that the base spell is expected to be a single target buff spell (or whatever it is expected to be). Just naming two constants AID and BID is not particularly descriptive. In general, the calibration sections could use better documentation.
Okay, gonna add a few sentences.

Quote:
This should not be a part of the calibration function, but a part of the code
Okay, will change that. Btw, i remember not healing the target of Seed of Life separately. I also remember that that led to certain bugs, so that distinction is necessary.

Quote:
Considering you cleanup the damage modifier in the damage callback anyway, the whole periodic checking is not really needed.
There are certain situations (ie. the user removes/kill a target of Prolonged Life), where not checking periodically would leak the instance of Prolonged Life. Same applies to Reverse Damage.

@Smiting Zeal: Ill see what i can do to improve it.


Thanks for the review.
__________________

Last edited by Deaod : 02-16-2010 at 03:19 AM.
Deaod is offline   Reply With Quote
Old 01-25-2011, 12:37 PM   #6
Deaod
User
 
Join Date: Jan 2007
Posts: 541

Submissions (11)

Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)

Send a message via ICQ to Deaod Send a message via MSN to Deaod
Default

Version 1.1.0
__________________
Deaod is offline   Reply With Quote
Old 01-25-2011, 08:41 PM   #7
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,075

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Seed of life
  • The ValidHealTarget function, being a calibration function, should not take an argument of type Data since that's part of internal spell code and not necessarily understandable to someone doing the calibrating. Instead, the function should take the casting unit of the spell as an argument directly (as well as other Data members, like level, if needed).
  • I am not sure this spell really requires a damage modifier, since it is thematically a healing spell rather than a damage modifying spell. Damage modifying spells restore the unit's life in order to make it seem like the damage was modified, so they must consider all sorts of special cases. Healing spells just restore the unit's life; there's no other requirement, so using a damage modifier for a healing spell seems like overkill, you could just use a regular damage event instead. (however, if you do end up using DamageModifiers anyway, you should use The SetUnitLife and GetUnitLife functions provided by that library instead of SetWidgetLife because other units in range could already be taking damage at that time)
  • When I suggested you didn't need the periodic checks, I did not realize units could die without taking damage, in which case, as you note, the spell will leak a damage modifier. This is not just a problem with mapmakers using RemoveUnit or KillUnit, it could also happen when summoned unit timers expire. This should still be avoidable without the need for periodic checks. One method would be to utilize AutoIndex's AutoDestroy feature.(I realize now you already use this solution for this spell; why can't you do the same thing for the other two spells that have this problem?) Another method would be to use a system like ABuff instead of a DamageModifier, which would also address my other point about DamageModifiers being an overkill, since ABuff uses a simple damage event.
  • Minor comment: something like SetUpSpellData might make a for a more descriptive function name than SetUpArrays.

Prolonged Life
  • Similar comments to above. I suppose damage modifiers are more justified here, since the spell does thematically block an attack, but at the same time it does also restore the unit's life so it's also a healing spell in addition to being a damage blocking spell. Maybe the code should reflect that by blocking the damage using the return value of the onDamageTaken method while restoring the rest of the unit's life by using SetUnitLife. The reason I feel that this distinction is important is because modifying the damage into the negative using DamageModifiers won't just heal the unit, it will also change the damage value for any damage callbacks that run afterwards, so it might seem like the attacker is healing the target when in fact it's the prolong life spell that's doing it, the attacker is just having its damage blocked.

Smiting Zeal
  • If the hero does not have enough mana to pay the additional cost, should the ability still activate? I think it shouldn't.
  • Similar to Seed of Life, the ValidateTarget function should take the casting unit as an argument instead of expecting users to use outside code like SpellEvent.CastingUnit in it.

Reverse Damage
  • FX_PLAY_DEATH_ANIM is not really needed, it can just cause odd compile errors if it is set to false and the user doesn't have TimedHandles in his map. You should use [ljass]LIBRARY_TimedHandles
in the static if statement instead and simply mention in the documentation of the FX_DURATION constant that it will be ignored if the TimedHandles library is not present.[*]The spell seems mostly useless right now, since it will in most cases reverse a single regular attack and players can't really get it to reverse stronger spells unless they make a lucky guess about when the opponent will cast them. Even then, the spell is limited in how much damage it can reverse. I can't open the map right now, but I'm guessing the spell is meant to be a weak innate ability rather than an ultimate. That's fine then I guess, but the code should support more useful spells as well, for example a simple value for minimum damage to trigger it in addition to the existing maximum damage reversed would allow users to make this into an effective damage spell blocker.[/list]

Reverse Damage, Prolonged Life and to a lesser extent Seed of Life are very similar spells. This is more of a hero design issue than a problem for a spell submission; after all, we accept single spells, so a spellpack with multiple similar spells is fine. Still, I wish the spells were a bit more diverse, if not in their default setups then at least in what their calibration sections allow you to do with them.

For example, with a bit more calibration options, Reverse Damage and Prolong Life could be the same spell. You'd just need a constant to tell if the spell should only trigger on lethal damage or not, another to determine the damage reduction percentage (so you can just block damage or fully reverse it or anything in between) in addition to the calibration values of the existing two spells. A single spell like that (you could still have two separate spells in the map to showcase the flexibility of the code) would be worth more than those two spells currently are.

Since these are meant to be buff spells, they should support dispel functionality. I realize the old periodic checks in combination with buff spells did this already, but that's a bad solution for multiple reasons: the periodic checks are wasteful and each such spell must be based on a different base spell (the number of which is limited) because buff spells based on the same spell don't stack. The latter is a problem even if you don't intend to support dispel, so instead, since you're already triggering large portions of the spell, it would be easy to use a self-targetting aura (auras, unlike buff spells, do stack even when based on the same ability) to display the buff. That still leaves the problem of detecting dispel, though, which could be solved by using a buff system like ABuff or IBS.

Another thing that comes to mind (and I am getting slightly off-topic here) is that there is use for a healing library. With a healing event, we could make more interesting spells for a healer-type hero. There's this, but it's terribly old and should be replaced by something newer.
__________________
Anitarf is offline   Reply With Quote
Old 01-28-2011, 04:01 PM   #8
Deaod
User
 
Join Date: Jan 2007
Posts: 541

Submissions (11)

Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)

Send a message via ICQ to Deaod Send a message via MSN to Deaod
Default

Version 1.2.0

This should fix almost every issue you brought up, Anitarf.
The only one it doesnt, is using a library dedicated to healing. And currently, i dont think i need to submit another library.
__________________
Deaod is offline   Reply With Quote
Old 01-28-2011, 08:59 PM   #9
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,075

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Quote:
Originally Posted by Deaod
This should fix almost every issue you brought up, Anitarf.
The only one it doesnt, is using a library dedicated to healing. And currently, i dont think i need to submit another library.
That's all right, like I said, it was an off-topic thought, not an approval requirement.

Approved.
__________________
Anitarf is offline   Reply With Quote
Old 01-28-2011, 11:22 PM   #10
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,905

Submissions (37)

Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)

Hero Contest #3 - 2nd Place

Default

There was a fourth spell contest?
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 02-08-2011, 03:17 PM   #11
Deaod
User
 
Join Date: Jan 2007
Posts: 541

Submissions (11)

Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)

Send a message via ICQ to Deaod Send a message via MSN to Deaod
Default

Version 1.2.1

Yes, i believe it was dropped though because only two people or so managed to submit an entry.
__________________
Deaod is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 09:40 PM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2014, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services