• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Light Shield 2.1.3

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. 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
Also this spell was already approved in wc3c, so it is sure to be of quality =D
You can see link here.

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.

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:
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

Keywords:
shield, light, divine, counter undead, heal, defend, defensive
Contents

Light shield (Map)

Reviews
13:37, 13th Jun 2009 hvo-busterkomo: A great vJASS spell, following the JESP standard. ShieldDyingEffect and Conditions could be made constant, but it doesn't really matter.

Moderator

M

Moderator

13:37, 13th Jun 2009
hvo-busterkomo: A great vJASS spell, following the JESP standard. ShieldDyingEffect and Conditions could be made constant, but it doesn't really matter.
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
Downloading...
Btw you didn't use the hidden tags correctly...
EDIT:
Strange, can't test it and i have JNGP o_O
Got an error in this line:
JASS:
set LightShield_id.eventCreate = ABuffEvent_Create.LightShield___Create
Will try to test it from the warcraft, not we...
 
Level 17
Joined
Mar 17, 2009
Messages
1,349
Well, I'm not going to fully read this, but there are two BJ's which could be easily replaced:
JASS:
call TriggerRegisterAnyUnitEventBJ( LightShieldTrg, EVENT_PLAYER_UNIT_SPELL_EFFECT )

With:
JASS:
local integer intr
set intr = 0
loop
    call TriggerRegisterPlayerUnitEvent(LightShieldTrg, Player(intr), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
    set intr = intr + 1
    exitwhen intr == bj_MAX_PLAYER_SLOTS
endloop

The same applies for the other BJ:
JASS:
call TriggerRegisterAnyUnitEventBJ(LightShieldTrg, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )


The script is very well documented and seems nicely done.
A lot of libraries are used, but they seem to be necessary...
Also it's very friendly user and easily adjustable

Well I like the idea, so all in all well done ;)


@ Kingz:
it opens normally on my WE :s
 
  • Like
Reactions: Rmx
Level 17
Joined
Sep 8, 2007
Messages
994
Well, I'm not going to fully read this, but there are two BJ's which could be easily replaced:
JASS:
call TriggerRegisterAnyUnitEventBJ( LightShieldTrg, EVENT_PLAYER_UNIT_SPELL_EFFECT )

With:
JASS:
local integer intr
set intr = 0
loop
    call TriggerRegisterPlayerUnitEvent(LightShieldTrg, Player(intr), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
    set intr = intr + 1
    exitwhen intr == bj_MAX_PLAYER_SLOTS
endloop

The same applies for the other BJ:
JASS:
call TriggerRegisterAnyUnitEventBJ(LightShieldTrg, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )


The script is very well documented and seems nicely done.
A lot of libraries are used, but they seem to be necessary...
Also it's very friendly user and easily adjustable

Well I like the idea, so all in all well done ;)


@ Kingz:
it opens normally on my WE :s

Those BJ's aren't dangerous or so slow that you have to replace it. You can just let it be there, it is no problem.
 
I am admired how fast people replied to this thread ... anyway:

@Kingz:
The hidden tags problem was fixed. About your problem, you are experiencing a bug with the JassHelper. This is a bug from the JassHelper in version 5c, please either run my spell with version 5b or simply update your JassHelper to the most recent version here:
http://www.wc3c.net/showthread.php?t=88142

@Deuterium:
You are correct about the BJ's, however those BJ's are not evil in the meaning of the word, they do some useful work. In this case I prefer code easy to read to a code that is hyper-mega-super efficient. We are talking about a few nanoseconds here, I don't think it is worth it xD

@xxdingo93xx:
Long time no see, thx for the fast reply buddy =D
Hope you can learn from this spell as well and make your spells even better than mine =P
 
Last edited:
Fats people, eh?^^
Wermm, I mean fast ! *fixed xD
There are no links for 5b, but fortunately I still have a 5b version backup, in case I need one. However the version is 120MB and so I can't attach it here =S

Your problem is easy to fix however, just download JassHelper from the link I gave you above, and then replace the JassHelper folder in your JNGP by the new one =D
 
Level 15
Joined
Jul 19, 2007
Messages
618
ohh well nice spell FP!

i checked it out and well you really use a lot of librarys :D
coding is object leakless MUI and not GUI
the only leaks i found are table ones (i mean boolexpr) leaks i dont know did you read Hankys tutor but using null as boolexpr is a leak! AnyUnitEventBJ creates 16 boolexpr leaks! but ill let you off since all GUI spells leak that!

still all other is quite nice ;) gj 4.7/5
but ill rate it 5/5 :D

Greets!
~Dark Dragon
 
I find it weird that AnyUnitEventBj leaks. If that happens then our maps should freeze after a few minutes of game, because that is one of the functions that is used massively. I can not discuss Table, that is something you have to do with Vex (it's creator). Also, Table already has an update for 1.23b, so this is not the most recent version it has (I decided to wait for 1.23b to update the lib, which will be just copy and paste xD ). There is a chance this "leak problem" you are reporting is fixed for 1.23b but I am not sure.

By the way, can you link me to Hanky's tut ? I didn't read it, I may learn something =)

Thx for the rating =D
 
Level 15
Joined
Jul 19, 2007
Messages
618
I find it weird that AnyUnitEventBj leaks. If that happens then our maps should freeze after a few minutes of game, because that is one of the functions that is used massively. I can not discuss Table, that is something you have to do with Vex (it's creator). Also, Table already has an update for 1.23b, so this is not the most recent version it has (I decided to wait for 1.23b to update the lib, which will be just copy and paste xD ). There is a chance this "leak problem" you are reporting is fixed for 1.23b but I am not sure.

By the way, can you link me to Hanky's tut ? I didn't read it, I may learn something =)

Thx for the rating =D

no no no :D your game wont freeze coz of this leaks nor will it freeze if u leak locations, groups... unless u leak 2^13 objects then u will see lag and delay in game...

what i mean by table is not table library but boolexpr coz type boolexpr is not an object its a table of boolean conditions thats what i mean and u leak them i could explain u better then that tutorial but i think that that hanky-s tutorial will be enough for u! ;)

Memory Leaks
currently number 1 tutorial about leaks i have ever seen!

np ty for checking my spell as well ;)
Greets!
~Dark Dragon
 
Top