Spell Wrath of the Fire God

Kazuga

Let the game begin...
Reaction score
110
Made by Kazuga

Requires:
Newgen
HAIL

Leakless? Think so
Laggless? Yep
MUI? Allways :p
Fun? You bet it is :p

Decription:
Call upon Ragnaros the fire god to let him release he's eternal wrath towards your enemies. In return you give him your energy.
Atleast 200 health is needed to cast the spell.


What it really does is seting a unit group containing all nearby enemy units and then picking them randomly and damages them. Ofcourse the affected units are removed from the group so they aren't damaged twice. The spell costs a massive amount of your life, you have less then 100 left after using it depending on if it's a hero or a normal unit. Also you need atleast 200 health to use it.:rolleyes: (A little more original idea?;))
Screenie:
wrathofthefiregodsq9.png


Code:
JASS:
//***********************************************************
//*                                                         *
//*             Wrath of the fire god by Kazuga             *
//*                                                         *
//***********************************************************


scope WrathOfTheFireGod initializer Lightning
//! runtextmacro HAIL_CreateProperty ("Data", "integer", "private")
globals
private constant integer dummyraw      = 'e001'        //Flame strike dummy raw code
private constant integer dummyraw2     = 'e002'       //Devil dummy raw code
private constant integer raw           = 'A000'      //Ability raw code
private constant integer HealthNeeded  = 200        //Health needed to cast the spell
private constant integer LifeRemaining = 200       //Health after the spell has been cast
private constant integer damage        = 200      //Damage dealt to each unit
private constant integer aoe           = 800     //Area of effect of the damage
private constant integer amounts       = 7      //Amount of units affected
private constant real delay = 0.5


//*******************************************************************************************
//Hearby follows the effects in the spell, you can change these by changing the effect code.*
//*******************************************************************************************

private constant string DarkPortalEffect   = "Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl"
private constant string ReinforcedBurrowEffect  = "Abilities\\Spells\\Orc\\ReinforcedTrollBurrow\\ReinforcedTrollBurrowTarget.mdl"
private constant string FlameStrikeEffect = "Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl"
private constant string UnsummonEffect = "Abilities\\Spells\\Undead\\Unsummon\\UnsummonTarget.mdl"
private constant string ExplosionEffect = "Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl"
private constant string SmallFlameStrike = "Objects\\Spawnmodels\\Human\\SmallFlameSpawn\\SmallFlameSpawn.mdl"
private constant string AnimateDeadEffect = "Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl"

//***********************************************************
//*                                                         *
//*             Do not change anything bellow               *
//*                                                         *
//***********************************************************

unit triggering
endglobals


private struct TestStruct
timer Timer
unit Caster
group z
integer counter
effect special1
unit dummy
endstruct



private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == raw
endfunction


function Trig_WrathOfTheFireGod_FilterCondition takes nothing returns boolean
    return GetWidgetLife( GetFilterUnit() ) > 0.405 and IsUnitEnemy( GetFilterUnit(), GetOwningPlayer( triggering ) ) == true
    
endfunction


private function Damage takes nothing returns nothing

    local TestStruct data = GetData (GetExpiredTimer ())
    local unit affected = GroupPickRandomUnit(data.z)
    local boolean groupnotempty = FirstOfGroup(data.z) != null


    local unit dummy
    local real health = GetWidgetLife(affected)

    set data.counter = data.counter + 1


    if data.counter == amounts then
        call PauseTimer (data.Timer)
        call ResetData (data.Timer)
        call DestroyTimer (data.Timer)

        call PauseUnit(data.Caster,false)
        call RemoveUnit(data.dummy)
  
        call DestroyEffect(data.special1)
        call SetUnitInvulnerable(data.Caster,false)
  
        call DestroyEffect(AddSpecialEffect(AnimateDeadEffect,GetUnitX(data.Caster),GetUnitY(data.Caster)))  
        call SetWidgetLife(data.Caster,LifeRemaining)
  
        call DestroyGroup(data.z)
        call SetUnitAnimation(data.Caster,"stand")
  
        call SetUnitTimeScale(data.Caster,1)
  endif
  
  
    if groupnotempty == true then
        set dummy = CreateUnit(GetOwningPlayer(data.Caster),dummyraw2,GetUnitX(affected),GetUnitY(affected),0)
        call SetUnitAnimation(dummy,"birth")

        call UnitApplyTimedLife(dummy,'BTLF',4)
        call DestroyEffect(AddSpecialEffect(ExplosionEffect,GetUnitX(affected),GetUnitY(affected)))  


        if health < damage then
            call SetUnitExploded(affected,true)
            endif   

            call UnitDamageTarget(data.Caster,affected,damage,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
            call GroupRemoveUnit(data.z,affected)

        endif

    set dummy = null
    set affected = null

endfunction





private function Actions takes nothing returns nothing
    local sound SimError
    local TestStruct data = TestStruct.create ()
    local unit caster = GetTriggerUnit()
    local real health = GetWidgetLife(caster)
    local real x = GetUnitX(caster)
    local real y = GetUnitY(caster)
    local real facing = GetUnitFacing(caster)
    local effect special2 
    local effect special3

    set data.special1 = AddSpecialEffectTarget(ReinforcedBurrowEffect,caster,"origin")


        if health < HealthNeeded then
            
            call IssueImmediateOrder(caster, "stop" )
            set SimError=CreateSoundFromLabel( "InterfaceError",false,false,false,10,10)
            call ClearTextMessages()
            call DisplayTimedTextToPlayer( GetOwningPlayer(caster), 0.52, -1.00, 2.00, "|cffffcc00"+"You don't have enough health."+"|r" )
            call StartSound( SimError )
            call PauseUnit(caster,true)
            call PolledWait(1)
            call DestroyEffect(data.special1)
            call PauseUnit(caster,false)
       
       else

       
            set special2 = AddSpecialEffectTarget(UnsummonEffect,caster,"origin")
            set special3 = AddSpecialEffect(FlameStrikeEffect,x,y)

            call SetUnitInvulnerable(caster,true)
            call DestroyEffect(AddSpecialEffectTarget(FlameStrikeEffect,caster,"origin"))
            call PauseUnit(caster,true)

            call PolledWait(2)
            call DestroyEffect(special2)
            call DestroyEffect(special3)

            call SetUnitTimeScalePercent(caster,50)
            call SetUnitAnimation(caster,"death")
            call DestroyEffect(special2)

            set data.dummy = CreateUnit(GetOwningPlayer(caster),dummyraw,x,y,facing)
            call SetUnitVertexColor(data.dummy,100,100,100,90)
            call SetUnitAnimation(data.dummy,"stand second")

            call DestroyEffect(AddSpecialEffectTarget(DarkPortalEffect,caster,"origin"))
            call TerrainDeformationRippleBJ(3,false,GetUnitLoc(caster), 1024, 1024, 64, 1, 512)
            set data.Caster=caster

            set triggering = caster
            set data.z = CreateGroup()
            call GroupEnumUnitsInRange(data.z,x,y,aoe,Condition(function Trig_WrathOfTheFireGod_FilterCondition))

            set data.Timer = CreateTimer()
            call TimerStart (data.Timer,1,true, function Damage)

            call SetData (data.Timer, data)
        endif


    set caster = null
endfunction

//===========================================================================
private function SafeFilt takes nothing returns boolean
return true
endfunction
private function Lightning takes nothing returns nothing
 local trigger trig = CreateTrigger()
     call TriggerRegisterPlayerUnitEvent(trig,GetLocalPlayer(),EVENT_PLAYER_UNIT_SPELL_EFFECT,Condition(function SafeFilt))

 call TriggerAddCondition (trig, Condition (function Conditions ) )
 call TriggerAddAction (trig, function Actions )
 endfunction



endscope


Thanks to:
Flare for tiping me about the custom error message
Vexorian for making the custom error message

Tips for decriptions, name of ability, icons and improvements are very welcome
Edit: Cleaned up the code a little
Edit: Updated code
Edit: Updated: Nerfed the damage, increased the health after casting the ability, added life remaining configuration to the configuration table.
 

Attachments

  • Wrath of the fire god.w3x
    40 KB · Views: 384

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
You really need to do some serious indenting in your codes, it's a pain to read through those massive blocks of text.
 

Kazuga

Let the game begin...
Reaction score
110
Don't really understand what you mean, can you give some tips for improvement?

Edit: Better?
Also what do you think of the spell? :)
 

Flare

Stops copies me!
Reaction score
662
Indenting means spacing in your code e.g.

Not indented code
JASS:
function test takes nothing returns nothing
local unit someunit = GetTriggerUnit ()
call KillUnit (someunit)
endfunction


Indented code
JASS:
function test takes nothing returns nothing
    local unit someunit = GetTriggerUnit ()
    call KillUnit (someunit)
endfunction


Makes it much easier to tell where you have loops, if's and other things within your code. Just press Tab in NewGen and it'll space it in about the equivalent of 5 spacebar presses.

Spell looks nice though
 

Trollvottel

never aging title
Reaction score
262
JASS:
private function Lightning takes nothing returns nothing
 local trigger trig = CreateTrigger()
local integer i = 0
     call TriggerRegisterPlayerUnitEvent(trig,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,Condition(function SafeFilt))

 call TriggerAddCondition (trig, Condition (function Conditions ) )
 call TriggerAddAction (trig, function Actions )
 set trig = null
 endfunction


you forgot "loop" and "endloop so this will only work for player red

but simply change it to

JASS:
private function Lightning takes nothing returns nothing
 local trigger trig = CreateTrigger()
     call TriggerRegisterPlayerUnitEvent(trig,GetLocalPlayer(),EVENT_PLAYER_UNIT_SPELL_EFFECT,Condition(function SafeFilt))

 call TriggerAddCondition (trig, Condition (function Conditions ) )
 call TriggerAddAction (trig, function Actions )
 endfunction


and:

JASS:
call SetUnitTimeScalePercent(data.Caster,100)


not very important but its a BJ

and:

JASS:
local integer groupint = CountUnitsInGroup(data.z)


not good, change it to:

JASS:
local boolean groupnotempty = FirstOfGroup(data.z) != null


since you only check if the group is empty or not this is th better solution

/edit3:

spell looks nice from the screenshot :)
 

Kazuga

Let the game begin...
Reaction score
110
Hm how can it be a BJ when it doesn't say it is...? Nvm one BJ here or there can't hurt now can it?^^
Thanks, fixed the group thing also and updated code and map. However what was bad with the count thing? A BJ also?^^

Thanks, the spell looks better ingame though:thup:
 

Trollvottel

never aging title
Reaction score
262
The count thing is bad because if there are many units in this group the function goes through all units and so you have many operations. but if you use firstofgroup you have only one function call
 

Drunken_God

Hopes to get back into Mapmaking with SC2 :)
Reaction score
106
maybe change the ingame tooltip (currently it isnt very informative)
 

Kazuga

Let the game begin...
Reaction score
110
Hm yes, now that I read it it isn't as good as I thought it were when I wrote it... Will see if I can think of something.
 

Cheesy

some fucker
Reaction score
95
>>Why is the count thing bad?

The count thing is bad because if there are many units in this group the function goes through all units and so you have many operations. but if you use firstofgroup you have only one function call
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
I suggest you to "nerf" the spell.

Who wants to be killed after every cast, right?


Make it do less damage and leave the caster more HP in the end.

Or better yet, add a configuration option to allow users to change the remaining HP.


"SetUnitTimeScalePercent(unit, 100)" can be replaced with "SetUnitTimeScale(unit, 1)"
 

Kazuga

Let the game begin...
Reaction score
110
Ah thanks for removing the bumps and reply Andrew.:) I did what you said, I set the damage to half of it's value (it really was real high, never thought about that when making it.) Put the health remaining to 10 times more than before, (now 200 instead of 20. Seemed more logical to have the same value as it is required to cast it somehow.) Also added life remaining configuration to the configuration table.

Also, if it's not too much to ask for could you have a look at my other spell and my spellpack? I know you are very busy and such, just asking.:)
 

Sim

Forum Administrator
Staff member
Reaction score
534
Thanks!

Naturally, if the author wishes for this spell to be approved again it will need an update!
 

Kazuga

Let the game begin...
Reaction score
110
Hmph, it broke together with all my other triggers and spells, that patch messed up everything I have ever created... And I still don't know how to fix it... Ah well, I will see if I can remake the spell when I get the time to.


(That's right, I'm back! :thup:)
 

Laiev

Hey Listen!!
Reaction score
188
welcome back :)

and here is a little edit to compile with 1.24 (uses now TimerUtils)

JASS:
//***********************************************************
//*                                                         *
//*             Wrath of the fire god by Kazuga             *
//*                                                         *
//***********************************************************


scope WrathOfTheFireGod initializer Lightning //requires TimerUtils

globals
private constant integer dummyraw      = 'e001'        //Flame strike dummy raw code
private constant integer dummyraw2     = 'e002'       //Devil dummy raw code
private constant integer raw           = 'A000'      //Ability raw code
private constant integer HealthNeeded  = 200        //Health needed to cast the spell
private constant integer LifeRemaining = 200       //Health after the spell has been cast
private constant integer damage        = 200      //Damage dealt to each unit
private constant integer aoe           = 800     //Area of effect of the damage
private constant integer amounts       = 7      //Amount of units affected
private constant real delay = 0.5


//*******************************************************************************************
//Hearby follows the effects in the spell, you can change these by changing the effect code.*
//*******************************************************************************************

private constant string DarkPortalEffect   = "Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl"
private constant string ReinforcedBurrowEffect  = "Abilities\\Spells\\Orc\\ReinforcedTrollBurrow\\ReinforcedTrollBurrowTarget.mdl"
private constant string FlameStrikeEffect = "Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl"
private constant string UnsummonEffect = "Abilities\\Spells\\Undead\\Unsummon\\UnsummonTarget.mdl"
private constant string ExplosionEffect = "Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl"
private constant string SmallFlameStrike = "Objects\\Spawnmodels\\Human\\SmallFlameSpawn\\SmallFlameSpawn.mdl"
private constant string AnimateDeadEffect = "Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl"

//***********************************************************
//*                                                         *
//*             Do not change anything bellow               *
//*                                                         *
//***********************************************************

unit triggering
endglobals


private struct TestStruct
timer Timer
unit Caster
group z
integer counter
effect special1
unit dummy
endstruct



private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == raw
endfunction


function Trig_WrathOfTheFireGod_FilterCondition takes nothing returns boolean
    return GetWidgetLife( GetFilterUnit() ) > 0.405 and IsUnitEnemy( GetFilterUnit(), GetOwningPlayer( triggering ) ) == true
    
endfunction


private function Damage takes nothing returns nothing

    local TestStruct data = GetTimerData (GetExpiredTimer ())
    local unit affected = GroupPickRandomUnit(data.z)
    local boolean groupnotempty = FirstOfGroup(data.z) != null


    local unit dummy
    local real health = GetWidgetLife(affected)

    set data.counter = data.counter + 1


    if data.counter == amounts then
        
        call ReleaseTimer(data.Timer)

        call PauseUnit(data.Caster,false)
        call RemoveUnit(data.dummy)
  
        call DestroyEffect(data.special1)
        call SetUnitInvulnerable(data.Caster,false)
  
        call DestroyEffect(AddSpecialEffect(AnimateDeadEffect,GetUnitX(data.Caster),GetUnitY(data.Caster)))  
        call SetWidgetLife(data.Caster,LifeRemaining)
  
        call DestroyGroup(data.z)
        call SetUnitAnimation(data.Caster,"stand")
  
        call SetUnitTimeScale(data.Caster,1)
  endif
  
  
    if groupnotempty == true then
        set dummy = CreateUnit(GetOwningPlayer(data.Caster),dummyraw2,GetUnitX(affected),GetUnitY(affected),0)
        call SetUnitAnimation(dummy,"birth")

        call UnitApplyTimedLife(dummy,'BTLF',4)
        call DestroyEffect(AddSpecialEffect(ExplosionEffect,GetUnitX(affected),GetUnitY(affected)))  


        if health < damage then
            call SetUnitExploded(affected,true)
            endif   

            call UnitDamageTarget(data.Caster,affected,damage,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
            call GroupRemoveUnit(data.z,affected)

        endif

    set dummy = null
    set affected = null

endfunction





private function Actions takes nothing returns nothing
    local sound SimError
    local TestStruct data = TestStruct.create ()
    local unit caster = GetTriggerUnit()
    local real health = GetWidgetLife(caster)
    local real x = GetUnitX(caster)
    local real y = GetUnitY(caster)
    local real facing = GetUnitFacing(caster)
    local effect special2 
    local effect special3

    set data.special1 = AddSpecialEffectTarget(ReinforcedBurrowEffect,caster,"origin")


        if health < HealthNeeded then
            
            call IssueImmediateOrder(caster, "stop" )
            set SimError=CreateSoundFromLabel( "InterfaceError",false,false,false,10,10)
            call ClearTextMessages()
            call DisplayTimedTextToPlayer( GetOwningPlayer(caster), 0.52, -1.00, 2.00, "|cffffcc00"+"You don't have enough health."+"|r" )
            call StartSound( SimError )
            call PauseUnit(caster,true)
            call PolledWait(1)
            call DestroyEffect(data.special1)
            call PauseUnit(caster,false)
       
       else

       
            set special2 = AddSpecialEffectTarget(UnsummonEffect,caster,"origin")
            set special3 = AddSpecialEffect(FlameStrikeEffect,x,y)

            call SetUnitInvulnerable(caster,true)
            call DestroyEffect(AddSpecialEffectTarget(FlameStrikeEffect,caster,"origin"))
            call PauseUnit(caster,true)

            call PolledWait(2)
            call DestroyEffect(special2)
            call DestroyEffect(special3)

            call SetUnitTimeScalePercent(caster,50)
            call SetUnitAnimation(caster,"death")
            call DestroyEffect(special2)

            set data.dummy = CreateUnit(GetOwningPlayer(caster),dummyraw,x,y,facing)
            call SetUnitVertexColor(data.dummy,100,100,100,90)
            call SetUnitAnimation(data.dummy,"stand second")

            call DestroyEffect(AddSpecialEffectTarget(DarkPortalEffect,caster,"origin"))
            call TerrainDeformationRippleBJ(3,false,GetUnitLoc(caster), 1024, 1024, 64, 1, 512)
            set data.Caster=caster

            set triggering = caster
            set data.z = CreateGroup()
            call GroupEnumUnitsInRange(data.z,x,y,aoe,Condition(function Trig_WrathOfTheFireGod_FilterCondition))

            set data.Timer = NewTimer()
            call TimerStart (data.Timer,1,true, function Damage)

            call SetTimerData (data.Timer, data)
        endif


    set caster = null
endfunction

//===========================================================================
private function SafeFilt takes nothing returns boolean
return true
endfunction
private function Lightning takes nothing returns nothing
 local trigger trig = CreateTrigger()
     call TriggerRegisterPlayerUnitEvent(trig,GetLocalPlayer(),EVENT_PLAYER_UNIT_SPELL_EFFECT,Condition(function SafeFilt))

 call TriggerAddCondition (trig, Condition (function Conditions ) )
 call TriggerAddAction (trig, function Actions )
 endfunction



endscope


of course this spell can be improved alot, but is your choice :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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