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 03-18-2008, 02:18 AM   #1
Rising_Dusk
Obscurity, the Art


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

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 Shrapnade

NOTE: You have been redirected in order for our attachments to be made available to you. This will only last two minutes; these measures where taken to avoid hotlinking and bandwidth theft.
To avoid these restrictions Log in or Register

Zoom (requires log in)
Shrapnade
v1.07

Description

Spell Description:
Shrapnade
Range: 1000
Cooldown: 3 seconds

Lobs an explosive bomb towards the target point which explodes and fragments into multiple other bombs upon landing. Each bomb deals damage.

Level 1 - 80 damage per bomb, 1 fragment
Level 2 - 100 damage per bomb, 2 fragments
Level 3 - 120 damage per bomb, 3 fragments
Level 4 - 140 damage per bomb, 4 fragments
Level 5 - 160 damage per bomb, 5 fragments


Background:
The spell is made specifically for the Spell Session #10 on wc3c. The spell also complies with the JESP manifest, is fully multi-instanceable, and requires Grimoire and vJass.
Change Log

v1.0: Spell created and submitted for critique.
v1.04: Spell updated to fix some errors and make more things modular.
v1.05: Corrected some typos in the documentation.
v1.06: Corrected some style concerns.
v1.07: Made the timer correctly pause.


Spell Code:
Expand Spell Code:

Special Thanks:
All credits to anything used in the spell are in the testmap, but I'll do it again here. There's really not much to say, thanks to Vex for vJass and JESP and his dummy model. Thanks to wc3c for another cool contest. Thanks to everyone who participated in the contest for being awesome. Thanks to whoever took the time to test and play with my spell...

And thank you WC3C for being the coolest WC3 site evar. <3
Attached Images
File Type: jpg Shrapnade.jpg (83.2 KB, 841 views)
Attached Files
File Type: w3x SpellSession10_Shrapnade_v1.07.w3x (73.4 KB, 253 views)
__________________
Home Page
DoE v1.14c Download
AotZ v2.03d Download
OD v0.10x Download

Coming soon eventually...

Personal To-Do List:
ICARUS
Aot3

WC3C Chat
Chat IP: 66.103.20.109
Earthbound 2 in English
vJass Manual

"DAMAGE_TYPE_POISON motherfucker!" ~Anitarf
Rising_Dusk is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 03-19-2008, 01:28 AM   #2
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,263

Submissions (17)

moyack is a splendid one to behold (661)moyack is a splendid one to behold (661)moyack is a splendid one to behold (661)moyack is a splendid one to behold (661)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Ok, some comments:
  • In the onCreate method of the struct nade, you should put this: local nade n = nade.allocate()
  • (optional) you use a filter function, which is constant, and you create it and destroy in every callback. You can store that boolexpr as a private global var and call it directly instead of creating and destroying it all the time.

What else... no, no more...

Fix this and I'll move it where it belongs.

Last edited by moyack : 03-19-2008 at 02:38 AM.
moyack is offline   Reply With Quote
Old 03-19-2008, 01:35 AM   #3
Rising_Dusk
Obscurity, the Art


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

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:
In the onCreate method of the struct nade, you should put this: local nade n = nade.allocate()
They do the exact same thing though, I was reading how it works the same way in the jass helper manual when making it. If I had named the method "create" it would require .allocate, but since I named it "onCreate" I can use .create
Quote:
You can store that boolexpr as a private global var and call it directly instead of creating and destroying it all the time.
Didn't we establish in the other topic that there's no memory allocation difference? :p If you'd really like me to fix the nominal style concerns I will, but I don't personally think it needs them. You're the mod, you tell me!

Oh, and I deleted your double post.
__________________
Home Page
DoE v1.14c Download
AotZ v2.03d Download
OD v0.10x Download

Coming soon eventually...

Personal To-Do List:
ICARUS
Aot3

WC3C Chat
Chat IP: 66.103.20.109
Earthbound 2 in English
vJass Manual

"DAMAGE_TYPE_POISON motherfucker!" ~Anitarf
Rising_Dusk is offline   Reply With Quote
Old 03-19-2008, 03:02 AM   #4
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,263

Submissions (17)

moyack is a splendid one to behold (661)moyack is a splendid one to behold (661)moyack is a splendid one to behold (661)moyack is a splendid one to behold (661)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Quote:
Originally Posted by Rising_Dusk
They do the exact same thing though, I was reading how it works the same way in the jass helper manual when making it. If I had named the method "create" it would require .allocate, but since I named it "onCreate" I can use .create
well, yes, they do the same, but (if I understood properly what the create and allocate functions do) allocate() is the most direct function to set the struct index (AKA like using the native). I've just checked, and Jasshelper replaces internally .create() with .allocate() automatically, so in this case no worries.

Quote:
Didn't we establish in the other topic that there's no memory allocation difference? :p If you'd really like me to fix the nominal style concerns I will, but I don't personally think it needs them. You're the mod, you tell me!
Don't forget this part: (optional), if you like to destroy boolexpr every time you make a loop, then I won't interfere, as it was said, it's so minimal the effect that there's no problem, so you can left as is.

I've tested with several heroes and such to ensure the MUI (no problems...), so... don't give to this baby more await.

*approved*

EDIT: I fixed my double post :P

EDIT2: I forgot to say that I'm glad you've learned vJASS, keep the good work.

Last edited by moyack : 03-19-2008 at 03:12 AM.
moyack is offline   Reply With Quote
Old 03-19-2008, 02:55 PM   #5
Rising_Dusk
Obscurity, the Art


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

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:
EDIT2: I forgot to say that I'm glad you've learned vJASS, keep the good work.
Yeah, I'm glad I did too, made this spell loads easier to code. <3
__________________
Home Page
DoE v1.14c Download
AotZ v2.03d Download
OD v0.10x Download

Coming soon eventually...

Personal To-Do List:
ICARUS
Aot3

WC3C Chat
Chat IP: 66.103.20.109
Earthbound 2 in English
vJass Manual

"DAMAGE_TYPE_POISON motherfucker!" ~Anitarf
Rising_Dusk is offline   Reply With Quote
Old 03-19-2008, 10:31 PM   #6
Here-b-Trollz
Corkscrew Chainsaw!!!
 
Join Date: Jun 2006
Posts: 711

Here-b-Trollz has a spectacular aura about (149)

Hero Contest #2 - 2nd Place

Default

Collapse JASS:
function InitTrig_Shrapnade takes nothing returns nothing
    set gg_trg_Shrapnade = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Shrapnade, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_Shrapnade, Condition(function Conditions))
    call TriggerAddAction(gg_trg_Shrapnade, function Actions)
endfunction

Not to be picky, but for the sake of the user, who may already have a spell named Shrapnade, would this not be more appropriate?

Collapse JASS:
public function InitTrig takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t, Condition(function Conditions))
    call TriggerAddAction(t, function Actions)
endfunction

Then, changing the name of the spell is as easy as changing the scope name. If you really were hellbent on having the global, then something like:

Collapse JASS:
globals
    public trigger Trig
endglobals

public function InitTrig takes nothing returns nothing
    set Trig = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(Trig, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(Trig, Condition(function Conditions))
    call TriggerAddAction(Trig, function Actions)
endfunction

But really, that's a long way to go... And it's just a suggestion.
__________________
By reading this signature, you agree that I cannot be held accountable for anything that I might say or do.
Here-b-Trollz is offline   Reply With Quote
Old 03-19-2008, 10:50 PM   #7
Rising_Dusk
Obscurity, the Art


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

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

I agree with you, but I know from personal experience that I always like to have that global trigger handy for use as necessary. I think it may be wiser to do it your way, though, for the sake of full copy/pasta of the spell across the map.

I'll update momentarily.
EDIT: Updated.
__________________
Home Page
DoE v1.14c Download
AotZ v2.03d Download
OD v0.10x Download

Coming soon eventually...

Personal To-Do List:
ICARUS
Aot3

WC3C Chat
Chat IP: 66.103.20.109
Earthbound 2 in English
vJass Manual

"DAMAGE_TYPE_POISON motherfucker!" ~Anitarf
Rising_Dusk is offline   Reply With Quote
Old 06-06-2008, 04:09 AM   #9
Leopard
Banned
 
Join Date: May 2006
Posts: 222

Submissions (6)

Leopard seems to be the reincarnation of TerranUp16 (-100)Leopard seems to be the reincarnation of TerranUp16 (-100)Leopard seems to be the reincarnation of TerranUp16 (-100)Leopard seems to be the reincarnation of TerranUp16 (-100)

Send a message via Yahoo to Leopard
Default

I love this spell and quite nice terrain, keep up your good job ^^
Leopard 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:20 AM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

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