NetherHawk
New Member
- Reaction score
- 26
Every time the hero attacks, he stores up lightning charges. When he reaches his limit, he unleashes the charges which slows the AS and MS of units in an area near the attacked unit.
requires 8/7/6/5 attacks,
deals 30/45/60/75 damage.
thx Daxtreme for helping =]
charged mountain king ready to unleash the lightning
requires 8/7/6/5 attacks,
deals 30/45/60/75 damage.
JASS:
globals
endglobals
//*******************************************************************************************
// Configuration (This is where you need to edit to make the spell works in your map)
//*******************************************************************************************
//
// <-------------------- Rawcode -------------------->
//
constant function AbilityID takes nothing returns integer
return 039;A001039;
endfunction
// The raw of the ability, Overload
constant function DAbilityID takes nothing returns integer
return 039;A000039;
endfunction
// The raw of the dummy ability Overload Effect
constant function DummyID takes nothing returns integer
return 039;h000039;
endfunction
// The raw of the dummy unit, Overload Dummy
//
// <------------------ Rawcode End ------------------>
//
// <----------------- Configuration ----------------->
//
// Changing the number of hits before the thunderclap is released
// Scroll down and find the function, Overload_Charge
// you would see this :
// local integer cx = 9 - i
// i = the level of Overload of the hero
// cx determines the number of attacks before the thunderclap is released
// adjust it to what you want
// for eg: 10 - 2i would mean 8 on level 1, 6 on level 2, 4 on level 3 and
// 2 on level 4.
// any further questions, you may post at the thread. Have fun, cheers!
//
constant function FX takes nothing returns string
return "Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl"
endfunction
// this is the special effect added to the hands of the hero
// if you want to change this, create a new trigger, select the special effect
// you want and create an action invovling that effect
// Convert the trigger to custom text under edit and see the name of the
// special effect, it should be something like above, "....."
// Replace the name above to change the effects
//
// <--------------- Configuration End --------------->//
//*******************************************************************************************
// Configuration End
//*******************************************************************************************
// -----------------------> Do not edit anything below this line. <-----------------------//
// -----------------------> Do not edit anything below this line. <-----------------------//
// -----------------------> Do not edit anything below this line. <-----------------------//
function Overload_Jass_Conditions takes nothing returns boolean
return GetLearnedSkill() == 039;A001039;
endfunction
function Overload_Filter takes nothing returns boolean
local trigger tr = GetTriggeringTrigger()
local unit u = GetHandleUnit(tr,"caster")
return GetAttacker() == u and IsUnitEnemy(GetTriggerUnit(),GetOwningPlayer(u)) == true
endfunction
function Overload_Check takes nothing returns boolean
local trigger tx = GetTriggeringTrigger()
local unit u = GetHandleUnit(tx,"caster")
return GetEventDamageSource() == u
endfunction
function Overload_Recount takes nothing returns nothing
local trigger tx = GetTriggeringTrigger()
local unit u = GetHandleUnit(tx,"caster")
local unit ux = GetTriggerUnit()
local integer i = GetUnitAbilityLevel(u,AbilityID())
local integer c = GetHandleInt(u,"counter")
local effect fx = GetHandleFX(u,"effectx")
local effect fy = GetHandleFX(u,"effecty")
local unit d
set c = c - 1
call SetHandleInt(u,"counter",c)
if c == 1 then
set fx = AddSpecialEffectTarget(FX(),u,"right + hand")
set fy = AddSpecialEffectTarget(FX(),u,"left + hand")
call SetHandleHandle(u,"effectx",fx)
call SetHandleHandle(u,"effecty",fy)
else
if c == 0 then
call DestroyEffect(fx)
call DestroyEffect(fy)
set d = CreateUnit(GetOwningPlayer(u),DummyID(),GetUnitX(ux),GetUnitY(ux),bj_UNIT_FACING)
call SetUnitAbilityLevel(d,DAbilityID(),i)
call UnitApplyTimedLife(d,039;BTLF039;,1)
call IssueImmediateOrder(d,"thunderclap")
set fx = null
set fy = null
set d = null
endif
endif
call DisableTrigger(tx)
call DestroyTrigger(tx)
set tx = null
endfunction
function Overload_Charge takes nothing returns nothing
local trigger tx = CreateTrigger()
local trigger tr = GetTriggeringTrigger()
local unit ux = GetTriggerUnit()
local unit u = GetHandleUnit(tr,"caster")
local integer i = GetUnitAbilityLevel(u,AbilityID())
local integer cx = 9 - i
local integer c = GetHandleInt(u,"counter")
if c == 0 then
set c = cx
endif
call SetHandleInt(u,"counter",c)
call SetHandleHandle(tx,"caster",u)
call TriggerRegisterUnitEvent(tx,ux,EVENT_UNIT_DAMAGED)
call TriggerAddCondition(tx, Condition(function Overload_Check))
call TriggerAddAction(tx, function Overload_Recount)
set u = null
set ux = null
endfunction
function Overload_Jass_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer i = GetUnitAbilityLevel(u,AbilityID())
local trigger tr
if i == 1 then
set tr = CreateTrigger()
call SetHandleHandle(tr,"caster",u)
call TriggerRegisterAnyUnitEventBJ(tr,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(tr, Condition(function Overload_Filter))
call TriggerAddAction(tr, function Overload_Charge)
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Overload_Jass takes nothing returns nothing
set gg_trg_Overload_Jass = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Overload_Jass, EVENT_PLAYER_HERO_SKILL )
call TriggerAddCondition( gg_trg_Overload_Jass, Condition( function Overload_Jass_Conditions ) )
call TriggerAddAction( gg_trg_Overload_Jass, function Overload_Jass_Actions )
endfunction
thx Daxtreme for helping =]
charged mountain king ready to unleash the lightning