//---------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
// Gets Position of Player in MultiBoard
function MyFuncGetMultiBoardPosition takes integer PlayerNo returns integer
if ( PlayerNo >= 7 ) then
return ( CountPlayersInForceBJ(GetPlayersAllies(Player(2))) + ( PlayerNo -5 ) )
else
return ( PlayerNo + 1 )
endif
endfunction
function MyFuncUnitPlayerNo takes unit TargetUnit returns integer
return GetConvertedPlayerId(GetOwningPlayer(TargetUnit))
endfunction
function HeroRemoveConditionIfHero takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
function MyFuncSetHeroPath takes unit Hero , integer Path returns nothing
local integer PlayerNo
set PlayerNo = MyFuncUnitPlayerNo ( Hero )
if (IsPlayerAlly(GetOwningPlayer( Hero), Player(0)) == true ) then
if (Path ==0 )then
set udg_RightLegion = true
call IssuePointOrderLocBJ( Hero, "move", GetRectCenter(gg_rct_Legion_Base_Right_Spawn) )
set udg_Playerz_LSTOFU[PlayerNo] = udg_Y_Atk_Right_Damned_Tower_1
set udg_Playerz_STOFU[PlayerNo] = udg_Playerz_LSTOFU[PlayerNo]
endif
if (Path ==1 )then
set udg_RightLegion = false
call IssuePointOrderLocBJ( Hero, "move", GetRectCenter(gg_rct_Legion_Base_Left_Spawn) )
set udg_Playerz_LSTOFU[PlayerNo] = udg_Y_Atk_Left_Damned_Tower_1
set udg_Playerz_STOFU[PlayerNo] = udg_Playerz_LSTOFU[PlayerNo]
endif
return
endif
if (IsPlayerAlly(GetOwningPlayer( Hero), Player(6)) == true ) then
if (Path ==0 )then
set udg_RightDamned = true
call IssuePointOrderLocBJ( Hero, "move", GetRectCenter(gg_rct_Damned_Base_Right_Spawn) )
set udg_Playerz_LSTOFU[PlayerNo] = udg_Y_Atk_Right_Legion_Tower_1
set udg_Playerz_STOFU[PlayerNo] = udg_Playerz_LSTOFU[PlayerNo]
endif
if (Path ==1 )then
set udg_RightDamned = true
call IssuePointOrderLocBJ( Hero, "move", GetRectCenter(gg_rct_Damned_Base_Left_Spawn) )
set udg_Playerz_LSTOFU[PlayerNo] = udg_Y_Atk_Left_Legion_Tower_1
set udg_Playerz_STOFU[PlayerNo] = udg_Playerz_LSTOFU[PlayerNo]
endif
return
endif
endfunction
function MyFuncRemoveHero takes unit Hero returns nothing
local integer PlayerNo
local group TargetGroup
set PlayerNo = MyFuncUnitPlayerNo( Hero )
set TargetGroup = GetUnitsOfPlayerMatching(GetOwningPlayer(Hero), Condition(function HeroRemoveConditionIfHero))
call GroupRemoveUnitSimple( Hero , TargetGroup )
set udg_PlayerHero[PlayerNo] = GroupPickRandomUnit(TargetGroup)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call UnitAddItemSwapped( UnitItemInSlotBJ(Hero, GetForLoopIndexA()), udg_PlayerHero[PlayerNo] )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call ShowUnitHide( Hero )
call SetUnitOwner( Hero , Player(PLAYER_NEUTRAL_PASSIVE), true )
call TriggerSleepAction( 2.00 )
call RemoveUnit( Hero )
endfunction
function MyFuncHeroEngaged takes unit Hero returns boolean
set udg_PlayerNo = MyFuncUnitPlayerNo( Hero )
if ( ( udg_PlayerIsGoingForKill[udg_PlayerNo] == true ) ) then
return true
endif
if ( ( udg_PlayerIsEnagaged[udg_PlayerNo] == true ) ) then
return true
endif
return false
endfunction
function MyFuncIsHeroTeleporting takes unit Hero returns boolean
set udg_PlayerNo = MyFuncUnitPlayerNo( Hero )
if (udg_PlayerIsUsingTownScroll[udg_PlayerNo] == true) then
return true
endif
if ( GetUnitUserData( Hero ) == 911 ) then
return true
endif
return false
endfunction
// Make A unit go to a location
function MyFuncGoToThisPoint takes unit Hero , location TravelLocation returns nothing
local real DistanceLeftToCover
if (MyFuncIsHeroTeleporting( Hero ) ) then
return
endif
call IssuePointOrderLocBJ( Hero , "move", TravelLocation )
call TriggerSleepAction( 3.00 )
set DistanceLeftToCover = DistanceBetweenPoints(GetUnitLoc( Hero ), TravelLocation )
if (MyFuncHeroEngaged (Hero)) then
call SetUnitUserData( Hero , 0 )
return
endif
if ( DistanceLeftToCover < 200.00) then
call SetUnitUserData( Hero , 0 )
return
else
call MyFuncGoToThisPoint( Hero, TravelLocation )
endif
endfunction
//=================== Patrol to a location
function MyFuncPatrolToThisPoint takes unit Hero , location TravelLocation returns nothing
local real DistanceLeftToCover
if (MyFuncIsHeroTeleporting( Hero ) ) then
return
endif
call IssuePointOrderLocBJ( Hero , "patrol", TravelLocation )
call TriggerSleepAction( 3.00 )
set DistanceLeftToCover = DistanceBetweenPoints(GetUnitLoc( Hero ), TravelLocation )
if (MyFuncHeroEngaged (Hero)) then
call SetUnitUserData( Hero , 0 )
return
endif
if ( DistanceLeftToCover < 200.00) then
call SetUnitUserData( Hero , 0 )
return
else
call MyFuncPatrolToThisPoint ( Hero, TravelLocation )
endif
endfunction
// ===Checking For If Any Enemy is Arround in range.of hero===========
function FilterFunctionToCheckEnemy takes nothing returns boolean
return GetBooleanAnd( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer( udg_Caster )) == true,GetConvertedPlayerId(GetOwningPlayer(GetFilterUnit())) <=12)
endfunction
function MyFuncToCheckISEnemyArround takes unit Hero , real Range returns integer
set udg_Caster = Hero
return CountUnitsInGroup(GetUnitsInRangeOfLocMatching( Range , GetUnitLoc(Hero), Condition(function FilterFunctionToCheckEnemy )))
endfunction
// ===Checking For If Any Ally is Arround in range.of hero===========
function FilterFunctionToCheckAlly takes nothing returns boolean
return GetBooleanAnd( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer( udg_Caster )) == false ,GetConvertedPlayerId(GetOwningPlayer( GetFilterUnit() )) <= 12 )
endfunction
function MyFuncToCheckIsAllyArround takes unit Hero , real Range returns integer
set udg_Caster = Hero
return CountUnitsInGroup(GetUnitsInRangeOfLocMatching( Range , GetUnitLoc(Hero), Condition(function FilterFunctionToCheckAlly )))
endfunction
//========Life and Mana Checking Condition ======================
function MyFuncHealthAndManaCheckUpValue takes unit Hero, real Life, real Mana returns boolean
if ( not ( GetUnitStateSwap(UNIT_STATE_LIFE, Hero ) >= Life ) ) then
return false
endif
if ( not ( GetUnitStateSwap(UNIT_STATE_MANA, Hero ) >= Mana ) ) then
return false
endif
return true
endfunction
function WhenToStopPursue takes unit Hero returns boolean
if ( not ( GetUnitUserData(Hero) != 911 ) ) then
return false
endif
if ( not ( GetUnitUserData(Hero) != 501 ) ) 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 (MyFuncIsHeroTeleporting( Hero ) ) then
return
endif
if ( GetUnitUserData( Hero ) == 301 ) then
return
endif
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 DelayedPursue takes unit Hero , unit VictimHero , real Delay returns nothing
call TriggerSleepAction( Delay )
call MyFuncToAttackAndPursue ( Hero , VictimHero )
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
//==============================================================================
// Rogue Damage Function Change it at your own risk=============================
//==============================================================================
function MyFuncDisplayDamage takes unit RogueVictim , real DamageToBeDisplayed , integer DisplayTypeOfDamage returns nothing
if (DamageToBeDisplayed < 0 ) then
set DamageToBeDisplayed = 0
endif
//Following Codes are for displaying pre calculated damage in types of Hero , Piercing ,Critical
// Hero Display
if(DisplayTypeOfDamage == 0) then
call CreateTextTagUnitBJ(I2S(R2I(DamageToBeDisplayed)), 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
// Piercing Display
if(DisplayTypeOfDamage == 1) then
call CreateTextTagUnitBJ(I2S(R2I(DamageToBeDisplayed)), 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
// Critical Display
if(DisplayTypeOfDamage == 2) then
call CreateTextTagUnitBJ(I2S(R2I( DamageToBeDisplayed )), 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)
endif
endfunction
// ================Start Here ==========
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 ) // This sleep is important else it becomes iterative function.
set CustomValue = GetUnitUserData(Hero )
call SetUnitUserData( Hero ,420 ) // To stop iteration of same function
// 420 acts like a switch when function ends 420 changed to original Custom value
// This Function may seem complicated but it is not
// 1. -> First Rogue damages a unit in Hero Type of Attack
// 2. -> This Funion takes that damage.
// 3. -> It First Calculate damage reduction for Hero and Pierce type damage for that unit including armour reduction and Armour type
// Since hero and piercing type damage does diffent kind of damage for diffenet type armour it is important
// 4. -> It Checks whether it should do critical by checking the Critical var passed to it. if it is >2 then it does critical
// 5. -> If Critcal var recieved is less than 2 then it calculated agility bonus , and checks if rogue is behind attacked unit.
// 6. -> Then critical chance is generated by rnd gen function or if rogue is behind then it is always critical.
// 7. -> Then since already rogue has damaged we calculate pierce damage and display it.
if ( IsUnitAliveBJ( RogueVictim ) != true ) then
return
endif
set Steal = false
set Agility = GetHeroStatBJ(bj_HEROSTAT_AGI, Hero, true)
set AgilityBonus = (Agility - GetHeroStatBJ(bj_HEROSTAT_AGI, Hero, false))
// AgilityBonus is for Getting attack bonus from agility required for determining critical chance
// 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
//This if is for ability damage only not when unit damages
if(Critical >= 2 ) then
set Steal = true
//( 50 % pierce and 50 % hero )
// Critical Hero Damage Note that Rogue has already done damage so find critical by reducing that damage
set DamageToBeDone = Damage* Critical - Damage
call UnitDamageTargetBJ(Hero, RogueVictim, (DamageToBeDone), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL)
//Calaculation For Display of Damage only for Hero Part
set DamageToBeDone = Damage* Critical
set DamageToBeDone = (DamageToBeDone - (((DamageToBeDone) * DamageReductionHero)))
call MyFuncDisplayDamage ( RogueVictim , DamageToBeDone , 2 )
// Critical Piercing Damage Note Same damage is done in Piercing damage Type
set DamageToBeDone = Damage* Critical
call UnitDamageTargetBJ(Hero, RogueVictim, DamageToBeDone , ATTACK_TYPE_PIERCE, DAMAGE_TYPE_NORMAL)
//Calaculation For Display of Damage only for Piercing Part
set DamageToBeDone = DamageToBeDone - DamageToBeDone * DamageReductionPierce
call MyFuncDisplayDamage ( RogueVictim , DamageToBeDone , 2 )
else
set CriticalChance = (Agility / 4)
set CriticalChance = (100 - CriticalChance)
// Determining Agility Bonus for Critical chance
// every 4 agility increase chance by 1
// backStab When attacking from behind.
set FacingAngleOfVictim = GetUnitFacing(RogueVictim)
if (FacingAngleOfVictim <= 0.0) then
set FacingAngleOfVictim = (FacingAngleOfVictim + 360.0)
endif
// simple critical damage when attacking from back or due to critical chance
// CriticalChance is for determining critical chance ( lets say critical change is 10 then
// Then if random number generated is greater than ( 100 - 10 ) 90 then it is critical. ( Agility required for this is 40 )
if (GetBooleanOr(GetRandomInt(1, 100) >= CriticalChance,GetBooleanAnd(GetUnitFacing(Hero) >= (FacingAngleOfVictim - 30.0), GetUnitFacing(Hero) <= (FacingAngleOfVictim + 30.0)))) then
set Steal = true
// conversion of int to real then real to int since Damage is integer multiplyig it with .5 results 0
//( 50 % pierce and 50 % hero )
// Critical Hero Damage Note that Rogue has already done damage so find critical by reducing that damage
set DamageToBeDone = Damage* 2 - Damage
call UnitDamageTargetBJ(Hero, RogueVictim, (DamageToBeDone), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL)
//Calaculation For Display of Damage only for Hero Part
set DamageToBeDone = Damage* 2
set DamageToBeDone = (DamageToBeDone - (((DamageToBeDone) * DamageReductionHero)))
call MyFuncDisplayDamage ( RogueVictim , DamageToBeDone , 2 )
else
set DamageToBeDone = Damage
call UnitDamageTargetBJ(Hero, RogueVictim, (DamageToBeDone), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL)
set DamageToBeDone = Damage + Damage* DamageReductionHero
call MyFuncDisplayDamage ( RogueVictim , DamageToBeDone , 0 ) // 0 becoz we are displaying Hero Type damage
endif
// Now calculate Critical or Not For Pierce damage. I know i know your tierd already not very far now
// A little more coding thats all.
if (GetBooleanOr(GetRandomInt(1, 100) >= CriticalChance,GetBooleanAnd(GetUnitFacing(Hero) >= (FacingAngleOfVictim - 30.0), GetUnitFacing(Hero) <= (FacingAngleOfVictim + 30.0)))) then
set DamageToBeDone = Damage
set DamageToBeDone = (DamageToBeDone * 2)
call UnitDamageTargetBJ(Hero, RogueVictim, (DamageToBeDone), ATTACK_TYPE_PIERCE, DAMAGE_TYPE_NORMAL)
set DamageToBeDone = (DamageToBeDone - ( DamageToBeDone* DamageReductionPierce))
call MyFuncDisplayDamage ( RogueVictim , DamageToBeDone , 2 )
else
set DamageToBeDone = Damage
call MyFuncDisplayDamage ( RogueVictim , DamageToBeDone , 1)
endif
endif
call TriggerSleepAction( 0.51 )
call SetUnitUserData( Hero , 0 )
endfunction
//=====================================================================================
//== Retreat For Heal : When low health hero returns to fountain by scroll or by walk==
//=====================================================================================
function MoveToFountain takes unit Hero returns nothing
if (MyFuncIsHeroTeleporting( Hero ) ) then
//call DisplayTextToForce( GetPlayersAll(), " Hero is Telporting ")
return
endif
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
endfunction
function WalkToFountain takes unit Hero returns nothing
local integer PlayerNo
set PlayerNo = GetConvertedPlayerId(GetOwningPlayer( Hero ))
set udg_PlayerIsGoingForHeal[PlayerNo ]= true
call MoveToFountain( Hero )
call TriggerSleepAction( 3.00 )
call SetUnitUserData( Hero , 501 )
if ( GetUnitUserData(Hero) == 401) then
set udg_Playerz_STOFU[PlayerNo ]= udg_Playerz_LSTOFU[PlayerNo ]
set udg_PlayerIsGoingForHeal[PlayerNo ]= false
return
else
endif
if(GetBooleanAnd(GetUnitLifePercent( Hero)>=95.00,GetUnitManaPercent( Hero)>=95.00)) then
set udg_Playerz_STOFU[PlayerNo ]= udg_Playerz_LSTOFU[PlayerNo ]
set udg_PlayerIsGoingForHeal[PlayerNo ]= false
return
else
call WalkToFountain( Hero )
endif
endfunction
function MyFuncToTownScroll takes unit Hero returns nothing
local integer TotalEnemyCountGroup
local real DistanceLeftToCover
call SetUnitUserData( Hero , 501 )
set TotalEnemyCountGroup = MyFuncToCheckISEnemyArround (Hero,1000.00)
if ( TotalEnemyCountGroup > 0 ) then
call MoveToFountain( Hero )
else
call SetUnitUserData( Hero , 911 )
if ( IsUnitAlly(Hero, Player(0)) == true ) then
call UnitUseItemPointLoc( Hero , GetItemOfTypeFromUnitBJ( Hero , 'I009'), GetRectCenter(gg_rct_Fountain_Of_Legion) )
else
if ( IsUnitAlly(Hero, Player(6)) == true ) then
call UnitUseItemPointLoc( Hero , GetItemOfTypeFromUnitBJ( Hero , 'I009'), GetRectCenter( gg_rct_Fountain_Of_Damned ) )
endif
endif
set udg_PlayerNo = GetConvertedPlayerId(GetOwningPlayer( Hero ))
set udg_Playerz_STOFU[udg_PlayerNo] = "Retreating By Town Scroll"
endif
call TriggerSleepAction( 3.00 )
if ( IsUnitAlly(Hero, Player(0)) == true ) then
set DistanceLeftToCover = DistanceBetweenPoints(GetUnitLoc( Hero ), GetRectCenter( gg_rct_Fountain_Of_Legion ))
else
set DistanceLeftToCover = DistanceBetweenPoints(GetUnitLoc( Hero ), GetRectCenter( gg_rct_Fountain_Of_Damned ))
endif
if ( DistanceLeftToCover > 2000.00) then
call MyFuncToTownScroll( Hero )
else
call WalkToFountain( Hero )
endif
endfunction
function MyFuncRetreatForHeal takes unit Hero returns nothing
if ( GetUnitUserData(Hero) == 911) then
return
else
endif
if ( GetUnitUserData(Hero) == 401) then
return
else
endif
if ( GetPlayerController(GetOwningPlayer(Hero )) != MAP_CONTROL_USER ) then
return
endif
// Setting Status so that Hero Is Not Interupted
set udg_PlayerNo = GetConvertedPlayerId(GetOwningPlayer( Hero ))
set udg_PlayerIsGoingForHeal[udg_PlayerNo] = true
set udg_Playerz_STOFU[udg_PlayerNo] = "Retreating For Healing"
if ( UnitHasItemOfTypeBJ(Hero, 'I009') == true ) then
call MyFuncToTownScroll( Hero )
else
call WalkToFountain( Hero )
endif
endfunction
//==================================
function MyFuncRetreatTower takes unit Hero , integer Durration returns nothing
//call DisplayTextToForce( GetPlayersAll(), GetUnitName(Hero) )
call MoveToFountain( Hero )
call TriggerSleepAction( 0.50 )
if ( GetBooleanOr(not(MyFuncHealthAndManaCheckUpValue(Hero,250.00,0.00)) , GetUnitLifePercent( Hero) <= 40.00 ) ) then
call MyFuncRetreatForHeal (Hero)
return
endif
if(Durration <1) then
set udg_PlayerNo = GetConvertedPlayerId(GetOwningPlayer( Hero ))
set udg_PlayerIsGoingForHeal[udg_PlayerNo] = true
set udg_PlayerIsEnagaged[udg_PlayerNo] = true
set udg_Playerz_STOFU[udg_PlayerNo] = udg_Playerz_LSTOFU[udg_PlayerNo]
return
endif
call MyFuncRetreatTower ( Hero , Durration -1)
endfunction
//=================================
function MyFuncHeroEngage takes unit Hero , unit Target , integer Durration returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = Durration
if (MyFuncIsHeroTeleporting( Hero ) ) then
return
endif
if ( GetUnitUserData( Hero ) == 301 ) then
return
endif
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( GetBooleanOr( not (MyFuncHealthAndManaCheckUpValue(Hero, 250.00,0.00)) , GetUnitLifePercent( Hero) <= 50.00 ) ) then
call MyFuncRetreatTower (Hero ,10 )
return
endif
if ( GetUnitUserData( Hero )!= 0 ) then
return
endif
call IssueTargetOrderBJ( Hero ,"attack", Target)
call TriggerSleepAction( 0.50 )
set udg_PlayerNo = GetConvertedPlayerId(GetOwningPlayer( Hero ))
set udg_PlayerIsGoingForHeal[udg_PlayerNo] = true
set udg_PlayerIsEnagaged[udg_PlayerNo] = true
set udg_Playerz_STOFU[udg_PlayerNo] = "Engaging " + GetUnitName(udg_TargetUnit)
endloop
endfunction
//=============================Spells Global Function Area Changes can have serious effect on thier working
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
// Dedicated To Hero Respawn and stats and Sound
//
function MyFuncPlayerColouredUnitName takes unit PlayerUnit returns string
local integer PlayerNo
local unit Hero
local string HeroName
set PlayerNo = MyFuncUnitPlayerNo ( PlayerUnit )
set Hero = udg_PlayerHero[ PlayerNo ]
set HeroName = GetUnitName( Hero )
set HeroName = HeroName + " |r"
if ( PlayerNo == 1 ) then
set HeroName = "|c00FF0000 " + " Legion |r"
endif
if ( PlayerNo == 2 ) then
set HeroName = "|c000042FF " + HeroName
endif
if ( PlayerNo == 3 ) then
set HeroName = "|c0000FFFF " + HeroName
endif
if ( PlayerNo == 4 ) then
set HeroName = "|c00400080 " + HeroName
endif
if ( PlayerNo == 5 ) then
set HeroName = "|c00FEBA0E " + HeroName
endif
if ( PlayerNo == 6 ) then
set HeroName = "|c00FF8000 " + HeroName
endif
if ( PlayerNo == 7 ) then
set HeroName = "|c0000FF00 " + " Damned |r"
endif
if ( PlayerNo == 8 ) then
set HeroName = "|c00FF80C0 " + HeroName
endif
if ( PlayerNo == 9 ) then
set HeroName = "|c00808080 " + HeroName
endif
if ( PlayerNo == 10 ) then
set HeroName = "|c007575FF " + HeroName
endif
if ( PlayerNo == 11 ) then
set HeroName = "|c00004000 " + HeroName
endif
if ( PlayerNo == 12) then
set HeroName = "|c00804040 " + HeroName
endif
return HeroName
endfunction
function MyFuncRespawnHero takes integer PlayerNoOfKiller , integer PlayerNoOfDead , integer TimeLeftToRespawn ,integer BountyToCollect returns nothing
local unit KillerHero
local unit DeadHero
local integer VarInteger
local integer GoldOfKiller
local integer GoldOfDead
local real VarReal
local string NameOfKillerHero
local string NameOfDeadHero
local string DisplayMessage
call TriggerSleepAction( 2.00 )
set KillerHero = udg_PlayerHero[PlayerNoOfKiller]
set DeadHero = udg_PlayerHero[PlayerNoOfDead]
set NameOfKillerHero = MyFuncPlayerColouredUnitName ( KillerHero )
set NameOfDeadHero = MyFuncPlayerColouredUnitName ( DeadHero )
if ( TimeLeftToRespawn <= 2 ) then
set VarInteger = MyFuncGetMultiBoardPosition ( PlayerNoOfDead )
call MultiboardSetItemValueBJ( udg_MyDisplayBoard, 1, VarInteger, NameOfDeadHero )
if ( BountyToCollect > 0 ) then
set DisplayMessage = NameOfKillerHero
set DisplayMessage = ( DisplayMessage + "has asked a bounty of |c00FEBA0E " )
set DisplayMessage = ( DisplayMessage + I2S(BountyToCollect) )
set DisplayMessage = ( DisplayMessage + "|r Gold for " )
set DisplayMessage = ( DisplayMessage + NameOfDeadHero )
set DisplayMessage = ( DisplayMessage + "'s Head " )
call DisplayTextToForce( GetPlayersAll(), DisplayMessage )
set GoldOfKiller = GetPlayerState(ConvertedPlayer(PlayerNoOfKiller), PLAYER_STATE_RESOURCE_GOLD)
set GoldOfDead = GetPlayerState(ConvertedPlayer(PlayerNoOfDead), PLAYER_STATE_RESOURCE_GOLD)
set GoldOfDead = ( GoldOfDead - BountyToCollect )
set GoldOfKiller = ( GoldOfKiller + BountyToCollect )
call SetPlayerStateBJ( ConvertedPlayer(PlayerNoOfDead), PLAYER_STATE_RESOURCE_GOLD, GoldOfDead )
call SetPlayerStateBJ( ConvertedPlayer(PlayerNoOfKiller), PLAYER_STATE_RESOURCE_GOLD, GoldOfKiller )
endif
call AddSpecialEffectLocBJ( udg_wLocationDying[PlayerNoOfKiller], "Abilities\\Spells\\Human\\Resurrect\\ResurrectCaster.mdl" )
call RemoveUnit( udg_wDyingImposterHero[PlayerNoOfDead] )
if ( IsPlayerAlly(ConvertedPlayer(PlayerNoOfDead), Player(0)) == true ) then
call ReviveHeroLoc( udg_PlayerHero[PlayerNoOfDead], GetRectCenter(gg_rct_Fountain_Of_Legion), false )
else
call ReviveHeroLoc( udg_PlayerHero[PlayerNoOfDead], GetRectCenter(gg_rct_Fountain_Of_Damned), false )
endif
if ( udg_ModeDebtXp == true ) then
set VarInteger = GetHeroXP(DeadHero)
set VarReal = I2R(VarInteger)
set VarReal = ( VarReal * 0.10 )
set VarInteger = ( 0 - R2I(VarReal) )
call AddHeroXPSwapped( VarInteger, udg_PlayerHero[PlayerNoOfDead], false )
call DisplayTextToForce( GetPlayersAll(), ( "The hero is Taxed of An Xp of |c005151FF " + I2S(IAbsBJ(VarInteger)) ) )
endif
return
else
endif
set TimeLeftToRespawn = ( TimeLeftToRespawn - 2 )
set DisplayMessage = ( NameOfDeadHero + " ( " )
set DisplayMessage = ( DisplayMessage + I2S(TimeLeftToRespawn) )
set DisplayMessage = ( DisplayMessage + " )" )
set VarInteger = MyFuncGetMultiBoardPosition ( PlayerNoOfDead )
if ( udg_ModeTaxingRespawnBounty == true ) then
set BountyToCollect = ( BountyToCollect + R2I(( I2R(BountyToCollect) * 0.01 )) )
else
endif
call MultiboardSetItemValueBJ( udg_MyDisplayBoard, 1, VarInteger, DisplayMessage )
// Its a iterative funtion I dont know the performance Issue with this Kind of funnction
// If you think its a bad idea mail me with reason or post a message on the forum
call MyFuncRespawnHero( PlayerNoOfKiller , PlayerNoOfDead , TimeLeftToRespawn , BountyToCollect )
return
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 | |
ConstPlayerCap | integer | No | |
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 | |
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 | |
Intelligence | 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 | |
LightiningEffect | lightning | Yes | |
LivingPoisonCaster | unit | No | |
Location | location | No | |
loopA | integervar | No | |
LoopInfinite | integer | No | |
ManaConst | real | No | |
Minute | integer | No | |
ModeDebtGold | boolean | No | |
ModeDebtXp | boolean | No | |
ModePlayerDebtGold | integer | Yes | |
ModeTaxingRespawnBounty | boolean | 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 | |
MultiBoard | hashtable | No | |
MyDisplayBoard | multiboard | No | |
MyTimer | timer | No | |
NewClassAbility | abilcode | Yes | |
NoOfPlayers | integer | No | |
Num | integer | No | |
Offset | integer | No | |
Owner | player | No | |
PlayerHero | unit | Yes | |
PlayerIsEnagaged | boolean | Yes | |
PlayerIsGoingForHeal | boolean | Yes | |
PlayerIsGoingForKill | boolean | Yes | |
PlayerIsJobClassAttained | boolean | Yes | |
PlayerIsStatDoubleKillOn | boolean | Yes | |
PlayerIsStatRampageOn | boolean | Yes | |
PlayerIsStatTripleKillOn | boolean | Yes | |
PlayerIsUsingTownScroll | boolean | Yes | |
PlayerIsXpBountyOn | boolean | Yes | |
PlayerNo | integer | No | |
PlayerNumCustomValueTimer | integer | Yes | |
PlayerNumRetreatTimer | integer | Yes | |
PlayerVictim | unit | Yes | |
Playerz_DeathBill | integer | Yes | |
Playerz_HeroLevel | integer | Yes | |
Playerz_KillBill | integer | Yes | |
Playerz_KillingSpreeCurrent | integer | Yes | |
Playerz_KillingSpreePrevious | integer | Yes | |
Playerz_KillStatDoubleKill | integer | Yes | |
Playerz_KillStatRampage | integer | Yes | |
Playerz_KillStatTripleKill | integer | Yes | |
Playerz_KillStatusTime | integer | Yes | |
Playerz_LSTOFU | string | Yes | |
Playerz_STOFU | string | 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 | |
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_Unit_1 | unit | No | |
Termal_Eruption_Ability_Level | integer | 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 | |
Terrain_Hash | hashtable | No | |
TerrainType | terraintype | 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 | |
VarInt | integer | No | |
VarReal | real | No | |
wAPlayerNoDying | integer | No | |
wAPlayerNoKilling | integer | No | |
wBounty | integer | No | |
wDisplayMessage | string | No | |
wDyingImposterHero | unit | Yes | |
wGoldDying | integer | No | |
wGoldKilling | integer | No | |
wHeroDying | unit | No | |
wHeroKilling | unit | No | |
wHeroLevelDying | integer | No | |
wHeroLevelKilling | integer | No | |
wHeroNameDying | string | No | |
wHeroNameKilling | string | No | |
wLevelDiff | integer | No | |
wLevelDiffBountyBonus | integer | No | |
wLevelDiffXpbonus | integer | No | |
wLocationDying | location | Yes | |
wRespawnTime | integer | No | |
wUnitKilling | unit | No | |
X | integer | No | |
x1 | real | No | |
Y | integer | No | |
Y_Atk_Damned_Portal | string | No | |
Y_Atk_Left_Damned_Tower_1 | string | No | |
Y_Atk_Left_Damned_Tower_2 | string | No | |
Y_Atk_Left_Damned_Tower_3 | string | No | |
Y_Atk_Left_Legion_Tower_1 | string | No | |
Y_Atk_Left_Legion_Tower_2 | string | No | |
Y_Atk_Left_Legion_Tower_3 | string | No | |
Y_Atk_Left_Legion_Tower_4 | string | No | |
Y_Atk_Legion_Portal | string | No | |
Y_Atk_Right_Damned_Tower_1 | string | No | |
Y_Atk_Right_Damned_Tower_2 | string | No | |
Y_Atk_Right_Damned_Tower_3 | string | No | |
Y_Atk_Right_Damned_Tower_4 | string | No | |
Y_Atk_Right_Legion_Tower_1 | string | No | |
Y_Atk_Right_Legion_Tower_2 | string | No | |
Y_Atk_Right_Legion_Tower_3 | string | 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( 1.20 )
// 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', Player(PLAYER_NEUTRAL_AGGRESSIVE ), 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 AddSpecialEffectTargetUnitBJ( "origin", GetLastCreatedUnit(), "Hammer_of_Thor.mdx" )
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(), 50.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(), 50.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
function Trig_Contages_Insanctus_Activate_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A06V' ) ) then
return false
endif
return true
endfunction
function TerrainTypeChangedOrNot takes location HeroLoc3 returns boolean
if ( not ( GetTerrainTypeBJ(HeroLoc3) != 'Drds' ) ) then
return false
endif
if ( not ( GetTerrainTypeBJ(HeroLoc3) != 'Dlvc' ) ) then
return false
endif
if ( not ( GetTerrainTypeBJ(HeroLoc3) != 'Glav' ) ) then
return false
endif
return true
endfunction
function Trig_Contages_Insanctus_Activate_Actions takes nothing returns nothing
local integer i
local integer j
local integer AbilityLevel
local integer TempVarInt
local integer LoopA
local location HeroLocProjection
local location HeroSqrtLoc1
local location HeroLoc2
local location HeroLoc3
call EnableTrigger( gg_trg_Contages_insanctus_Terrain_Change )
set AbilityLevel = GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetTriggerUnit())
set i = 1
loop
exitwhen i > 4
set j = 1
loop
exitwhen j > 36
set HeroLocProjection = PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()), ( 200.00 * I2R( i ) ), ( I2R( j ) * 10.00 ))
// -------------------------
// -------------------------
// -------------------------
// -------------------------
// -------------------------
// -------------------------
// Terrain changing system
// -------------------------
set HeroSqrtLoc1 = PolarProjectionBJ(HeroLocProjection, ( 1 * SquareRoot(( 2.00 * Pow(128.00, 2.00) )) ), 225.00)
set bj_forLoopAIndex = 0
set bj_forLoopAIndexEnd = 2
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set HeroLoc2 = PolarProjectionBJ(HeroSqrtLoc1, ( I2R(GetForLoopIndexA()) * 128.00 ), 90.00)
set bj_forLoopBIndex = 0
set bj_forLoopBIndexEnd = 2
loop
exitwhen bj_forLoopBIndex > bj_forLoopBIndexEnd
set HeroLoc3 = PolarProjectionBJ(HeroLoc2, ( I2R(GetForLoopIndexB()) * 128.00 ), 0)
// -------------------------
// If terrain already changed, no changes
// -------------------------
if ( TerrainTypeChangedOrNot( HeroLoc3) ) then
set TempVarInt = GetTerrainVarianceBJ(HeroLoc3)
call CreateNUnitsAtLoc( 1, 'n009', GetOwningPlayer(GetTriggerUnit()), HeroLoc3, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_CI_Dummies )
call UnitApplyTimedLifeBJ( GetRandomReal(20.00, 30.00), 'BTLF', GetLastCreatedUnit() )
set LoopA = 0
loop
exitwhen LoopA > R2I(udg_CI_Reals[12])
if ( GetTerrainTypeBJ(HeroLoc3) == udg_CI_Terrain_Types[LoopA] ) then
// -------------------------
// Save original terrain type and variation
// -------------------------
call SaveIntegerBJ( LoopA, StringHashBJ("terrain_type"), GetHandleIdBJ(GetLastCreatedUnit()), udg_Terrain_Hash )
call SaveIntegerBJ( TempVarInt, StringHashBJ("terrain_variation"), GetHandleIdBJ(GetLastCreatedUnit()), udg_Terrain_Hash )
else
endif
set LoopA = LoopA + 1
endloop
set TempVarInt = GetRandomInt(1, 3)
if ( TempVarInt == 1 ) then
set TempVarInt = GetRandomInt(1, 2)
if ( TempVarInt == 1 ) then
call UnitAddAbilityBJ( 'A072', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A072', GetLastCreatedUnit(), AbilityLevel )
call SetTerrainTypeBJ( HeroLoc3, 'Dlav', -1, 1, 0 )
else
call SetTerrainTypeBJ( HeroLoc3, 'Drds', -1, 1, 0 )
endif
else
if ( TempVarInt == 2 ) then
call UnitAddAbilityBJ( 'A072', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A072', GetLastCreatedUnit(), AbilityLevel )
call SetTerrainTypeBJ( HeroLoc3, 'Dlav', -1, 1, 0 )
else
call UnitAddAbilityBJ( 'A073', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A073', GetLastCreatedUnit(), AbilityLevel )
call SetTerrainTypeBJ( HeroLoc3, 'Dlvc', -1, 1, 0 )
endif
endif
else
endif
call RemoveLocation(HeroLoc3)
set bj_forLoopBIndex = bj_forLoopBIndex + 1
endloop
call RemoveLocation(HeroLoc2)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call RemoveLocation(HeroSqrtLoc1)
set j = j + 1
endloop
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_Contages_Insanctus_Activate takes nothing returns nothing
set gg_trg_Contages_Insanctus_Activate = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Contages_Insanctus_Activate, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Contages_Insanctus_Activate, Condition( function Trig_Contages_Insanctus_Activate_Conditions ) )
call TriggerAddAction( gg_trg_Contages_Insanctus_Activate, function Trig_Contages_Insanctus_Activate_Actions )
endfunction