Kazuga proudly presents!
Lightning Anger
Requires:
HAIL
TT
TimedLightning by Flare
Newgen
GUI/JASS? vJass
Laggless? Haven't felt any lagg at all and my computer sucks^^
Leakless? Hope so..
Description:
Screen shots:
They aren't the best so you better check it out ingame^^
Code:
Please report possible leaks or issues, and feedback on the terrain would be nice to^^
Thanks to all who helped me with making this spell^^
And finally the map itself
Edit: Updated code
Edit: Changed some eyecandy
Edit: It's now easier to modify the spell
Edit: Updated code
Edit: Updated code
Lightning Anger
Requires:
HAIL
TT
TimedLightning by Flare
Newgen
GUI/JASS? vJass
Laggless? Haven't felt any lagg at all and my computer sucks^^
Leakless? Hope so..
Description:
Channels up elektricity to then send it out in form of a giant electricity ball towards your enemy. The electricity ball will follow the target untill it reaches it's goal. When hit the electricity ball will shock all enemies within range of the target dealing damage.
Screen shots:
They aren't the best so you better check it out ingame^^
Code:
JASS:
//************************************************************************
//* Lightning Anger by Kazuga *
//************************************************************************
scope Lightnings initializer Lightning
//! runtextmacro HAIL_CreateProperty ("Data", "integer", "private")
globals
private constant integer dummyID = 039;h001039; //Dummy id
private constant integer raw = 039;A001039; //Ability id
private constant integer aoe = 500 //AoE of the damage
private constant integer movement = 20 //Range of the movement of the lightning ball
private constant integer damage = 200 //Amount of damage dealt, damage is multiplied with level of ability
private constant string lightnings = "CLPB" //Chain lightning type
private constant real speed = 0.05 //Speed of the lightning ball
//********************************************************************************************
//Hearby follows the special effects. To change the effect you must write the path within the*
//speech signs ("), and don't forget to add a backslash sign (\) to each backslash sign. *
//********************************************************************************************
private constant string lightningeffect = "Abilities\\Weapons\\Bolt\\BoltImpact.mdl" //Lightning effect type
private constant string skylightning = "Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl" //The lightning coming from the sky
private constant string starfalleffect = "Abilities\\Spells\\NightElf\\Starfall\\StarfallCaster.mdl" //The starfall effect when casting the ability
private constant string warstompeffect = "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" // The warstomp effect wich apears on the targeted unit when hit
//*******************************************************************************
//* WARNING! WARNING! WARNING! *
//* Spell starts here! Do not change anything below unless you know what you do!*
//*******************************************************************************
group z
unit unitx = null
unit dummyx = null
endglobals
private struct TestStruct
unit dummy
unit target
real tx
real ty
timer SlideTimer
unit caster
endstruct
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == raw
endfunction
function Trig_LightningAnger_FilterCondition takes nothing returns boolean
return GetWidgetLife( GetFilterUnit() ) > 0.405 and IsUnitEnemy( GetFilterUnit(), GetOwningPlayer( unitx ) ) == true
endfunction
function Damage takes nothing returns nothing
local unit affected = GetEnumUnit ()
call UnitDamageTarget(unitx,affected,(damage*I2R(GetUnitAbilityLevel(unitx,039;A001039;))),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect (AddSpecialEffectTarget(lightningeffect,affected,"origin"))
call TimedLightning (lightnings,GetUnitX(affected),GetUnitY(affected),0,GetUnitX(dummyx),GetUnitY(dummyx),0,1.,true,1,0)
set affected = null
endfunction
private function Effect takes real myX, real myY, unit Target returns nothing
local real x = GetUnitX(Target)
local real y = GetUnitY(Target)
set z = CreateGroup()
call GroupEnumUnitsInRange(z,x,y,aoe,Condition(function Trig_LightningAnger_FilterCondition))
call ForGroup(z,function Damage)
call DestroyEffect(AddSpecialEffect(skylightning,myX,myY))
call DestroyEffect(AddSpecialEffect(warstompeffect,myX,myY))
call DestroyGroup(z)
endfunction
private function Slide takes nothing returns nothing
local TestStruct data = GetData (GetExpiredTimer ())
local real x = GetUnitX(data.dummy)
local real y = GetUnitY(data.dummy)
local real newX
local real newY
local real angle
local real distance
local real real1=45
set data.tx = GetUnitX(data.target)
set data.ty = GetUnitY(data.target)
set angle = Atan2(data.ty-y,data.tx-x)
set newX = x + movement *Cos(angle)
set newY = y + movement *Sin(angle)
call SetUnitPosition(data.dummy,newX,newY)
set distance=SquareRoot( (x-data.tx)*(x-data.tx) + (y-data.ty)*(y-data.ty) )
if distance < 20 then
call PauseTimer (data.SlideTimer)
call ResetData (data.SlideTimer)
call DestroyTimer (data.SlideTimer)
call RemoveUnit(data.dummy)
set unitx = data.caster
set dummyx= data.dummy
call Effect( data.tx, data.ty, data.target)
call data.destroy ()
endif
endfunction
private function Actions takes nothing returns nothing
local TestStruct data = TestStruct.create ()
local unit Unit = GetTriggerUnit()
local real real1 = GetUnitFacing(GetTriggerUnit())*bj_DEGTORAD
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local real x2 = x + 300 * Cos((real1+2.531))
local real y2 = y + 300 * Sin((real1+2.531))
local real x3 = x + 300 * Cos((real1+3.142))
local real y3 = y + 300 * Sin((real1+3.142))
local real x4 = x + 300 * Cos((real1+3.752))
local real y4 = y + 300 * Sin((real1+3.752))
local effect special1
set data.caster = GetTriggerUnit()
set data.SlideTimer = CreateTimer()
set data.target = (GetSpellTargetUnit())
set special1 = AddSpecialEffect(starfalleffect,x,y)
call TriggerSleepAction (0.1)
call DestroyEffect (AddSpecialEffect(lightningeffect,x2,y2))
call DestroyEffect (AddSpecialEffect(lightningeffect,x3,y3))
call DestroyEffect (AddSpecialEffect(lightningeffect,x4,y4))
call DestroyEffect (AddSpecialEffect(skylightning,x,y))
call PauseUnit (Unit, true)
call TimedLightning (lightnings, x, y, 0, x2, y2, 0, 1., true, 1, 0)
call TimedLightning (lightnings, x, y, 0, x3, y3, 0, 1., true, 1, 0)
call TimedLightning (lightnings, x, y, 0, x4, y4, 0, 1., true, 1, 0)
call TriggerSleepAction (1)
call DestroyEffect(special1)
set data.dummy = CreateUnit (GetOwningPlayer(Unit),dummyID,x,y,0)
call SetUnitPathing(data.dummy, false )
call PauseUnit (Unit, false)
call TimerStart (data.SlideTimer,speed,true, function Slide)
call SetData (data.SlideTimer, data)
set Unit = null
set special1 = null
endfunction
//===========================================================================
private function SafeFilt takes nothing returns boolean
return true
endfunction
private function Lightning takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer i = 0
loop
exitwhen i > 15
call TriggerRegisterPlayerUnitEvent(trig,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,Condition(function SafeFilt))
set i = i + 1
endloop
call TriggerAddCondition (trig, Condition (function Conditions ) )
call TriggerAddAction (trig, function Actions )
set trig = null
endfunction
endscope
Please report possible leaks or issues, and feedback on the terrain would be nice to^^
Thanks to all who helped me with making this spell^^
And finally the map itself
Edit: Updated code
Edit: Changed some eyecandy
Edit: It's now easier to modify the spell
Edit: Updated code
Edit: Updated code