Spell Mana Explosion

1

1337D00D

Guest
pie2.jpg

pie-1.jpg

(The peasants in the picture have mana.)

MUI: Yes
Leak-Free: Yes
JESP: No
Import Difficulty: Low
Requirements: KaTTana's Local handle variables.

This is just a simple spell I made when I was bored. It takes in 50/70/90 mana from all enemy units near the hero and unleashes it in a big explosion. (Mostly an eye candy spell.) :shades:

View attachment Spell-ManaExplosion.w3x

If there are any leaks I missed, please let me know.
 

Hero

─║╣ero─
Reaction score
250
From that 2nd screenshot it looks like it could lag..does it lag?
 
1

1337D00D

Guest
Mine does a little, but you can change the effect to one that dosen't use as many particles.
 

Sim

Forum Administrator
Staff member
Reaction score
534
Spell submission rules said:
-Make it easy to test
Add functions such as "Press ESC to regenerate HP and Mana and reset cooldowns" and fast creep respawn.

I have other things to do than restart the game just to continue testing. :)

It should be channeling instead of pausing the caster for the duration. Just check every x seconds if your unit's current order is still, say, starfall, and if it isn't, you stop the spell.

> exitwhen CountUnitsInGroup(g) <= 0

You can just do "exitwhen first == null" and put it after "set first = FirstOfGroup(g)".

Because the loop exits before first is set to null (when the group is empty), it isn't nulled.

Other than that... Great!
 
1

1337D00D

Guest
Updated:

-Added cooldown resetter.
-Added respawn.
-Fixed that leak.
-Spell is now a channel spell, interrupting it while still absorbing mana will release only what has been absorbed so far.
-Changed the effect to something less intensive.

:p
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
Very nice, good job! +Reputation.

Trigger comments:

Firstly I would put the Xs and Ys in locals (in the first function), you keep calling them what slows slightly the function. If you put them inside a local the speed will increase (and also it would make it clearer).

JASS:
call GroupEnumUnitsInRange(g,GetUnitX(caster),GetUnitY(caster),500,null)


I would put the 500 in a constant as well to ease the modification. In small maps this can be overpowered, while in big maps it can be powerful.

JASS:
if IsPlayerEnemy(GetOwningPlayer(first),GetOwningPlayer(caster)) == true and GetUnitState(first,UNIT_STATE_MAX_MANA) &gt;0 and GetUnitState(first,UNIT_STATE_LIFE) &gt; 0 then


Do:

Code:
if [B]IsUnitEnemy(first[/B],GetOwningPlayer(caster)) == true and GetUnitState(first,UNIT_STATE_MAX_MANA) > 0 and GetUnitState(first,UNIT_STATE_LIFE) > [B].405[/B] then

JASS:
call DestroyEffect(AddSpecialEffectTarget(&quot;Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl&quot;,first,&quot;origin&quot;))


Why don't you put the strings as constants?

JASS:
call DestroyTimer(t)


Pause the timer first.

Note: instead of doing:

JASS:

call GroupEnumUnitsInRange(g,GetUnitX(caster),GetUnitY(caster),500,null)

...

if IsPlayerEnemy(GetOwningPlayer(first),GetOwningPlayer(caster)) == true and GetUnitState(first,UNIT_STATE_MAX_MANA) &gt;0 and GetUnitState(first,UNIT_STATE_LIFE) &gt; 0 then


You can just put the condition inside a function and call it in GroupEnumUnitsInRange.

Why are you not merging the 2 loops?

JASS:
call SetUnitPosition(caster,GetUnitX(caster),GetUnitY(caster))


No need for that as far as I can tell.
 
1

1337D00D

Guest
Updated:

Did those things
-I'm not putting it in a condition in a function because its just easier that way, and that way I don't have to fool around with boolexprs.
-SetUnitPosition thing is to interrupt the channeling when the spell is over.
-The timer was never started in that instance, so I'm not pausing it.
 

Sim

Forum Administrator
Staff member
Reaction score
534
Please make spellpacks instead of submitting 2 spells at the same time.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top