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 04-16-2009, 11:47 PM   #1
JonNny
User
 
JonNny's Avatar
 
Join Date: Jun 2007
Posts: 51

Submissions (2)

JonNny has little to show at this moment (9)

Default Live Distortion & Mind Burst

Quote:
Originally Posted by Live Distortion
Sends out souls which will steal healthpoints and leave a debuff on the target. When returning they heal the caster depending on the dealt damage.
Rank 1 - sends out 6 souls which deal 40 dmg and heal for 30%
Rank 2 - sends out 9 souls which deal 55 dmg and heal for 40%
Rank 3 - sends out 12 souls which deal 70 dmg and heal for 50%

Quote:
Originally Posted by Mind Burst
Sends out two concentrated essences which will move in the target direction. On hit they deal damage, leave a mana draining debuff and if the target has mana it will also transfer a bit of it directly to the caster. Range Increases per level.
Rank 1 - 50 damage, 55 mana debuff, steals 10 mana directly
Rank 2 - 50 damage, 55 mana debuff, steals 15 mana directly
Rank 3 - 90 damage, 100 mana debuff, steals 20 mana directly


changelog

Update: v1.01
-made functions constant
-improved documention
-removed leaks in the init function
-other minor improvements of the script
-added that missiles grow after stealing hp

Update: v1.02
-changed SetUnitState to SetWidgetLife
-removed all bj_DEGTORAD as wanted

Update: v1.03
-minor bugfix due the remove of bj_DEGTORAD

Update : LD v1.04
-optimizing

+added Mind Burst v1.00

updated LD 1.06 , MB v1.02
-improved general scripting
-added GroupUtils
-made various changes
-reworked cofiguration block

updated LD 1.07 , MB 1.03
-made globals constant
-changed filter and removed NullFilter

updated LD 1.08 , MB 1.04
-removed dynamic dummy usage
-changed other small things

updated LD 1.08b, MB 1.04b
-removed Group Utilities due the patch
-made it 1.24 compatible



Expand Live Distortion code:

Expand Mind Burst code:
Attached Images
File Type: jpg LiveDistortion.JPG (68.7 KB, 517 views)
Attached Files
File Type: w3x vJass Spells v1.4b.w3x (31.5 KB, 136 views)
__________________

Last edited by JonNny : 09-06-2009 at 10:26 AM.
JonNny is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 04-17-2009, 12:34 AM   #2
TriggerHappy
 
Join Date: Feb 2008
Posts: 405

Submissions (2)

TriggerHappy will become famous soon enough (43)TriggerHappy will become famous soon enough (43)

Default

Collapse JASS:
call SetUnitState(data.Caster,UNIT_STATE_LIFE,GetUnitState(data.Caster,UNIT_STATE_LIFE)+PercentageHealPerLevel(data.level) * data.StolenHealth)

Use Get/SetWidgetLife, it's easier to use and it's faster.

Collapse JASS:
            set e = AddSpecialEffectTarget(HealSpecialeffect, data.Caster, "origin")
            call DestroyEffect(e)

Can be inlined.

Also, upload a demo map.

Last edited by TriggerHappy : 04-17-2009 at 12:35 AM.
TriggerHappy is offline   Reply With Quote
Old 04-17-2009, 05:38 AM   #3
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:
Can be inlined.

Not necessarily. If the ability has a death animation that isn't the same as its birth/stand animation, you could get an unwanted (or nonexistant) result.

Or is that code straight out of what he posted? If so, then you're right, it should be inlined.
__________________
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 04-17-2009, 09:41 AM   #4
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

please use radians everywhere, when you create your essences / in the callback..
And i think aswell that effect should be inlined..
__________________
akolyt0r is offline   Reply With Quote
Old 04-17-2009, 10:03 AM   #5
Dark_Dragon
User
 
Dark_Dragon's Avatar
 
Join Date: Apr 2008
Posts: 191

Dark_Dragon has little to show at this moment (9)

Default

Use Get/SetWidgetLife is slower since it must check what it must do item, unit, destructable to who and how to change a life since in c++ we have classes of unit, destructable and item...

setunitstate knows that it will apply something to unit and in fact getwidgetlife and getunitstate are different getunitstate is a constant native...

and inlining means do not call function but use its actions directly and storing value in local and then destroying it is not a problem its of same speed exept you have to null that local effect but i think he did that so no leaks...
Dark_Dragon is offline   Reply With Quote
Old 04-17-2009, 12:09 PM   #6
JonNny
User
 
JonNny's Avatar
 
Join Date: Jun 2007
Posts: 51

Submissions (2)

JonNny has little to show at this moment (9)

Default

Quote:
Originally Posted by TriggerHappy187
Collapse JASS:
            set e = AddSpecialEffectTarget(HealSpecialeffect, data.Caster, "origin")
            call DestroyEffect(e)

Can be inlined.

Also, upload a demo map.

Updated, fixed various things and also inlined this
There was already a demo map attached

Quote:
Originally Posted by akolyt0r
please use radians everywhere, when you create your essences / in the callback
Do you mean using 0.017453 instead of bj_DEGTORAD) ?

Else, i dont know what is faster. SetWidgetLife or GetUnitState but to be honest i dont care if my script could a nanosecond faster or not...
__________________

Last edited by JonNny : 07-02-2009 at 01:44 PM.
JonNny is offline   Reply With Quote
Old 04-17-2009, 12:24 PM   #7
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

Quote:
Originally Posted by JonNny
Do you mean using 0.017453 instead of bj_DEGTORAD) ?
no, just use radians directly...
example:
Collapse JASS:
local real angstep = 2*bj_PI / I2R(EssencesAmount) //2*PI (radians) == 360 (degrees)
//...
    loop 
            exitwhen a > EssencesAmount
            // Creating the missiles here
            set angle = angstep * I2R(a)
            set Essences.Data[Essences.Index-1].angle[a] = angle
            set Essences.Data[Essences.Index-1].EssenceDummy[a] = CreateUnit(GetOwningPlayer(caster), DummyID , x + ReleaseDistance * Cos(angle),y + ReleaseDistance * Sin(angle) , angle)
            set Essences.Data[Essences.Index-1].DamagedUnits[a] = CreateGroup()
            set Essences.Data[Essences.Index-1].MissileScale[a] = MissileStartScale
            set a = a + 1
    endloop
of course you have to change the rest of the code (callback function) aswell, to get rid of all those bj_DEGTORAD
__________________

Last edited by akolyt0r : 04-17-2009 at 12:25 PM.
akolyt0r is offline   Reply With Quote
Old 04-18-2009, 12:02 AM   #8
JonNny
User
 
JonNny's Avatar
 
Join Date: Jun 2007
Posts: 51

Submissions (2)

JonNny has little to show at this moment (9)

Default

Quote:
Originally Posted by akolyt0r
no, just use radians directly...
example:
Collapse JASS:
local real angstep = 2*bj_PI / I2R(EssencesAmount) //2*PI (radians) == 360 (degrees)
//...
    loop 
            exitwhen a > EssencesAmount
            // Creating the missiles here
            set angle = angstep * I2R(a)
            set Essences.Data[Essences.Index-1].angle[a] = angle
            set Essences.Data[Essences.Index-1].EssenceDummy[a] = CreateUnit(GetOwningPlayer(caster), DummyID , x + ReleaseDistance * Cos(angle),y + ReleaseDistance * Sin(angle) , angle)
            set Essences.Data[Essences.Index-1].DamagedUnits[a] = CreateGroup()
            set Essences.Data[Essences.Index-1].MissileScale[a] = MissileStartScale
            set a = a + 1
    endloop
of course you have to change the rest of the code (callback function) aswell, to get rid of all those bj_DEGTORAD

shouldnt be that hard to change
but is it really that faster ? whats the problem with bj_DEGTORAD?
__________________
JonNny is offline   Reply With Quote
Old 04-18-2009, 12:23 AM   #9
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

Using Get/SetWidgetLife may improve speed by nanoseconds or might slow it by nanoseconds, but it'll look a little neater.
__________________
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 04-18-2009, 06:34 AM   #10
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

Quote:
Originally Posted by JonNny
shouldnt be that hard to change
but is it really that faster ? whats the problem with bj_DEGTORAD?
its faster, and there is no reason what'so ever to use bj_DEGTORAD ...except when working with facing of unit as Get/SetUnitFacing are the only natives that take degrees and not radians...
__________________
akolyt0r is offline   Reply With Quote
Old 04-19-2009, 03:32 AM   #11
TriggerHappy
 
Join Date: Feb 2008
Posts: 405

Submissions (2)

TriggerHappy will become famous soon enough (43)TriggerHappy will become famous soon enough (43)

Default

Quote:
Originally Posted by Dark_Dragon
Use Get/SetWidgetLife is slower since it must check what it must do item, unit, destructable to who and how to change a life since in c++ we have classes of unit, destructable and item...

setunitstate knows that it will apply something to unit and in fact getwidgetlife and getunitstate are different getunitstate is a constant native...

and inlining means do not call function but use its actions directly and storing value in local and then destroying it is not a problem its of same speed exept you have to null that local effect but i think he did that so no leaks...

Get widget life has been tested, and is faster.

Just because you assume what goes on in the backend, doesn't make it true.

Last edited by TriggerHappy : 04-19-2009 at 03:32 AM.
TriggerHappy is offline   Reply With Quote
Old 04-19-2009, 01:50 PM   #12
JonNny
User
 
JonNny's Avatar
 
Join Date: Jun 2007
Posts: 51

Submissions (2)

JonNny has little to show at this moment (9)

Default

Hmm... kk
changed SetWhidgedLive and the radians
__________________

Last edited by JonNny : 04-19-2009 at 01:51 PM.
JonNny is offline   Reply With Quote
Old 04-23-2009, 06:09 PM   #13
JonNny
User
 
JonNny's Avatar
 
Join Date: Jun 2007
Posts: 51

Submissions (2)

JonNny has little to show at this moment (9)

Default

bump

updated , fixed some minor things and fixed some thing i forgot to change after removing the bj_DEGTORAD

Is there anything else improveable in this script?
__________________
JonNny is offline   Reply With Quote
Old 04-23-2009, 08:20 PM   #14
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

- dont use GroupEnumUnitsInRangeOfLoc, use GroupEnumUnitsInRange instead, so you can get rid of that location.

- And private constant function EssencesRangePerLevel takes real level returns real ... this function should take integer level not real...
- use bj_PI for all places where you use Pi

Optional:
- use TriggerRegisterAnyUnitEvent, you can totally use this BJ !
__________________
akolyt0r is offline   Reply With Quote
Old 04-24-2009, 11:38 AM   #15
JonNny
User
 
JonNny's Avatar
 
Join Date: Jun 2007
Posts: 51

Submissions (2)

JonNny has little to show at this moment (9)

Default

:) updated

also added a second spell, originally they were supposed to be Synenergy , ill add some interactivity later
__________________

Last edited by JonNny : 05-18-2009 at 12:48 AM.
JonNny 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 03:34 PM.


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

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