Naminator
Coming Back To Life
- Reaction score
- 76
Here's a DotA Spell. Call Epicenter, from Crixalis. I don't if it's right the damage when units are more closer. Tell if something leaks or how can I improve, so then I can add it to the index. Thanks.
It's GUI and JASS.
Epicenter:
Sends a disturbance into the earth, causing it to shudder violently. All caught within range will take damage and become slowed. The closer to the epicenter, the more damage taken.
Level 1 - 2.0 second casting time, 6 pulses of 110 damage.
Level 2 - 2.0 second casting time, 8 pulses of 110 damage.
Level 3 - 2.0 second casting time, 10 pulses of 110 damage.
Epicenter GUI:
Epicenter JASS:
It's GUI and JASS.
Epicenter:
Sends a disturbance into the earth, causing it to shudder violently. All caught within range will take damage and become slowed. The closer to the epicenter, the more damage taken.
Level 1 - 2.0 second casting time, 6 pulses of 110 damage.
Level 2 - 2.0 second casting time, 8 pulses of 110 damage.
Level 3 - 2.0 second casting time, 10 pulses of 110 damage.
Epicenter GUI:
Code:
Epicenter
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Epicenter
Actions
Set Epicenter_Caster = (Triggering unit)
Set Epicenter_Caster_Loc = (Position of Epicenter_Caster)
Set Epicenter_Pulses = (4 + (2 x (Level of Epicenter for Epicenter_Caster)))
Set Epicenter_Damage = 110
Trigger - Turn on Epicenter Action <gen>
Wait until (Epicenter_Pulses Equal to 0), checking every 0.10 seconds
Trigger - Turn off Epicenter Action <gen>
Code:
Epicenter Action
Events
Time - Every 0.30 seconds of game time
Conditions
Actions
Set Epicenter_Pulses = (Epicenter_Pulses - 1)
Set Epicenter_Caster_Loc = (Position of Epicenter_Caster)
Set Epicenter_Group = (Units within 600.00 of Epicenter_Caster_Loc matching ((((Matching unit) belongs to an enemy of (Owner of Epicenter_Caster)) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is A structure) Equal to False))))
Environment - Create a 0.50 second Temporary crater deformation at Epicenter_Caster_Loc with radius 560.00 and depth 28.00
Unit - Create 1 Dummy Unit for (Owner of Epicenter_Caster) at Epicenter_Caster_Loc facing Default building facing degrees
Unit - Add Epicenter Slow to (Last created unit)
Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
Unit - Add a 0.30 second Generic expiration timer to (Last created unit)
Unit Group - Pick every unit in Epicenter_Group and do (Actions)
Loop - Actions
Set Epicenter_Picked_Loc = (Position of (Picked unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between Epicenter_Caster_Loc and Epicenter_Picked_Loc) Less than or equal to 200.00
Then - Actions
Unit - Cause Epicenter_Caster to damage (Picked unit), dealing ((Real(Epicenter_Damage)) + 20.00) damage of attack type Spells and damage type Universal
Else - Actions
Custom script: call RemoveLocation (udg_Epicenter_Picked_Loc)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between Epicenter_Caster_Loc and Epicenter_Picked_Loc) Less than or equal to 400.00
Then - Actions
Unit - Cause Epicenter_Caster to damage (Picked unit), dealing ((Real(Epicenter_Damage)) - 20.00) damage of attack type Spells and damage type Universal
Else - Actions
Custom script: call RemoveLocation (udg_Epicenter_Picked_Loc)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between Epicenter_Caster_Loc and Epicenter_Picked_Loc) Less than or equal to 600.00
Then - Actions
Unit - Cause Epicenter_Caster to damage (Picked unit), dealing ((Real(Epicenter_Damage)) - 30.00) damage of attack type Spells and damage type Universal
Else - Actions
Custom script: call RemoveLocation (udg_Epicenter_Caster_Loc)
Custom script: call RemoveLocation (udg_Epicenter_Picked_Loc)
Custom script: call DestroyGroup (udg_Epicenter_Group)
Epicenter JASS:
JASS:
//These constant functions control the range of the damage and deformation. Just change the values in these functions to alter the trigger.
constant function LargeDamageRange takes nothing returns real
return 600.00
endfunction
constant function MediumDamageRange takes nothing returns real
return 400.00
endfunction
constant function SmallDamageRange takes nothing returns real
return 200.00
endfunction
constant function TimeBetweenRipples takes nothing returns real
return 0.3
endfunction
constant function EpicenterAbilityCode takes nothing returns integer
return 039;A002039;
endfunction
constant function DummyUnitCode takes nothing returns integer
return 039;h000039;
endfunction
constant function DummyAbilityCode takes nothing returns integer
return 039;A001039;
endfunction
function NumberOfPulses takes unit caster returns integer
return ( 4 + ( 2 * GetUnitAbilityLevel(caster, EpicenterAbilityCode()) ) )
endfunction
function Matching takes nothing returns boolean
return GetWidgetLife(GetFilterUnit()) > 0.405 and IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_Epicenter_Caster)) == true
endfunction
function Picked takes nothing returns nothing
local location unitloc = GetUnitLoc(GetEnumUnit())
local location Epicenter_Caster_Loc = GetUnitLoc(udg_Epicenter_Caster)
if ( DistanceBetweenPoints(Epicenter_Caster_Loc, unitloc) <= SmallDamageRange() ) then
call UnitDamageTarget( udg_Epicenter_Caster, GetEnumUnit(), ( I2R(udg_Epicenter_Damage) + 20.00 ), true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
else
if ( DistanceBetweenPoints(Epicenter_Caster_Loc, unitloc) <= MediumDamageRange() ) then
call UnitDamageTarget( udg_Epicenter_Caster, GetEnumUnit(), ( I2R(udg_Epicenter_Damage) - 20.00 ), true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
else
if ( DistanceBetweenPoints(Epicenter_Caster_Loc, unitloc) <= LargeDamageRange() ) then
call UnitDamageTarget( udg_Epicenter_Caster, GetEnumUnit(), ( I2R(udg_Epicenter_Damage) - 30.00 ),true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
else
endif
endif
endif
call RemoveLocation (unitloc)
call RemoveLocation (Epicenter_Caster_Loc)
set unitloc = null
set Epicenter_Caster_Loc = null
endfunction
function Trig_Epicenter_Action_Actions takes nothing returns nothing
local unit caster = udg_Epicenter_Caster
local integer Epicenter_Pulses = NumberOfPulses(caster)
local location Epicenter_Caster_Loc
local group Epicenter_Group
local boolexpr b
loop
exitwhen Epicenter_Pulses == 0
set udg_Epicenter_Caster = caster
set Epicenter_Caster_Loc = GetUnitLoc(caster)
set b = Condition(function Matching)
set Epicenter_Group = GetUnitsInRangeOfLocMatching(LargeDamageRange(), Epicenter_Caster_Loc, b)
call TerrainDeformationCraterBJ( 0.5, false, Epicenter_Caster_Loc, LargeDamageRange()-40.00, 28.00 )
call CreateNUnitsAtLoc( 1, DummyUnitCode(), GetOwningPlayer(caster), Epicenter_Caster_Loc, bj_UNIT_FACING )
call UnitAddAbility(GetLastCreatedUnit(), DummyAbilityCode() )
call IssueImmediateOrder( GetLastCreatedUnit(), "thunderclap" )
call UnitApplyTimedLife(GetLastCreatedUnit(), 039;BTLF039;, 0.30 )
call ForGroup( Epicenter_Group, function Picked )
set Epicenter_Pulses = Epicenter_Pulses-1
call RemoveLocation (Epicenter_Caster_Loc)
call DestroyGroup (Epicenter_Group)
call DestroyBoolExpr(b)
set b = null
set Epicenter_Caster_Loc = null
set Epicenter_Group = null
call PolledWait(TimeBetweenRipples())
endloop
set caster = null
endfunction
//===========================================================================
function InitTrig_Epicenter_Action takes nothing returns nothing
set gg_trg_Epicenter_Action = CreateTrigger( )
call TriggerAddAction( gg_trg_Epicenter_Action, function Trig_Epicenter_Action_Actions )
endfunction