Spell Burning Hell

Komaqtion

You can change this now in User CP.
Reaction score
469
Do you have any tips to how to get the map working like that ??? :S

(Tested with saving and testin another map first, and then go in to WC3 and play it from there and it worked !)
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
I suppose the map requires v1.23b, right?

you should put that in the "Requirements"
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Added :D

Still, both need a new name for the spell XD and also need help fixing the bug which causes some dummies to go further than the others :D:D
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Huh i though name only but il give u 1 just gime time to think
 

Romek

Super Moderator
Reaction score
963
> Slightly MUI (Can only handle 32 unit at one time...
Consider that MUI. Chances are that the same spell is used 32 times in one go..? Zero.
Then again. Why is that even there, if KT2 isn't used anymore?

Frankly, the worst part of this spell is kingkingyyk3s code.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Will change that now :D

(What's wrong with kingkingyyk3's coding ??? Mind giving suggestions ??? :D)
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Tooltip: Name: Tormental Wraith: The <ur unit> conjures hell itself to deal damage to the units who dare enter hell :D hope u like it
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Since Romek said my code is worst, I wrote a brand new efficient code for you.

New EAE
JASS:
library EAE requires TT
    //A library designed for Burning Hell, By Komaqtion
    //by kingking
    //How to use?
    //&gt;&gt; For delayed effect, use :
    //function EAE_Effect takes effect e, real duration
    //&gt;&gt;For delayed callback, use :
    //function EAE_Calllback takes code c, real duration, integer structz
    //In order to access the data, Use EAE_GetData() to get the struct index in the callback function.
    
    globals
        private integer ReturnIndex
    endglobals

///////////////////////////////Effect Section////////////////////////////////////////////////
    private struct EffectData
        effect e
        
        method onDestroy takes nothing returns nothing
            call DestroyEffect(.e)
        endmethod
    endstruct
    
    private function DesEffect takes nothing returns boolean
        local EffectData d = TT_GetData()
        call d.destroy()
        return true
    endfunction
    
    public function Effect takes effect e, real duration returns nothing 
        local EffectData d = EffectData.create()
        set d.e = e
        call TT_Once(function DesEffect, 0, duration)
    endfunction
    
/////////////////////////////////////////////////////////////////////////////////////////////
    private struct DelayedCallback
        integer data
        trigger callback = CreateTrigger()
        triggeraction ta
    endstruct
    
    private function Destroy takes nothing returns boolean
        local DelayedCallback d = TT_GetData()
        
        set ReturnIndex = d.data
        call TriggerExecute(d.callback)
        call TriggerRemoveAction(d.callback, d.ta)
        
        call d.destroy()
        return true
    endfunction
    
    public function GetData takes nothing returns integer
        return ReturnIndex
    endfunction
    
    public function Callback takes code callback, real duration, integer data returns nothing
        local DelayedCallback d = DelayedCallback.create()
            
        set d.data = data
        set d.ta = TriggerAddAction(d.callback, callback)
            
        call TT_Once(function Destroy, d, duration)
    endfunction
    
endlibrary


You spell now :
JASS:
scope Dummy initializer init
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
//***********************************************************************************************************//
//@@////////////////////////////////////Burning Hell, Made By Komaqtion////////////////////////////////////@@//
//@@                                                                                                       @@//
//@@                                          How to import:                                               @@//
//@@                                                                                                       @@//
//@@        ¤ First copy the ability &quot;Burning Hell&quot; and the unit &quot;Dummy&quot; and change the ID&#039;s in the        @@//
//@@        constants below to the new ones. Then you need to import Vexorian&#039;s dummy.mdx file from        @@//
//@@        this map, or another, and change &quot;Dummy&quot; unit&#039;s model to this one. Then, of course, you        @@//
//@@        need to import the triggers, which are in the categories &quot;The Spell&quot; and                       @@//
//@@        &quot;Required Systems&quot;. Then you&#039;re free to change any of the given global constants to suit       @@//
//@@        your needs.                                                                                    @@//
//@@                                                                                                       @@//
//@@                                           Requirements:                                               @@//
//@@        ¤ This spell, of course !                                                                      @@//
//@@        ¤ Timer Ticker, made by Cohadar <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />                                                             @@//
//@@        ¤ The library made especially for this spell, EAE, made by kingkingyyk3!!!                     @@//
//@@        ¤ The dummy.mdx, made by Vexorian !                                                            @@//
//@@                                                                                                       @@//
//@@        ¤ Credits to:                                                                                  @@//
//@@          * Vexorian, for the dummy.mdx file                                                           @@//
//@@          * Cohadar for TT (Timer Ticker)                                                              @@//
//@@          * Jesus4Lyf, for KeyTimers 2 (Even if this spell doesn&#039;t use it anymore XD)                  @@//
//@@          * TriggerHappy187, for TimedHandles (Even if this spell doesn&#039;t use it anymore XD)           @@//
//@@          * Kingkingyyk3, for his wonderfull help on this spell, and for making EAE !                  @@//
//@@                                                                                                       @@//
//@@          And, of course, so many thanks to all of the many helpfull people at TheHelper.net           @@//
//@@          who has helped get is spell working! (kingkingyyk3 and WolfieNoCT especially <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />)             @@//
//@@                                                                                                       @@//
//@@                                                                                                       @@//
//@@        Note: This is my very first fully working, and quite good, spell made completely in vJASS.     @@//
//@@        vJASS.                                                                                         @@//
//@@        So much feedback, and suggestions are very much welcome, and maybe some tips to make it        @@//
//@@        even better would be nice <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />                                                                   @@//
//@@                                                                                                       @@//
//@@///////////////////////////////////////////////////////////////////////////////////////////////////////@@//
//***********************************************************************************************************//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
globals

    // Effects! Change as you&#039;d like <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink    ;)" loading="lazy" data-shortname=";)" />\\
    
    private constant string EFFECT_C = &quot;Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl&quot;                // Effect on the caster!
    private constant string EFFECT_1 = &quot;Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl&quot;              // Effect 200 range from the caster!
    private constant string EFFECT_2 = &quot;Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl&quot;                      // Effect at the end!
    private constant string DUMMY_EFFECT = &quot;Abilities\\Weapons\\DemolisherFireMissile\\DemolisherFireMissile.mdl&quot;  // Effect on the moving dummy!
    
    // ID&#039;s! Change to the ID&#039;s on your map <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />\\
    
    private constant integer SPELL_ID = &#039;0000&#039;          // ID of the spell!
    private constant integer DUMMY_ID = &#039;h000&#039;          // ID of the dummy unit!
    private constant integer LOCUST = &#039;Aloc&#039;            // ID of the &quot;Locust&quot; ability! (Might not need changing)
    private constant integer BUFF_ID = &#039;BTLF&#039;           // ID of the expiration buff on the dummy!
    
    // Other constant integers! Change at will <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" />\\
    
    private constant real DAMAGE_FACTOR = 1.
    private constant real RANGE_FACTOR = 15.
    private constant integer ANGLES = 16                   // The number of agles the effects will show at! (360/ANGLES)
    private constant attacktype ATTACK_TYPE = ATTACK_TYPE_NORMAL  // Explains itself i think XD
    private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_NORMAL  //  Same here <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" />
    private constant real SLIDE_SPEED = 10                 // How much the dummy effect moves each 0.05 seconds!
    
endglobals

globals
        
    // Globals! Simply DON&#039;T CHANGE!\\
    
    private integer TempStructIndex
    private group Temp = CreateGroup()

endglobals
    
private struct Data
    unit array du [ANGLES]
    unit cs
    real array pointx [ANGLES]
    real array pointy [ANGLES]
    boolean b
    player p
    group g
    integer lvl
    
    static method create takes unit u returns Data
        local Data a = Data.allocate()
        set a.cs = u
        set a.b = false
        set a.p = GetOwningPlayer(u)
        set a.g = CreateGroup()
        set a.lvl = GetUnitAbilityLevel(a.cs,SPELL_ID)
        return a
    endmethod
    
endstruct

        // Some more configurables that needed the struct!\\

    // Damage functions!\\

private function Damage_Small takes nothing returns real
    return DAMAGE_FACTOR * 10
endfunction

private function Damage_Medium takes integer lv returns real   
    return 50 + lv * DAMAGE_FACTOR * 50
endfunction

private function Damage_High takes integer lv returns real
    return lv * DAMAGE_FACTOR * 100
endfunction

    // Range functions!\\

private function Range_Small takes nothing returns real
    return RANGE_FACTOR * 5
endfunction

private function Range_Medium takes nothing returns real
    return RANGE_FACTOR * 10
endfunction

private function Range_High takes nothing returns real
    return RANGE_FACTOR * RANGE_FACTOR
endfunction

        // End of Configuration!\\

private function Spell_Check takes nothing returns boolean
    return GetSpellAbilityId() == SPELL_ID
endfunction

private function GroupEm takes nothing returns boolean
    local Data a = TempStructIndex
    return GetWidgetLife(GetFilterUnit()) &gt; 0.405 and IsUnitEnemy(GetFilterUnit(), a.p) and IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) == false and IsUnitInGroup(GetFilterUnit(),a.g) == false
endfunction

private function Smaller_GroupEm takes nothing returns boolean
    local Data a = TempStructIndex
    return GetWidgetLife(GetFilterUnit()) &gt; 0.405 and IsUnitEnemy(GetFilterUnit(), a.p) and IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) == false
endfunction

private function Callback takes nothing returns nothing
    local Data a = EAE_GetData()
    local integer i = 1
    local unit temp
    loop
    exitwhen i &gt;=ANGLES
        set a.pointx<i> = GetUnitX(a.du<i>)
        set a.pointy<i> = GetUnitY(a.du<i>)
        call DestroyEffect(AddSpecialEffect(EFFECT_2,a.pointx<i>,a.pointy<i>))
        call GroupEnumUnitsInRange(Temp, a.pointx<i>, a.pointy<i>, Range_High(), Condition(function Smaller_GroupEm))
        loop
            set temp = FirstOfGroup(Temp)
        exitwhen temp == null
            call UnitDamageTarget(a.cs, temp, Damage_High(a.lvl), true, false, ATTACK_TYPE, DAMAGE_TYPE, null)
            call GroupRemoveUnit(Temp,temp)
        endloop
        call RemoveUnit(a.du<i>)
        set i = i+1
    endloop
endfunction

private function Move_Dummy takes nothing returns boolean
    local Data a = TT_GetData()
    local real xd
    local real yd
    local integer i = 1
    local unit temp
    loop
        exitwhen i&gt;=ANGLES
        set xd = GetUnitX(a.du<i>)
        set yd = GetUnitY(a.du<i>)
        set a.pointx<i> = xd+SLIDE_SPEED*Cos(I2R(i*(360/(ANGLES-1)))*bj_DEGTORAD)
        set a.pointy<i> = yd+SLIDE_SPEED*Sin(I2R(i*(360/(ANGLES-1)))*bj_DEGTORAD)
        set TempStructIndex = a
        call GroupEnumUnitsInRange(Temp, a.pointx<i>, a.pointy<i>, Range_Small(), Condition(function Smaller_GroupEm))
        loop
            set temp = FirstOfGroup(Temp)
        exitwhen temp == null
            call UnitDamageTarget(a.cs, temp, Damage_Small(), true, false, ATTACK_TYPE, DAMAGE_TYPE, null)
            call GroupAddUnit(a.g,temp)
            call GroupRemoveUnit(Temp,temp)
        endloop
        call SetUnitX(a.du<i>,a.pointx<i>)
        call SetUnitY(a.du<i>,a.pointy<i>)
        set i = i+1
    endloop
    
    return a.b
endfunction

private function Effects takes nothing returns nothing
    local Data a = Data.create(GetTriggerUnit())
    local real xu = GetUnitX(a.cs)
    local real yu = GetUnitY(a.cs)
    local integer i = 1
    local unit temp
    call DestroyEffect(AddSpecialEffect(EFFECT_C,xu,yu))
    loop
        exitwhen i&gt;=ANGLES
        set a.pointx<i> = xu+200*Cos(I2R(i*(360/(ANGLES-1)))*bj_DEGTORAD)
        set a.pointy<i> = yu+200*Sin(I2R(i*(360/(ANGLES-1)))*bj_DEGTORAD)
        set TempStructIndex = a
        call DestroyEffect(AddSpecialEffect(EFFECT_1, a.pointx<i>, a.pointy<i>))
        call GroupEnumUnitsInRange(Temp, a.pointx<i>, a.pointy<i>,Range_Medium(), Condition(function GroupEm))
        loop
            set temp = FirstOfGroup(Temp)
            exitwhen temp == null
            call UnitDamageTarget(a.cs, temp, Damage_Medium(a.lvl), true, false, ATTACK_TYPE, DAMAGE_TYPE, null)
            call GroupAddUnit(a.g,temp)
            call GroupRemoveUnit(Temp,temp)
        endloop
        set a.du<i> = CreateUnit(a.p,DUMMY_ID,xu,yu,bj_RADTODEG*Atan2(a.pointy<i>-yu,a.pointx<i>-xu))
        call UnitAddAbility(a.du<i>,LOCUST)
        call EAE_Effect(AddSpecialEffectTarget(DUMMY_EFFECT,a.du<i>,&quot;origin&quot;),2.5)
        set i = i+1
    endloop
    call EAE_Callback(function Callback, 2.5, a)
    call TT_StartEx(function Move_Dummy,a,.05)
    call TriggerSleepAction(2.5)
    set a.b = true
    call GroupClear(a.g)
    call GroupClear(Temp)
    call DestroyGroup(a.g)
    call a.destroy()
endfunction

private function init takes nothing returns nothing
    local trigger t=CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t,Condition(function Spell_Check))
    call TriggerAddAction(t,function Effects)
endfunction
endscope
</i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i>


If I am free later, I will look into your code and try to improve it.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Hallo do u like the tooltip or not say what u think if its horible then say so
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well :S It's kinda short, and since it's name isn't Burning Hell anymore, the hell parts might not fit :(
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Wel could could u say what the spel does so i can make the tooltip beter. I stil hav patch 1.22 :(
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, look at the screenshots :D
First creates some effect around the caster and damaging unit in range, then it send out small balls to about 500 range out which damages units it comes in contact with then another effect is created where they stop (War stomp effect).
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
K name: Tormental Wraith The <ur unit> brings waves of torment upon the enemies close by. First wave of torment damages enemies near <ur unit>. Second wave of torment send ball of fury to damage unit Third wave of torment. Not sure what the stomp do. Do they damage and stun or just there for eye candy
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Okay, I optimized your script a bit. Now the spell only need TT to work.

JASS:
scope BurningHell initializer init
//Edited by kingking
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
//***********************************************************************************************************//
//@@////////////////////////////////////Burning Hell, Made By Komaqtion////////////////////////////////////@@//
//@@                                                                                                       @@//
//@@                                          How to import:                                               @@//
//@@                                                                                                       @@//
//@@        ¤ First copy the ability &quot;Burning Hell&quot; and the unit &quot;Dummy&quot; and change the ID&#039;s in the        @@//
//@@        constants below to the new ones. Then you need to import Vexorian&#039;s dummy.mdx file from        @@//
//@@        this map, or another, and change &quot;Dummy&quot; unit&#039;s model to this one. Then, of course, you        @@//
//@@        need to import the triggers, which are in the categories &quot;The Spell&quot; and                       @@//
//@@        &quot;Required Systems&quot;. Then you&#039;re free to change any of the given global constants to suit       @@//
//@@        your needs.                                                                                    @@//
//@@                                                                                                       @@//
//@@                                           Requirements:                                               @@//
//@@        ¤ This spell, of course !                                                                      @@//
//@@        ¤ Timer Ticker, made by Cohadar <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />                                                             @@//
//@@        ¤ The dummy.mdx, made by Vexorian !                                                            @@//
//@@                                                                                                       @@//
//@@        ¤ Credits to:                                                                                  @@//
//@@          * Vexorian, for the dummy.mdx file                                                           @@//
//@@          * Cohadar for TT (Timer Ticker)                                                              @@//
//@@          * Jesus4Lyf, for KeyTimers 2 (Even if this spell doesn&#039;t use it anymore XD)                  @@//
//@@          * TriggerHappy187, for TimedHandles (Even if this spell doesn&#039;t use it anymore XD)           @@//
//@@                                                                                                       @@//
//@@          And, of course, so many thanks to all of the many helpfull people at TheHelper.net           @@//
//@@          who has helped get is spell working! (kingkingyyk3 and WolfieNoCT especially <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />)             @@//
//@@                                                                                                       @@//
//@@                                                                                                       @@//
//@@        Note: This is my very first fully working, and quite good, spell made completely in vJASS.     @@//
//@@                                                                                                       @@//
//@@        So much feedback, and suggestions are very much welcome, and maybe some tips to make it        @@//
//@@        even better would be nice <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />                                                                   @@//
//@@                                                                                                       @@//
//@@///////////////////////////////////////////////////////////////////////////////////////////////////////@@//
//***********************************************************************************************************//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
globals

    // Effects! Change as you&#039;d like <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink    ;)" loading="lazy" data-shortname=";)" />\\
    
    private constant string EFFECT_C = &quot;Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl&quot;                // Effect on the caster!
    private constant string EFFECT_1 = &quot;Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl&quot;              // Effect 200 range from the caster!
    private constant string EFFECT_2 = &quot;Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl&quot;                      // Effect at the end!
    private constant string DUMMY_EFFECT = &quot;Abilities\\Weapons\\DemolisherFireMissile\\DemolisherFireMissile.mdl&quot;  // Effect on the moving dummy!
    
    // ID&#039;s! Change to the ID&#039;s on your map <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />\\
    
    private constant integer SPELL_ID = &#039;0000&#039;          // ID of the spell!
    private constant integer DUMMY_ID = &#039;h000&#039;          // ID of the dummy unit!
    private constant integer LOCUST = &#039;Aloc&#039;            // ID of the &quot;Locust&quot; ability! (Might not need changing)
    private constant integer BUFF_ID = &#039;BTLF&#039;           // ID of the expiration buff on the dummy!
    
    // Other constant integers! Change at will <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" />\\
    
    private constant real DAMAGE_FACTOR = 1.
    private constant real RANGE_FACTOR = 15.
    private constant integer ANGLES = 16                   // The number of agles the effects will show at! (360/ANGLES)
    private constant attacktype ATTACK_TYPE = ATTACK_TYPE_NORMAL  // Explains itself i think XD
    private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_NORMAL  //  Same here <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" />
    private constant real SLIDE_SPEED = 10                 // How much the dummy effect moves each 0.05 seconds!
    
endglobals

globals
        
    // Globals! Simply DON&#039;T CHANGE!\\
    
    private integer TempStructIndex
    private group Temp = CreateGroup()

endglobals
    
private struct Data
    unit array du [ANGLES]
    unit cs
    real array pointx [ANGLES]
    real array pointy [ANGLES]
    boolean b
    player p
    group g = CreateGroup()
    integer lvl
    effect array e [ANGLES]
    integer ticks
    
    static method create takes unit u returns Data
        local Data a = Data.allocate()
        set a.cs = u
        set a.b = false
        set a.p = GetOwningPlayer(u)
        set a.lvl = GetUnitAbilityLevel(a.cs,SPELL_ID)
        return a
    endmethod
    
endstruct

        // Some more configurables that needed the struct!\\

    // Damage functions!\\

private function Damage_Small takes nothing returns real
    return DAMAGE_FACTOR * 10
endfunction

private function Damage_Medium takes integer lv returns real   
    return 50 + lv * DAMAGE_FACTOR * 50
endfunction

private function Damage_High takes integer lv returns real
    return lv * DAMAGE_FACTOR * 100
endfunction

    // Range functions!\\

private function Range_Small takes nothing returns real
    return RANGE_FACTOR * 5
endfunction

private function Range_Medium takes nothing returns real
    return RANGE_FACTOR * 10
endfunction

private function Range_High takes nothing returns real
    return RANGE_FACTOR * RANGE_FACTOR
endfunction

        // End of Configuration!\\

private function Spell_Check takes nothing returns boolean
    return GetSpellAbilityId() == SPELL_ID
endfunction

private function GroupEm takes nothing returns boolean
    return GetWidgetLife(GetFilterUnit()) &gt; 0.405 and IsUnitEnemy(GetFilterUnit(), Data(TempStructIndex).p) and IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) == false and IsUnitInGroup(GetFilterUnit(),Data(TempStructIndex).g) == false
endfunction

private function Smaller_GroupEm takes nothing returns boolean
    return GetWidgetLife(GetFilterUnit()) &gt; 0.405 and IsUnitEnemy(GetFilterUnit(), Data(TempStructIndex).p) and IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) == false
endfunction

private function Move_Dummy takes nothing returns boolean
    local Data a = TT_GetData()
    local real xd
    local real yd
    local integer i = 1
    local unit temp
    if a.ticks &gt; 0 then
        set a.ticks = a.ticks - 1
        loop
            exitwhen i&gt;=ANGLES
            set xd = GetUnitX(a.du<i>)
            set yd = GetUnitY(a.du<i>)
            set a.pointx<i> = xd+SLIDE_SPEED*Cos(I2R(i*(360/(ANGLES-1)))*bj_DEGTORAD)
            set a.pointy<i> = yd+SLIDE_SPEED*Sin(I2R(i*(360/(ANGLES-1)))*bj_DEGTORAD)
            set TempStructIndex = a
            call GroupEnumUnitsInRange(Temp, a.pointx<i>, a.pointy<i>, Range_Small(), Condition(function Smaller_GroupEm))
            loop
                set temp = FirstOfGroup(Temp)
            exitwhen temp == null
                call UnitDamageTarget(a.cs, temp, Damage_Small(), true, false, ATTACK_TYPE, DAMAGE_TYPE, null)
                call GroupAddUnit(a.g,temp)
                call GroupRemoveUnit(Temp,temp)
            endloop
            call SetUnitX(a.du<i>,a.pointx<i>)
            call SetUnitY(a.du<i>,a.pointy<i>)
            set i = i+1
        endloop
        return false
    else
        loop
        exitwhen i &gt;=ANGLES
            set a.pointx<i> = GetUnitX(a.du<i>)
            set a.pointy<i> = GetUnitY(a.du<i>)
            call DestroyEffect(a.e<i>)
            call DestroyEffect(AddSpecialEffect(EFFECT_2,a.pointx<i>,a.pointy<i>))
            set TempStructIndex = a
            call GroupEnumUnitsInRange(Temp, a.pointx<i>, a.pointy<i>, Range_High(), Condition(function Smaller_GroupEm))
            loop
                set temp = FirstOfGroup(Temp)
            exitwhen temp == null
                call UnitDamageTarget(a.cs, temp, Damage_High(a.lvl), true, false, ATTACK_TYPE, DAMAGE_TYPE, null)
                call GroupRemoveUnit(Temp,temp)
            endloop
            call RemoveUnit(a.du<i>)
            set i = i+1
        endloop
        call a.destroy()
        return true
    endif
endfunction

private function Effects takes nothing returns nothing
    local Data a = Data.create(GetTriggerUnit())
    local real xu = GetUnitX(a.cs)
    local real yu = GetUnitY(a.cs)
    local integer i = 1
    local unit temp
    call DestroyEffect(AddSpecialEffect(EFFECT_C,xu,yu))
    loop
        exitwhen i&gt;=ANGLES
        set a.pointx<i> = xu+200*Cos(I2R(i*(360/(ANGLES-1)))*bj_DEGTORAD)
        set a.pointy<i> = yu+200*Sin(I2R(i*(360/(ANGLES-1)))*bj_DEGTORAD)
        set TempStructIndex = a
        call DestroyEffect(AddSpecialEffect(EFFECT_1, a.pointx<i>, a.pointy<i>))
        call GroupEnumUnitsInRange(Temp, a.pointx<i>, a.pointy<i>,Range_Medium(), Condition(function GroupEm))
        loop
            set temp = FirstOfGroup(Temp)
            exitwhen temp == null
            call UnitDamageTarget(a.cs, temp, Damage_Medium(a.lvl), true, false, ATTACK_TYPE, DAMAGE_TYPE, null)
            call GroupAddUnit(a.g,temp)
            call GroupRemoveUnit(Temp,temp)
        endloop
        set a.du<i> = CreateUnit(a.p,DUMMY_ID,xu,yu,bj_RADTODEG*Atan2(a.pointy<i>-yu,a.pointx<i>-xu))
        call UnitAddAbility(a.du<i>,LOCUST)
        set a.e<i> = AddSpecialEffectTarget(DUMMY_EFFECT,a.du<i>,&quot;origin&quot;)
        set i = i+1
    endloop
    set a.ticks = R2I( 2.5 / .05)
    call TT_StartEx(function Move_Dummy,a,.05)
    call GroupClear(a.g)
    call GroupClear(Temp)
endfunction

private function init takes nothing returns nothing
    local trigger t=CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t,Condition(function Spell_Check))
    call TriggerAddAction(t,function Effects)
endfunction
endscope
</i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i>


Say : "bye bye!! :D" to the bug and lag issue.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top