//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 1|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)
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_Preload_Ability_Actions takes nothing returns nothing
local unit dummy
set dummy=CreateUnit(Player(15),'e000',0,0,270) // 'e000'->rawcode of Dummy Caster unit
call UnitAddAbility(dummy,'A001') // 'A001'->ability rawcode of Broken Phantasm dummy ability
call RemoveUnit(dummy)
set dummy=null
endfunction
//===========================================================================
function InitTrig_Preload_Ability takes nothing returns nothing
set gg_trg_Preload_Ability = CreateTrigger( )
call TriggerAddAction( gg_trg_Preload_Ability, function Trig_Preload_Ability_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
//=============================================================================
// Broken Phantasm
// By: scorpion182
//
// Broken Phantasm consists of packing a Noble Phantasm with prana and making it
// explode when striking the target with it.
//
// Spell Requires: Broken Phantasm ability
// Slowed Broken Phantasm buff
// Broken Phantasm dummy ability
// Broken Phantasm dummy1 unit
// Broken Phantasm dummy2 unit
// Dummy Caster 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 BP_Dummy1 takes nothing returns integer
return 'h000' // rawcode of Broken Phantasm dummy1 unit
endfunction
constant function BP_Dummy2 takes nothing returns integer
return 'h001' // rawcode of Broken Phantasm dummy2 unit
endfunction
constant function BP_AbilId takes nothing returns integer
return 'A000' // ability rawcode of Broken Phantasm ability
endfunction
constant function BPDummy_AbilId takes nothing returns integer
return 'A001' // ability rawcode of Broken Phantasm dummy ability
endfunction
//Configuration end
//=============================================================================
//=============================================================================
//The Spell itself
//Don't Touch unless you know what you are doing!!
//=============================================================================
function BP_Con takes nothing returns boolean
return GetSpellAbilityId()==BP_AbilId()
endfunction
function Unit_Distance takes unit A,unit B returns real
return bj_RADTODEG*Atan2(GetUnitY(B)-GetUnitY(A),GetUnitX(B)-GetUnitX(A))
endfunction
function BP_Actions takes nothing returns nothing
local unit target=GetSpellTargetUnit()
local unit array dummy
local integer i=0
local integer array dummy_id
set dummy_id[0]=Dummy_Caster()
set dummy_id[1]=BP_Dummy1()
set dummy_id[2]=BP_Dummy2()
call TriggerSleepAction(Unit_Distance(GetTriggerUnit(),GetSpellTargetUnit())/2500)
loop
exitwhen i>2
set dummy[i]=CreateUnit(GetOwningPlayer(GetTriggerUnit()),dummy_id[i],GetUnitX(target),GetUnitY(target),270)
call UnitApplyTimedLife(dummy[i],'BTLF',2.0)
set i=i+1
endloop
call UnitAddAbility(dummy[0],BPDummy_AbilId())
call SetUnitAbilityLevel(dummy[0],BPDummy_AbilId(),GetUnitAbilityLevel(GetTriggerUnit(),BP_AbilId()))
call IssueImmediateOrder(dummy[0],"thunderclap")
set target=null
set dummy[0]=null
set dummy[1]=null
set dummy[2]=null
endfunction
//===========================================================================
function InitTrig_Broken_Phantasm takes nothing returns nothing
set gg_trg_Broken_Phantasm = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(gg_trg_Broken_Phantasm,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction( gg_trg_Broken_Phantasm, function BP_Actions )
call TriggerAddCondition(gg_trg_Broken_Phantasm,Condition(function BP_Con))
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
//=============================================================================
// Mamaragan
// By: scorpion182
//
// Creates a thunder storm showers lightning everywhere in target location,
// that deal massive damage.
//
//
// Spell Requires: Mamaragan ability
// Mamaragan dummy unit
//
//
// Implementation:
// Simply copy the forementioned requirements to your map, go through the
// options below and enjoy!
//=============================================================================
//Configuration Options:
//=============================================================================
constant function Mamaragan_Dummy takes nothing returns integer
return 'u000' // rawcode of Mamaragan Dummy unit
endfunction
constant function Mamaragan_AbilId takes nothing returns integer
return 'A002' // ability rawcode of Mamaragan ability
endfunction
constant function Mamaragan_Damage takes integer lvl returns integer
return 150 + ( 140 * lvl) // damage option
endfunction
//Configuration end
//=============================================================================
//=============================================================================
//The Spell itself
//Don't Touch unless you know what you are doing!!
//=============================================================================
function M_DamageFilter 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 M_DoDamage takes nothing returns nothing
local integer dmg=Mamaragan_Damage(GetUnitAbilityLevel(GetTriggerUnit(),Mamaragan_AbilId()))
call UnitDamageTarget(GetTriggerUnit(), GetEnumUnit(), I2R(dmg), true, false, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
endfunction
function Trig_Mamaragan_Conditions takes nothing returns boolean
return( GetSpellAbilityId() == Mamaragan_AbilId() )
endfunction
function Trig_Mamaragan_Actions takes nothing returns nothing
local location loc=GetSpellTargetLoc()
local unit caster=GetTriggerUnit()
local location loc2
local integer i=0
local unit dummy
local group grp
local real x = GetLocationX(loc)
local real y = GetLocationY(loc)
local rect r=Rect( x - 400.0*0.5, y - 400.*0.5, x + 400.*0.5, y + 400*0.5 )
local boolexpr b=Condition(function M_DamageFilter)
loop
exitwhen i>5
set loc2=Location(GetRandomReal(GetRectMinX(r), GetRectMaxX(r)), GetRandomReal(GetRectMinY(r), GetRectMaxY(r)))
set dummy=CreateUnitAtLoc(GetOwningPlayer(caster),Mamaragan_Dummy(),loc2,bj_UNIT_FACING)
call UnitApplyTimedLife(dummy,'BTLF',0.5)
call SetUnitPathing(dummy,false)
call SetUnitInvulnerable(dummy,true)
call RemoveLocation(loc2)
set loc2=null
set i=i+1
endloop
set grp=CreateGroup()
call GroupEnumUnitsInRangeOfLoc(grp,loc,400., b)
call ForGroup(grp,function M_DoDamage)
call DestroyGroup(grp)
call DestroyBoolExpr(b)
call RemoveLocation(loc)
call RemoveRect(r)
set b=null
set caster=null
set loc=null
set grp=null
set dummy=null
set r=null
endfunction
//===========================================================================
function InitTrig_Mamaragan takes nothing returns nothing
set gg_trg_Mamaragan = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Mamaragan, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Mamaragan, Condition( function Trig_Mamaragan_Conditions ) )
call TriggerAddAction( gg_trg_Mamaragan, function Trig_Mamaragan_Actions )
endfunction