//---------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 MyFuncToAttackAndPursue ( Hero , Target)
else
return
endif
call IssueTargetOrderBJ( Hero, "attack", Target )
call TriggerSleepAction( 2 )
if ( IsUnitAliveBJ( Target ) != true ) then
return
endif
endfunction
function IsHeroAvailability takes integer Hero returns boolean
set bj_forLoopAIndex = 5
set bj_forLoopAIndexEnd = 13
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 MyFuncRogueAttack takes unit Hero , unit RogueVictim ,integer Critical , integer RogueMinDamage ,integer RogueMaxDamage returns nothing
local boolean Steal
local integer Agility
local integer num
local integer DamageToBeDone
local integer AgilityBonus
local integer CriticalChance
local integer Gold
local real DamageReduction
local real DamageReductionPierce
local real DamageReductionHero
local real LifeBeforeAttack
local real LifeAfterAttack
local real FacingAngleOfVictim
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 = (DamageReductionPierce / 50.0)
call SetUnitLifeBJ(RogueVictim, LifeBeforeAttack)
if(Critical >= 1 ) then
set DamageToBeDone = GetRandomInt((RogueMinDamage + AgilityBonus), (RogueMaxDamage + AgilityBonus))
// conversion of int to real then real to int since udgDamage is integer multiplyig it with .6 results 0
set DamageToBeDone = R2I(I2R(DamageToBeDone) * 1)
// Critical damge = 2 times normal damage
set DamageToBeDone = (DamageToBeDone * Critical)
if (IsUnitIllusionBJ(Hero) != true ) then
call UnitDamageTargetBJ(Hero, RogueVictim, I2R(DamageToBeDone), ATTACK_TYPE_PIERCE, DAMAGE_TYPE_NORMAL)
else
endif
set DamageToBeDone = (DamageToBeDone - R2I((I2R(DamageToBeDone) * DamageReductionPierce)))
if(DamageToBeDone < 0) then
set DamageToBeDone = 0
else
endif
call CreateTextTagUnitBJ(I2S(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 = GetRandomInt((RogueMinDamage + AgilityBonus), (RogueMaxDamage + AgilityBonus))
set DamageToBeDone = R2I(I2R(DamageToBeDone) * 1)
set DamageToBeDone = (DamageToBeDone * Critical )
if (IsUnitIllusionBJ(Hero) != true ) then
call UnitDamageTargetBJ(Hero, RogueVictim, I2R(DamageToBeDone), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL)
else
endif
set DamageToBeDone = (DamageToBeDone - R2I((I2R(DamageToBeDone) * DamageReductionHero)))
if(DamageToBeDone < 0) then
set DamageToBeDone = 0
else
endif
call CreateTextTagUnitBJ(I2S(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
set DamageToBeDone = GetRandomInt((RogueMinDamage + AgilityBonus), (RogueMaxDamage + AgilityBonus))
// conversion of int to real then real to int since udgDamage is integer multiplyig it with .6 results 0
set DamageToBeDone = R2I(I2R(DamageToBeDone) * 1)
// Critical damge = 2 times normal damage
set DamageToBeDone = (DamageToBeDone * 2)
if (IsUnitIllusionBJ(Hero) == true ) then
else
call UnitDamageTargetBJ(Hero, RogueVictim, I2R(DamageToBeDone), ATTACK_TYPE_PIERCE, DAMAGE_TYPE_NORMAL)
endif
set DamageToBeDone = (DamageToBeDone - R2I((I2R(DamageToBeDone) * DamageReductionPierce)))
if(DamageToBeDone < 0) then
set DamageToBeDone = 0
else
endif
call CreateTextTagUnitBJ(I2S(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 = GetRandomInt((RogueMinDamage + AgilityBonus), (RogueMaxDamage + AgilityBonus))
set DamageToBeDone = R2I(I2R(DamageToBeDone) * 0.6)
// Checking if Rogue Illusions are attacking
if (IsUnitIllusionBJ(Hero) == true) then
else
call UnitDamageTargetBJ(Hero, RogueVictim, I2R(DamageToBeDone), ATTACK_TYPE_PIERCE, DAMAGE_TYPE_NORMAL)
endif
set DamageToBeDone = (DamageToBeDone - R2I((I2R(DamageToBeDone) * DamageReductionPierce)))
if(DamageToBeDone < 0) then
set DamageToBeDone = 0
else
endif
call CreateTextTagUnitBJ(I2S(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 = GetRandomInt((RogueMinDamage + AgilityBonus), (RogueMaxDamage + AgilityBonus))
set DamageToBeDone = R2I(I2R(DamageToBeDone) * 1)
set DamageToBeDone = (DamageToBeDone * 2)
if (IsUnitIllusionBJ(Hero) == true) then
else
call UnitDamageTargetBJ(Hero, RogueVictim, I2R(DamageToBeDone), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL)
endif
set DamageToBeDone = (DamageToBeDone - R2I((I2R(DamageToBeDone) * DamageReductionHero)))
if(DamageToBeDone < 0) then
set DamageToBeDone = 0
else
endif
call CreateTextTagUnitBJ(I2S(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 = GetRandomInt((RogueMinDamage + AgilityBonus), (RogueMaxDamage + AgilityBonus))
set DamageToBeDone = R2I(I2R(DamageToBeDone) * 0.4)
call UnitDamageTargetBJ(Hero, RogueVictim, I2R(DamageToBeDone), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL)
if (IsUnitIllusionBJ(Hero) == true) then
else
set DamageToBeDone = (DamageToBeDone - R2I((I2R(DamageToBeDone) * DamageReductionHero)))
endif
if(DamageToBeDone < 0) then
set DamageToBeDone = 0
else
endif
call CreateTextTagUnitBJ(I2S(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
if ( GetBooleanAnd( Steal == true , IsUnitType(RogueVictim, UNIT_TYPE_STRUCTURE) != true ) ) then
if( GetUnitAbilityLevelSwapped('A06I', udg_Caster) == 1 ) then
set Gold = GetPlayerState(GetOwningPlayer(RogueVictim), PLAYER_STATE_RESOURCE_GOLD)
set Gold = R2I((I2R(Gold) * 0.1))
call SetPlayerStateBJ(GetOwningPlayer(Hero), PLAYER_STATE_RESOURCE_GOLD, (GetPlayerState(GetOwningPlayer(Hero), PLAYER_STATE_RESOURCE_GOLD) + Gold))
call SetPlayerStateBJ(GetOwningPlayer(RogueVictim), PLAYER_STATE_RESOURCE_GOLD, (GetPlayerState(GetOwningPlayer(RogueVictim), PLAYER_STATE_RESOURCE_GOLD) - Gold))
else
endif
else
endif
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( 0.50 )
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_Caster | unit | 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_Target | unit | 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 | |
CreepRespawn | hashtable | No | |
Damage | integer | No | |
Distance | real | 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 | |
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 | |
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 | |
Intelligence | integer | No | |
IntVar | integer | No | |
ItemCost | integer | Yes | |
ItemID | itemcode | Yes | |
ItemToSell | item | No | |
ItemType | itemcode | 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 | |
LivingPoisonCaster | unit | No | |
Location | location | 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 | |
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 | |
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 | |
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 | |
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 | |
Y_Map_Point | location | Yes |
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
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 MyFuncRogueAttack( Hero , TargetUnit , 2 , udg_RogueDiceIncMin , udg_RogueDiceInc )
if ( IsUnitAliveBJ(TargetUnit) == true ) then
call DoNothing( )
else
call SetUnitPositionLocFacingLocBJ( Hero, GetRandomLocInRect(RectFromCenterSizeBJ(GetUnitLoc(TargetUnit), 700.00, 700.00)), GetUnitLoc(TargetUnit) )
call EnableTrigger( gg_trg_Rogue_Attack )
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
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 kinky
call PanCameraToTimedLocForPlayer( Player(2), PolarProjectionBJ(GetUnitLoc(Target), 100.00, 120.00), 0 )
call SetCameraFieldForPlayer( Player(2), CAMERA_FIELD_TARGET_DISTANCE, 3500.00, 0 )
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 SetUnitAnimation( Caster, "attack" )
call SetUnitTimeScalePercent( Caster, 25.00 )
call TriggerSleepAction( 1.00 )
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
call SetUnitTimeScalePercent( Target, 100.00 )
call ResetUnitAnimation( Target )
call TriggerSleepAction( 0.50 )
call UnitRemoveAbilityBJ( 'Avul', Target )
call MyFuncRogueAttack( Caster , Target , 10 , udg_RogueDiceIncMin , udg_RogueDiceInc )
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(1), 2.00 )
endfunction
//===========================================================================
function InitTrig_Cold_Up_And_Hot_Down takes nothing returns nothing
set gg_trg_Cold_Up_And_Hot_Down = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Cold_Up_And_Hot_Down, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Cold_Up_And_Hot_Down, Condition( function Trig_HotOrCold_Conditions ) )
call TriggerAddAction( gg_trg_Cold_Up_And_Hot_Down, function HotAndCold )
endfunction