//---------Geting Angle b/w two point usefull in hero
//----going backwards after recieving attack
function MyFuncAngle takes real Angle returns real
if ( Angle<= 0.00 ) then
set Angle = ( RAbsBJ(( 360.00 + Angle )) + 1 )
endif
return Angle
endfunction
// Hid and Remove a hero after some time
function MyFuncRemoveHero takes unit Hero returns nothing
call ShowUnitHide( Hero )
call SetUnitOwner( Hero , Player(PLAYER_NEUTRAL_PASSIVE), true )
call TriggerSleepAction( 2.00 )
call RemoveUnit( Hero )
endfunction
function WhenToStopPursue takes unit Hero returns boolean
if ( not ( GetUnitUserData(Hero) != 911 ) ) then
return false
endif
if ( not ( GetUnitUserData(Hero) != 401 ) ) then
return false
endif
if ( not ( GetUnitUserData(Hero) != 301 ) ) then
return false
endif
if ( not ( GetUnitStateSwap(UNIT_STATE_LIFE, Hero) >= 500.00 ) ) then
return false
endif
return true
endfunction
function MyFuncToAttackAndPursue takes unit Hero , unit Target returns nothing
if ( WhenToStopPursue ( Hero ) ) then
call TriggerSleepAction( 2 )
call MyFuncToAttackAndPursue ( Hero , Target)
else
return
endif
call IssueTargetOrderBJ( Hero, "attack", Target )
if ( IsUnitAliveBJ( Target ) != true ) then
return
endif
endfunction
function IsHeroAvailability takes integer Hero returns boolean
set bj_forLoopAIndex = 5
set bj_forLoopAIndexEnd = 18
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( udg_TargetUnitType[bj_forLoopAIndex ] == Hero )then
if ( udg_HeroAvailability[ GetForLoopIndexA() ]== true) then
set udg_HeroAvailability[ GetForLoopIndexA() ] = false
return true
else
return false
endif
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
return false
endfunction
//--------------------------FaLLeN------------------------
//-------------For comp player item creation --------------
// below func uses string extraction tech to extract cost from name of item.
// like - Armour of berzerker -2500 ( 2500 is cost) '- ' determine extraction point
// have to use this tech till i come up with something better
// some times have used global variable.
//it s just to avoid local variable creation.
// although it can cause severe conflict if two different funtion use them.
// which i find unlikely-- learn more about memory leak..
//---------------------------FaLLeN-------------------------
function MyFuncItemCost takes string ITEM returns integer
local integer StrLength
local string SubStr
local integer Gold
set StrLength = StringLength( ITEM )
set ITEM = SubStringBJ( ITEM , ( StrLength - 5 ), StrLength)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = StrLength
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set SubStr = SubStringBJ(ITEM, GetForLoopIndexA(), GetForLoopIndexA())
if ( SubStr == "-" ) then
set ITEM = SubStringBJ(ITEM, GetForLoopIndexA() + 1, StrLength)
set Gold = S2I(ITEM)
return Gold
else
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
return 0
endfunction
function MyFuncHeroFreeSlot takes unit TargetHero returns integer
local integer I
set I = 0
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( UnitHasItemOfTypeBJ( TargetHero , GetItemTypeId(UnitItemInSlotBJ( TargetHero ,bj_forLoopAIndex)) )== true ) then
else
set I = ( I + 1 )
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
return I
endfunction
function MyFuncMakeSlot takes unit TargetHero returns integer
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( GetItemType(UnitItemInSlotBJ(TargetHero ,bj_forLoopAIndex )) == ITEM_TYPE_CHARGED ) then
call RemoveItem(UnitItemInSlotBJ(TargetHero ,bj_forLoopAIndex ))
return 1
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
return 0
endfunction
function MyFuncItemName takes integer ITEM returns string
local string Str
call CreateItemLoc( ITEM, GetRectCenter(GetPlayableMapRect()) )
set Str = GetItemName(GetLastCreatedItem())
call RemoveItem(GetLastCreatedItem())
return Str
endfunction
function MyFuncHalfPrice takes unit Hero, integer ITEM returns integer //unit Hero , i returns integer
local string String
local item HeroSlotItem // Hero's slot item can be any thing
local item ItemHeroHave // item which is of same type
local integer ItemToSellFlag
local itemtype ItemType
local integer ItemLevel //like armour or weapon which can be sold
local integer GoldAvailable // After selling armour of same type + current gold
local integer PlayerGold
local integer costOfItem // gold required to buy item
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6 // 6 slots for item for hero
// creating an item of type which need to bought
call CreateItemLoc( ITEM, GetRectCenter(GetPlayableMapRect()) )
set String = GetItemName( GetLastCreatedItem() )
set ItemType = GetItemType( GetLastCreatedItem() )
set ItemLevel = GetItemLevel( GetLastCreatedItem() )
call RemoveItem(GetLastCreatedItem())
// only for comparision inside for loop after which it is destroyed
set GoldAvailable = 0
set ItemToSellFlag = 0 // to check if any item to sell found
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd // exit cond
// getting slot item . say like in slot1 , slot2 ... as loop inc
set HeroSlotItem =UnitItemInSlotBJ(Hero, bj_forLoopAIndex )
if ( ItemType == GetItemType(HeroSlotItem) ) then
if( GetItemLevel(HeroSlotItem ) == ItemLevel ) then
set String = GetItemName(UnitItemInSlotBJ(Hero, bj_forLoopAIndex )) // getting name of item
set GoldAvailable = MyFuncItemCost ( String )
set ItemHeroHave = HeroSlotItem
set ItemToSellFlag = 1
else
endif
else
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set PlayerGold = GetPlayerState(GetOwningPlayer(Hero),PLAYER_STATE_RESOURCE_GOLD)
set GoldAvailable = (GoldAvailable) / 2 + PlayerGold
//call DisplayTextToForce( GetPlayersAll(),GetItemName( ItemHeroHave ) )
//call DisplayTextToForce( GetPlayersAll(), I2S( GoldAvailable ) )
set costOfItem = MyFuncItemCost ( String )
//call DisplayTextToForce( GetPlayersAll(), I2S( GoldAvailable ) )
// call DisplayTextToForce( GetPlayersAll(), I2S( costOfItem ) )
//---- Identation(Space) is very important dont mess it upp---Write beautifully
if (GoldAvailable > costOfItem ) then // not very complicated first check item is affordable
// after selling same type of item
if (ItemToSellFlag == 1) then
call RemoveItem( ItemHeroHave )
set GoldAvailable = GoldAvailable - costOfItem
// call SetPlayerStateBJ( GetOwningPlayer( Hero ), PLAYER_STATE_RESOURCE_GOLD, GoldAvailable )
// call DisplayTextToForce( GetPlayersAll(), I2S( GoldAvailable ) )
// call DisplayTextToForce( GetPlayersAll(), "Item Sold to get " )
//call DisplayTextToForce( GetPlayersAll(),GetItemName( ItemHeroHave ) )
// call DisplayTextToForce( GetPlayersAll(),GetItemName( LastCreated ) )
call SetPlayerStateBJ( GetOwningPlayer( Hero ), PLAYER_STATE_RESOURCE_GOLD, ( GoldAvailable ) )
return GoldAvailable
else
if( MyFuncHeroFreeSlot( Hero )==0) then // check whether slot space is here for hero
if( MyFuncMakeSlot( Hero ) ==0 ) then // if not sell chargend item
return 0
else
set GoldAvailable = (GoldAvailable) - costOfItem
// call SetPlayerStateBJ( GetOwningPlayer( Hero ), PLAYER_STATE_RESOURCE_GOLD, GoldAvailable )
// call DisplayTextToForce( GetPlayersAll(), "Space is not there but made" )
// call DisplayTextToForce( GetPlayersAll(), I2S( GoldAvailable ) )
call SetPlayerStateBJ( GetOwningPlayer( Hero ), PLAYER_STATE_RESOURCE_GOLD, ( GoldAvailable ) )
return GoldAvailable
endif
else
set GoldAvailable = (GoldAvailable) - costOfItem
// call SetPlayerStateBJ( GetOwningPlayer( Hero ), PLAYER_STATE_RESOURCE_GOLD, GoldAvailable )
// call DisplayTextToForce( GetPlayersAll(), "Space is there but made" + I2S( MyFuncHeroFreeSlot( Hero )) )
// call DisplayTextToForce( GetPlayersAll(), I2S( GoldAvailable ) )
call SetPlayerStateBJ( GetOwningPlayer( Hero ), PLAYER_STATE_RESOURCE_GOLD, ( GoldAvailable ) )
return GoldAvailable
endif
endif
else
return 0
endif
endfunction
//===========================================================================
function MyFuncRogueDamage takes unit Hero , unit RogueVictim ,integer Critical , real Damage returns nothing
local boolean Steal
local integer Agility
local integer num
local integer AgilityBonus
local integer CriticalChance
local integer Gold
local integer CustomValue
local real DamageToBeDone
local real DamageReduction
local real DamageReductionPierce
local real DamageReductionHero
local real LifeBeforeAttack
local real LifeAfterAttack
local real FacingAngleOfVictim
local real TotalDamage
call TriggerSleepAction( 0.01 )
if ( IsUnitAliveBJ( RogueVictim ) != true ) then
return
endif
//call DisplayTextToForce( GetPlayersAll(), R2S(GetUnitStateSwap(UNIT_STATE_LIFE, RogueVictim)) )
call SetUnitLifeBJ( GetTriggerUnit(), ( GetUnitStateSwap(UNIT_STATE_LIFE, RogueVictim ) + Damage ) )
//call DisplayTextToForce( GetPlayersAll(), R2S(GetUnitStateSwap(UNIT_STATE_LIFE, RogueVictim)) )
set CustomValue = GetUnitUserData(Hero )
call SetUnitUserData( Hero ,420 )
//call DisplayTextToForce( GetPlayersAll(), R2S( Critical ))
set Steal = false
set Agility = GetHeroStatBJ(bj_HEROSTAT_AGI, Hero, true)
set AgilityBonus = (Agility - GetHeroStatBJ(bj_HEROSTAT_AGI, Hero, false))
// Num is for Getting attack bonus from agility
// Determining Damage reduction for Pierce attack
set LifeBeforeAttack = GetUnitStateSwap(UNIT_STATE_LIFE, RogueVictim)
call UnitDamageTargetBJ(Hero, RogueVictim, 50.0, ATTACK_TYPE_PIERCE, DAMAGE_TYPE_NORMAL)
set LifeAfterAttack = GetUnitStateSwap(UNIT_STATE_LIFE, RogueVictim)
set DamageReductionPierce = (LifeBeforeAttack - LifeAfterAttack)
set DamageReductionPierce = (DamageReductionPierce / 50.0)
call SetUnitLifeBJ(RogueVictim, LifeBeforeAttack)
// Determining Damage reduction for Hero Attack
set LifeBeforeAttack = GetUnitStateSwap(UNIT_STATE_LIFE, RogueVictim)
call UnitDamageTargetBJ(Hero, RogueVictim, 50.0, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL)
set LifeAfterAttack = GetUnitStateSwap(UNIT_STATE_LIFE, RogueVictim)
set DamageReductionHero = (LifeBeforeAttack - LifeAfterAttack)
set DamageReductionHero = ( DamageReductionHero / 50.0)
call SetUnitLifeBJ(RogueVictim, LifeBeforeAttack)
set DamageReductionHero = 1 - DamageReductionHero
set DamageReductionPierce = 1 - DamageReductionPierce
//call DisplayTextToForce( GetPlayersAll(), R2S( Damage ) )
set DamageToBeDone = Damage + Damage* DamageReductionHero
//call DisplayTextToForce( GetPlayersAll(), R2S( DamageToBeDone ) )
if(Critical >= 1 ) then
// Pierce Damage .6 times normal and hero .4 times i.e ( 60 % pierce and 40 % hero )
set DamageToBeDone = Damage + Damage* DamageReductionHero
set DamageToBeDone = DamageToBeDone * 0.6
// Critical damge = 2 times normal damage
set DamageToBeDone = DamageToBeDone * Critical
call UnitDamageTargetBJ(Hero, RogueVictim, DamageToBeDone , ATTACK_TYPE_PIERCE, DAMAGE_TYPE_NORMAL)
set DamageToBeDone = DamageToBeDone - DamageToBeDone * DamageReductionPierce
if (DamageToBeDone < 0 ) then
set DamageToBeDone =DamageToBeDone * -1
endif
call CreateTextTagUnitBJ(I2S(R2I(DamageToBeDone)), RogueVictim, 0, 25.0, 100.0, 100.0, 0.0, 0.0)
call SetTextTagPermanentBJ(GetLastCreatedTextTag(), false)
call SetTextTagVelocityBJ(GetLastCreatedTextTag(), 60.0, GetRandomReal(0.0, 70.0))
call SetTextTagLifespanBJ(GetLastCreatedTextTag(), 1.0)
call SetTextTagFadepointBJ(GetLastCreatedTextTag(), 3.0)
set DamageToBeDone = Damage + Damage* DamageReductionHero
set DamageToBeDone =(DamageToBeDone * 0.4)
set DamageToBeDone = DamageToBeDone * I2R(Critical)
call UnitDamageTargetBJ(Hero, RogueVictim, (DamageToBeDone), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL)
set DamageToBeDone = (DamageToBeDone - (((DamageToBeDone) * DamageReductionHero)))
if (DamageToBeDone < 0 ) then
set DamageToBeDone =DamageToBeDone * -1
endif
call CreateTextTagUnitBJ(I2S(R2I(DamageToBeDone)), RogueVictim, 0, 25.0, 100.0, 100.0, 0.0, 0.0)
call SetTextTagPermanentBJ(GetLastCreatedTextTag(), false)
call SetTextTagVelocityBJ(GetLastCreatedTextTag(), 60.0, GetRandomReal(90.0, 160.0))
call SetTextTagLifespanBJ(GetLastCreatedTextTag(), 1.0)
call SetTextTagFadepointBJ(GetLastCreatedTextTag(), 3.0)
set Steal = true
else
set CriticalChance = (Agility / 4)
set CriticalChance = (100 - CriticalChance)
// Determining Agility Bonus for Critical chance
// every 4 agility increase chance by 1
// backStab When Not Looking
set FacingAngleOfVictim = GetUnitFacing(RogueVictim)
if (FacingAngleOfVictim <= 0.0) then
set FacingAngleOfVictim = (FacingAngleOfVictim + 360.0)
else
endif
// simple critical damage when attacking from back or due to critical chance
// intVar is for determining critical chance
if (GetBooleanOr(GetRandomInt(1, 100) >= CriticalChance,GetBooleanAnd(GetUnitFacing(Hero) >= (FacingAngleOfVictim - 30.0), GetUnitFacing(Hero) <= (FacingAngleOfVictim + 30.0)))) then
// conversion of int to real then real to int since udgDamage is integer multiplyig it with .6 results 0
set DamageToBeDone = Damage + Damage* DamageReductionHero
set DamageToBeDone = ((DamageToBeDone) * 0.6)
// Critical damge = 2 times normal damage
set DamageToBeDone = (DamageToBeDone * 2)
if (IsUnitIllusionBJ(Hero) != true ) then
call UnitDamageTargetBJ(Hero, RogueVictim, (DamageToBeDone), ATTACK_TYPE_PIERCE, DAMAGE_TYPE_NORMAL)
else
endif
set DamageToBeDone = (DamageToBeDone - (((DamageToBeDone) * DamageReductionPierce)))
if (DamageToBeDone < 0 ) then
set DamageToBeDone =DamageToBeDone * -1
endif
call CreateTextTagUnitBJ(I2S(R2I(DamageToBeDone)), RogueVictim, 0, 25.0, 100.0, 100.0, 0.0, 0.0)
call SetTextTagPermanentBJ(GetLastCreatedTextTag(), false)
call SetTextTagVelocityBJ(GetLastCreatedTextTag(), 60.0, GetRandomReal(0.0, 70.0))
call SetTextTagLifespanBJ(GetLastCreatedTextTag(), 1.0)
call SetTextTagFadepointBJ(GetLastCreatedTextTag(), 3.0)
set Steal = true
else
set DamageToBeDone = Damage + Damage* DamageReductionHero
set DamageToBeDone = ((DamageToBeDone) * 0.6)
// Checking if Rogue Illusions are attacking
call UnitDamageTargetBJ(Hero, RogueVictim, (DamageToBeDone), ATTACK_TYPE_PIERCE, DAMAGE_TYPE_NORMAL)
set DamageToBeDone = (DamageToBeDone - (((DamageToBeDone) * DamageReductionPierce)))
if (DamageToBeDone < 0 ) then
set DamageToBeDone =DamageToBeDone * -1
endif
call CreateTextTagUnitBJ(I2S(R2I(DamageToBeDone)), RogueVictim, 0, 13.0, 0.0, 0.0, GetRandomReal(50.0, 100.0), 0.0)
call SetTextTagPermanentBJ(GetLastCreatedTextTag(), false)
call SetTextTagVelocityBJ(GetLastCreatedTextTag(), 60.0, GetRandomReal(0.0, 70.0))
call SetTextTagLifespanBJ(GetLastCreatedTextTag(), 1.0)
call SetTextTagFadepointBJ(GetLastCreatedTextTag(), 3.0)
endif
if (GetBooleanOr(GetRandomInt(1, 100) >= CriticalChance,GetBooleanAnd(GetUnitFacing(Hero) >= (FacingAngleOfVictim - 30.0), GetUnitFacing(Hero) <= (FacingAngleOfVictim + 30.0)))) then
set DamageToBeDone = Damage + Damage* DamageReductionHero
set DamageToBeDone = ((DamageToBeDone) * 0.4)
set DamageToBeDone = (DamageToBeDone * 2)
call UnitDamageTargetBJ(Hero, RogueVictim, (DamageToBeDone), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL)
set DamageToBeDone = (DamageToBeDone - (((DamageToBeDone) * DamageReductionHero)))
if (DamageToBeDone < 0 ) then
set DamageToBeDone =DamageToBeDone * -1
endif
call CreateTextTagUnitBJ(I2S(R2I(DamageToBeDone)), RogueVictim, 0, 25.0, 100.0, 100.0, 0.0, 0.0)
call SetTextTagPermanentBJ(GetLastCreatedTextTag(), false)
call SetTextTagVelocityBJ(GetLastCreatedTextTag(), 60.0, GetRandomReal(90.0, 160.0))
call SetTextTagLifespanBJ(GetLastCreatedTextTag(), 1.0)
call SetTextTagFadepointBJ(GetLastCreatedTextTag(), 3.0)
set Steal = true
else
set DamageToBeDone = Damage + Damage* DamageReductionHero
set DamageToBeDone = ((DamageToBeDone) * 0.4)
call UnitDamageTargetBJ(Hero, RogueVictim, (DamageToBeDone), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL)
set DamageToBeDone = (DamageToBeDone - (((DamageToBeDone) * DamageReductionHero)))
if (DamageToBeDone < 0 ) then
set DamageToBeDone =DamageToBeDone * -1
endif
call CreateTextTagUnitBJ(I2S(R2I(DamageToBeDone)), RogueVictim, 0, 13.0, 25.0, 0.0, GetRandomReal(25.0, 50.0), 0.0)
call SetTextTagPermanentBJ(GetLastCreatedTextTag(), false)
call SetTextTagVelocityBJ(GetLastCreatedTextTag(), 60.0, GetRandomReal(90.0, 160.0))
call SetTextTagLifespanBJ(GetLastCreatedTextTag(), 1.0)
call SetTextTagFadepointBJ(GetLastCreatedTextTag(), 3.0)
endif
endif
call TriggerSleepAction( 0.51 )
call SetUnitUserData( Hero , CustomValue )
endfunction
//===========================================================================
//===========================================================================
function CheckingHeroStatus takes unit Hero returns boolean
if ( not ( LoadStringBJ(StringHashBJ("STOFU"), GetHandleIdBJ(Hero), udg_hshTblCurrentStatus) != "Using Town Scroll" ) ) then
return false
endif
if ( not ( LoadStringBJ(StringHashBJ("STOFU"), GetHandleIdBJ(Hero), udg_hshTblCurrentStatus) != "Going To Fountain" ) ) then
return false
endif
if ( not ( GetUnitUserData(Hero) != 911 ) ) then
return false
endif
// if ( not ( GetPlayerController(GetOwningPlayer(Hero)) != MAP_CONTROL_USER ) ) then
// return false
//endif
return true
endfunction
function IsEnemyStructure takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == true )
endfunction
function IsThereAnyEnemy takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer( udg_TargetUnit )) == true )
endfunction
function FilterFunctionToCheckEnemy takes nothing returns boolean
return GetBooleanAnd( IsEnemyStructure( ), IsThereAnyEnemy( ) )
endfunction
function CheckForNearByEnemy takes unit Hero returns boolean
if ( not ( CountUnitsInGroup(GetUnitsInRangeOfLocMatching(1000.00, GetUnitLoc( Hero ), Condition(function FilterFunctionToCheckEnemy))) >= 1 ) ) then
return false
endif
return true
endfunction
function MyFuncGoingForHeal takes unit Hero returns nothing
// Getting unit handle
if ( GetUnitUserData( Hero )== 911 ) then
return
endif
if ( CheckingHeroStatus(Hero) ) then
call SaveStringBJ( "Going To Fountain", StringHashBJ("STOFU"), GetHandleIdBJ( Hero), udg_hshTblCurrentStatus )
if ( IsUnitAlly(Hero, Player(0)) == true ) then
call IssuePointOrderLocBJ( Hero, "move", GetRectCenter(gg_rct_Fountain_Of_Legion) )
else
call IssuePointOrderLocBJ( Hero, "move", GetRectCenter(gg_rct_Fountain_Of_Damned) )
endif
call TriggerSleepAction( 5.00 )
// I dont know how to pass local variablle through filter functions getting system crashing
set udg_TargetUnit = Hero
if ( CheckForNearByEnemy( Hero ) ) then
if ( IsUnitAlly(Hero, Player(0)) == true ) then
call IssuePointOrderLocBJ( Hero, "move", GetRectCenter(gg_rct_Fountain_Of_Legion) )
else
call IssuePointOrderLocBJ( Hero, "move", GetRectCenter(gg_rct_Fountain_Of_Damned) )
endif
call TriggerSleepAction( 5.00 )
else
endif
if ( GetUnitUserData( Hero )== 911 ) then
return
endif
// Decide To Go by scroll or by walk
if ( UnitHasItemOfTypeBJ(Hero, 'I009') == true ) then
if ( IsUnitAlly(Hero, Player(0)) == true ) then
call IssuePointOrderLocBJ( Hero, "move", GetRectCenter(gg_rct_Fountain_Of_Legion) )
else
call IssuePointOrderLocBJ( Hero, "move", GetRectCenter(gg_rct_Fountain_Of_Damned) )
endif
if ( IsUnitAlly(Hero, Player(0)) == true ) then
call SetUnitUserData( Hero , 911 )
call UnitUseItemPointLoc( Hero, GetItemOfTypeFromUnitBJ(Hero, 'I009'), GetRectCenter(gg_rct_Fountain_Of_Legion) )
call SaveStringBJ( "Using Town Scroll", StringHashBJ("STOFU"), GetHandleIdBJ(Hero), udg_hshTblCurrentStatus )
else
call SetUnitUserData( Hero , 911 )
call UnitUseItemPointLoc( Hero, GetItemOfTypeFromUnitBJ(Hero, 'I009'), GetRectCenter(gg_rct_Fountain_Of_Damned) )
call SaveStringBJ( "Using Town Scroll", StringHashBJ("STOFU"), GetHandleIdBJ(Hero), udg_hshTblCurrentStatus )
endif
call SaveIntegerBJ( 5, StringHashBJ("Reset911"), GetHandleIdBJ(Hero), udg_hshTblCurrentStatus )
return
else
if ( IsUnitAlly(Hero, Player(0)) == true ) then
call SaveStringBJ( "Going To Fountain", StringHashBJ("STOFU"), GetHandleIdBJ( Hero), udg_hshTblCurrentStatus )
call IssuePointOrderLocBJ( Hero, "move", GetRectCenter(gg_rct_Fountain_Of_Legion) )
else
call SaveStringBJ( "Going To Fountain", StringHashBJ("STOFU"), GetHandleIdBJ( Hero), udg_hshTblCurrentStatus )
call IssuePointOrderLocBJ( Hero, "move", GetRectCenter(gg_rct_Fountain_Of_Damned) )
endif
if ( GetUnitLifePercent( Hero) == 100.00 ) then
call MyFuncGoingForHeal (Hero)
endif
endif
endif
endfunction
function MyFuncRetreatTower takes unit Hero , integer Durration returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = Durration
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( IsPlayerAlly(GetOwningPlayer( Hero ), Player(0)) == true ) then
call IssuePointOrderLocBJ( Hero , "move", GetRectCenter(gg_rct_Fountain_Of_Legion) )
else
call IssuePointOrderLocBJ( Hero , "move", GetRectCenter(gg_rct_Fountain_Of_Damned) )
endif
call TriggerSleepAction( 1.00 )
if ( GetBooleanOr( GetUnitStateSwap(UNIT_STATE_LIFE, Hero) <= 250.00, GetUnitLifePercent( Hero) <= 40.00 ) ) then
call MyFuncGoingForHeal (Hero)
return
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call SaveStringBJ( LoadStringBJ(StringHashBJ("LSTOFU"), GetHandleIdBJ( udg_TargetUnit ), udg_hshTblLastStatus), StringHashBJ("STOFU"), GetHandleIdBJ( Hero), udg_hshTblCurrentStatus )
endfunction
//=================================
function MyFuncHeroEngage takes unit Hero , unit Target , integer Durration returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = Durration
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( GetBooleanOr( GetUnitStateSwap(UNIT_STATE_LIFE, Hero) <= 250.00, GetUnitLifePercent( Hero) <= 50.00 ) ) then
call MyFuncRetreatTower (Hero ,10 )
return
endif
if ( GetUnitUserData( Hero )!= 0 ) then
return
else
endif
call IssueTargetOrderBJ( Hero ,"attack", Target)
call TriggerSleepAction( 0.50 )
call SaveStringBJ( "Engaging " + GetUnitName(Target) , StringHashBJ("STOFU"), GetHandleIdBJ( Hero ), udg_hshTblCurrentStatus )
endloop
endfunction
function UnfreezeUnitHotCold takes unit Caster, unit Target returns nothing
call TriggerSleepAction( 25)
call PauseUnitBJ( false, Caster )
call UnitRemoveAbilityBJ( 'Avul', Caster )
call PauseUnitBJ( false, Target )
call UnitRemoveAbilityBJ( 'Avul', Target )
call SetUnitFlyHeightBJ( Caster, GetUnitDefaultFlyHeight( Caster ), 10000.00 )
call SetUnitFlyHeightBJ( Target , GetUnitDefaultFlyHeight( Target ), 10000.00)
endfunction
Name | Type | is_array | initial_value |
AbilityDamageLevel | real | Yes | |
AbilityLevel | integer | No | |
Agility | integer | No | |
Angle | real | No | |
Apocalypse | timerdialog | No | |
AreaOfEffect | real | No | |
AttackingHeroRegion | rect | No | |
AutoStandOff | integer | No | |
Beast_Attack_Ability_Level | integer | No | |
Beast_Attack_Atribute | integer | No | |
Beast_Attack_Atribute_Damage | real | No | |
Beast_Attack_Damage_Splitter | integer | No | |
Beast_Attack_Life_Damage | real | No | |
Beast_Attack_Location | location | No | |
Beast_Attack_Location2 | location | No | |
Beast_Attack_Max_Life | real | No | |
Beast_Attack_Total_Damage | real | No | |
Blue | real | Yes | |
BoolVar | boolean | No | |
BUMPED | group | No | |
Caster | unit | No | |
CasterAbility | abilcode | No | |
ChiOffAttack | integer | No | |
ChiTimerOn | boolean | No | |
CI_Dummies | group | No | |
CI_Group | group | No | |
CI_Hash | hashtable | No | |
CI_Reals | real | Yes | |
CI_Terrain_Types | terraintype | Yes | |
CreepRespawn | hashtable | No | |
Damage | integer | No | |
Distance | real | No | |
DivinePurgeTargetUnit | unit | No | |
DmgRed | real | No | |
DmgRedHero | real | No | |
DmgRedMagic | real | No | |
DummyAbility | abilcode | No | |
DynamicOffset | real | No | |
Effect | effect | No | |
End | integer | No | |
EndSpellIndex | integer | No | |
EndTime | integer | No | |
Face | string | No | |
FaceAngle | real | No | |
FlyingHeight | real | No | |
GhoulLeft4 | group | No | |
GhoulRight4 | group | No | |
Gold | integer | No | |
Green | real | Yes | |
GruntLeft4 | group | No | |
GruntRight4 | group | No | |
HandleCasterID | handle | No | |
HandleTargetID | handle | No | |
Hawk | unit | No | |
HeroAbility | abilcode | Yes | |
HeroAbilityLevel | integer | Yes | |
HeroAvailability | boolean | Yes | |
HeroBeingAtkIndex | integer | No | |
HeroFace | hashtable | No | |
HeroGroup | group | No | |
HeroName | string | No | |
HeroRespawn | integer | No | |
HeroRespawnTime | hashtable | No | |
HOAM | unit | No | |
hshHeroInfo | hashtable | No | |
hshTblCurrentStatus | hashtable | No | |
hshTblLastStatus | hashtable | No | |
hshUnit | hashtable | No | |
i | integervar | No | |
Intelligence | integer | No | |
IntVar | integer | No | |
ItemCost | integer | Yes | |
ItemID | itemcode | Yes | |
ItemToSell | item | No | |
ItemType | itemcode | No | |
j | integervar | No | |
JD_Angle | real | Yes | |
JD_Animations | string | Yes | |
JD_Distances | real | Yes | |
JD_Effect | string | Yes | |
JD_Group | group | No | |
JD_HighSettings | real | Yes | |
JD_Integers | integer | Yes | |
JD_JumpHigh | real | Yes | |
JD_ReachedDistance | real | Yes | |
JD_RealTimer | real | Yes | |
JD_SpeedUnits | real | Yes | |
JD_TempPoint | location | Yes | |
JD_TreesDestroy | boolean | Yes | |
JD_Unit | unit | Yes | |
JDA_Animation | string | No | |
JDA_AnimationSpeed | real | No | |
JDA_Collusion | boolean | No | |
JDA_DestroyTrees_Dash | boolean | No | |
JDA_JumpHigh_Distance | real | No | |
JDA_SpecialEffect | string | No | |
JDA_Speed | real | No | |
JDA_TargetPoint | location | No | |
JDA_Unit | unit | No | |
KB_Angle | real | Yes | |
KB_Casters | unit | Yes | |
KB_CountBuffs | integer | No | |
KB_DestroyTrees | boolean | Yes | |
KB_EffectCounter | integer | Yes | |
KB_EffectCounter2 | integer | Yes | |
KB_Effects_1 | string | Yes | |
KB_Effects_2 | string | Yes | |
KB_GeneralIntegers | integervar | Yes | |
KB_KnockbackedUnits | group | No | |
KB_Levels | integer | Yes | |
KB_MaxDistance | real | Yes | |
KB_ReachedDistance | real | Yes | |
KB_ReducedReal | real | No | |
KB_ReduceSpeedReal | real | Yes | |
KB_SpecificSpeed | real | Yes | |
KB_StartPositions | location | Yes | |
KB_TempPoint | location | Yes | |
KB_TempReal | real | No | |
KB_TotalKnockUnits | integer | No | |
KB_Units | unit | Yes | |
KBA_Caster | unit | No | |
KBA_DestroyTrees | boolean | No | |
KBA_DistancePerLevel | real | No | |
KBA_Level | integer | No | |
KBA_SpecialEffects | string | Yes | |
KBA_Speed | real | No | |
KBA_StartingPosition | location | No | |
KBA_TargetUnit | unit | No | |
KillingSpree | integer | No | |
KnightHealPoint | integer | No | |
Knockback_Loc1 | location | No | |
Knockback_Loc2 | location | No | |
Knockback_Target | unit | No | |
KnockbackAngle | real | No | |
KnockbackDistance | real | No | |
KnockbackSpeed | real | No | |
KnockbackTable | hashtable | No | |
KnockbackUnits | group | No | |
Length | integer | No | |
LevitationCaster | unit | No | |
LevitationTargets | group | No | |
LevitationTimer | timer | No | |
Life | real | No | |
LightiningEffect | lightning | Yes | |
LivingPoisonCaster | unit | No | |
Location | location | No | |
loopA | integervar | No | |
LoopInfinite | integer | No | |
ManaConst | real | No | |
Minute | integer | No | |
Multi_Shot_Ability_Level | integer | No | |
Multi_Shot_Base_Arrow_Count | integer | No | |
Multi_Shot_Caster | unit | No | |
Multi_Shot_Dummy_Ability | abilcode | No | |
Multi_Shot_Location | location | No | |
Multi_Shot_Location_2 | location | No | |
Multi_Shot_Loop_Location | location | No | |
Multi_Shot_Loop_Location2 | location | No | |
Multi_Shot_Owner | player | No | |
Multi_Shot_Total_Arrow_Count | integer | No | |
MultiBoard | hashtable | No | |
MyDisplayBoard | multiboard | No | |
MyTimer | timer | No | |
NewClassAbility | abilcode | Yes | |
NoOfPlayers | integer | No | |
Num | integer | No | |
offset | integer | No | |
Owner | player | No | |
Pent_index | integer | No | |
Pent_SFX | effect | Yes | |
PentagramCast | boolean | No | |
PlayerNo | integer | No | |
Point_Pent | location | Yes | |
PointOfSpell | location | No | |
PointOfSpellJump | location | No | |
QueenOFBladeOwner | player | No | |
Razor_Edge_Ability_Level | integer | No | |
Razor_Edge_Area_of_Effect | real | No | |
Razor_Edge_Base_Damage | real | No | |
Razor_Edge_Caster | unit | No | |
Razor_Edge_Damage_Group | group | No | |
Razor_Edge_Location | location | No | |
Razor_Edge_Location2 | location | No | |
Razor_Edge_Total_Damage | real | No | |
RE_Knock_Angle | real | No | |
RE_Knock_Distance | real | No | |
RE_Knock_Group | group | No | |
RE_Knock_Loc1 | location | No | |
RE_Knock_Loc2 | location | No | |
RE_Knock_Speed | real | No | |
RE_Knocktable | hashtable | No | |
RealVar | real | No | |
red | real | Yes | |
RemoveEffect | effect | Yes | |
RemoveSpecialEffect | effect | Yes | |
RemoveSplEffectIndex | integer | No | |
RightDamned | boolean | No | |
RightLegion | boolean | No | |
RndRegion | rect | No | |
RndUnit | unit | No | |
RndVar | integer | No | |
RogueDiceInc | integer | No | |
RogueDiceIncMin | integer | No | |
RowIndex | integer | No | |
Sample_Group | group | No | |
Sample_Point | location | No | |
Seconds | integer | No | |
SiegeOff | boolean | No | |
SiegeOn | boolean | No | |
SoldHero | unit | No | |
SoldItemType | itemcode | No | |
SoldUnitComputer | unit | No | |
SpellDamage | real | No | |
StandAndDeliver | boolean | No | |
Start | integer | No | |
StartHeroSelect | boolean | No | |
StartSpellIndex | integer | No | |
StatticOffset | real | No | |
Strength | integer | No | |
String | string | No | |
SubString | string | No | |
TargetArea | rect | No | |
TargetGroup | group | No | |
TargetPlayer | player | No | |
TargetUnit | unit | No | |
TargetUnitType | unitcode | Yes | |
Temp_Group_1 | group | No | |
Temp_Integer_1 | integer | No | |
Temp_Loc_1 | location | No | |
Temp_Loc_2 | location | No | |
Temp_Loc_3 | location | No | |
Temp_Loc_4 | location | No | |
Temp_Real_1 | real | No | |
Temp_Unit_1 | unit | No | |
Termal_Eruption_Ability_Level | integer | No | |
Termal_Eruption_Area_of_Effect | real | No | |
Termal_Eruption_Base_Damage | real | No | |
Termal_Eruption_Caster | unit | No | |
Termal_Eruption_Damage_Group | group | No | |
Termal_Eruption_Dummy_Ability | abilcode | No | |
Termal_Eruption_DummyAbility2 | abilcode | No | |
Termal_Eruption_Location | location | No | |
Termal_Eruption_Loop_Location | location | No | |
Termal_Eruption_Loop_Number | integer | No | |
Termal_Eruption_Owner | player | No | |
Termal_Eruption_Total_Damage | real | No | |
Terrain_Hash | hashtable | No | |
TerrainType | terraintype | No | |
TerrainTypeVariation | integer | No | |
TmrChi | timer | No | |
TmrWindow | timerdialog | No | |
TopOffset | location | No | |
Tree | destructable | No | |
UgW_AbilityTypeA | abilcode | Yes | |
UgW_AbilityTypeB | abilcode | Yes | |
UgW_AlreadyTouched | group | Yes | |
UgW_AngleA | real | Yes | |
UgW_AngleB | real | Yes | |
UgW_AoE | real | Yes | |
UgW_AoEExplosion | real | Yes | |
UgW_BumpedUnit | unit | Yes | |
UgW_CasterA | unit | Yes | |
UgW_CasterB | unit | Yes | |
UgW_DamagesFinal | real | Yes | |
UgW_DamagesUnderground | real | Yes | |
UgW_DestroyTrees | boolean | Yes | |
UgW_Distance | real | Yes | |
UgW_DistanceA | real | Yes | |
UgW_DistanceB | real | Yes | |
UgW_DistanceEffects | real | Yes | |
UgW_DistanceReachedA | real | Yes | |
UgW_DistanceReachedB | real | Yes | |
UgW_DummyGroup | unit | Yes | |
UgW_DummyPoint | unit | Yes | |
UgW_Effect | string | Yes | |
UgW_EffectExplosion1 | string | Yes | |
UgW_EffectExplosion2 | string | Yes | |
UgW_FinalDestination | unit | Yes | |
UgW_GroupA | group | No | |
UgW_GroupB | group | No | |
UgW_HighBump | real | Yes | |
UgW_HighSettings | real | Yes | |
UgW_Integer | integer | Yes | |
UgW_LandingEffectA | string | Yes | |
UgW_LandingEffectB | modelfile | Yes | |
UgW_LevelA | integer | Yes | |
UgW_LevelB | integer | Yes | |
UgW_RealTimer | real | Yes | |
UgW_Speed | real | Yes | |
UgW_SpeedBumpA | real | Yes | |
UgW_SpeedBumpB | real | Yes | |
UgW_StunTypeA | unitcode | Yes | |
UgW_StunTypeB | unitcode | Yes | |
UgW_TempGroup | group | No | |
UgW_TempPoint | location | No | |
UgW_TempPoint2 | location | No | |
UgW_TempPoint3 | location | No | |
UgW_TempPoint4 | location | No | |
UnitFacingAngle | real | No | |
UnitName | string | No | |
UnitType | unitcode | No | |
x1 | real | No |
function DancingTrigCond takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A05U' ) ) then
return false
endif
return true
endfunction
function DancingStrikeTriggerAction takes nothing returns nothing
local unit Hero
local unit TargetUnit
local integer AbilityLevel
local real Angle
local integer i
local integer InfiniteLoop
set Hero = GetTriggerUnit()
set TargetUnit = GetSpellTargetUnit()
set AbilityLevel = GetUnitAbilityLevelSwapped( 'A05U' , Hero)
set AbilityLevel = ( AbilityLevel + 4 )
//call DisplayTextToForce( GetPlayersAll(), I2S(AbilityLevel))
call TriggerSleepAction( 0.01 )
call PauseUnitBJ( true, Hero )
call TriggerSleepAction( 0.20 )
set i = 1
loop
exitwhen i > AbilityLevel
set Angle = GetUnitFacing(TargetUnit)
set Angle = ( Angle - 180.00 )
if ( Angle <= 0.00 ) then
set Angle = ( Angle + 360.00 )
else
endif
call SetUnitPositionLocFacingLocBJ( Hero, PolarProjectionBJ(PolarProjectionBJ(GetUnitLoc(Hero), 256, GetUnitFacing(Hero)), 300.00, Angle), GetUnitLoc(TargetUnit) )
call TriggerSleepAction( 0.50 )
set Angle = GetUnitFacing(TargetUnit)
set Angle = ( Angle - 180.00 )
if ( Angle <= 0.00 ) then
set Angle = ( Angle + 360.00 )
else
endif
call SetUnitPositionLocFacingLocBJ( Hero, PolarProjectionBJ(GetUnitLoc(TargetUnit), 50.00, Angle), GetUnitLoc(TargetUnit) )
call SetUnitAnimation( Hero, "Spell Slam" )
call TriggerSleepAction( .3 )
call PauseUnitBJ( false, Hero )
call SetUnitUserData( Hero , 1110)
set InfiniteLoop = 1
loop
exitwhen InfiniteLoop > 10
call IssueTargetOrderBJ( Hero , "attack", TargetUnit )
call TriggerSleepAction( 0.1 )
// custom value is wait cond unless it changes loop iterates
if ( GetUnitUserData( Hero ) != 1110) then
//call DisplayTextToForce( GetPlayersAll(), ( GetUnitName(Hero )+ ( " Custom value " + I2S(GetUnitUserData( Hero )) ) ) )
set InfiniteLoop = 10
call PauseUnitBJ( true, Hero )
else
set InfiniteLoop = 0
endif
set InfiniteLoop = InfiniteLoop + 1
endloop
if ( IsUnitAliveBJ(TargetUnit) == true ) then
call DoNothing( )
else
call SetUnitPositionLocFacingLocBJ( Hero, GetRandomLocInRect(RectFromCenterSizeBJ(GetUnitLoc(TargetUnit), 700.00, 700.00)), GetUnitLoc(TargetUnit) )
call PauseUnitBJ( false, Hero )
return
endif
call TriggerSleepAction( 0.60 )
call SetUnitPositionLocFacingLocBJ( Hero, GetRandomLocInRect(RectFromCenterSizeBJ(GetUnitLoc(TargetUnit), 700.00, 700.00)), GetUnitLoc(TargetUnit) )
call AddSpecialEffectLocBJ( GetUnitLoc(Hero), "Abilities\\Spells\\Undead\\ReplenishMana\\SpiritTouchTarget.mdl" )
call AddSpecialEffectLocBJ( GetUnitLoc(Hero), "Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl" )
call TriggerSleepAction( 0.50 )
set i = i + 1
endloop
call SetUnitPositionLocFacingLocBJ( Hero, GetRandomLocInRect(RectFromCenterSizeBJ(GetUnitLoc(TargetUnit), 1400.00, 1400.00)), GetUnitLoc(TargetUnit) )
call UnitRemoveBuffBJ( 'BEsh', TargetUnit )
call PauseUnitBJ( false, Hero )
endfunction
//===========================================================================
function InitTrig_Dancing_Strike takes nothing returns nothing
set gg_trg_Dancing_Strike = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dancing_Strike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Dancing_Strike, Condition( function DancingTrigCond ) )
call TriggerAddAction( gg_trg_Dancing_Strike, function DancingStrikeTriggerAction )
endfunction
function Trig_HotOrCold_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A06A' ) ) then
return false
endif
return true
endfunction
function KillerTree takes nothing returns nothing
call KillDestructable( GetEnumDestructable())
endfunction
function HotAndCold takes nothing returns nothing
local location PointOfSpell
local unit Caster
local unit Target
local real Angle
local effect array RemoveSpecialEffect
local integer InfiniteLoop
local real LifeBeforeAttack
local real LifeAfterAttack
set Target = GetSpellTargetUnit()
set Caster = GetTriggerUnit()
set Angle = GetUnitFacing(Caster)
set Angle = Angle
set PointOfSpell = GetSpellTargetLoc()
//call UnfreezeUnitHotCold ( Caster, GetSpellTargetUnit())
call TriggerSleepAction( 0.01 )
call PauseUnitBJ( true, Caster )
call PauseUnitBJ( true, Target )
call SetUnitAnimation( Caster, "Stand Victory" )
call QueueUnitAnimationBJ( Caster, "Stand Victory" )
call SetUnitTimeScalePercent( Caster, 25.00 )
if ( GetUnitTypeId(Caster) == 'E00C' ) then
call SetUnitAnimation( Caster, "Stand 2" )
call QueueUnitAnimationBJ( Caster, "Stand 2" )
call SetUnitTimeScalePercent( Caster, 25.00 )
else
endif
call UnitRemoveBuffsExBJ( bj_BUFF_POLARITY_EITHER, bj_BUFF_RESIST_EITHER, Target, true, true )
call UnitAddAbilityBJ( 'Avul', Target )
set udg_JDA_JumpHigh_Distance = ( 0.66 * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetTriggerUnit())) )
if ( udg_JDA_JumpHigh_Distance >= 1.50 ) then
set udg_JDA_JumpHigh_Distance = 1.50
else
endif
set udg_JDA_DestroyTrees_Dash = true
set udg_JDA_Collusion = false
set udg_JDA_TargetPoint = PolarProjectionBJ(PointOfSpell, 500.00, Angle)
set udg_JDA_Unit = Target
set udg_JDA_Speed = 4.00
set udg_JDA_SpecialEffect = "Abilities\\Weapons\\FaerieDragonMissile\\FaerieDragonMissile.mdl"
set udg_JDA_Animation = "walk"
set udg_JDA_AnimationSpeed = 0.60
call ConditionalTriggerExecute( gg_trg_Jump_System_1 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 10
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call AddSpecialEffectTargetUnitBJ( "hand", Caster, "Abilities\\Weapons\\AncestralGuardianMissile\\AncestralGuardianMissile.mdl" )
set RemoveSpecialEffect[GetForLoopIndexA()] = GetLastCreatedEffectBJ()
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call TriggerSleepAction( 1.00 )
set udg_JDA_TargetPoint = PolarProjectionBJ(PointOfSpell, 500.00, Angle)
// Cam Taken To 3500 height Nice
if ( ( GetPlayerController(GetOwningPlayer( Caster )) == MAP_CONTROL_USER ) ) then
call PanCameraToTimedLocForPlayer( GetOwningPlayer( Caster ), PolarProjectionBJ(GetUnitLoc(Target), 100.00, 120.00), 0 )
call SetCameraFieldForPlayer(GetOwningPlayer( Caster ), CAMERA_FIELD_TARGET_DISTANCE, 3500.00, 0 )
else
if ( ( GetPlayerController(GetOwningPlayer( Target )) == MAP_CONTROL_USER ) ) then
call PanCameraToTimedLocForPlayer( GetOwningPlayer( Target ) , PolarProjectionBJ(GetUnitLoc(Target), 100.00, 120.00), 0 )
call SetCameraFieldForPlayer( GetOwningPlayer( Target ), CAMERA_FIELD_TARGET_DISTANCE, 3500.00, 0 )
endif
endif
call UnitAddAbilityBJ( 'Avul', Caster )
set udg_JDA_Unit = Caster
set udg_JDA_Speed = 15.00
set udg_JDA_SpecialEffect = "Abilities\\Weapons\\FaerieDragonMissile\\FaerieDragonMissile.mdl"
set udg_JDA_Animation = "walk"
set udg_JDA_AnimationSpeed = 0.60
call ConditionalTriggerExecute( gg_trg_Jump_System_1 )
set InfiniteLoop = 1
loop
exitwhen InfiniteLoop > 10
if ( DistanceBetweenPoints(GetUnitLoc(Caster), GetUnitLoc(Target)) <= 100.00) then
set InfiniteLoop = 10
else
call TriggerSleepAction( 0.05 )
set InfiniteLoop = 0
endif
set InfiniteLoop = InfiniteLoop + 1
endloop
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 10
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_JD_Distances[GetForLoopIndexA()] = 0.00
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call SetUnitTimeScalePercent( Caster, 25.00 )
call TriggerSleepAction( 1.00 )
call SetUnitTimeScalePercent( Target, 100.00 )
call ResetUnitAnimation( Target )
call TriggerSleepAction( 0.50 )
call UnitRemoveAbilityBJ( 'Avul', Target )
call PauseUnitBJ( false, Caster )
call TriggerSleepAction( 0.01 )
call SetUnitUserData( Caster , 1111 )
set InfiniteLoop = 1
loop
exitwhen InfiniteLoop > 10
call IssueTargetOrderBJ( Caster , "attack", Target )
call TriggerSleepAction( 0.1 )
// custom value is wait cond unless it changes loop iterates
if ( GetUnitUserData( Caster ) != 1111) then
set InfiniteLoop = 10
//removing glow from hand
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 10
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call DestroyEffectBJ( RemoveSpecialEffect[GetForLoopIndexA()] )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
else
set InfiniteLoop = 0
endif
set InfiniteLoop = InfiniteLoop + 1
endloop
call PauseUnitBJ( true ,Caster )
call SetUnitFlyHeightBJ( Target, 0.00, 2000.00 )
call SetUnitFlyHeightBJ( Caster, GetUnitDefaultFlyHeight( Caster ), 400.00 )
call SetUnitPathing( Target, true )
call SetUnitPathing( Caster, true )
call AddSpecialEffectLocBJ( GetUnitLoc(Target), "Abilities\\Spells\\Orc\\EarthQuake\\EarthQuakeTarget.mdl" )
set RemoveSpecialEffect[200] = GetLastCreatedEffectBJ()
call TriggerSleepAction( 0.20 )
call EnumDestructablesInCircleBJ( 500.00, GetUnitLoc(Target), function KillerTree )
call AddSpecialEffectLocBJ( GetUnitLoc(Target), "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" )
call AddSpecialEffectLocBJ( GetUnitLoc(Target), "war3mapImported\\NewDirtEXNofire.mdx" )
call TriggerSleepAction( 0.10 )
call TerrainDeformationCraterBJ( 2.00, false, GetUnitLoc(Target), 512, 100.00 )
call TriggerSleepAction( 2.00 )
call DestroyEffectBJ( RemoveSpecialEffect[200] )
call PauseUnitBJ( false, Target )
call TriggerSleepAction( 2.00 )
set InfiniteLoop = 1
// loop
// exitwhen InfiniteLoop > 10
// if ( GetUnitFlyHeight(Caster) <= 50.00 ) then
set InfiniteLoop = 10
//else
// call TriggerSleepAction( 0.01 )
// set InfiniteLoop = 0
//endif
//set InfiniteLoop = InfiniteLoop + 1
/// endloop
call PauseUnitBJ( false, Caster )
call UnitRemoveAbilityBJ( 'Avul', Caster )
call ResetToGameCameraForPlayer( Player(0), 2.00 )
endfunction
//===========================================================================
function InitTrig_Cold_Up_And_Hot_Down_Reloaded takes nothing returns nothing
set gg_trg_Cold_Up_And_Hot_Down_Reloaded = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Cold_Up_And_Hot_Down_Reloaded, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Cold_Up_And_Hot_Down_Reloaded, Condition( function Trig_HotOrCold_Conditions ) )
call TriggerAddAction( gg_trg_Cold_Up_And_Hot_Down_Reloaded, function HotAndCold )
endfunction
function Trig_Divine_Shield_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A06R' ) ) then
return false
endif
return true
endfunction
function Trig_Divine_Shield_Actions takes nothing returns nothing
local effect SplEffect
local unit CastingUnit
local unit DisplayUnit
local integer AbilityLevel
set AbilityLevel = ( GetUnitAbilityLevelSwapped('A06R', GetTriggerUnit()) - 1 )
call SetPlayerTechResearchedSwap( 'R00E', AbilityLevel, GetOwningPlayer(GetTriggerUnit()) )
call CreateNUnitsAtLoc( 1, 'o005', GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A06P', GetLastCreatedUnit() )
call UnitApplyTimedLifeBJ( ( 10.00 + ( I2R(AbilityLevel) * 5.00 ) ), 'BTLF', GetLastCreatedUnit() )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "voodoo" )
call ShowUnitHide( GetLastCreatedUnit() )
set CastingUnit = GetLastCreatedUnit()
call CreateNUnitsAtLoc( 1, 'h01H', GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( ( 10.00 + ( I2R(AbilityLevel) * 5.00 ) ), 'BTLF', GetLastCreatedUnit() )
call AddSpecialEffectTargetUnitBJ( "origin", GetLastCreatedUnit(), "Divine Shield.mdx" )
set SplEffect = GetLastCreatedEffectBJ()
set DisplayUnit = GetLastCreatedUnit()
loop
exitwhen ( GetBooleanOr( IsUnitAliveBJ(DisplayUnit) == false, IsUnitAliveBJ(CastingUnit) == false ) )
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 1))
endloop
call RemoveUnit( CastingUnit )
call DestroyEffectBJ( SplEffect )
endfunction
//===========================================================================
function InitTrig_Divine_Shield takes nothing returns nothing
set gg_trg_Divine_Shield = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Divine_Shield, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Divine_Shield, Condition( function Trig_Divine_Shield_Conditions ) )
call TriggerAddAction( gg_trg_Divine_Shield, function Trig_Divine_Shield_Actions )
endfunction
function Trig_Grand_Cross_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A06Q' ) ) then
return false
endif
return true
endfunction
function Trig_Grand_Cross_Actions takes nothing returns nothing
local integer index
local integer EndIndex
local integer i
local integer AbilityLevel
local integer DummyAbility
local real StatticOffset
local real DynamicOffset
local location TopOffset
local location PointOfSpell
local effect array RemoveSpecialEffect
set index= 0
set PointOfSpell = GetUnitLoc(GetTriggerUnit())
set StatticOffset = 500.00
set DynamicOffset = 0.00
set TopOffset = PolarProjectionBJ(PointOfSpell, StatticOffset, 30.00)
set AbilityLevel = GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetTriggerUnit())
call CreateNUnitsAtLoc( 1, 'n009', GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastCreatedUnit() )
call ShowUnitHide( GetLastCreatedUnit() )
set DummyAbility = 'A00H'
call UnitAddAbilityBJ( DummyAbility, GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( DummyAbility, GetLastCreatedUnit(), AbilityLevel )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "tranquility" )
// Iam just going to draw a cross as you can see at the end of spell
// To make it easy to understand i would recomend you to draw a picture in a piwece of paper
// Observe the angle each line make. Dont know how take a protractor and simply measeure.
// I hope you know how to do tat else just skipp everything .........
// After you draw a cross draw a circle of tranquility target. mdl
// And finaly remove all effects.
set i = 1
loop
exitwhen i > 5
call AddSpecialEffectLocBJ( PolarProjectionBJ(TopOffset, DynamicOffset, 210.00), "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl" )
set DynamicOffset = ( DynamicOffset + 50.00 )
set RemoveSpecialEffect[index] = GetLastCreatedEffectBJ()
set index = ( index + 1 )
set i = i + 1
endloop
set DynamicOffset = 0.00
set TopOffset = PolarProjectionBJ(PointOfSpell, StatticOffset, 60.00)
set i = 1
loop
exitwhen i > 5
call AddSpecialEffectLocBJ( PolarProjectionBJ(TopOffset, DynamicOffset, 240.00), "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl" )
set DynamicOffset = ( DynamicOffset + 50.00 )
set RemoveSpecialEffect[index] = GetLastCreatedEffectBJ()
set index = ( index + 1 )
set i = i + 1
endloop
set DynamicOffset = 0.00
set TopOffset = PolarProjectionBJ(PointOfSpell, StatticOffset, 120.00)
set i = 1
loop
exitwhen i > 5
call AddSpecialEffectLocBJ( PolarProjectionBJ(TopOffset, DynamicOffset, 300.00), "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl" )
set DynamicOffset = ( DynamicOffset + 50.00 )
set RemoveSpecialEffect[index] = GetLastCreatedEffectBJ()
set index = ( index + 1 )
set i = i + 1
endloop
set DynamicOffset = 0.00
set TopOffset = PolarProjectionBJ(PointOfSpell, StatticOffset, 150.00)
set i = 1
loop
exitwhen i > 5
call AddSpecialEffectLocBJ( PolarProjectionBJ(TopOffset, DynamicOffset, 330.00), "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl" )
set DynamicOffset = ( DynamicOffset + 50.00 )
set RemoveSpecialEffect[index] = GetLastCreatedEffectBJ()
set index = ( index + 1 )
set i = i + 1
endloop
set DynamicOffset = 0.00
set TopOffset = PolarProjectionBJ(PointOfSpell, StatticOffset, 210.00)
set i = 1
loop
exitwhen i > 5
call AddSpecialEffectLocBJ( PolarProjectionBJ(TopOffset, DynamicOffset, 30.00), "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl" )
set DynamicOffset = ( DynamicOffset + 50.00 )
set RemoveSpecialEffect[index] = GetLastCreatedEffectBJ()
set index = ( index + 1 )
set i = i + 1
endloop
set DynamicOffset = 0.00
set TopOffset = PolarProjectionBJ(PointOfSpell, StatticOffset, 240.00)
set i = 1
loop
exitwhen i > 5
call AddSpecialEffectLocBJ( PolarProjectionBJ(TopOffset, DynamicOffset, 60.00), "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl" )
set DynamicOffset = ( DynamicOffset + 50.00 )
set RemoveSpecialEffect[index] = GetLastCreatedEffectBJ()
set index = ( index + 1 )
set i = i + 1
endloop
set DynamicOffset = 0.00
set TopOffset = PolarProjectionBJ(PointOfSpell, StatticOffset, 300.00)
set i = 1
loop
exitwhen i > 5
call AddSpecialEffectLocBJ( PolarProjectionBJ(TopOffset, DynamicOffset, 120.00), "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl" )
set DynamicOffset = ( DynamicOffset + 50.00 )
set RemoveSpecialEffect[index] = GetLastCreatedEffectBJ()
set index = ( index + 1 )
set i = i + 1
endloop
set DynamicOffset = 0.00
set TopOffset = PolarProjectionBJ(PointOfSpell, StatticOffset, 330.00)
set i = 1
loop
exitwhen i > 5
call AddSpecialEffectLocBJ( PolarProjectionBJ(TopOffset, DynamicOffset, 150.00), "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl" )
set DynamicOffset = ( DynamicOffset + 50.00 )
set RemoveSpecialEffect[index] = GetLastCreatedEffectBJ()
set index = ( index + 1 )
set i = i + 1
endloop
// Side
set DynamicOffset = 0.00
set TopOffset = PolarProjectionBJ(PointOfSpell, StatticOffset, 30.00)
set i = 1
loop
exitwhen i > 10
call AddSpecialEffectLocBJ( PolarProjectionBJ(TopOffset, DynamicOffset, 270.00), "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl" )
set DynamicOffset = ( DynamicOffset + 50.00 )
set RemoveSpecialEffect[index] = GetLastCreatedEffectBJ()
set index = ( index + 1 )
set i = i + 1
endloop
set DynamicOffset = 0.00
set TopOffset = PolarProjectionBJ(PointOfSpell, StatticOffset, 150.00)
set i = 1
loop
exitwhen i > 10
call AddSpecialEffectLocBJ( PolarProjectionBJ(TopOffset, DynamicOffset, 270.00), "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl" )
set DynamicOffset = ( DynamicOffset + 50.00 )
set RemoveSpecialEffect[index] = GetLastCreatedEffectBJ()
set index = ( index + 1 )
set i = i + 1
endloop
set DynamicOffset = 0.00
set TopOffset = PolarProjectionBJ(PointOfSpell, StatticOffset, 60.00)
set i = 1
loop
exitwhen i > 10
call AddSpecialEffectLocBJ( PolarProjectionBJ(TopOffset, DynamicOffset, 180.00), "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl" )
set DynamicOffset = ( DynamicOffset + 50.00 )
set RemoveSpecialEffect[index] = GetLastCreatedEffectBJ()
set index = ( index + 1 )
set i = i + 1
endloop
set DynamicOffset = 0.00
set TopOffset = PolarProjectionBJ(PointOfSpell, StatticOffset, 240.00)
set i = 1
loop
exitwhen i > 10
call AddSpecialEffectLocBJ( PolarProjectionBJ(TopOffset, DynamicOffset, 0.00), "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl" )
set DynamicOffset = ( DynamicOffset + 50.00 )
set RemoveSpecialEffect[index] = GetLastCreatedEffectBJ()
set index = ( index + 1 )
set i = i + 1
endloop
// Angled
set StatticOffset = 250.00
set DynamicOffset = 0.00
set TopOffset = PolarProjectionBJ(PointOfSpell, StatticOffset, 60.00)
set i = 1
loop
exitwhen i > 3
call AddSpecialEffectLocBJ( PolarProjectionBJ(TopOffset, DynamicOffset, 315.00), "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl" )
set DynamicOffset = ( DynamicOffset + 50.00 )
set RemoveSpecialEffect[index] = GetLastCreatedEffectBJ()
set index = ( index + 1 )
set i = i + 1
endloop
set DynamicOffset = 0.00
set TopOffset = PolarProjectionBJ(PointOfSpell, StatticOffset, 120.00)
set i = 1
loop
exitwhen i > 3
call AddSpecialEffectLocBJ( PolarProjectionBJ(TopOffset, DynamicOffset, 225.00), "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl" )
set DynamicOffset = ( DynamicOffset + 50.00 )
set RemoveSpecialEffect[index] = GetLastCreatedEffectBJ()
set index = ( index + 1 )
set i = i + 1
endloop
set DynamicOffset = 0.00
set TopOffset = PolarProjectionBJ(PointOfSpell, StatticOffset, 210.00)
set i = 1
loop
exitwhen i > 3
call AddSpecialEffectLocBJ( PolarProjectionBJ(TopOffset, DynamicOffset, 315.00), "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl" )
set DynamicOffset = ( DynamicOffset + 50.00 )
set RemoveSpecialEffect[index] = GetLastCreatedEffectBJ()
set index = ( index + 1 )
set i = i + 1
endloop
set DynamicOffset = 0.00
set TopOffset = PolarProjectionBJ(PointOfSpell, StatticOffset, 300.00)
set i = 1
loop
exitwhen i > 3
call AddSpecialEffectLocBJ( PolarProjectionBJ(TopOffset, DynamicOffset, 45.00), "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl" )
set DynamicOffset = ( DynamicOffset + 50.00 )
set RemoveSpecialEffect[index] = GetLastCreatedEffectBJ()
set index = ( index + 1 )
set i = i + 1
endloop
// Tranquility
set StatticOffset = 500.00
set i = 1
loop
exitwhen i > 4
call AddSpecialEffectLocBJ( PolarProjectionBJ(PointOfSpell, StatticOffset, ( I2R(i) * 90.00 )), "Abilities\\Spells\\NightElf\\Tranquility\\Tranquility.mdl" )
set RemoveSpecialEffect[index] = GetLastCreatedEffectBJ()
set index = ( index + 1 )
set i = i + 1
endloop
set StatticOffset = 500.00
set i = 1
loop
exitwhen i > 36
call AddSpecialEffectLocBJ( PolarProjectionBJ(PointOfSpell, StatticOffset, ( I2R(i) * ( 360.00 / 36.00 ) )), "Abilities\\Spells\\NightElf\\Tranquility\\TranquilityTarget.mdl" )
set RemoveSpecialEffect[index] = GetLastCreatedEffectBJ()
set index = ( index + 1 )
set i = i + 1
endloop
set EndIndex=index
call DisplayTextToForce( GetPlayersAll(), I2S(index) )
call TriggerSleepAction( 30.00 )
set i = ( EndIndex - 36 )
loop
exitwhen i > EndIndex
call DestroyEffectBJ( RemoveSpecialEffect[i] )
set i = i + 1
endloop
call TriggerSleepAction( 2.00 )
set i = 0
loop
exitwhen i > ( EndIndex - 36 )
call DestroyEffectBJ( RemoveSpecialEffect[i] )
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_Grand_Cross takes nothing returns nothing
set gg_trg_Grand_Cross = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Grand_Cross, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Grand_Cross, Condition( function Trig_Grand_Cross_Conditions ) )
call TriggerAddAction( gg_trg_Grand_Cross, function Trig_Grand_Cross_Actions )
endfunction
function TriggerCondition takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A075' ) ) then
return false
endif
return true
endfunction
function DamageCondition takes nothing returns boolean
return GetBooleanAnd( IsUnitType( GetFilterUnit() , UNIT_TYPE_STRUCTURE) != true , IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction
function DamageFunction takes nothing returns nothing
local integer AbilityLevel
set AbilityLevel = GetUnitAbilityLevelSwapped('A075', GetTriggerUnit())
call CreateNUnitsAtLoc( 1, 'n009', GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 20.00, 'BTLF', GetLastCreatedUnit() )
// call ShowUnitHide( GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A076', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A076', GetLastCreatedUnit(), AbilityLevel )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "silence", GetUnitLoc(GetEnumUnit()) )
call AddSpecialEffectLocBJ( GetUnitLoc(GetEnumUnit()), "war3mapImported\\HolyStrike.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
if ( IsUnitType(GetEnumUnit(), UNIT_TYPE_UNDEAD) == true ) then
call UnitDamageTargetBJ( GetTriggerUnit(), GetEnumUnit(), ( I2R( AbilityLevel ) * 200.00 ), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_FIRE )
else
call UnitDamageTargetBJ( GetTriggerUnit(), GetEnumUnit(), ( I2R( AbilityLevel ) * 100.00 ), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_FIRE )
endif
endfunction
function Trig_Divine_Purge_Actions takes nothing returns nothing
local unit TargetUnit
local unit Caster
local location PointOfSpell
local effect array RemoveEffect
local integer i
set Caster = GetTriggerUnit()
set PointOfSpell = GetUnitLoc(Caster)
call CreateNUnitsAtLoc( 1, 'o004', GetOwningPlayer(Caster), PointOfSpell, bj_UNIT_FACING )
set TargetUnit = GetLastCreatedUnit()
call SetUnitPathing( GetLastCreatedUnit(), false )
call UnitApplyTimedLifeBJ( 20.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitPositionLoc( GetLastCreatedUnit(), PolarProjectionBJ(GetUnitLoc(Caster), 700.00, ( I2R(5) )) )
call CreateNUnitsAtLoc( 1, 'H01J', Player(PLAYER_NEUTRAL_AGGRESSIVE), PointOfSpell, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 20.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitPathing( GetLastCreatedUnit(), false )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", TargetUnit )
call CreateNUnitsAtLoc( 1, 'H01J', Player(PLAYER_NEUTRAL_AGGRESSIVE), PointOfSpell, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 20.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitPathing( GetLastCreatedUnit(), false )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", TargetUnit )
call CreateNUnitsAtLoc( 1, 'H01J', Player(PLAYER_NEUTRAL_AGGRESSIVE), PointOfSpell, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 20.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitPathing( GetLastCreatedUnit(), false )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", TargetUnit )
call CreateNUnitsAtLoc( 1, 'H01J', Player(PLAYER_NEUTRAL_AGGRESSIVE), PointOfSpell, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 20.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitPathing( GetLastCreatedUnit(), false )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", TargetUnit )
call CreateNUnitsAtLoc( 1, 'H01J', Player(PLAYER_NEUTRAL_AGGRESSIVE), PointOfSpell, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 20.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitPathing( GetLastCreatedUnit(), false )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", TargetUnit )
call AddSpecialEffectLocBJ( GetUnitLoc(GetLastCreatedUnit()), "Hammer_of_Thor.mdl" )
set RemoveEffect[501] = GetLastCreatedEffectBJ()
call AddSpecialEffectLocBJ( GetUnitLoc(GetLastCreatedUnit()), "Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeTarget.mdl" )
set RemoveEffect[500] = GetLastCreatedEffectBJ()
call PauseUnitBJ( true, GetTriggerUnit() )
loop
exitwhen ( GetUnitLifePercent( TargetUnit ) < 100.00 )
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 0.10))
endloop
set i = 1
call TriggerSleepAction( 0.10 )
call SetUnitAnimation( GetTriggerUnit() , "stand channel" )
loop
exitwhen i > 72
call SetUnitPositionLoc( TargetUnit, PolarProjectionBJ(PointOfSpell, 700.00, ( I2R( i ) * ( -5) )) )
call AddSpecialEffectLocBJ( GetUnitLoc(TargetUnit), "Doodads\\Cinematic\\FireRockSmall\\FireRockSmall.mdl" )
set RemoveEffect[ i ] = GetLastCreatedEffectBJ()
call AddSpecialEffectLocBJ( GetUnitLoc(TargetUnit), "war3mapImported\\HolyStrike.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddLightningLoc( "LEAS", PointOfSpell, GetUnitLoc(TargetUnit) )
set udg_LightiningEffect[ i ] = GetLastCreatedLightningBJ()
call TriggerSleepAction( 0.01 )
set i = i + 1
endloop
set i = 1
loop
exitwhen i > 72
call DestroyEffectBJ( RemoveEffect[i] )
call DestroyLightningBJ( udg_LightiningEffect[ i ] )
set i = i + 1
endloop
call DestroyEffectBJ( RemoveEffect[500] )
call DestroyEffectBJ( RemoveEffect[501] )
call PauseUnitBJ( false, GetTriggerUnit() )
call ForGroupBJ( GetUnitsInRangeOfLocMatching(700.00, GetUnitLoc(Caster), Condition(function DamageCondition)), function DamageFunction )
call RemoveUnit( TargetUnit )
endfunction
//===========================================================================
function InitTrig_Divine_Purge takes nothing returns nothing
set gg_trg_Divine_Purge = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Divine_Purge, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Divine_Purge, Condition( function TriggerCondition ) )
call TriggerAddAction( gg_trg_Divine_Purge, function Trig_Divine_Purge_Actions )
endfunction
function Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A06O' ) ) then
return false
endif
return true
endfunction
function FilterFunction1 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_TargetUnit)) == true )
endfunction
function DamageUnitWhenUp takes nothing returns nothing
if ( IsUnitType(GetEnumUnit(), UNIT_TYPE_STRUCTURE ) == true ) then
return
endif
if ( IsUnitType(GetEnumUnit(), UNIT_TYPE_FLYING ) == true ) then
return
endif
call UnitDamageTargetBJ( udg_TargetUnit, GetEnumUnit(), 100.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endfunction
function FilterFunction2 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_TargetUnit)) == true )
endfunction
function DamageUnitWhenDown takes nothing returns nothing
if ( IsUnitType(GetEnumUnit(), UNIT_TYPE_STRUCTURE) == true ) then
return
endif
if ( IsUnitType(GetEnumUnit(), UNIT_TYPE_FLYING ) == true ) then
return
endif
call UnitDamageTargetBJ( udg_TargetUnit, GetEnumUnit(), 100.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endfunction
function FunctionDamageWhenSwordGoingDown takes nothing returns nothing
local location PointOfSpell
if ( GetDestructableTypeId(GetEnumDestructable()) == 'B006' ) then
set PointOfSpell = GetDestructableLoc(GetEnumDestructable())
call ForGroupBJ( GetUnitsInRangeOfLocMatching(250.00, PointOfSpell, Condition(function FilterFunction2)), function DamageUnitWhenDown )
call AddSpecialEffectLocBJ( PointOfSpell, "Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveDestructable( GetEnumDestructable() )
else
endif
endfunction
function Trig_Valdis_Actions takes nothing returns nothing
local unit TargetUnit
local location PointOfSpellJump
local location PointOfSpell
local real Distance
local real Angle
local integer i
local integer j
set TargetUnit= GetTriggerUnit()
set PointOfSpellJump =GetSpellTargetLoc()
call TriggerSleepAction( 0.20 )
call PauseUnitBJ( true, TargetUnit )
call SetUnitAnimation( TargetUnit, "Attack 1" )
call SetUnitTimeScalePercent( TargetUnit, 125.00 )
call TriggerSleepAction( 0.73 )
call ResetUnitAnimation( TargetUnit )
call SetUnitAnimation( TargetUnit, "attack" )
call TriggerSleepAction( 0.60 )
set TargetUnit = TargetUnit
call UnitAddAbilityBJ( 'Amrf', TargetUnit )
call UnitRemoveAbilityBJ( 'Amrf', TargetUnit )
call ResetUnitAnimation( TargetUnit )
call SetUnitTimeScalePercent( TargetUnit, 50.00 )
call SetUnitFlyHeightBJ( TargetUnit, 200.00, 100.00 )
call SetUnitAnimation( TargetUnit, "Attack Slam" )
call TriggerSleepAction( 1.50 )
set TargetUnit = TargetUnit
call SetUnitFlyHeightBJ( TargetUnit, 0.00, 300.00 )
call TriggerSleepAction( 0.80 )
set Distance = 0
set i = 4
loop
exitwhen i > 8
call TriggerSleepAction( 0.10 )
set udg_TargetUnit = TargetUnit
set Distance = Distance + 200
call PlaySoundAtPointBJ( gg_snd_MetalMediumSliceMetal2, 100, GetUnitLoc(TargetUnit), 0 )
//call DisplayTextToForce( GetPlayersAll(), I2S(i) )
set j = 1
loop
exitwhen j > 15
set Angle = ( AngleBetweenPoints(GetUnitLoc(TargetUnit), PointOfSpellJump) - 30.00 )
set Angle = ( Angle + ( I2R(j) * 5.00 ) )
set PointOfSpell = PolarProjectionBJ(GetUnitLoc(TargetUnit), Distance, Angle)
call CreateDestructableLoc( 'B006', PointOfSpell, Angle, I2R(i), 0 )
call AddSpecialEffectLocBJ( PointOfSpell, "Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call ForGroupBJ( GetUnitsInRangeOfLocMatching(250.00, PointOfSpell, Condition(function FilterFunction1)), function DamageUnitWhenUp )
set j = j + 1
endloop
call PlaySoundAtPointBJ( gg_snd_MetalMediumSliceMetal2, 100, GetUnitLoc(TargetUnit), 0 )
set i = i + 1
endloop
call TriggerSleepAction( 0.10 )
set TargetUnit = TargetUnit
call PauseUnitBJ( false, TargetUnit )
call TriggerSleepAction( 2 )
set udg_TargetUnit = TargetUnit
call EnumDestructablesInCircleBJ( 2000.00, GetUnitLoc(TargetUnit), function FunctionDamageWhenSwordGoingDown )
endfunction
//===========================================================================
function InitTrig_Valdis takes nothing returns nothing
set gg_trg_Valdis = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Valdis, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Valdis, Condition( function Conditions ) )
call TriggerAddAction( gg_trg_Valdis, function Trig_Valdis_Actions )
endfunction