Steelb_l_ade
11-07-2008, 23:42
It seems since the release of warcraft 3's latest update the Sea Drake's "Divebomb" spell causes extreme lag online, We have checked other similier spells to this and they all function fine, it appears Blizzard ahve changed some of the functions in the latest update and that is what has caused this issue, as soon as i can work out why this is there will be an update to resolve this issue, If u have any other suggestions for changes that i can include in the new version please use the forum.
I havent worked out yet why Divebomb now lags so badly, the code for it is listed below, so feel free to try and work it out for yourselves and if u figure it out let me know.
DIVEBOMB CODE
"DIVEBOMB TRIGGER"
function Trig_DiveBomb_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0B7' ) ) then
return false
endif
return true
endfunction
function Trig_DiveBomb_Func008C takes nothing returns boolean
if ( not ( R2I(udg_Spell_DiveBombDistanceA) > 650 ) ) then
return false
endif
return true
endfunction
function Trig_DiveBomb_Actions takes nothing returns nothing
set udg_Spell_DiveBombCaster = GetTriggerUnit()
set udg_Spell_DiveBombPointA = GetUnitLoc(udg_Spell_DiveBombCaster)
set udg_Spell_DiveBombTargetPoint = GetSpellTargetLoc()
set udg_Spell_DiveBombDirection = AngleBetweenPoints(udg_Spell_DiveBombPointA, udg_Spell_DiveBombTargetPoint)
set udg_Spell_DiveBombDistanceA = DistanceBetweenPoints(udg_Spell_DiveBombPointA, udg_Spell_DiveBombTargetPoint)
call SetUnitFacingToFaceLocTimed( udg_Spell_DiveBombCaster, udg_Spell_DiveBombTargetPoint, 0 )
set udg_Spell_DiveBombDirection = GetUnitFacing(udg_Spell_DiveBombCaster)
if ( Trig_DiveBomb_Func008C() ) then
set udg_Spell_DiveBombDistanceA = 650.00
else
call DoNothing( )
endif
set udg_Spell_DiveBombDistanceB = ( udg_Spell_DiveBombDistanceA / 50.00 )
// 13 MAX
set udg_Spell_DiveBombKnock = 8.00
set udg_Spell_DiveBombKnockAngle = udg_Spell_DiveBombDirection
call RemoveLocation(udg_Spell_DiveBombPointA)
call EnableTrigger( gg_trg_DiveBombKNOCKBACK )
call EnableTrigger( gg_trg_DiveBombMove )
call TriggerSleepAction( 0.50 )
call DisableTrigger( gg_trg_DiveBombKNOCKBACK )
call DisableTrigger( gg_trg_DiveBombMove )
endfunction
//================================================== =========================
function InitTrig_DiveBomb takes nothing returns nothing
set gg_trg_DiveBomb = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_DiveBomb, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_DiveBomb, Condition( function Trig_DiveBomb_Conditions ) )
call TriggerAddAction( gg_trg_DiveBomb, function Trig_DiveBomb_Actions )
endfunction
"DIVEBOMB MOVE TRIGGER"
function Trig_DiveBombMove_Actions takes nothing returns nothing
// FIRES 50 TIMES
set udg_Spell_DiveBombPointA = GetUnitLoc(udg_Spell_DiveBombCaster)
call SetUnitPositionLoc( udg_Spell_DiveBombCaster, PolarProjectionBJ(udg_Spell_DiveBombPointA, udg_Spell_DiveBombDistanceB, udg_Spell_DiveBombDirection) )
call AddSpecialEffectLocBJ( udg_Spell_DiveBombPointA, "Abilities\\Weapons\\WaterElementalMissile\\WaterEl ementalMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveLocation(udg_Spell_DiveBombPointA)
endfunction
//================================================== =========================
function InitTrig_DiveBombMove takes nothing returns nothing
set gg_trg_DiveBombMove = CreateTrigger( )
call DisableTrigger( gg_trg_DiveBombMove )
call TriggerRegisterTimerEventPeriodic( gg_trg_DiveBombMove, 0.01 )
call TriggerAddAction( gg_trg_DiveBombMove, function Trig_DiveBombMove_Actions )
endfunction
"DIVEBOMB KNOCKBACK TRIGGER"
function Trig_DiveBombKNOCKBACK_Func002002003001 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_DiveBombKNOCKBACK_Func002002003002001 takes nothing returns boolean
return ( GetFilterUnit() != udg_Spell_DiveBombCaster )
endfunction
function Trig_DiveBombKNOCKBACK_Func002002003002002001 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_ANCIENT) == false )
endfunction
function Trig_DiveBombKNOCKBACK_Func002002003002002002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction
function Trig_DiveBombKNOCKBACK_Func002002003002002 takes nothing returns boolean
return GetBooleanAnd( Trig_DiveBombKNOCKBACK_Func002002003002002001(), Trig_DiveBombKNOCKBACK_Func002002003002002002() )
endfunction
function Trig_DiveBombKNOCKBACK_Func002002003002 takes nothing returns boolean
return GetBooleanAnd( Trig_DiveBombKNOCKBACK_Func002002003002001(), Trig_DiveBombKNOCKBACK_Func002002003002002() )
endfunction
function Trig_DiveBombKNOCKBACK_Func002002003 takes nothing returns boolean
return GetBooleanAnd( Trig_DiveBombKNOCKBACK_Func002002003001(), Trig_DiveBombKNOCKBACK_Func002002003002() )
endfunction
function Trig_DiveBombKNOCKBACK_Func005Func006C takes nothing returns boolean
if ( not ( IsPlayerEnemy(GetOwningPlayer(GetEnumUnit()), GetOwningPlayer(udg_Spell_DiveBombCaster)) == true ) ) then
return false
endif
return true
endfunction
function Trig_DiveBombKNOCKBACK_Func005A takes nothing returns nothing
set udg_Spell_DiveBombKnockPoint = GetUnitLoc(GetEnumUnit())
call AddSpecialEffectLocBJ( udg_Spell_DiveBombKnockPoint, "Abilities\\Weapons\\AncientProtectorMissile\\Ancie ntProtectorMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call SetUnitPositionLoc( GetEnumUnit(), PolarProjectionBJ(udg_Spell_DiveBombKnockPoint, udg_Spell_DiveBombKnock, udg_Spell_DiveBombKnockAngle) )
call RemoveLocation(udg_Spell_DiveBombKnockPoint)
if ( Trig_DiveBombKNOCKBACK_Func005Func006C() ) then
call UnitDamageTargetBJ( udg_Spell_DiveBombCaster, GetEnumUnit(), ( 1.00 * I2R(GetUnitAbilityLevelSwapped('A0B7', udg_Spell_DiveBombCaster)) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_DIVINE )
else
call DoNothing( )
endif
endfunction
function Trig_DiveBombKNOCKBACK_Actions takes nothing returns nothing
set udg_Spell_DiveBombPointB = GetUnitLoc(udg_Spell_DiveBombCaster)
set udg_Spell_DiveBombKnockGroup = GetUnitsInRangeOfLocMatching(225.00, udg_Spell_DiveBombPointB, Condition(function Trig_DiveBombKNOCKBACK_Func002002003))
call RemoveLocation(udg_Spell_DiveBombPointB)
set udg_Spell_DiveBombKnock = ( udg_Spell_DiveBombKnock - 0.07 )
call ForGroupBJ( udg_Spell_DiveBombKnockGroup, function Trig_DiveBombKNOCKBACK_Func005A )
call DestroyGroup (udg_Spell_DiveBombKnockGroup)
endfunction
//================================================== =========================
function InitTrig_DiveBombKNOCKBACK takes nothing returns nothing
set gg_trg_DiveBombKNOCKBACK = CreateTrigger( )
call DisableTrigger( gg_trg_DiveBombKNOCKBACK )
call TriggerRegisterTimerEventPeriodic( gg_trg_DiveBombKNOCKBACK, 0.01 )
call TriggerAddAction( gg_trg_DiveBombKNOCKBACK, function Trig_DiveBombKNOCKBACK_Actions )
endfunction
I havent worked out yet why Divebomb now lags so badly, the code for it is listed below, so feel free to try and work it out for yourselves and if u figure it out let me know.
DIVEBOMB CODE
"DIVEBOMB TRIGGER"
function Trig_DiveBomb_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0B7' ) ) then
return false
endif
return true
endfunction
function Trig_DiveBomb_Func008C takes nothing returns boolean
if ( not ( R2I(udg_Spell_DiveBombDistanceA) > 650 ) ) then
return false
endif
return true
endfunction
function Trig_DiveBomb_Actions takes nothing returns nothing
set udg_Spell_DiveBombCaster = GetTriggerUnit()
set udg_Spell_DiveBombPointA = GetUnitLoc(udg_Spell_DiveBombCaster)
set udg_Spell_DiveBombTargetPoint = GetSpellTargetLoc()
set udg_Spell_DiveBombDirection = AngleBetweenPoints(udg_Spell_DiveBombPointA, udg_Spell_DiveBombTargetPoint)
set udg_Spell_DiveBombDistanceA = DistanceBetweenPoints(udg_Spell_DiveBombPointA, udg_Spell_DiveBombTargetPoint)
call SetUnitFacingToFaceLocTimed( udg_Spell_DiveBombCaster, udg_Spell_DiveBombTargetPoint, 0 )
set udg_Spell_DiveBombDirection = GetUnitFacing(udg_Spell_DiveBombCaster)
if ( Trig_DiveBomb_Func008C() ) then
set udg_Spell_DiveBombDistanceA = 650.00
else
call DoNothing( )
endif
set udg_Spell_DiveBombDistanceB = ( udg_Spell_DiveBombDistanceA / 50.00 )
// 13 MAX
set udg_Spell_DiveBombKnock = 8.00
set udg_Spell_DiveBombKnockAngle = udg_Spell_DiveBombDirection
call RemoveLocation(udg_Spell_DiveBombPointA)
call EnableTrigger( gg_trg_DiveBombKNOCKBACK )
call EnableTrigger( gg_trg_DiveBombMove )
call TriggerSleepAction( 0.50 )
call DisableTrigger( gg_trg_DiveBombKNOCKBACK )
call DisableTrigger( gg_trg_DiveBombMove )
endfunction
//================================================== =========================
function InitTrig_DiveBomb takes nothing returns nothing
set gg_trg_DiveBomb = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_DiveBomb, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_DiveBomb, Condition( function Trig_DiveBomb_Conditions ) )
call TriggerAddAction( gg_trg_DiveBomb, function Trig_DiveBomb_Actions )
endfunction
"DIVEBOMB MOVE TRIGGER"
function Trig_DiveBombMove_Actions takes nothing returns nothing
// FIRES 50 TIMES
set udg_Spell_DiveBombPointA = GetUnitLoc(udg_Spell_DiveBombCaster)
call SetUnitPositionLoc( udg_Spell_DiveBombCaster, PolarProjectionBJ(udg_Spell_DiveBombPointA, udg_Spell_DiveBombDistanceB, udg_Spell_DiveBombDirection) )
call AddSpecialEffectLocBJ( udg_Spell_DiveBombPointA, "Abilities\\Weapons\\WaterElementalMissile\\WaterEl ementalMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveLocation(udg_Spell_DiveBombPointA)
endfunction
//================================================== =========================
function InitTrig_DiveBombMove takes nothing returns nothing
set gg_trg_DiveBombMove = CreateTrigger( )
call DisableTrigger( gg_trg_DiveBombMove )
call TriggerRegisterTimerEventPeriodic( gg_trg_DiveBombMove, 0.01 )
call TriggerAddAction( gg_trg_DiveBombMove, function Trig_DiveBombMove_Actions )
endfunction
"DIVEBOMB KNOCKBACK TRIGGER"
function Trig_DiveBombKNOCKBACK_Func002002003001 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_DiveBombKNOCKBACK_Func002002003002001 takes nothing returns boolean
return ( GetFilterUnit() != udg_Spell_DiveBombCaster )
endfunction
function Trig_DiveBombKNOCKBACK_Func002002003002002001 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_ANCIENT) == false )
endfunction
function Trig_DiveBombKNOCKBACK_Func002002003002002002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction
function Trig_DiveBombKNOCKBACK_Func002002003002002 takes nothing returns boolean
return GetBooleanAnd( Trig_DiveBombKNOCKBACK_Func002002003002002001(), Trig_DiveBombKNOCKBACK_Func002002003002002002() )
endfunction
function Trig_DiveBombKNOCKBACK_Func002002003002 takes nothing returns boolean
return GetBooleanAnd( Trig_DiveBombKNOCKBACK_Func002002003002001(), Trig_DiveBombKNOCKBACK_Func002002003002002() )
endfunction
function Trig_DiveBombKNOCKBACK_Func002002003 takes nothing returns boolean
return GetBooleanAnd( Trig_DiveBombKNOCKBACK_Func002002003001(), Trig_DiveBombKNOCKBACK_Func002002003002() )
endfunction
function Trig_DiveBombKNOCKBACK_Func005Func006C takes nothing returns boolean
if ( not ( IsPlayerEnemy(GetOwningPlayer(GetEnumUnit()), GetOwningPlayer(udg_Spell_DiveBombCaster)) == true ) ) then
return false
endif
return true
endfunction
function Trig_DiveBombKNOCKBACK_Func005A takes nothing returns nothing
set udg_Spell_DiveBombKnockPoint = GetUnitLoc(GetEnumUnit())
call AddSpecialEffectLocBJ( udg_Spell_DiveBombKnockPoint, "Abilities\\Weapons\\AncientProtectorMissile\\Ancie ntProtectorMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call SetUnitPositionLoc( GetEnumUnit(), PolarProjectionBJ(udg_Spell_DiveBombKnockPoint, udg_Spell_DiveBombKnock, udg_Spell_DiveBombKnockAngle) )
call RemoveLocation(udg_Spell_DiveBombKnockPoint)
if ( Trig_DiveBombKNOCKBACK_Func005Func006C() ) then
call UnitDamageTargetBJ( udg_Spell_DiveBombCaster, GetEnumUnit(), ( 1.00 * I2R(GetUnitAbilityLevelSwapped('A0B7', udg_Spell_DiveBombCaster)) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_DIVINE )
else
call DoNothing( )
endif
endfunction
function Trig_DiveBombKNOCKBACK_Actions takes nothing returns nothing
set udg_Spell_DiveBombPointB = GetUnitLoc(udg_Spell_DiveBombCaster)
set udg_Spell_DiveBombKnockGroup = GetUnitsInRangeOfLocMatching(225.00, udg_Spell_DiveBombPointB, Condition(function Trig_DiveBombKNOCKBACK_Func002002003))
call RemoveLocation(udg_Spell_DiveBombPointB)
set udg_Spell_DiveBombKnock = ( udg_Spell_DiveBombKnock - 0.07 )
call ForGroupBJ( udg_Spell_DiveBombKnockGroup, function Trig_DiveBombKNOCKBACK_Func005A )
call DestroyGroup (udg_Spell_DiveBombKnockGroup)
endfunction
//================================================== =========================
function InitTrig_DiveBombKNOCKBACK takes nothing returns nothing
set gg_trg_DiveBombKNOCKBACK = CreateTrigger( )
call DisableTrigger( gg_trg_DiveBombKNOCKBACK )
call TriggerRegisterTimerEventPeriodic( gg_trg_DiveBombKNOCKBACK, 0.01 )
call TriggerAddAction( gg_trg_DiveBombKNOCKBACK, function Trig_DiveBombKNOCKBACK_Actions )
endfunction