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 02-18-2009, 09:17 PM   #1
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default Light Shield

Ok people, this is the return of my infamous Light Shield. After a discussion with Rising_Dusk complaining about me not using systems and doing things in an insane way, I quited the spell again, after all it worked well. However, recently (once again) I started working on the spell to make it approved, I decided that after so much time wasted on the spell, it would be a crime not to make an acceptable version of it to wc3c. Therefore I returned from the shadows making this spell as modular as I can, with as much experience as possible for a newbie like me xD
I know the mods are having problems with the unstoppable waves of submissions (or so I have been told) and I also know that the server was down for a few days, so instead of blasting the spell right in the submitting section (as I usually do when I finish) I decided to be more helpful and to post it on the Triggers and Scripts section of wc3c and THW so I could get critics on the code and suggestions for ideas and improvements.
Anyway, I think I did all I could to ease the job of the moderators, and somehow, I think I am addicted to the high standards of wc3c (it's a curse, trust me...) so here i am presenting another spell for the community.

Description:
- A JESP spell that allows the hero to cast a shield on a not Ud ally or on an Ud enemy (just like Holy Light). The shield will absorb an amount of damage for the allied unit thus protecting it from harm, or it will amplify the damage caused to the unit if it is enemy. When the shield dies, the shield unit will get healed by the remaining energies of the shield if it is an ally, or it will be damage by the remaining energies if it is an enemy.

Click image for larger version

Name:	LightShield1.jpg
Views:	159
Size:	216.9 KB
ID:	40580

Click image for larger version

Name:	LightShield2.jpg
Views:	355
Size:	174.8 KB
ID:	40579

Requirements:
- Jass NewGen Pack (uses vJASS)
- Timer Utils ( I use Blue flavor)
- xe basic and xedamage module
- ABuff and ADamage
- LastOrder(stand alone version) and AbortSpell

History:
Hidden information:

Version 1.0:
- Start of the spell, release to the forums in order to upgrade and search solutions

Version 1.1, 1.2, 1.3, 1.4:
- Testing and construction of the spell, fix of bugs and add of functionalities
- Public release as ready

Version 1.5
- Decided to join the community standards and so the spell now uses ADamage and Abuff

Version 1.6, 1.7:
- Improved many other aspects of the spell, including personalized error messages
among other new features

Version 1.8:
- Improved map to use AborSpell better
- Reduced the two error messages to only 1, thus simplifying the code and the SETUP
section
- Fixed a bug on the targets, now choosing targets work fine
- Corrected a few documentation typos

Version 1.9:
- Removed the alone version, it was buggy and inferior when compared to the other
- Improved the code, now the extra damage considers enemy armor when dealt
- Added w3gamer to credits

Version 2.0:
- Quick fix to a bug. Now when you cast the spell with chainlightning as an
order string it wont conflict
- Corrected a typo in the documentation and updated the JESP document
- Updated the requirements of the spell

Version 2.0.1:
- Removed the use of tags, after all, they are useless for this spell
- Improved the code in a line
- Updated the credits
- Changed the attack type to chaos
- Corrected the requirements of the spell

Version 2.0.2:
- Added another function to the SETUP that allows use to make a better use of the
spell
- Eliminated a useless variable ".lastDamage", this allowed me to greatly simplify
the if statements of some sections and allowed me to clean up the code a lot better
- Minos fixes in the change log

Version 2.1:
- Added another xedamage object that allows the use to calibrate the lastDamage
caused by the destruction of the shield in a different way
- Added new globals that allow the user to define the attachment points of the
effects on the units
- Fixed a leak problem
- Added another function that allows the to chose what he wants to do when the shield
dies
- Increased and corrected code documentation

Version 2.1.1:
- Fixed the capitalization conventions for the SETUP section
- Improved comments

Version 2.1.2:
- Fixed the description of the ability
- Fixed the description of the map
- Fixed the description of the loading screen
- Added more levels to the aura
- Fixed the tooltip of the buff, now it is not red, it is green

Version 2.1.3:
- Updated for patch 1.24.


code:
LightShield 2.1.3.txt

I am sorry, but I can not post the entire code here... it is too long, so instead I just post a txt file with it.
Attached Files
File Type: w3x Light Shield 2.1.3.w3x (101.0 KB, 119 views)
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition

Last edited by Flame_Phoenix : 08-06-2009 at 09:47 AM.
Flame_Phoenix is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 02-19-2009, 06:16 AM   #2
darkwulfv
Alpha Male of Wc3c
 
darkwulfv's Avatar


Official Map Reviewer
 
Join Date: Mar 2006
Posts: 3,646

Submissions (6)

darkwulfv is just really nice (270)darkwulfv is just really nice (270)

Send a message via AIM to darkwulfv
Default

Quote:
I think I am addicted to the high standards of wc3c (it's a curse, trust me...)
I wouldn't consider it a curse, since it makes you create things with a high standard by default; and since when has that been a bad thing? =P
__________________
The Spell Request Thread
Quote:
Originally Posted by Joe-Black-5
a dota like map but with unique stuff
(There was no map attached, and that was all the thread said.)
Spells I've Made

Darkwulfv's Lightning Grapple || Tritanis' Lazy Bolt

darkwulfv is offline   Reply With Quote
Old 02-19-2009, 12:46 PM   #3
emjlr3
Rehabbing
 
emjlr3's Avatar
 
Join Date: Jun 2005
Posts: 1,386

Submissions (14)

emjlr3 is a jewel in the rough (151)emjlr3 is a jewel in the rough (151)

Mapping Contest First Place

Send a message via AIM to emjlr3 Send a message via MSN to emjlr3
Default

i was under the impression Dusks lastorder doodad was built to work through the issueorder event, though perhaps it makes no difference

Collapse JASS:
call SetWidgetLife(shieldData.shielded, damage * 0.9)

i say save the multiplication and just use 1., or .5 - how often does someone actually take damage that is less then 1.? and how often does it actually matter? the overhead is negligable, but neglibable is the name of the game here - also I wonder, what if damage*.9<.405? ( I haven't run the math with your expression but it seems possible)

also, won't that method screw with assistance systems? - I see no internal way you can pass out who did the life reduction...currently
__________________

Last edited by emjlr3 : 02-19-2009 at 12:57 PM.
emjlr3 is offline   Reply With Quote
Old 02-19-2009, 12:58 PM   #4
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Quote:
I wouldn't consider it a curse, since it makes you create things with a high standard by default; and since when has that been a bad thing? =P
Lol, it was supposed to be a joke, but it is annoying to have people trying to destroy your codes all the time =P

Quote:
i say save the multiplication and just use 1., or .5 - how often does someone actually take damage that is less then 1.? and how often does it actually matter - also, the damage*.9 does not take into consideration armor/spell resistance/etc. (I think), therefor that could fail as well
I make no idea the attack that my victim will take, so the multiplication works for all cases. It is safe bet.
About armor, the extra damage is calculated based on the incoming damage, which is reduced by armor, so the extra damage will depend on the armor afaik.
And it will not screw assistance systems, first because the extra damage will be caused by the attacking unit and second because it can't die due extra damage, it dies due to the final damage.
In case my english skills fail, I just want to say that I am 100% this will not mess up assistance systems because we always have the attacker doing the damage in last place, thus the attacking unit always gets credit.
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix is offline   Reply With Quote
Old 02-19-2009, 02:29 PM   #5
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Quote:
Originally Posted by emjlr3
i was under the impression Dusks lastorder doodad was built to work through the issueorder event, though perhaps it makes no difference
It works on both, but it works the best on the ISSUED_ORDER events.
__________________
Rising_Dusk is offline   Reply With Quote
Old 02-19-2009, 03:39 PM   #6
emjlr3
Rehabbing
 
emjlr3's Avatar
 
Join Date: Jun 2005
Posts: 1,386

Submissions (14)

emjlr3 is a jewel in the rough (151)emjlr3 is a jewel in the rough (151)

Mapping Contest First Place

Send a message via AIM to emjlr3 Send a message via MSN to emjlr3
Default

FP, looks like you commented on a pre-edited version of my post, look at it again
__________________
emjlr3 is offline   Reply With Quote
Old 02-19-2009, 03:52 PM   #7
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Quote:
also I wonder, what if damage*.9<.405?
For that to happen we would need to have a damage value lower than 1, and in wc3 the lowest attack a unit can have is 1. Therefore this case is impossible.

Quote:
also, won't that method screw with assistance systems? - I see no internal way you can pass out who did the life reduction...currently
I think I already answered this question, but since I don't remember, I will just say it again: it doesn't matter who is doing the extra damage, because the unit making the extra will inevitably do the normal damage after. Because a unit can not kill with extra damage, we ensure a unit always damages the enemy (or kills it). This is I am sure I don't screw up kill systems or assistance systems.
Besides I am really not sure if it is my obligation to make my spells compatible with all other systems out there, because that is impossible.

Quote:
It works on both, but it works the best on the ISSUED_ORDER events.
I make no idea what you guys are talking about, but I just want to say I am using the same tactic I used in Launch Seal spell to cancel the spell and re-cast it again. If Dusk says it is Ok in Launch Seal, than it must be Ok here as well.
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition

Last edited by Flame_Phoenix : 02-19-2009 at 03:54 PM.
Flame_Phoenix is offline   Reply With Quote
Old 02-19-2009, 04:30 PM   #8
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

It could still be better using the same library. If you read the AbortSpell library documentation, it works best on the ISSUED_ORDER events. It still works on the SPELL_CAST event, but it's a quick change and improves the order intercepting significantly.

If you're doing it in that launch spell with SPELL_CAST, I recommend changing it there as well.
__________________
Rising_Dusk is offline   Reply With Quote
Old 02-19-2009, 04:51 PM   #9
Anitarf
Procrastination Incarnate


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

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

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

Default

Quote:
Originally Posted by Flame_Phoenix
For that to happen we would need to have a damage value lower than 1, and in wc3 the lowest attack a unit can have is 1. Therefore this case is impossible.
You are forgetting armour damage reduction.
__________________
Anitarf is offline   Reply With Quote
Old 02-19-2009, 05:52 PM   #10
emjlr3
Rehabbing
 
emjlr3's Avatar
 
Join Date: Jun 2005
Posts: 1,386

Submissions (14)

emjlr3 is a jewel in the rough (151)emjlr3 is a jewel in the rough (151)

Mapping Contest First Place

Send a message via AIM to emjlr3 Send a message via MSN to emjlr3
Default

along with spells, etc.

maybe I am entirely blind, but when exactly do you use the method damaged?
__________________

Last edited by emjlr3 : 02-19-2009 at 05:58 PM.
emjlr3 is offline   Reply With Quote
Old 02-19-2009, 06:31 PM   #11
Anitarf
Procrastination Incarnate


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

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

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

Default

Quote:
Originally Posted by emjlr3
maybe I am entirely blind, but when exactly do you use the method damaged?
It is used here.

F_P, you should only list the spell's actual requirements. For example, you don't use TimerUtils or Table, ABuff uses them; a different implementation of ABuff might not need them.

Also, you really should be using the order event for aborting spells.
__________________
Anitarf is offline   Reply With Quote
Old 02-19-2009, 08:08 PM   #12
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Quote:
If you read the AbortSpell library documentation, it works best on the ISSUED_ORDER events. It still works on the SPELL_CAST event, but it's a quick change and improves the order intercepting significantly.

If you're doing it in that launch spell with SPELL_CAST, I recommend changing it there as well.
Ohh....
Mmm, it seems a quick change in fact I will change that asap.

Quote:
You are forgetting armour damage reduction.
Werrmm, since it is extra damage, should it really be reduced?
Besides, how am I supposed to do that with the method Moyack suggested ? I just can't. For some reason amplifying damage with ADamage is nearly impossible, it is a nightmare to avoid an infinite loop, and xedamage doesn't help at all.

Quote:
F_P, you should only list the spell's actual requirements. For example, you don't use TimerUtils or Table, ABuff uses them; a different implementation of ABuff might not need them.
Right, I'm on it.

Ok guys, I will make a few changes and then will update this post telling what I changed.

EDIT EDIT EDIT

Ok guys, I made a few updates, see changelog (or code) for more info.
Meh, heck with it:
1 - I changed the event to issue order (as requested by Dusk)
2 - simplified the SETUP section and therefore the inner code related to it
3 - fixed a few typos
4 - fixed a bug (or so I think it was one)
5 - Removed Table and TimerUtils from the requirements (as requested by Ani)

I think this is all =P
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition

Last edited by Flame_Phoenix : 02-19-2009 at 08:32 PM.
Flame_Phoenix is offline   Reply With Quote
Old 03-09-2009, 02:47 AM   #13
Anitarf
Procrastination Incarnate


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

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

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

Default

Quote:
Originally Posted by Flame_Phoenix
5 - Removed Table and TimerUtils from the requirements (as requested by Ani)
My request was broader than that.

Your spell now conflicts with any other spell using the same orderstring, fix it.
__________________
Anitarf is offline   Reply With Quote
Old 03-09-2009, 11:39 AM   #14
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Quote:
My request was broader than that.
I also did other changes. Anyway please Elaborate.

Quote:
Your spell now conflicts with any other spell using the same orderstring, fix it.
?? I don't understand how can it conflict? I think I changed the spell to go as Dusk intended to, using an order string. I don't understand Ani, please Elaborate.

EDIT EDIT EDIT


Version Updated to meet (some of) Anitarf's demands:
- Now the shield considers armor
- Added TimerUtils to requirements because now I use it on code directly

Please see change log for more info.
Ani, I still need your help to understand what you want me to change about he conflicting order.

Quote:
Your spell now conflicts with any other spell using the same orderstring,
Isn't this suppose to happen?
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition

Last edited by Flame_Phoenix : 03-09-2009 at 11:41 AM.
Flame_Phoenix is offline   Reply With Quote
Old 03-09-2009, 12:43 PM   #15
emjlr3
Rehabbing
 
emjlr3's Avatar
 
Join Date: Jun 2005
Posts: 1,386

Submissions (14)

emjlr3 is a jewel in the rough (151)emjlr3 is a jewel in the rough (151)

Mapping Contest First Place

Send a message via AIM to emjlr3 Send a message via MSN to emjlr3
Default

if another hero uses a spell with with the same order string, al biet of a different ability, this will consider it the same thing

that should not be the case
__________________

Last edited by emjlr3 : 03-09-2009 at 03:35 PM.
emjlr3 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 12:55 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

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