• 🏆 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!

Distributor v1.0a

This bundle is marked as pending. It has not been reviewed by a staff member yet.

Distributor v1.0a


Description

Distributor means a two type which distribute each state, the life and the mana, the main ability is will summon a spirit ball either life or mana, the ball will move infinite style to target position, target could be anyone, caster can cast it to his self and can so to enemy, the ball will move infinite style to target position, when the ball hits an enemy it will distribute state, if the ball is for life the ball will damage them and keep it as a life while the mana will steal mana to hitted enemy until they hit an ally so they will give the state they keep.

After infinite move, the ball will stop and stay until they die, at the moment they stay, the other ability could use them.

The slam,the slingshot, the dragon and the reunion
Can manipulate them


Author's note

Very sorry if the gif's are not high quality i was saving my data because i only used hacked internet data

Also my spell still uses dummy, im sorry for im a legendary pirated user ever since, i cant afford to update my warcraft version, i dont have any budget, im poor programmer XD

Credits

-Owner of SpellEffectEvent
-Owner of PlayerUnitEvent
-Vexorian for his dummy

Changelog

v1.0a
-Reduced Memory Usage

How to Import

First of all copy the imported dummy
Second copy all objects
Finally copy requirements folder and distributor folder


The spell pack is 100% configureable.

Previews
Contents

Just another Warcraft III map (Map)

Level 24
Joined
Feb 9, 2009
Messages
1,783
Gadzooks, from the gif this looks awesome!

Edit: rather confusing on what it does, but from my understanding the orbiting missile sap their respective type from enemy units it passes through and then stops where it is when it's full?
 
Last edited:
This is quite the eye-candy for a spellpack, I must say. However, optimizations and such are still possible. A lot needs to be said, but I can't say them all at once, so I've left it in spoilers.

  • The function DistanceBetweenXY can be optimized to return the square of the distance (not bothering with square root). That way, it would be less CPU-intensive to call this function in a loop.

  • In struct DISTRIBUTOR_dummy
    • In static method Death
      • The if-condition GetUnitTypeId(u)==DUMMY_ID can be replaced with a hashtable HaveSavedHandle(hash, GetHandleId(u), 0) check instead. This further ensures that only dummy units created for the class/struct will correctly proceed to the next step.
      • Setting a field value (of a hashtable entry) to null before removing that entry from the hashtable is redundant. SaveEffectHandle(hash, id, 0, null) before RemoveSavedHandle(hash, id, 0).
  • In struct createballs
    • In static method onCast
      • Having to use the same parent key to store different types would be more difficult to troubleshoot when something goes wrong with the spellpack (internally or externally). In this case, using 0 as a parent key to store both integers (unit types) and handles (groups) will cause some sort of confusion as to whether to treat the entry as an integer or as a handle.

 
Last edited:
Level 14
Joined
Oct 19, 2014
Messages
187
This is quite the eye-candy for a spellpack, I must say. However, optimizations and such are still possible. A lot needs to be said, but I can't say them all at once, so I've left it in spoilers.

  • The function DistanceBetweenXY can be optimized to return the square of the distance (not bothering with square root). That way, it would be less CPU-intensive to call this function in a loop.

  • In struct DISTRIBUTOR_dummy
    • In static method Death
      • The if-condition GetUnitTypeId(u)==DUMMY_ID can be replaced with a hashtable lookup HaveSavedHandle(hash, GetHandleId(u), 0)[/ljas] check instead. This further ensures that only dummy units created for the class/struct will correctly proceed to the next step. [*]Setting a field value (of a hashtable entry) to null before removing that entry from the hashtable is redundant. [icode=jass]SaveEffectHandle(hash, id, 0, null) before RemoveSavedHandle(hash, id, 0).
  • In struct createballs
    • In static method onCast
      • Having to use the same parent key to store different types would be more difficult to troubleshoot when something goes wrong with the spellpack (internally or externally). In this case, using 0 as a parent key to store both integers (unit types) and handles (groups) will cause some sort of confusion as to whether to treat the entry as an integer or as a handle.

DistanceBetweenXY

Hehehe about square of distance XD i havent master that formula, how i wish I could easily understand them XD , as for now by reading Vexorian's tutorial, unexpectedly that formula was there, XD but I'll try my best,, blabla nvm bro

Death Condition

Thanks maan for making me aware of

Finaly the

Parent's key

Probably if you will ask my opinion, my theory, i think they are in different section
By just looking the RemoveSaved$TYPE$
Maybe its a clue XD

Edit:Ah the square of distance that 10 is equal to 100? XD okay got it, honeslty i hate that formula, i dont know why

Edit:

DitanceBetweenXY

JASS:
  private function DistanceBetweenXY takes real x1,real y1,real x2,real y2 returns real
        local real dx=x2-x1
        local real dy=y2-y1
        return dx*dx+dy*dy
    endfunction
/*--------------------------------------------------------------------*/
                        set r=DistanceBetweenXY(x,y,xd,yd)
                        if r>((dist*dist)/2.0) then
                            set deg=bj_RADTODEG*Atan2(y-yd,x-xd)
                        elseif r<((dist*dist)/2.0) then
                            set deg=bj_RADTODEG*Atan2(yd-y,xd-x)
                        endif

Death Condition

How about this, I load the unit that was being save to dummy's parent by the key of 1 because key 0 had the attached effect to dummies so no way to save them in the same key because they are in handle section then I load the saved group by the parent of loaded unit from dummy's parent.
JASS:
GetUnitTypeId(u)==DUMMY_ID and IsUnitInGroup(u,LoadGroupHandle(hash,GetHandleId(LoadUnitHandle(hash,id,1)),0))
 
Last edited:
lol this is pretty cool, however im having a problem, it is crashing when using the life and mana distributor on enemies, and usually happen after a few uses of the skills initially, and then something doesn't seem quite about the reunion, is anybody else having problems too or is just me? xD

Update; Ive discovered the one problem im having, is when the unit you cast the mana or life distributor on dies before the distributor can finish, it seems to get stuck following you in an attack form i suppose ill call it, and never become usable by another spell, walking through a group of enemies cause the distributors non stop attack anything is passes through lol and they do not time out either, i believe too the same is happening when using reunion when they come back to you, same kind of stuck but following you deal cant quite remember if those ones timed out but i think so.

Update2; fixed my problem, however the reunion skill does not function and also does not in your test map running it in reforged. Any ideas on why and how to fix?
 
Last edited:
Level 14
Joined
Oct 19, 2014
Messages
187
lol this is pretty cool, however im having a problem, it is crashing when using the life and mana distributor on enemies, and usually happen after a few uses of the skills initially, and then something doesn't seem quite about the reunion, is anybody else having problems too or is just me? xD

Update; Ive discovered the one problem im having, is when the unit you cast the mana or life distributor on dies before the distributor can finish, it seems to get stuck following you in an attack form i suppose ill call it, and never become usable by another spell, walking through a group of enemies cause the distributors non stop attack anything is passes through lol and they do not time out either, i believe too the same is happening when using reunion when they come back to you, same kind of stuck but following you deal cant quite remember if those ones timed out but i think so.

Update2; fixed my problem, however the reunion skill does not function and also does not in your test map running it in reforged. Any ideas on why and how to fix?
OMG im very sorry,, this spell was made at old warcraft version.. no wonder why you encounter bugs because you are using reforged (+_+)
 
Top