[Contest] Official Spell Contest #1

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
>>talk about a lot of code Gals, good god, its not all that serious, lol
God !?
Hmm, I don't really get your meaning in your post. You mean that I am not taking it seriously? Or..

>>It still includes ABC system. And alot of comments.
I intend to make this spell easy to be implement, so I just bunch up everything into a trigger.
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
>>That too.
Hmm.....What would have been counted for taking it seriously..?
GodLike SFX?...-.-

>>Actually though, he was talking about the time he has to read this in great detail to grade it...
Which means...waste of time..><''
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
~GaLs~, you should use units casting dummy Finger of Death abilities instead of lightning effects, as there is a problem when trying to move the end of a lightning effect to the proper Z location to intersect flying units.

That and some of your constant globals are ridiculous. Why not make this a constant function that can support any number of levels?:
JASS:
    private constant string  BJS_Lightning1 = &quot;MFPB&quot; //Mana Flare
    private constant string  BJS_Lightning2 = &quot;MBUR&quot; //Mana Burn
    private constant string  BJS_Lightning3 = &quot;HWSB&quot; //Healing Wave (Secondary)
    private constant string  BJS_Lightning4 = &quot;SPLK&quot; //Spirit Link
    private constant string  BJS_Lightning5 = &quot;AFOD&quot; //Finger Of Death

And what in god's name is this?
JASS:
    private constant integer ChannelId = 852600

I'm not even entirely sure what this value is for, but my educated guess is that it's OrderId("channel"). You should just have a constant integer for the base orderid of the spell (people may want to change it so that orderstrings don't conflict) like so:
JASS:
private constant integer ChannelId = OrderId(&quot;channel&quot;)


The last thing is that because all those configuration variables are private, you don't need the "BJS_" prefix before them.
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
>>That and some of your constant globals are ridiculous. Why not make this a constant function that can support any number of levels?:
:/?
I don't get what you mean. I set different them to 5 because I want people to be able to know which stage had the unit channeled just by a sight. Ex: Red = Max

>>~GaLs~, you should use units casting dummy Finger of Death abilities instead of lightning effects, as there is a problem when trying to move the end of a lightning effect to the proper Z location to intersect flying units.

Hmm, finger of Death?.. Might considered.. XD

>>I'm not even entirely sure what this value is for, but my educated guess is that it's OrderId("channel"). You should just have a constant integer for the base orderid of the spell (people may want to change it so that orderstrings don't conflict) like so:
I am crazy. :p

>>you don't need the "BJS_" prefix before them.
I was too used to it, for making JESP spell.
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
I improved a bit the spell and the testing map, I also got a screen shot.

So here it is, version 2 of my spell.

Call of Despair

CallofDespair6.jpg


Jass / GUI: GUI!
MUI? Of course not.
Leaks? Yes. The more, the better, aye?
Lags? You bet.
Fun? Asking serously? NO.

V2: Test map was improved, creeps were added, terrain got improved and I created a few triggers to help you test the spell. As for changes for the spell itself, comments were slightly improved, and eye-candy was added.

Description:

When casting Call of Despair, the hero will call the dark forces of the gods. Four orbs will be created around him. The orbs will advance to him while as long as he is channeling, once they one reach him a dark force will hit the ground around the caster damaging foes. However if one of the dark orbs are destroyed then the 3 others will as well. The hero, will also slow the enemies around him.
CallofDespair5.jpg

Code: (USES ABC BY COHADAR IN THE HEADER)
JASS:
// ABC In Header
// Keeping it in the header so it won&#039;t bother you while reading this spell.


scope CoD // Keep it all in scope

globals
    private integer spellId = &#039;A000&#039; // Spell&#039;s Id
    private integer slowId = &#039;A001&#039; // Slow spell&#039;s Id
    private integer stompId = &#039;A002&#039; // The damaging spell&#039;s (stomp) Id
    private integer bonusId = &#039;A003&#039; // The bonus life spell Id.
    private integer dummyId = &#039;h000&#039; // Caster dummy Id
    private integer objectId = &#039;h001&#039; // Dummy Orb Id
    private integer orderId = 852600 // Order&#039;s Id (needed to check if the caster is casting the spell)
    
    private real MoveS1 = 130 // MoveS1 + MoveS2 * level will set the objects&#039; speed.
    private real MoveS2 = 20
    private real Interval = 0.4 // The timer&#039;s interval.
    private real Radius = 500. // Radius of the spell
    
    private string Effect = &quot;Abilities\\Spells\\Undead\\RaiseSkeletonWarrior\\RaiseSkeleton.mdl&quot;
    
    // Also suggested for Effect: &quot;Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl&quot;
endglobals

struct CoDS
    unit caster
    
    real x 
    real y
    
    integer level
    
    group dummies
endstruct 

// Spell&#039;s Conditions
public function Conditions takes nothing returns boolean
    return GetSpellAbilityId() == spellId
endfunction

// The slowed group&#039;s conditions, pick enemies only
private function groupConditions takes nothing returns boolean
    return IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(bj_lastCreatedUnit))
endfunction

// The dummies group&#039;s actions, check if one of them is dead.
private function groupActions takes nothing returns nothing    
    if GetUnitState(GetEnumUnit(),UNIT_STATE_LIFE) &lt; .405 then
        call GroupRemoveUnit(bj_lastCreatedGroup,GetEnumUnit())
        set bj_groupCountUnits = bj_groupCountUnits + 1
    endif
endfunction

// As it&#039;s name, this is the core of the spell.
private function Core takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local CoDS stru = GetTimerStructA(t)
    
    local unit caster = stru.caster
    local unit first
    
    local group dummies = stru.dummies
    local group slowed = CreateGroup()
    
    local integer level = stru.level
    local integer counter = 1
    
    local real x = stru.x
    local real y = stru.y
    local real dx
    local real dy
    local real distance
    
    set bj_lastCreatedGroup = dummies
    set bj_lastCreatedUnit = caster
    set bj_groupCountUnits = 0 
    
    if GetUnitCurrentOrder(caster) == orderId then // Still casting?
        call ForGroup(dummies, function groupActions) // See if one of the orbs died.
        
        if bj_groupCountUnits &gt; 1 then // If it did...
            call IssueImmediateOrder(caster,&quot;stop&quot;)
            
            loop // Kill all object, we don&#039;t need them anymore
                set first = FirstOfGroup(dummies)
                exitwhen first == null
                call KillUnit(first)
                call GroupRemoveUnit(dummies,first)
            endloop
            
            call stru.destroy()
            call ClearTimerStructA(t)
            call PauseTimer(t)
            call DestroyTimer(t)
            call DestroyGroup(dummies)
            call DestroyGroup(slowed)
            set slowed = null
            set t = null
            set dummies = null
            set first = null
            set caster = null
            return
        endif
        
        set first = FirstOfGroup(dummies) // They move at the same speed, we can assume they will reach the caster at
                                          // the same name, no need to start checking each and everyone of them.
        
        set dx = GetUnitX(first)
        set dy = GetUnitY(first)
        
        set distance = SquareRoot((dx - x) * (dx - x) + (dy - y) * (dy - y))
        
        if distance &lt;= 50 then // Did they reach the hero?
            set first = CreateUnit(GetOwningPlayer(caster),dummyId,x,y,0)
            call UnitAddAbility(first,stompId)
            call SetUnitAbilityLevel(first,stompId,level)
            call IssueImmediateOrder(first,&quot;stomp&quot;)
            call UnitApplyTimedLife(first,&#039;BTLF&#039;,2.) // Stomp &#039;em.
            
            loop // Eye-Candy
                exitwhen counter &gt; 6
                set dx = x + 100 * Cos(counter * 60 * bj_DEGTORAD)
                set dy = y + 100 * Sin(counter * 60 * bj_DEGTORAD)
                call DestroyEffect(AddSpecialEffect(Effect,dx,dy))
                set counter = counter + 1 
            endloop

            loop // Kill all object, we don&#039;t need them anymore
                set first = FirstOfGroup(dummies)
                exitwhen first == null
                call KillUnit(first)
                call GroupRemoveUnit(dummies,first)
            endloop
            
            call IssueImmediateOrder(caster,&quot;stop&quot;)
            call stru.destroy()
            call ClearTimerStructA(t)
            call PauseTimer(t)
            call DestroyTimer(t)
            call DestroyGroup(dummies)
            call DestroyGroup(slowed)
            set slowed = null
            set t = null
            set dummies = null
            set first = null
            set caster = null
            return // And destroy leaks and stop the spell, we are done, aye?
        endif
        
        call GroupEnumUnitsInRange(slowed,x,y,Radius,Condition(function groupConditions)) // Taking all enemies
        
        loop // Slowing our enemies
            set first = FirstOfGroup(slowed)
            exitwhen first == null
            set dx = GetUnitX(first)
            set dy = GetUnitY(first)
            set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(caster),dummyId,dx,dy,0.) // Why not use globals? 
                                                                                          //Better than creating ANOTHER 
                                                                                          //local. We got enough of them.
            call UnitAddAbility(bj_lastCreatedUnit,slowId)
            call SetUnitAbilityLevel(bj_lastCreatedUnit,slowId,level)
            call IssueTargetOrder(bj_lastCreatedUnit,&quot;slow&quot;,first)
            call UnitApplyTimedLife(bj_lastCreatedUnit,&#039;BTLF&#039;,2.)
            call GroupRemoveUnit(slowed,first)
        endloop
    else // He is not casting the spell anymore!
        loop // Kill all object, we don&#039;t need them anymore
            set first = FirstOfGroup(dummies)
            exitwhen first == null
            call KillUnit(first)
            call GroupRemoveUnit(dummies,first)
        endloop
    
        call stru.destroy()
        call ClearTimerStructA(t)
        call PauseTimer(t)
        call DestroyTimer(t)
        call DestroyGroup(dummies)
        call DestroyGroup(slowed)
        set slowed = null
        set t = null
        set dummies = null
        set first = null
        set caster = null
        return
    endif
    
    call DestroyGroup(slowed)
    set t = null
    set slowed = null
    set dummies = null
    set caster = null
    set first = null // Remove leaks that are created in each run
endfunction

// Sets up the spell and calls the Core function to do
// the real work.
public function Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local unit used
    
    local group dummies = CreateGroup()
    local timer t = CreateTimer()

    local integer level = GetUnitAbilityLevel(caster,spellId)
    local integer counter = 1
    local CoDS stru = CoDS.create()
    
    local real x = GetUnitX(caster)
    local real y = GetUnitY(caster)
    local real ux
    local real uy
    
    loop
        exitwhen counter &gt; 4
        set ux =  x + Radius * Cos((90 * counter - 25) * bj_DEGTORAD)
        set uy =  y + Radius * Sin((90 * counter - 25) * bj_DEGTORAD)
        
        set used = CreateUnit(GetOwningPlayer(caster),objectId,ux,uy,0.)
        
        call UnitAddAbility(used,bonusId)
        call SetUnitAbilityLevel(used,bonusId,level) // Unit has more life as the level is higher
        call SetUnitPathing(used,false) // Disable pathing so the object could go through everything
        call SetUnitMoveSpeed(used,MoveS1 + MoveS2 * level) // Set move speed of the objects
        
        call GroupAddUnit(dummies,used) // We store all objects in one group for us to trasfer
        
        call IssuePointOrder(used,&quot;move&quot;,x,y) // Order it to actually move to the proper location!
        set counter = counter + 1
    endloop
    
    set stru.dummies = dummies
    set stru.caster = caster
    set stru.x = GetUnitX(caster)
    set stru.y = GetUnitY(caster)
    
    call SetTimerStructA(t,stru)
    call TimerStart(t,Interval,true,function Core) // Attach struct and start the timers
    
    set dummies = null
    set used = null
    set t = null
    set caster = null
endfunction

endscope

// Creates the trigger, the general stuff are constructed here.
function InitTrig_Call_of_Despair takes nothing returns nothing
    set gg_trg_Call_of_Despair = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Call_of_Despair, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_Call_of_Despair, Condition(function CoD_Conditions))
    call TriggerAddAction(gg_trg_Call_of_Despair, function CoD_Actions)
endfunction

Screen Shots:
CallofDespair1.jpg
CallofDespair2.jpg
//
CallofDespair3.jpg
CallofDespair4.jpg
 

Attachments

  • Call of Despair.w3x
    64.8 KB · Views: 256

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Eye Candy

Conjures up some unspecified energies out of thin air,
concentrated into some ball-like structure,
and, once there is "enough"(*) of it,
send it off to some target point where something will happen...

That something, in this case, is dealing area damage.
The longer you channeled, the more damage.

The energies won't stay around forever.
They will explode... um... soon or so.
Alternatively, you may order the explosion at will.


That's it already :p


(*) Either at the end of the channeling time, or when the spell gets interrupted.


- requires NewGen
- multi-unit, multi-player, multi-what-the-heck-else-you-may-want-to-see-there
- no Furbolgs anywhere...


The map:
 

Attachments

  • ChannelEntry_forHulk3_AceHart.w3x
    30.8 KB · Views: 363

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
Wow AceHart.
That is a wicked idea.
Just for coming up with it you deserve to win (after me, of course).

I'll give a glance at the code.
I hope to find a leak, PM it to Emj and cuase you to lose.
But I'm not optimistic.
This IS AceHart after all.
Leaks are unheard of when it comes to him.
 

NetherHawk

New Member
Reaction score
26
not being rude or anything Rheias, dont u think u overdid a little, the coding and all?
haha Ace ur spell was cute =/
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
AceHart you know your spell works only for player(0), right? Also, note that creeps are not aggroing the casting hero, even though usually it happens, but I guess this is a "works a designed" kind of thing. Doesn't really matter. :p
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> your spell works only for player(0), right?

Seems normal, as the events are only registered for "Player 1 (Red)".

The Creeps are for target practice... I didn't want them to be in the way.
It's a demo map after all. Not some "fight your way through hordes of aggressive whatevers while still trying to appreciate the spell".
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
> AceHart

Of course, just saying that if one would one to import this spell, it wouldn't work as other spells.

Nothing but a note. ;)
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
I improved a bit the spell and the testing map, I also got a screen shot.

So here it is, version 2 of my spell.

Call of Despair

CallofDespair6.jpg


Jass / GUI: GUI!
MUI? Of course not.
Leaks? Yes. The more, the better, aye?
Lags? You bet.
Fun? Asking serously? NO.

V2: Test map was improved, creeps were added, terrain got improved and I created a few triggers to help you test the spell. As for changes for the spell itself, comments were slightly improved, and eye-candy was added. 2.1: Small bug fixed. Thanks ~Gals~.

Description:

When casting Call of Despair, the hero will call the dark forces of the gods. Four orbs will be created around him. The orbs will advance to him while as long as he is channeling, once they one reach him a dark force will hit the ground around the caster damaging foes. The Hero will slow his enemies around him as well. If the hero will stop channeling the spell before one of the orbs reach him, they will all be destroyed.
CallofDespair5.jpg

Code: (USES ABC BY COHADAR IN THE HEADER)
JASS:
// ABC In Header
// Keeping it in the header so it won&#039;t bother you while reading this spell.


scope CoD // Keep it all in scope

globals
    private integer spellId = &#039;A000&#039; // Spell&#039;s Id
    private integer slowId = &#039;A001&#039; // Slow spell&#039;s Id
    private integer stompId = &#039;A002&#039; // The damaging spell&#039;s (stomp) Id
    private integer bonusId = &#039;A003&#039; // The bonus life spell Id.
    private integer dummyId = &#039;h000&#039; // Caster dummy Id
    private integer objectId = &#039;h001&#039; // Dummy Orb Id
    private integer orderId = 852600 // Order&#039;s Id (needed to check if the caster is casting the spell)
    
    private real MoveS1 = 130 // MoveS1 + MoveS2 * level will set the objects&#039; speed.
    private real MoveS2 = 20
    private real Interval = 0.4 // The timer&#039;s interval.
    private real Radius = 500. // Radius of the spell
    
    private string Effect = &quot;Abilities\\Spells\\Undead\\RaiseSkeletonWarrior\\RaiseSkeleton.mdl&quot;
    
    // Also suggested for Effect: &quot;Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl&quot;
endglobals

struct CoDS
    unit caster
    
    real x 
    real y
    
    integer level
    
    group dummies
endstruct 

// Spell&#039;s Conditions
public function Conditions takes nothing returns boolean
    return GetSpellAbilityId() == spellId
endfunction

// The slowed group&#039;s conditions, pick enemies only
private function groupConditions takes nothing returns boolean
    return IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(bj_lastCreatedUnit))
endfunction

// The dummies group&#039;s actions, check if one of them is dead.
private function groupActions takes nothing returns nothing    
    if GetUnitState(GetEnumUnit(),UNIT_STATE_LIFE) &lt; .405 then
        call GroupRemoveUnit(bj_lastCreatedGroup,GetEnumUnit())
        set bj_groupCountUnits = bj_groupCountUnits + 1
    endif
endfunction

// As it&#039;s name, this is the core of the spell.
private function Core takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local CoDS stru = GetTimerStructA(t)
    
    local unit caster = stru.caster
    local unit first
    
    local group dummies = stru.dummies
    local group slowed = CreateGroup()
    
    local integer level = stru.level
    local integer counter = 1
    
    local real x = stru.x
    local real y = stru.y
    local real dx
    local real dy
    local real distance
    
    set bj_lastCreatedGroup = dummies
    set bj_lastCreatedUnit = caster
    set bj_groupCountUnits = 0 
    
    if GetUnitCurrentOrder(caster) == orderId then // Still casting?
        call ForGroup(dummies, function groupActions) // See if one of the orbs died.
        
        if bj_groupCountUnits &gt; 1 then // If it did...
            call IssueImmediateOrder(caster,&quot;stop&quot;)
            
            loop // Kill all object, we don&#039;t need them anymore
                set first = FirstOfGroup(dummies)
                exitwhen first == null
                call KillUnit(first)
                call GroupRemoveUnit(dummies,first)
            endloop
            
            call stru.destroy()
            call ClearTimerStructA(t)
            call PauseTimer(t)
            call DestroyTimer(t)
            call DestroyGroup(dummies)
            call DestroyGroup(slowed)
            set slowed = null
            set t = null
            set dummies = null
            set first = null
            set caster = null
            return
        endif
        
        set first = FirstOfGroup(dummies) // They move at the same speed, we can assume they will reach the caster at
                                          // the same name, no need to start checking each and everyone of them.
        
        set dx = GetUnitX(first)
        set dy = GetUnitY(first)
        
        set distance = SquareRoot((dx - x) * (dx - x) + (dy - y) * (dy - y))
        
        if distance &lt;= 50 then // Did they reach the hero?
            set first = CreateUnit(GetOwningPlayer(caster),dummyId,x,y,0)
            call UnitAddAbility(first,stompId)
            call SetUnitAbilityLevel(first,stompId,level)
            call IssueImmediateOrder(first,&quot;stomp&quot;)
            call UnitApplyTimedLife(first,&#039;BTLF&#039;,2.) // Stomp &#039;em.
            
            loop // Eye-Candy
                exitwhen counter &gt; 6
                set dx = x + 100 * Cos(counter * 60 * bj_DEGTORAD)
                set dy = y + 100 * Sin(counter * 60 * bj_DEGTORAD)
                call DestroyEffect(AddSpecialEffect(Effect,dx,dy))
                set counter = counter + 1 
            endloop

            loop // Kill all object, we don&#039;t need them anymore
                set first = FirstOfGroup(dummies)
                exitwhen first == null
                call KillUnit(first)
                call GroupRemoveUnit(dummies,first)
            endloop
            
            call IssueImmediateOrder(caster,&quot;stop&quot;)
            call stru.destroy()
            call ClearTimerStructA(t)
            call PauseTimer(t)
            call DestroyTimer(t)
            call DestroyGroup(dummies)
            call DestroyGroup(slowed)
            set slowed = null
            set t = null
            set dummies = null
            set first = null
            set caster = null
            return // And destroy leaks and stop the spell, we are done, aye?
        endif
        
        call GroupEnumUnitsInRange(slowed,x,y,Radius,Condition(function groupConditions)) // Taking all enemies
        
        loop // Slowing our enemies
            set first = FirstOfGroup(slowed)
            exitwhen first == null
            set dx = GetUnitX(first)
            set dy = GetUnitY(first)
            set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(caster),dummyId,dx,dy,0.) // Why not use globals? 
                                                                                          //Better than creating ANOTHER 
                                                                                          //local. We got enough of them.
            call UnitAddAbility(bj_lastCreatedUnit,slowId)
            call SetUnitAbilityLevel(bj_lastCreatedUnit,slowId,level)
            call IssueTargetOrder(bj_lastCreatedUnit,&quot;slow&quot;,first)
            call UnitApplyTimedLife(bj_lastCreatedUnit,&#039;BTLF&#039;,2.)
            call GroupRemoveUnit(slowed,first)
        endloop
    else // He is not casting the spell anymore!
        loop // Kill all object, we don&#039;t need them anymore
            set first = FirstOfGroup(dummies)
            exitwhen first == null
            call KillUnit(first)
            call GroupRemoveUnit(dummies,first)
        endloop
    
        call stru.destroy()
        call ClearTimerStructA(t)
        call PauseTimer(t)
        call DestroyTimer(t)
        call DestroyGroup(dummies)
        call DestroyGroup(slowed)
        set slowed = null
        set t = null
        set dummies = null
        set first = null
        set caster = null
        return
    endif
    
    call DestroyGroup(slowed)
    set t = null
    set slowed = null
    set dummies = null
    set caster = null
    set first = null // Remove leaks that are created in each run
endfunction

// Sets up the spell and calls the Core function to do
// the real work.
public function Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local unit used
    
    local group dummies = CreateGroup()
    local timer t = CreateTimer()

    local integer level = GetUnitAbilityLevel(caster,spellId)
    local integer counter = 1
    local CoDS stru = CoDS.create()
    
    local real x = GetUnitX(caster)
    local real y = GetUnitY(caster)
    local real ux
    local real uy
    
    loop
        exitwhen counter &gt; 4
        set ux =  x + Radius * Cos((90 * counter - 25) * bj_DEGTORAD)
        set uy =  y + Radius * Sin((90 * counter - 25) * bj_DEGTORAD)
        
        set used = CreateUnit(GetOwningPlayer(caster),objectId,ux,uy,0.)
        
        call UnitAddAbility(used,bonusId)
        call SetUnitAbilityLevel(used,bonusId,level) // Unit has more life as the level is higher
        call SetUnitPathing(used,false) // Disable pathing so the object could go through everything
        call SetUnitMoveSpeed(used,MoveS1 + MoveS2 * level) // Set move speed of the objects
        
        call GroupAddUnit(dummies,used) // We store all objects in one group for us to trasfer
        
        call IssuePointOrder(used,&quot;move&quot;,x,y) // Order it to actually move to the proper location!
        set counter = counter + 1
    endloop
    
    set stru.dummies = dummies
    set stru.caster = caster
    set stru.x = GetUnitX(caster)
    set stru.y = GetUnitY(caster)
    
    call SetTimerStructA(t,stru)
    call TimerStart(t,Interval,true,function Core) // Attach struct and start the timers
    
    set dummies = null
    set used = null
    set t = null
    set caster = null
endfunction

endscope

// Creates the trigger, the general stuff are constructed here.
function InitTrig_Call_of_Despair takes nothing returns nothing
    set gg_trg_Call_of_Despair = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Call_of_Despair, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_Call_of_Despair, Condition(function CoD_Conditions))
    call TriggerAddAction(gg_trg_Call_of_Despair, function CoD_Actions)
endfunction

Screen Shots:
CallofDespair1.jpg
CallofDespair2.jpg
//
CallofDespair3.jpg
CallofDespair4.jpg

Edit: If it wasn't clear enough, I would like to replace my previous entry, with this one. Thank you.
 

Attachments

  • Call of Despair.w3x
    64.8 KB · Views: 216

Drunken_God

Hopes to get back into Mapmaking with SC2 :)
Reaction score
106
Acehearts is till now the best one (dont want to say that the others are bad but they rent sooo good like aces)

Leaks? Yes. The more, the better, aye?
OFFTOPIC: thx for that good joke it saved my day
 

rodead

Active Member
Reaction score
42
i don't want to be enoying but you don't have seen all of them so you better wait till the contest ends and everybody made his entrie

Maybe mine is better who knows :p
 

Demonwrath

Happy[ExtremelyOverCommercializ ed]HolidaysEveryon
Reaction score
47
Finally Finished!!!

Okay I finally got my spell finished. I had to make a new one however because I forgot about the 'do not ask for help' rule. So anyway this is my spell:

Please note I still have some typos in the tooltips and what not to fix :p

Demon Storm


GUI/JASS - GUI
MUI - Don't think so
Leakless - Pretty sure it is :D

Tooltip:
Demonwrath begins to open a way to a demonic world, and summoning demons to serve him. Doing so also causes fluxes in the universe and balls of fire fall from the sky striking Demonwrath's enemies. The longer he channels the spell the more powerful the demons are that are summoned. However, doing this ritual takes a tole on Demonwrath, and when his channeling is complete, he becomes exhausted and has his health reduced to 1/10 of his total. Health is not increased if current health is already below 1/10 of maximum hit points.

Initialization:
1. Copy over the spell, as well as the two Buffs for the spell [Demon Storm (Target) and Demon Storm (Effect)]
2. Copy over all Triggers, and adjust anything any way you want it.
3. Make sure you have all variables
4. Enjoy :D

Trigger:
Code:
Portals
    Events
        Unit - A unit Begins channeling an ability
    Conditions
        (Ability being cast) Equal to Demon Storm 
    Actions
        Set Caster = (Casting unit)
        For each (Integer A) from 0 to 3, do (Actions)
            Loop - Actions
                Destructible - Create a Shimmering Portal at ((Position of Caster) offset by 300.00 towards (Real(((Integer A) x 90))) degrees) facing (Real(((Integer A) x 90))) with scale 1.00 and variation 0
                Set portal_Unit[(Integer A)] = (Last created destructible)
                Set portal_Position[(Integer A)] = (Position of portal_Unit[(Integer A)])
                Animation - Play portal_Unit[(Integer A)]'s birth animation
                Countdown Timer - Start unitSpawn[1] as a One-shot timer that will expire in 10.00 seconds
Code:
Spawns
    Events
        Time - unitSpawn[1] expires
        Time - unitSpawn[2] expires
        Time - unitSpawn[3] expires
        Time - unitSpawn[4] expires
        Time - unitSpawn[5] expires
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                SpawnCounter Less than or equal to 5
            Then - Actions
                For each (Integer A) from 0 to 3, do (Actions)
                    Loop - Actions
                        Unit - Create 1 Felguard for (Owner of Caster) at (Position of portal_Unit[(Integer A)]) facing (Real(((Integer A) x 90))) degrees
                Countdown Timer - Start unitSpawn[1] as a One-shot timer that will expire in 4.00 seconds
                Set SpawnCounter = (SpawnCounter + 1)
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        SpawnCounter Greater than 5
                        SpawnCounter Less than or equal to 10
                    Then - Actions
                        For each (Integer A) from 0 to 3, do (Actions)
                            Loop - Actions
                                Unit - Create 1 Succubus for (Owner of Caster) at (Position of portal_Unit[(Integer A)]) facing (Real(((Integer A) x 90))) degrees
                        Countdown Timer - Start unitSpawn[2] as a One-shot timer that will expire in 6.00 seconds
                        Set SpawnCounter = (SpawnCounter + 1)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                SpawnCounter Greater than 10
                                SpawnCounter Less than or equal to 15
                            Then - Actions
                                For each (Integer A) from 0 to 3, do (Actions)
                                    Loop - Actions
                                        Unit - Create 1 Fel Stalker for (Owner of Caster) at (Position of portal_Unit[(Integer A)]) facing (Real(((Integer A) x 90))) degrees
                                Countdown Timer - Start unitSpawn[3] as a One-shot timer that will expire in 8.00 seconds
                                Set SpawnCounter = (SpawnCounter + 1)
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        SpawnCounter Greater than 15
                                        SpawnCounter Less than or equal to 17
                                    Then - Actions
                                        For each (Integer A) from 0 to 3, do (Actions)
                                            Loop - Actions
                                                Unit - Create 1 Doom Guard for (Owner of Caster) at (Position of portal_Unit[(Integer A)]) facing (Real(((Integer A) x 90))) degrees
                                        Countdown Timer - Start unitSpawn[3] as a One-shot timer that will expire in 10.00 seconds
                                        Set SpawnCounter = (SpawnCounter + 1)
                                    Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                SpawnCounter Greater than 17
                                            Then - Actions
                                                For each (Integer A) from 0 to 3, do (Actions)
                                                    Loop - Actions
                                                        Destructible - Kill portal_Unit[(Integer A)]
                                                        Special Effect - Create a special effect at ((Position of Caster) offset by 200.00 towards (Real(((Integer A) x 90))) degrees) using Units\Demon\Infernal\InfernalBirth.mdl
                                                        If ((Life of Caster) Greater than ((Max life of Caster) / 10.00)) then do (Unit - Set life of Caster to ((Max life of Caster) / 10.00)) else do (Do nothing)
                                                Trigger - Turn off Portal Remove <gen>
                                                Trigger - Turn on Portal Remove <gen>
                                                Set SpawnCounter = 1
                                            Else - Actions
Code:
Portal Remove
    Events
        Unit - A unit Stops casting an ability
    Conditions
        (Ability being cast) Equal to Demon Storm 
    Actions
        For each (Integer A) from 0 to 3, do (Actions)
            Loop - Actions
                Destructible - Kill portal_Unit[(Integer A)]
        Trigger - Turn off Spawns <gen>
        Wait 10.00 seconds
        Trigger - Turn on Spawns <gen>

Screenshots:


EDIT: Wow, I forgot to upload the map :p
View attachment DemonwrathContestSpell.w3x
 
T

The Mapmaker

Guest
Alrighty:


Pulse Wave

GUI/JASS: GUI with some JASS scripts
MUI: ....
Leaks: Hope not

History: "The Pulse Wave was a legendary ability used only by the most powerful of the universe. Bending Gravity, Time, and Space itself, the user creates a massive void that pulls all enemy units towards him at an impossible speed. The units take much damage from the sucking of the void. When the casting ends, the pull is suddenly released in an explosion, sending all enemy units flying away."

Creates a void that pulls all enemies within a 1000 radius towards you, deals 100 damage per second, completely removes their attack accuracy, and then blasts them away dealing 200 damage. Channeling lasts 5 seconds. Casting makes you unable to move.

Screenshots:
WC3ScrnShot_110307_002401_08.jpg
WC3ScrnShot_110307_002406_09.jpg
WC3ScrnShot_110307_002420_11.jpg
WC3ScrnShot_110307_002408_10.jpg

Triggers:
Code:
Pulse Wave Damage
    Events
        Unit - A unit Begins channeling an ability
    Conditions
        (Ability being cast) Equal to Pulse Wave 
    Actions
        Special Effect - Create a special effect attached to the origin of (Triggering unit) using doodads\cinematic\ShimmeringPortal\ShimmeringPortal.mdl
        Set PulseWaveVoid = (Last created special effect)
        Unit - Add Pulse Wave Damage Book  to (Triggering unit)
        Player - Disable Pulse Wave Damage Book  for (Owner of (Triggering unit))
        Unit - Add Pulse Wave Evasion  to (Triggering unit)
        Set PulseWaveDeselected = (Triggering unit)
        Trigger - Turn on Deselection <gen>
        Wait 5.00 seconds
        Special Effect - Destroy PulseWaveVoid
        Floating Text - Create floating text that reads GTFO!! above PulseWaveDeselected with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        Unit - Create 1 Pulse Wave Dummy Unit for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
        Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
        Wait 0.20 seconds
        Unit - Remove (Last created unit) from the game
        Trigger - Turn off Deselection <gen>
        Custom script:   set udg_PulseWaveDeselected=null
        Unit - Remove Pulse Wave Damage Book  from (Triggering unit)
        Unit - Remove Pulse Wave Evasion  from (Triggering unit)
        Wait 0.80 seconds
        Floating Text - Destroy (Last created floating text)

Code:
Deselection
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Selection - Remove PulseWaveDeselected from selection for (Owner of PulseWaveDeselected)

Code:
Pulse Wave Cast
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Pulse Wave Knockback 
    Actions
        Set KnockbackInteger = 0
        Set KnockbackTimerPause = 0.03
        Set KnockbackCaster = (Triggering unit)
        Set KnockbackCasterPoint = (Position of KnockbackCaster)
        Set KnockbackValue = 12.00
        Set KnockbackUnits = (Units within 500.00 of KnockbackCasterPoint matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A ground unit) Equal to True) and (((Matching unit) belongs to an enemy of (O
        Countdown Timer - Start KnockbackTimer as a Repeating timer that will expire in KnockbackTimerPause seconds
        Wait 1.25 seconds
        Countdown Timer - Pause KnockbackTimer
        Custom script:   call RemoveLocation(udg_KnockbackCasterPoint)
        Custom script:   call DestroyGroup(udg_KnockbackUnits)

Code:
Pulse Wave Knockback
    Events
        Time - KnockbackTimer expires
    Conditions
    Actions
        Unit Group - Pick every unit in KnockbackUnits and do (Actions)
            Loop - Actions
                Set KnockbackUnitsPoints = (Position of (Picked unit))
                Set KnockbackUnitsPointsOffset = (KnockbackUnitsPoints offset by KnockbackValue towards (Angle from KnockbackCasterPoint to KnockbackUnitsPoints) degrees)
                Unit - Move (Picked unit) instantly to KnockbackUnitsPointsOffset
                Custom script:   call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl", GetEnumUnit(), "chest"))
                Custom script:   call RemoveLocation(udg_KnockbackUnitsPoints)
                Custom script:   call RemoveLocation(udg_KnockbackUnitsPointsOffset)

Code:
PulseWaveCast
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Pulse Wave 
    Actions
        Set PulseWaveCaster = (Triggering unit)
        Set K = 0.00
        Trigger - Turn on PulseWaveSlide <gen>
        Wait 0.20 seconds

Code:
PulseWaveSlide
    Events
        Time - Every 0.03 seconds of game time
    Conditions
    Actions
        Set K = (K + 1.00)
        Set PulseWaveCasterPoint = (Position of PulseWaveCaster)
        Set PulseWaveUnits = (Units within 1000.00 of (Position of PulseWaveCaster) matching (((Matching unit) belongs to an ally of (Owner of PulseWaveCaster)) Equal to False))
        Unit Group - Pick every unit in PulseWaveUnits and do (Actions)
            Loop - Actions
                Set PulseWavePickedUnitPoint = (Position of (Picked unit))
                Set PulseWaveDistance = (Distance between PulseWaveCasterPoint and PulseWavePickedUnitPoint)
                Set PulseWaveAngle = (Angle from PulseWavePickedUnitPoint to PulseWaveCasterPoint)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        PulseWaveDistance Greater than 100.00
                    Then - Actions
                        Unit - Move (Picked unit) instantly to (PulseWavePickedUnitPoint offset by 50.00 towards PulseWaveAngle degrees)
                    Else - Actions
                        Do nothing
                Custom script:   call RemoveLocation (udg_PulseWavePickedUnitPoint)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                K Equal to 19
            Then - Actions
                Trigger - Turn off (This trigger)
            Else - Actions
                Do nothing
        Custom script:   call RemoveLocation (udg_PulseWaveCasterPoint)
        Custom script:   call DestroyGroup (udg_PulseWaveUnits)
 

Attachments

  • Pulse Wave.w3x
    23.3 KB · Views: 236

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
JASS:
//!&lt;--Start of my Spell--&gt;!//
scope BunJeeShotStructed


//---------------------------------------------------------//
//                        BunJee Shot                      //
//                         by ~GaLs~                       //
//---------------------------------------------------------//
//**Especially made for Official Spell Contest #1**//
//
//[3 Simple Step To Implement This Spell]
//
//Implementation Instruction:
//
//1. Things need to be copied from Object Editor to your map:
//      &lt;&lt; Unit &gt;&gt;
//  a. A dummy unit named Stick DummyUse.
//
//      &lt;&lt; Ability &gt;&gt;
//  b. The BunJee Shot ability.
//
//2. Copy this whole trigger to your map.
//
//3. Replace those rawcode in the configuration below. (Also modify those speed, effect at there.)
//---------------------------------------------------------//
//                Thanks For Using My Spell                //
//                    Please Give Credit                   //
//---------------------------------------------------------//


globals
//===================================================
//==                 Configuration                 ==
//===================================================
//-------------------------------------------------------------------------------------
    //&lt;--RawCode--&gt;//
    
    private constant integer BJS_Id = &#039;A000&#039;        //Rawcode of the main ability.
    private constant integer BJS_TorchId = &#039;h001&#039;   //Rawcode of the Torch Unit.
    
    //&lt;--End--&gt;//
//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------
    //&lt;--Charging Speed--&gt;//
    
    private constant real    BJS_ChargingSpeed = .07
    //This is the charge speed of the charging period. (Channeling Period)
    //The smaller the number, the faster the unit charge.
    
    //&lt;--End--&gt;//
//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------
    //&lt;--Rush Speed--&gt;//
    
    private constant real    BJS_RushSpeed = 100.
    //This is the rush speed of the rushing period. (After Channel)
    //The larger the number, the faster it rush. BEWARE: Do not set it larger than 200 or less than 50, LAG warning.
    
    //&lt;--End--&gt;//
//-------------------------------------------------------------------------------------
    //&lt;--Charge Effect--&gt;//
    
    private constant string  BJS_ChargeEffect = &quot;Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl&quot;
    //This is the special effect that will be view when charging.
    
    //&lt;--End--&gt;//
//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------
    //&lt;--Lightning Effect--&gt;//
    
    //These are the lightning effect which is act as an elastic string. The level of it is sort by BJS_Lightning&lt;Level&gt;.
    private constant string  BJS_Lightning1 = &quot;MFPB&quot; //Mana Flare
    private constant string  BJS_Lightning2 = &quot;MBUR&quot; //Mana Burn
    private constant string  BJS_Lightning3 = &quot;HWSB&quot; //Healing Wave (Secondary)
    private constant string  BJS_Lightning4 = &quot;SPLK&quot; //Spirit Link
    private constant string  BJS_Lightning5 = &quot;AFOD&quot; //Finger Of Death
    
    //&lt;--End--&gt;//
//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------    
    //&lt;--Rush Effect--&gt;//

    private constant string  BJS_RushEffect = &quot;Abilities\\Spells\\Items\\WandOfNeutralization\\NeutralizationMissile.mdl&quot;
    //This is the effect that will be display at whole caster&#039;s body when the channeling had finished.
    
    //&lt;--End--&gt;//
//------------------------------------------------------------------------------------- 
//-------------------------------------------------------------------------------------   
    //&lt;--Channel ID--&gt;//
    
    private constant integer ChannelId = 852600
    //Well, I was force to use 852600 because OrderId doesn&#039;t work for unknown reason. =.=
    
    //&lt;--End--&gt;//
//-------------------------------------------------------------------------------------
//===================================================
//==               End Configuration               ==
//===================================================    
    
    
//===================================
//==        Unrelated Items        ==
//===================================
//Comment: These 3 variable are variable that is needed to pass function. Advised to not take any care of them.

    private group DummyDamaged
    private unit  DummyCaster
    private real  DummyDamage
//===================================
//==      Unrelated Items End      ==
//===================================   

endglobals

//========================================================================================
//==                             WARNING! WARNING! WARNING!                             ==
//==                        DO NOT EDIT ANYTHING UNDER THIS LINE!                       ==
//========================================================================================                                                   

//! Comments below is only for emjlr3. (Judging purpose) !//

//===================================
//==       BunjeeShot Struct       ==
//===================================
private struct BunjeeShot
unit caster
unit array Torch [3]
real TarAngle
real ChannelTotal = 5
real Charged
real DamageOn
real RushDist
real CX
real CY
real TX
real TY
timer t
timer RushT
lightning array Elastic [3]
string LastLightningEffect
string array LightningEffect[6]
group Damaged
    
    static method create takes unit cast, real TarX, real TarY returns BunjeeShot
    local BunjeeShot BJS = BunjeeShot.allocate()
        set BJS.caster = cast                   //set caster
        set BJS.TX     = TarX                   //set targeted position&#039;s X
        set BJS.TY     = TarY                   //set targeted position&#039;s Y
        set BJS.CX     = GetUnitX(BJS.caster)   //set the caster&#039;s position to X and Y
        set BJS.CY     = GetUnitY(BJS.caster)
        set BJS.TarAngle = bj_RADTODEG * Atan2(BJS.TY - BJS.CY, BJS.TX - BJS.CX) //This evaluate the angle from caster to the casting point
        set BJS.t = CreateTimer()                      //create timer.
        set BJS.RushT = CreateTimer()                  //create timer. (Which uses CSSafety xD)
        set BJS.ChannelTotal = 5                    //The maximun channel period.
        set BJS.LightningEffect[1] = BJS_Lightning1 //Setting all those lightning string to array.
        set BJS.LightningEffect[2] = BJS_Lightning2
        set BJS.LightningEffect[3] = BJS_Lightning3
        set BJS.LightningEffect[4] = BJS_Lightning4
        set BJS.LightningEffect[5] = BJS_Lightning5
        set BJS.Damaged = CreateGroup()             //This group is to store damaged unit during the damaging period.
    return BJS
    endmethod
    
    method offsetX takes real X, real distance, real angle returns real
        return X + distance * Cos(angle * bj_DEGTORAD)
    endmethod
    
    method offsetY takes real Y, real distance, real angle returns real
        return Y + distance * Sin(angle * bj_DEGTORAD)
    endmethod
    
    method CreLightning takes nothing returns nothing //This is a short system for creating the lightning effect as elastic. <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick Out Tongue    :p" loading="lazy" data-shortname=":p" />
    local integer start =0
    local integer end = 5           //Thanks to the array I just set at the create method. I would use loop to finish this task.
        loop
        exitwhen start&gt;end
            if 5 - .ChannelTotal &gt;start and 5-.ChannelTotal &lt;start+1 then
                call DestroyLightning(.Elastic[1])
                call DestroyLightning(.Elastic[2])
                set .Elastic[1] = AddLightningEx(.LightningEffect[start+1],true,GetUnitX(.Torch[1]),GetUnitY(.Torch[1]),0,GetUnitX(.caster),GetUnitY(.caster),GetUnitFlyHeight(.caster))
                set .Elastic[2] = AddLightningEx(.LightningEffect[start+1],true,GetUnitX(.Torch[2]),GetUnitY(.Torch[2]),0,GetUnitX(.caster),GetUnitY(.caster),GetUnitFlyHeight(.caster))
            endif
        set start = start+1
        endloop
    endmethod
    
    method EndLightning takes nothing returns nothing //This is what the lightning looks like when the channeling is done.
        call DestroyLightning(.Elastic[1])
        call DestroyLightning(.Elastic[2])
        set .Elastic[1] = AddLightning(.LightningEffect[5],true,GetUnitX(.Torch[1]),GetUnitY(.Torch[1]),GetUnitX(.Torch[2]),GetUnitY(.Torch[2]))
        set .Elastic[2] = AddLightning(.LightningEffect[5],true,GetUnitX(.Torch[2]),GetUnitY(.Torch[2]),GetUnitX(.Torch[1]),GetUnitY(.Torch[1]))
    endmethod
    
    method onDestroy takes nothing returns nothing //Cleans all leaks
    set .caster = null
    set .Torch[1] = null
    set .Torch[2] = null
    call DestroyTimer(.t)
    call DestroyTimer(.RushT)
    set .t = null
    set .RushT = null
    call DestroyLightning(.Elastic[1])
    call DestroyLightning(.Elastic[2])
    set .Elastic[1] = null
    set .Elastic[2] = null
    call DestroyGroup(.Damaged)
    set .Damaged = null
    endmethod
    
endstruct
//===================================
//==     BunjeeShot Struct End     ==
//===================================


//=======================================================================
//==                          Timer Call Back                          ==    
//=======================================================================                
    private function BJS_DamagedCond takes nothing returns boolean
        return IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) == false and GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE)&gt;0 and IsUnitInGroup(GetFilterUnit(),DummyDamaged) == false and IsUnitAlly(GetFilterUnit(),GetOwningPlayer(DummyCaster))==false
        //The condition of damaging a unit.
    endfunction  
    
    private function BJS_DamagedAct takes nothing returns nothing
        call UnitDamageTarget(DummyCaster,GetEnumUnit(),DummyDamage,true,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_NORMAL,null)
        call GroupAddUnit(DummyDamaged,GetEnumUnit())
        //To prevent double or even triple damage deal to a unit.
    endfunction

    private function BJS_RushTEnd takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local BunjeeShot BJS = GetTimerStructB(t)
    local group Damaged = CreateGroup()
    set DummyDamaged = BJS.Damaged
    set DummyCaster  = BJS.caster       //This 3 globals are to pass value through functions.
    set DummyDamage = BJS.DamageOn      //Don&#039;t worry, leaks are all cleaned when the struct is destroyed.
    
        if BJS.RushDist &gt; 0 then
        
            set BJS.CX = BJS.offsetX(BJS.CX,BJS_RushSpeed,BJS.TarAngle)
            set BJS.CY = BJS.offsetY(BJS.CY,BJS_RushSpeed,BJS.TarAngle)
            
            call DestroyEffect(AddSpecialEffectTarget(BJS_RushEffect, BJS.caster,&quot;chest&quot;))
            call DestroyEffect(AddSpecialEffectTarget(BJS_RushEffect, BJS.caster,&quot;hand, left&quot;))
            call DestroyEffect(AddSpecialEffectTarget(BJS_RushEffect, BJS.caster,&quot;hand, right&quot;))
            call DestroyEffect(AddSpecialEffectTarget(BJS_RushEffect, BJS.caster,&quot;foot, left&quot;))
            call DestroyEffect(AddSpecialEffectTarget(BJS_RushEffect, BJS.caster,&quot;foot, right&quot;))
            
            if IsTerrainPathable(BJS.CX,BJS.CY,PATHING_TYPE_WALKABILITY)==false then
                call SetUnitX(BJS.caster,BJS.CX)
                call SetUnitY(BJS.caster,BJS.CY)
            endif
            
            call GroupEnumUnitsInRange(Damaged, BJS.CX,BJS.CY,200, Condition(function BJS_DamagedCond))
            call ForGroup(Damaged, function BJS_DamagedAct)
            
            set BJS.Damaged = DummyDamaged
            set BJS.RushDist = BJS.RushDist - BJS_RushSpeed
            
        elseif BJS.RushDist &lt; 0 then
        
            call PauseTimer(t)
            call DestroyTimer(t)
            call BJS.destroy()
            
        endif
    set t = null
    call DestroyGroup(Damaged)
    set Damaged = null
    endfunction

private function BJS_TimerEnd takes nothing returns nothing
local timer t = GetExpiredTimer()
local BunjeeShot BJS = GetTimerStructA(t)

    if GetUnitCurrentOrder(BJS.caster) == ChannelId and BJS.ChannelTotal &gt; 0 then
        set BJS.CX = BJS.offsetX(BJS.CX, 5, BJS.TarAngle-180)//New X 
        set BJS.CY = BJS.offsetY(BJS.CY, 5, BJS.TarAngle-180)//New Y
        
        
        if IsTerrainPathable(BJS.CX,BJS.CY,PATHING_TYPE_WALKABILITY)==false then //Avoid unit to crash outside of the map border.
            call DestroyEffect(AddSpecialEffect(BJS_ChargeEffect,BJS.CX,BJS.CY))
            call SetUnitX(BJS.caster,BJS.CX)
            call SetUnitY(BJS.caster,BJS.CY)
        endif
        
        call BJS.CreLightning()
        set BJS.ChannelTotal = BJS.ChannelTotal - .08
        
    elseif GetUnitCurrentOrder(BJS.caster) != ChannelId or BJS.ChannelTotal &lt; 0 then
    
        call UnitApplyTimedLife(BJS.Torch[1],&#039;BTLF&#039;,.1)
        call UnitApplyTimedLife(BJS.Torch[2],&#039;BTLF&#039;,.1)
        set BJS.Charged = 5 - BJS.ChannelTotal
        set BJS.DamageOn = (GetUnitAbilityLevel(BJS.caster,BJS_Id))*(BJS.Charged)*(50) 
        set BJS.RushDist = (GetUnitAbilityLevel(BJS.caster,BJS_Id)) * (100) * (BJS.Charged)
        call SetTimerStructB(t,BJS)
        call BJS.EndLightning()
        call TimerStart(t,.01,true,function BJS_RushTEnd)
    endif
set t = null
endfunction
//=======================================================================
//==                        Timer Call Back End                       ==    
//=======================================================================  


//=========================================================
//==                     Main Function                   ==
//=========================================================
private function BJS_Cond takes nothing returns boolean
    return GetSpellAbilityId() == BJS_Id
endfunction

private function BJS_Act takes nothing returns nothing
local location TLoc = GetSpellTargetLoc()
local BunjeeShot BJS = BunjeeShot.create(GetSpellAbilityUnit(),GetLocationX(TLoc),GetLocationY(TLoc))
local integer LoopInt = 1    
local real CreateDummyX
local real CreateDummyY
    
    //&lt;--Creating Torch--&gt;//
    loop
    exitwhen LoopInt&gt;2
    
        if LoopInt == 1 then
        
            set CreateDummyX = BJS.offsetX(BJS.CX,200,BJS.TarAngle+90)
            set CreateDummyY = BJS.offsetY(BJS.CY,200,BJS.TarAngle+90)
            set BJS.Torch[LoopInt] = CreateUnit(GetOwningPlayer(BJS.caster),BJS_TorchId,CreateDummyX,CreateDummyY,BJS.TarAngle)
            
        elseif LoopInt == 2 then
        
            set CreateDummyX = BJS.offsetX(BJS.CX,200,BJS.TarAngle-90)
            set CreateDummyY = BJS.offsetY(BJS.CY,200,BJS.TarAngle-90)
            set BJS.Torch[LoopInt] = CreateUnit(GetOwningPlayer(BJS.caster),BJS_TorchId,CreateDummyX,CreateDummyY,BJS.TarAngle)
            
        endif
        
    set LoopInt = LoopInt + 1
    endloop
    //&lt;--End--&gt;//
    
    
    call SetTimerStructA(BJS.t,BJS)
    call TimerStart(BJS.t,BJS_ChargingSpeed,true,function BJS_TimerEnd)

endfunction
//=========================================================
//==                   End Main Function                 ==
//=========================================================

//===========================================================================
function InitTrig_BunJee_Shot takes nothing returns nothing
local integer start = 0
local integer end = 15
    set gg_trg_BunJee_Shot = CreateTrigger()
    
    loop
    exitwhen start&gt;end
        call TriggerRegisterPlayerUnitEvent(gg_trg_BunJee_Shot,Player(start),EVENT_PLAYER_UNIT_SPELL_EFFECT,null)
        set start = start + 1
    endloop
    call TriggerAddCondition(gg_trg_BunJee_Shot, Condition(function BJS_Cond))
    call TriggerAddAction(gg_trg_BunJee_Shot, function BJS_Act)
endfunction

endscope

//!&lt;--End of my Spell--&gt;!//


//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


//Thanks to Cohadar for his brilliant ABC system.

//==============================================================================
//  ABC -- STRUCT ATTACHMENT SYSTEM BY COHADAR -- v5.1
//==============================================================================


//------------------------------------------------------------------------------
//  We will use textmacros to create multiple instances of system
//------------------------------------------------------------------------------
//! textmacro ABC takes X, NAME, TYPE

//------------------------------------------------------------------------------
// Global arrays represent our hash tables.
// System is currently using 3 hash tables per handle type. (A, B, C)
//------------------------------------------------------------------------------
globals
    private $TYPE$    array $TYPE$Key$X$
    private integer  array $TYPE$Value$X$
	private integer  $TYPE$maxCollision$X$ = 0
endglobals

//------------------------------------------------------------------------------
// returns the maximum collision so far
//------------------------------------------------------------------------------
function Get$NAME$Collision$X$ takes nothing returns integer
    return $TYPE$maxCollision$X$
endfunction


//------------------------------------------------------------------------------
// initializes hash arrays to prevent lag when ABC is used for the first time
//------------------------------------------------------------------------------
private function Init$NAME$Hash$X$ takes nothing returns nothing
    set $TYPE$Key$X$[HASH_INDEX_LIMIT]   = null
	set $TYPE$Value$X$[HASH_INDEX_LIMIT] = 0
endfunction

//------------------------------------------------------------------------------
// attaches struct to a handle by using hash table
//------------------------------------------------------------------------------
function Set$NAME$Struct$X$ takes $TYPE$ t, integer s returns nothing
	debug local integer collision
	
	// hash using 32-bit integer overflow
    local integer i = (H2I(t) * HASH_UP) / HASH_DOWN + HASH_BIAS

	if $TYPE$Key$X$<i> == null then
	    set $TYPE$Value$X$<i> = s
		set $TYPE$Key$X$<i> = t
		return
	endif

    debug if $TYPE$Key$X$<i> == t then
        debug call BJDebugMsg(&quot;|cFFFF0000ERROR: Hash[$X$] attachment overwrite on $TYPE$ #&quot; +I2S(H2I(t)))
        debug return
    debug endif        
    
	// if function gets below this line we have a collision
    debug set collision = 1
    loop
		debug if collision &gt;= HASH_COLLISION_LIMIT then
            debug call BJDebugMsg(&quot;|cFFFF0000ERROR: Hash[$X$] overflow&quot;)
            debug return
		debug endif    
        debug set collision = collision + 1
    
        set i = i + 1    
	    exitwhen $TYPE$Key$X$<i> == null

        debug if $TYPE$Key$X$<i> == t then
            debug call BJDebugMsg(&quot;|cFFFF0000ERROR: Hash[$X$] attachment overwrite on $TYPE$ #&quot; +I2S(H2I(t)))
            debug return
        debug endif    
	endloop

	debug if collision &gt; $TYPE$maxCollision$X$ then
	debug 	call BJDebugMsg(&quot;|cFFFF4444Warning: Hash[$X$] maximum collision is now: &quot; + I2S(collision))
	debug 	set $TYPE$maxCollision$X$ = collision
	debug endif
	
    set $TYPE$Value$X$<i> = s
    set $TYPE$Key$X$<i> = t

    return
endfunction

//------------------------------------------------------------------------------
// gets stored struct from a handle 
//------------------------------------------------------------------------------
function Get$NAME$Struct$X$ takes $TYPE$ t returns integer
	debug local integer collision
	
	// hash using 32-bit integer overflow
    local integer i = (H2I(t) * HASH_UP) / HASH_DOWN + HASH_BIAS
	
	if $TYPE$Key$X$<i> == t then
		return $TYPE$Value$X$<i>
	endif
	
	// if function gets below this line we have a collision
    debug set collision = 1
    loop
		debug if collision &gt;= HASH_COLLISION_LIMIT then
		debug   call BJDebugMsg(&quot;|cFFFF0000ERROR: Hash[$X$] : get request on unknown handle&quot;)
		debug   return 0
		debug endif		
        debug set collision = collision + 1      
    
        set i = i + 1
	    exitwhen $TYPE$Key$X$<i> == t
	endloop	
	
    return $TYPE$Value$X$<i>
endfunction


//------------------------------------------------------------------------------
// clears stored struct from a handle, also returns cleared value
//------------------------------------------------------------------------------
function Clear$NAME$Struct$X$ takes $TYPE$ t returns integer
	debug local integer collision
    local integer ik
    local integer ret
	
	// hash using 32-bit integer overflow
    local integer i = (H2I(t) * HASH_UP) / HASH_DOWN + HASH_BIAS
	
    // first find the index on witch key is stored
    debug set collision = 0
    loop
		debug if collision &gt;= HASH_COLLISION_LIMIT then
		debug   call BJDebugMsg(&quot;|cFFFF0000ERROR: Hash[$X$] : clear request on unknown handle&quot;)
		debug   return 0
		debug endif        
        debug set collision = collision + 1       
    
        exitwhen $TYPE$Key$X$<i> == t
        set i = i + 1
    endloop
    
    set ik = i
    set ret = $TYPE$Value$X$[ik]
    
    // then find last used key index in bucket
    loop
        set i = i + 1
        // we use the fact bucket borders (mod 8 indexes) are always null
        exitwhen $TYPE$Key$X$<i> == null  
    endloop
    
    // shift last bucket entry to the place of removed one
    set $TYPE$Key$X$[ik] = $TYPE$Key$X$[i-1]
    set $TYPE$Value$X$[ik] = $TYPE$Value$X$[i-1]
    // clear the previous last bucket entry
    set $TYPE$Key$X$[i-1] = null
    
    return ret
endfunction

//! endtextmacro

//==============================================================================
//  Macro execution -- this is where real functions get created
//==============================================================================
library ABC initializer Init

globals
	public constant integer HASH_SIZE = 8192
	public constant integer HASH_INDEX_LIMIT = 8190
	public constant integer HASH_DOWN = 524288     // 2^19	
	public constant integer HASH_UP   = 2134900736 // 2^22 * 509
	public constant integer HASH_BIAS = 4096       // HASH_SIZE / 2
	public constant integer HASH_COLLISION_LIMIT = 7 // ABC v5.0 had limit 8
	// 509 is the prime closest to 512
endglobals


//------------------------------------------------------------------------------
// conversion function used by the system internally
// you will not need to use it directly
//------------------------------------------------------------------------------
public function H2I takes handle h returns integer
    return h
    return 0
endfunction

//! runtextmacro ABC(&quot;A&quot;,&quot;Timer&quot;,&quot;timer&quot;)
//! runtextmacro ABC(&quot;B&quot;,&quot;Timer&quot;,&quot;timer&quot;)
//! runtextmacro ABC(&quot;C&quot;,&quot;Timer&quot;,&quot;timer&quot;)

//! runtextmacro ABC(&quot;A&quot;,&quot;Trigger&quot;,&quot;trigger&quot;)
//! runtextmacro ABC(&quot;B&quot;,&quot;Trigger&quot;,&quot;trigger&quot;)
//! runtextmacro ABC(&quot;C&quot;,&quot;Trigger&quot;,&quot;trigger&quot;)

//! runtextmacro ABC(&quot;A&quot;,&quot;Dialog&quot;,&quot;dialog&quot;)
//! runtextmacro ABC(&quot;B&quot;,&quot;Dialog&quot;,&quot;dialog&quot;)
//! runtextmacro ABC(&quot;C&quot;,&quot;Dialog&quot;,&quot;dialog&quot;)

private function Init takes nothing returns nothing
	call InitTimerHashA()
	call InitTimerHashB()
	call InitTimerHashC()

	call InitTriggerHashA()
	call InitTriggerHashB()
	call InitTriggerHashC()       
    
	call InitDialogHashA()
	call InitDialogHashB()
	call InitDialogHashC()
endfunction


endlibrary
//==============================================================================
//  END OF ABC STRUCT ATTACHMENT SYSTEM
//==============================================================================</i></i></i></i></i></i></i></i></i></i></i></i></i></i>


BunJee Shot v1

Edit - Hmm, I think I forgoten something. vJass compatible.
 

MoonSlinger

I Love using Cheap Tricks... only Results matters
Reaction score
74
My Spell

[SIZE="+2"]Dragon Breath[/SIZE]

[SIZE="+1"]Spell Description:[/SIZE]
- A simple spell to summons a Drake.
- When the summoning is complete the Drake simply just do massive damage and fade away.
- If the summoning is interrupted, the Drake will just fade away doing nothing.

[SIZE="+1"]Triggers:[/SIZE]
- GUI with local variable
- MI == Multi-Instance, up to 9 times (same unit multi-instance)
- Leaks? don't there is any

[SIZE="+1"]Configure:[/SIZE]
- "Initialization" trigger have the configuration options
- Damage is done via placing and detonating land mines.
- To change damage means you have to edit them via object editor. (or do something to the above)

[SIZE="+1"]Codes:[/SIZE]
- Running a System which requires many triggers
- Its better to see them in the map, don't know how to post them, too many triggers

[SIZE="+1"]ScreenShot[/SIZE]
DragonBreath.jpg
 

Attachments

  • Dragon Breath.w3x
    57.7 KB · Views: 246

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
Well, I wonder. Why only Jass coded spell can post their code? GUI can't?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top