//TESH.scrollpos=0
//TESH.alwaysfold=0
Name | Type | is_array | initial_value |
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Init_Actions takes nothing returns nothing
call DisplayTimedTextToPlayer(Player(0),0,0,20.," |cff8b814c S P E L L P A C K 2|r")
call DisplayTimedTextToPlayer(Player(0),0,0,20.," |cffcdbe70 By: scorpion182")
call DisplayTimedTextToPlayer(Player(0),0,0,20.,"Type -refresh to reset cooldown and mana.")
call FogEnable(false)
call FogMaskEnable(false)
call DestroyTrigger(GetTriggeringTrigger())
endfunction
//===========================================================================
function InitTrig_Init takes nothing returns nothing
set gg_trg_Init = CreateTrigger( )
call TriggerAddAction( gg_trg_Init, function Trig_Init_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Revive_Creep_Conditions takes nothing returns boolean
return( GetOwningPlayer(GetDyingUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE))
endfunction
function Trig_Revive_Creep_Actions takes nothing returns nothing
local location loc=GetUnitLoc(GetDyingUnit())
call TriggerSleepAction( 20.00 )
call CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE),GetUnitTypeId(GetDyingUnit()),loc,bj_UNIT_FACING)
call RemoveLocation(loc)
set loc=null
endfunction
//===========================================================================
function InitTrig_Revive_Creep takes nothing returns nothing
set gg_trg_Revive_Creep = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Revive_Creep, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Revive_Creep, Condition( function Trig_Revive_Creep_Conditions ) )
call TriggerAddAction( gg_trg_Revive_Creep, function Trig_Revive_Creep_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
//=============================================================================
// Passive Polymorph
// By: scorpion182
//
// Gives a percent chance to turns a target enemy unit into a sheep.
//
//
//
// Spell Requires: Passive Polymorph ability
// Polymorph Dummy ability
// Dummy unit
//
// Implementation:
// Simply copy the forementioned requirements to your map, go through the
// options below and enjoy!
//=============================================================================
//Configuration Options:
//=============================================================================
constant function Dummy_Caster takes nothing returns integer
return 'e000' // rawcode of Dummy Caster unit
endfunction
constant function PP_AbilId takes nothing returns integer
return 'A000' // ability rawcode of Passive Polymorph ability
endfunction
constant function PP_Dummy_AbilId takes nothing returns integer
return 'A002' // ability rawcode of Polymorph Dummy ability
endfunction
constant function PP_Chance takes integer lvl returns integer
return 10+5*lvl // % chance
endfunction
//Configuration end
//=============================================================================
function PP_Conditions takes nothing returns boolean
if GetUnitAbilityLevel(GetAttacker(),PP_AbilId())==0 then
return false
endif
if IsUnitIllusion(GetAttacker())==true then
return false
endif
if IsPlayerEnemy(GetOwningPlayer(GetAttacker()),GetOwningPlayer(GetTriggerUnit()))==false then
return false
endif
if GetUnitAbilityLevel(GetTriggerUnit(),'Bply')>0 then
return false
endif
return true
endfunction
function PP_Main takes nothing returns nothing
local unit target=GetTriggerUnit()
local unit caster=GetAttacker()
local unit dummy
if(GetRandomInt(1,100)<=PP_Chance(GetUnitAbilityLevel(caster,PP_AbilId()))) then
set dummy=CreateUnit(GetOwningPlayer(caster),Dummy_Caster(),GetUnitX(target),GetUnitY(target),0)
call UnitApplyTimedLife(dummy,'BTLF',1.0)
call UnitAddAbility(dummy,PP_Dummy_AbilId())
call SetUnitAbilityLevel(dummy,PP_Dummy_AbilId(),GetUnitAbilityLevel(caster,PP_AbilId()))
call IssueTargetOrder(dummy,"polymorph",target)
endif
set caster=null
set dummy=null
set target=null
endfunction
//===========================================================================
function InitTrig_Passive_Polymorph takes nothing returns nothing
set gg_trg_Passive_Polymorph = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(gg_trg_Passive_Polymorph,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(gg_trg_Passive_Polymorph,Condition(function PP_Conditions))
call TriggerAddAction( gg_trg_Passive_Polymorph, function PP_Main )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
//=============================================================================
// Red Barrier
// By: scorpion182
//
// Gives a percent chance to create red barrier which can deflect both physical
// and magical attacks.
//
//
//
// Spell Requires: Red Barrier ability
// Red Barrier FX unit
//
//
// Implementation:
// Simply copy the forementioned requirements to your map, go through the
// options below and enjoy!
//=============================================================================
//Configuration Options:
//=============================================================================
constant function RB_AbilId takes nothing returns integer
return 'A001' // ability rawcode of Red Barrier ability
endfunction
constant function RB_Dummy_AbilId takes nothing returns integer
return 'e001' // ability rawcode of Red Barrier FX unit
endfunction
constant function RB_Chance takes integer lvl returns integer
return 10+5*lvl // % chance
endfunction
//Configuration end
//=============================================================================
function Red_Barrier_Cons takes nothing returns boolean
return GetLearnedSkill()==RB_AbilId() and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function Red_Barrier_Main takes nothing returns nothing
local unit caster=GetTriggerUnit()
local real damage=GetEventDamage()
local unit dummy
local timer t=CreateTimer()
if(damage>0)then
if(GetRandomInt(1,100)<=RB_Chance(GetUnitAbilityLevel(caster,RB_AbilId()))) then
call SetUnitState(caster,UNIT_STATE_LIFE,GetUnitState(caster,UNIT_STATE_LIFE)+damage)
set dummy=CreateUnit(GetOwningPlayer(caster),RB_Dummy_AbilId(),GetUnitX(caster),GetUnitY(caster),0)
call SetUnitPathing(dummy,false)
call SetUnitInvulnerable(dummy,true)
call UnitApplyTimedLife(dummy,'BTLF',2.0)
endif
endif
set t=null
set caster=null
set dummy=null
endfunction
function Red_Barrier_Acts takes nothing returns nothing
local trigger t
if GetUnitAbilityLevel(GetTriggerUnit(),RB_AbilId())==1 then
set t=CreateTrigger()
call TriggerRegisterUnitEvent(t,GetTriggerUnit(),EVENT_UNIT_DAMAGED)
call TriggerAddAction(t,function Red_Barrier_Main)
endif
set t=null
endfunction
function InitTrig_Red_Barrier takes nothing returns nothing
set gg_trg_Red_Barrier=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Red_Barrier,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(gg_trg_Red_Barrier,Condition(function Red_Barrier_Cons))
call TriggerAddAction(gg_trg_Red_Barrier,function Red_Barrier_Acts)
endfunction
//TESH.scrollpos=21
//TESH.alwaysfold=0
//=============================================================================
// AoE Slow
// By: scorpion182
//
// Slows target enemies in AoE.
//
//
//
//
//
// Spell Requires: AoE Slow ability
// AoE Slow Dummy ability
// Dummy Caster Unit
//
//
// Implementation:
// Simply copy the forementioned requirements to your map, go through the
// options below and enjoy!
//=============================================================================
//Configuration Options:
//=============================================================================
constant function AS_AbilId takes nothing returns integer
return 'A003' // ability rawcode of AoE Slow ability
endfunction
constant function AS_Dummy_AbilId takes nothing returns integer
return 'A004' // ability rawcode of AoE Slow Dummy ability
endfunction
constant function DummyCaster takes nothing returns integer
return 'e000' // ability rawcode of Dummy Caster unit
endfunction
//Configuration end
//=============================================================================
function AS_Conditions takes nothing returns boolean
return( GetSpellAbilityId() ==AS_AbilId())
endfunction
function AS_Filter takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE))then//not effect on building
return false
endif
if(GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) <= 0)then//not effect on died unit
return false
endif
if(IsUnitAlly(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))then//only damage enemies
return false
endif
return true
endfunction
function AS_Main takes nothing returns nothing
local location loc=GetSpellTargetLoc()
local unit caster=GetTriggerUnit()
local unit dummy
local unit target=GetEnumUnit()
set dummy=CreateUnitAtLoc(GetOwningPlayer(caster),DummyCaster(),loc,bj_UNIT_FACING)
call UnitApplyTimedLife(dummy,'BTLF',0.5)
call UnitAddAbility(dummy,AS_Dummy_AbilId())
call SetUnitAbilityLevel(dummy,AS_Dummy_AbilId(),GetUnitAbilityLevel(caster,AS_AbilId()))
call IssueTargetOrder(dummy,"slow",target)
call RemoveLocation(loc)
set loc=null
set dummy=null
set target=null
set caster=null
endfunction
function Trig_AoE_Slow_Actions takes nothing returns nothing
local location loc=GetSpellTargetLoc()
local group grp
local boolexpr b=Condition(function AS_Filter)
set grp=CreateGroup()
call GroupEnumUnitsInRangeOfLoc(grp,loc,250., b)
call ForGroup(grp,function AS_Main)
call DestroyGroup(grp)
call DestroyBoolExpr(b)
call RemoveLocation(loc)
set grp=null
set b=null
set loc=null
endfunction
//===========================================================================
function InitTrig_AoE_Slow takes nothing returns nothing
set gg_trg_AoE_Slow = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_AoE_Slow , EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_AoE_Slow , Condition( function AS_Conditions ) )
call TriggerAddAction( gg_trg_AoE_Slow, function Trig_AoE_Slow_Actions )
endfunction