Name | Type | is_array | initial_value |
AllUnits | group | No | |
Creep | unit | Yes | |
CreepLocation | location | No | |
DeadPhantomLocation | location | Yes | |
DispersionCasterLocation | location | No | |
DispersionDamageAmount | real | Yes | |
DispersionDamageFactor | real | Yes | |
DispersionTargetGroup | group | No | |
Hero | unit | No | |
HeroPanLocation | location | No | |
PhantomAttacker | unit | No | |
PhantomAttackerLocation | location | No | |
PhantomGroup | group | No | |
PhantomLocation | location | No | |
PhantomTarget | unit | No | |
PhantomTargetLocation | location | No | |
SoulDrainCaster | unit | Yes | |
SoulDrainCasterLocation | location | Yes | |
SoulDrainDamageAmount | real | No | |
UnitData | integer | No | |
VacantMana | real | No |
// ========================================================================================================================================
// **********************
// Spectre Spellpack v1.0
// By: AGD.Aloever91939
// **********************
// ========================================================================================================================================
//
// [Instructions]
//
// How to Import:
//
// 1. Copy the Custom Abilities
// 2. Copy the Variables
// 3. Copy the Triggers
//
// Note: Be sure to check "automatically create unknown variables when pasting trigger data" in the preference menu to avoid inconvenience.
//
// ========================================================================================================================================
//
// [Contents]
//
// The spells here aren't necessarilly the spells of Spectre in DotA.
// The spellpack includes the following spells:
//
// - Phantom Strike -
// Description:
// Gives 40 percent chance to create a phantom double which deals 15 percent of your damage and takes 400 percent damage.
// Level 1 - Phantom Duration: 0.75 seconds
// Level 2 - Phantom Duration: 1 second
// Level 3 - Phantom Duration: 1.25 second
// Level 4 - Phantom Duration: 1.5 seconds
// Level 5 - Phantom Duration: 1.75 seconds
// Level 6 - Phantom Duration: 2 seconds
// Phantom Limit: 5
//
// - Soul Drain -
// Description:
// Mercurial's attacks drain the target's energy, causing it to lose mana points. Targets take additional damage equal to 20 percent of their missing mana. If the target's mana points is equal or below 40 percent of its maximum mana points, it will be stunned for a certain duration. If the target's mana pool is empty, it will take additional damage equal to its mana pool capacity.
// Level 1 - Drains 2 mana points.
// Level 2 - Drains 3 mana points.
// Level 3 - Drains 4 mana points.
// Level 4 - Drains 5 mana points.
// Level 5 - Drains 6 mana points.
// If the target's mana is equal or below 40 percent of its maximum mana pool, it will be stunned for 0.1/0.15/0.2/0.25/0.3 seconds.
//
// - Dispersion -
// Description:
// Mercurial is able to lessen the damage she recieves by sharing a portion of the damage she takes to enemy units within 2000 AOE.
// Level 1 - Reflects 20 percent of damage taken.
// Level 2 - Reflects 28 percent of damage taken.
// Level 3 - Reflects 36 percent of damage taken.
// Level 4 - Reflects 44 percent of damage taken.
// Level 5 - Reflects 52 percent of damage taken.
//
// ========================================================================================================================================
//****************************************************//
//** **//
//** This is just a dummy function, albeit required **//
//** **//
//****************************************************//
//******************************************************************//
//* *//
function InitTrig_How_to_Import takes nothing returns nothing
endfunction
//* *//
//******************************************************************//
// ========================================================================================================================================
function Trig_AddHero_Conditions takes nothing returns boolean
if ( not ( GetLearnedSkillBJ() == 'A000' ) ) then
return false
endif
return true
endfunction
function Trig_AddHero_Actions takes nothing returns nothing
call TriggerRegisterUnitEvent( gg_trg_DispersionEffect, GetLearningUnit(), EVENT_UNIT_DAMAGED )
call DestroyTrigger (GetTriggeringTrigger())
endfunction
//===========================================================================
function InitTrig_AddHero takes nothing returns nothing
set gg_trg_AddHero = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_AddHero, EVENT_PLAYER_HERO_SKILL )
call TriggerAddCondition( gg_trg_AddHero, Condition( function Trig_AddHero_Conditions ) )
call TriggerAddAction( gg_trg_AddHero, function Trig_AddHero_Actions )
endfunction
function Trig_AddPhantoms_Func003C takes nothing returns boolean
if ( not ( IsUnitIllusionBJ(GetEnteringUnit()) == true ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'E000' ) ) then
return false
endif
return true
endfunction
function Trig_AddPhantoms_Actions takes nothing returns nothing
set udg_UnitData = ( udg_UnitData + 1 )
call SetUnitUserData( GetEnteringUnit(), udg_UnitData )
if ( Trig_AddPhantoms_Func003C() ) then
call TriggerRegisterUnitEvent( gg_trg_DispersionEffect, GetEnteringUnit(), EVENT_UNIT_DAMAGED )
else
call DoNothing( )
endif
endfunction
//===========================================================================
function InitTrig_AddPhantoms takes nothing returns nothing
set gg_trg_AddPhantoms = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_AddPhantoms, GetPlayableMapRect() )
call TriggerAddAction( gg_trg_AddPhantoms, function Trig_AddPhantoms_Actions )
endfunction
function Trig_DispersionEffect_Conditions takes nothing returns boolean
if ( not ( UnitHasBuffBJ(GetTriggerUnit(), 'B000') == true ) ) then
return false
endif
return true
endfunction
function Trig_DispersionEffect_Func007Func001C takes nothing returns boolean
if ( not ( GetEnumUnit() != GetTriggerUnit() ) ) then
return false
endif
if ( not ( IsUnitAliveBJ(GetEnumUnit()) == true ) ) then
return false
endif
if ( not ( IsUnitEnemy(GetEnumUnit(), GetOwningPlayer(GetTriggerUnit())) == true ) ) then
return false
endif
return true
endfunction
function Trig_DispersionEffect_Func007A takes nothing returns nothing
if ( Trig_DispersionEffect_Func007Func001C() ) then
call UnitDamageTargetBJ( GetTriggerUnit(), GetEnumUnit(), udg_DispersionDamageAmount[GetUnitUserData(GetTriggerUnit())], ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
call AddSpecialEffectTargetUnitBJ( "overhead", GetEnumUnit(), "Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayDamage.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
else
call DoNothing( )
endif
endfunction
function Trig_DispersionEffect_Actions takes nothing returns nothing
set udg_DispersionDamageFactor[GetUnitUserData(GetTriggerUnit())] = ( ( 12.00 + ( I2R(GetUnitAbilityLevelSwapped('A000', GetTriggerUnit())) * 8.00 ) ) / 100.00 )
set udg_DispersionDamageAmount[GetUnitUserData(GetTriggerUnit())] = ( GetEventDamage() * udg_DispersionDamageFactor[GetUnitUserData(GetTriggerUnit())] )
set udg_DispersionCasterLocation = GetUnitLoc(GetTriggerUnit())
set udg_DispersionTargetGroup = GetUnitsInRangeOfLocAll(1000.00, udg_DispersionCasterLocation)
call SetUnitLifeBJ( GetTriggerUnit(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetTriggerUnit()) + udg_DispersionDamageAmount[GetUnitUserData(GetTriggerUnit())] ) )
call ForGroupBJ( udg_DispersionTargetGroup, function Trig_DispersionEffect_Func007A )
call RemoveLocation(udg_DispersionCasterLocation)
call DestroyGroup (udg_DispersionTargetGroup)
endfunction
//===========================================================================
function InitTrig_DispersionEffect takes nothing returns nothing
set gg_trg_DispersionEffect = CreateTrigger( )
call TriggerAddCondition( gg_trg_DispersionEffect, Condition( function Trig_DispersionEffect_Conditions ) )
call TriggerAddAction( gg_trg_DispersionEffect, function Trig_DispersionEffect_Actions )
endfunction
function Trig_PhantomStrikeSetup_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A002', GetAttacker()) > 0 ) ) then
return false
endif
if ( not ( GetRandomInt(1, 5) <= 2 ) ) then
return false
endif
return true
endfunction
function Trig_PhantomStrikeSetup_Func006002003001 takes nothing returns boolean
return ( IsUnitIllusionBJ(GetFilterUnit()) == true )
endfunction
function Trig_PhantomStrikeSetup_Func006002003002001 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_PhantomStrikeSetup_Func006002003002002 takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == 'E000' )
endfunction
function Trig_PhantomStrikeSetup_Func006002003002 takes nothing returns boolean
return GetBooleanAnd( Trig_PhantomStrikeSetup_Func006002003002001(), Trig_PhantomStrikeSetup_Func006002003002002() )
endfunction
function Trig_PhantomStrikeSetup_Func006002003 takes nothing returns boolean
return GetBooleanAnd( Trig_PhantomStrikeSetup_Func006002003001(), Trig_PhantomStrikeSetup_Func006002003002() )
endfunction
function Trig_PhantomStrikeSetup_Func007Func004C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A002', GetAttacker()) == 1 ) ) then
return false
endif
return true
endfunction
function Trig_PhantomStrikeSetup_Func007Func005C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A002', GetAttacker()) == 2 ) ) then
return false
endif
return true
endfunction
function Trig_PhantomStrikeSetup_Func007Func006C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A002', GetAttacker()) == 3 ) ) then
return false
endif
return true
endfunction
function Trig_PhantomStrikeSetup_Func007Func007C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A002', GetAttacker()) == 4 ) ) then
return false
endif
return true
endfunction
function Trig_PhantomStrikeSetup_Func007Func008C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A002', GetAttacker()) == 5 ) ) then
return false
endif
return true
endfunction
function Trig_PhantomStrikeSetup_Func007Func009C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A002', GetAttacker()) == 6 ) ) then
return false
endif
return true
endfunction
function Trig_PhantomStrikeSetup_Func007C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_PhantomGroup) < 5 ) ) then
return false
endif
return true
endfunction
function Trig_PhantomStrikeSetup_Actions takes nothing returns nothing
set udg_PhantomAttacker = GetAttacker()
set udg_PhantomAttackerLocation = GetUnitLoc(udg_PhantomAttacker)
set udg_PhantomTarget = GetAttackedUnitBJ()
set udg_PhantomTargetLocation = GetUnitLoc(udg_PhantomTarget)
set udg_PhantomLocation = PolarProjectionBJ(udg_PhantomTargetLocation, DistanceBetweenPoints(udg_PhantomAttackerLocation, udg_PhantomTargetLocation), GetRandomDirectionDeg())
set udg_PhantomGroup = GetUnitsInRangeOfLocMatching(1000000000.00, udg_PhantomAttackerLocation, Condition(function Trig_PhantomStrikeSetup_Func006002003))
if ( Trig_PhantomStrikeSetup_Func007C() ) then
if ( Trig_PhantomStrikeSetup_Func007Func004C() ) then
call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(udg_PhantomAttacker), udg_PhantomAttackerLocation, bj_UNIT_FACING )
call UnitAddItemByIdSwapped( 'I001', GetLastCreatedUnit() )
call UnitUseItemTarget( GetLastCreatedUnit(), GetLastCreatedItem(), udg_PhantomAttacker )
call RemoveItem( GetLastCreatedItem() )
call UnitApplyTimedLifeBJ( 0.50, 'BTLF', GetLastCreatedUnit() )
else
call DoNothing( )
endif
if ( Trig_PhantomStrikeSetup_Func007Func005C() ) then
call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(udg_PhantomAttacker), udg_PhantomAttackerLocation, bj_UNIT_FACING )
call UnitAddItemByIdSwapped( 'I002', GetLastCreatedUnit() )
call UnitUseItemTarget( GetLastCreatedUnit(), GetLastCreatedItem(), udg_PhantomAttacker )
call RemoveItem( GetLastCreatedItem() )
call UnitApplyTimedLifeBJ( 0.50, 'BTLF', GetLastCreatedUnit() )
else
call DoNothing( )
endif
if ( Trig_PhantomStrikeSetup_Func007Func006C() ) then
call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(udg_PhantomAttacker), udg_PhantomAttackerLocation, bj_UNIT_FACING )
call UnitAddItemByIdSwapped( 'I003', GetLastCreatedUnit() )
call UnitUseItemTarget( GetLastCreatedUnit(), GetLastCreatedItem(), udg_PhantomAttacker )
call RemoveItem( GetLastCreatedItem() )
call UnitApplyTimedLifeBJ( 0.50, 'BTLF', GetLastCreatedUnit() )
else
call DoNothing( )
endif
if ( Trig_PhantomStrikeSetup_Func007Func007C() ) then
call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(udg_PhantomAttacker), udg_PhantomAttackerLocation, bj_UNIT_FACING )
call UnitAddItemByIdSwapped( 'I004', GetLastCreatedUnit() )
call UnitUseItemTarget( GetLastCreatedUnit(), GetLastCreatedItem(), udg_PhantomAttacker )
call RemoveItem( GetLastCreatedItem() )
call UnitApplyTimedLifeBJ( 0.50, 'BTLF', GetLastCreatedUnit() )
else
call DoNothing( )
endif
if ( Trig_PhantomStrikeSetup_Func007Func008C() ) then
call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(udg_PhantomAttacker), udg_PhantomAttackerLocation, bj_UNIT_FACING )
call UnitAddItemByIdSwapped( 'I005', GetLastCreatedUnit() )
call UnitUseItemTarget( GetLastCreatedUnit(), GetLastCreatedItem(), udg_PhantomAttacker )
call RemoveItem( GetLastCreatedItem() )
call UnitApplyTimedLifeBJ( 0.50, 'BTLF', GetLastCreatedUnit() )
else
call DoNothing( )
endif
if ( Trig_PhantomStrikeSetup_Func007Func009C() ) then
call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(udg_PhantomAttacker), udg_PhantomAttackerLocation, bj_UNIT_FACING )
call UnitAddItemByIdSwapped( 'I000', GetLastCreatedUnit() )
call UnitUseItemTarget( GetLastCreatedUnit(), GetLastCreatedItem(), udg_PhantomAttacker )
call RemoveItem( GetLastCreatedItem() )
call UnitApplyTimedLifeBJ( 0.50, 'BTLF', GetLastCreatedUnit() )
else
call DoNothing( )
endif
call RemoveLocation (udg_PhantomAttackerLocation)
call RemoveLocation (udg_PhantomTargetLocation)
call DestroyGroup (udg_PhantomGroup)
else
call RemoveLocation (udg_PhantomAttackerLocation)
call RemoveLocation (udg_PhantomTargetLocation)
call DestroyGroup (udg_PhantomGroup)
endif
call RemoveLocation (udg_PhantomAttackerLocation)
call RemoveLocation (udg_PhantomTargetLocation)
call DestroyGroup (udg_PhantomGroup)
endfunction
//===========================================================================
function InitTrig_PhantomStrikeSetup takes nothing returns nothing
set gg_trg_PhantomStrikeSetup = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_PhantomStrikeSetup, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_PhantomStrikeSetup, Condition( function Trig_PhantomStrikeSetup_Conditions ) )
call TriggerAddAction( gg_trg_PhantomStrikeSetup, function Trig_PhantomStrikeSetup_Actions )
endfunction
function Trig_PhantomPositioning_Conditions takes nothing returns boolean
if ( not ( IsUnitIllusionBJ(GetSummonedUnit()) == true ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetSummonedUnit()) == 'E000' ) ) then
return false
endif
return true
endfunction
function Trig_PhantomPositioning_Actions takes nothing returns nothing
call SetUnitPositionLoc( GetSummonedUnit(), udg_PhantomLocation )
call SetUnitPathing( GetSummonedUnit(), false )
call IssueTargetOrderBJ( GetSummonedUnit(), "attack", udg_PhantomTarget )
call RemoveLocation (udg_PhantomLocation)
set udg_PhantomTarget = null
endfunction
//===========================================================================
function InitTrig_PhantomPositioning takes nothing returns nothing
set gg_trg_PhantomPositioning = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_PhantomPositioning, EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( gg_trg_PhantomPositioning, Condition( function Trig_PhantomPositioning_Conditions ) )
call TriggerAddAction( gg_trg_PhantomPositioning, function Trig_PhantomPositioning_Actions )
endfunction
function Trig_PhantomDeathAnimation_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'E000' ) ) then
return false
endif
return true
endfunction
function Trig_PhantomDeathAnimation_Actions takes nothing returns nothing
set udg_DeadPhantomLocation[GetUnitUserData(GetDyingUnit())] = GetUnitLoc(GetDyingUnit())
call AddSpecialEffectLocBJ( udg_DeadPhantomLocation[GetUnitUserData(GetDyingUnit())], "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveLocation (udg_DeadPhantomLocation[GetUnitUserData(GetDyingUnit())])
endfunction
//===========================================================================
function InitTrig_PhantomDeathAnimation takes nothing returns nothing
set gg_trg_PhantomDeathAnimation = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_PhantomDeathAnimation, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_PhantomDeathAnimation, Condition( function Trig_PhantomDeathAnimation_Conditions ) )
call TriggerAddAction( gg_trg_PhantomDeathAnimation, function Trig_PhantomDeathAnimation_Actions )
endfunction
function Trig_SoulDrainSetup_Actions takes nothing returns nothing
call TriggerRegisterUnitEvent( gg_trg_SoulDrainEffect, GetEnteringUnit(), EVENT_UNIT_DAMAGED )
endfunction
//===========================================================================
function InitTrig_SoulDrainSetup takes nothing returns nothing
set gg_trg_SoulDrainSetup = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_SoulDrainSetup, GetPlayableMapRect() )
call TriggerAddAction( gg_trg_SoulDrainSetup, function Trig_SoulDrainSetup_Actions )
endfunction
function Trig_SoulDrainEffect_Func002C takes nothing returns boolean
if ( ( GetUnitAbilityLevelSwapped('A008', GetEventDamageSource()) == 1 ) ) then
return true
endif
if ( ( GetUnitAbilityLevelSwapped('A008', GetEventDamageSource()) == 2 ) ) then
return true
endif
if ( ( GetUnitAbilityLevelSwapped('A008', GetEventDamageSource()) == 3 ) ) then
return true
endif
if ( ( GetUnitAbilityLevelSwapped('A008', GetEventDamageSource()) == 4 ) ) then
return true
endif
if ( ( GetUnitAbilityLevelSwapped('A008', GetEventDamageSource()) == 5 ) ) then
return true
endif
return false
endfunction
function Trig_SoulDrainEffect_Conditions takes nothing returns boolean
if ( not ( GetUnitStateSwap(UNIT_STATE_MAX_MANA, GetTriggerUnit()) > 0.00 ) ) then
return false
endif
if ( not Trig_SoulDrainEffect_Func002C() ) then
return false
endif
return true
endfunction
function Trig_SoulDrainEffect_Func010001 takes nothing returns boolean
return ( GetUnitManaPercent(GetTriggerUnit()) <= 40.00 )
endfunction
function Trig_SoulDrainEffect_Func011C takes nothing returns boolean
if ( not ( GetUnitStateSwap(UNIT_STATE_MANA, GetTriggerUnit()) <= ( I2R(GetUnitAbilityLevelSwapped('A008', udg_SoulDrainCaster[GetUnitUserData(GetEventDamageSource())])) + 1 ) ) ) then
return false
endif
return true
endfunction
function Trig_SoulDrainEffect_Actions takes nothing returns nothing
set udg_SoulDrainCaster[GetUnitUserData(GetEventDamageSource())] = GetEventDamageSource()
set udg_SoulDrainCasterLocation[GetUnitUserData(GetEventDamageSource())] = GetUnitLoc(udg_SoulDrainCaster[GetUnitUserData(GetEventDamageSource())])
set udg_VacantMana = ( GetUnitStateSwap(UNIT_STATE_MAX_MANA, GetTriggerUnit()) - GetUnitStateSwap(UNIT_STATE_MANA, GetTriggerUnit()) )
set udg_SoulDrainDamageAmount = ( udg_VacantMana * 0.20 )
call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(udg_SoulDrainCaster[GetUnitUserData(GetEventDamageSource())]), udg_SoulDrainCasterLocation[GetUnitUserData(GetEventDamageSource())], bj_UNIT_FACING )
call RemoveLocation (udg_SoulDrainCasterLocation[GetUnitUserData(GetEventDamageSource())])
call UnitAddAbilityBJ( 'A009', GetLastCreatedUnit() )
if ( Trig_SoulDrainEffect_Func010001() ) then
call SetUnitAbilityLevelSwapped( 'A009', GetLastCreatedUnit(), ( GetUnitAbilityLevelSwapped('A008', udg_SoulDrainCaster[GetUnitUserData(GetEventDamageSource())]) + 1 ) )
else
call DoNothing( )
endif
if ( Trig_SoulDrainEffect_Func011C() ) then
call UnitDamageTargetBJ( GetLastCreatedUnit(), GetTriggerUnit(), udg_VacantMana, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call AddSpecialEffectTargetUnitBJ( "chest", GetTriggerUnit(), "Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
else
call DoNothing( )
endif
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", GetTriggerUnit() )
call UnitDamageTargetBJ( GetLastCreatedUnit(), GetTriggerUnit(), udg_SoulDrainDamageAmount, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call RemoveUnit( GetLastCreatedUnit() )
set udg_SoulDrainCaster[GetUnitUserData(GetEventDamageSource())] = null
endfunction
//===========================================================================
function InitTrig_SoulDrainEffect takes nothing returns nothing
set gg_trg_SoulDrainEffect = CreateTrigger( )
call TriggerAddCondition( gg_trg_SoulDrainEffect, Condition( function Trig_SoulDrainEffect_Conditions ) )
call TriggerAddAction( gg_trg_SoulDrainEffect, function Trig_SoulDrainEffect_Actions )
endfunction