Made by Kazuga
Requires:
Newgen
HAIL
Leakless? Think so
Laggless? Yep
MUI? Allways
Fun? You bet it is
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. (A little more original idea?)
Screenie:
Code:
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.
Requires:
Newgen
HAIL
Leakless? Think so
Laggless? Yep
MUI? Allways
Fun? You bet it is
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. (A little more original idea?)
Screenie:
Code:
JASS:
//***********************************************************
//* *
//* Wrath of the fire god by Kazuga *
//* *
//***********************************************************
scope WrathOfTheFireGod initializer Lightning
//! runtextmacro HAIL_CreateProperty ("Data", "integer", "private")
globals
private constant integer dummyraw = 039;e001039; //Flame strike dummy raw code
private constant integer dummyraw2 = 039;e002039; //Devil dummy raw code
private constant integer raw = 039;A000039; //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,039;BTLF039;,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 don039;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.