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: 372

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
715
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.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top