H2I went bye bye... Warcraft III Patch in place.
Posted: August 4th, 2009, 12:52 pm
So, with that said, EotA is now unhostable. I'm willing to volunteer myself or dekar to take the time to convert current EotA to a usable current. <_<
An Aeon of Strife map for Warcraft 3
http://eota.emufarmers.com/forums/
So looking at the version you said would be out by May at best, and it's currently August. . .We can expect something sometime around January on?DarnYak wrote:I'm on it!
ETA No sooner than october
DarnYak
If you have a working JNGP/JH I'll help you do some scripts, and I'm sure perhaps will be willing to help out too (not sure if anyone else knows jass well)DarnYak wrote:Ok, I originally wrote this patch off as being an easy fix because all i should have to do is change two functions. Turns out, that's not the case, and all the possible quickfixes won't work or save me almost no time at all. So...this is going to be a big fucking mess of a rewrite.
DarnYak
Patchlog wrote:- Der mögliche Exploit aufgrund unsicherer Typumwandlungen in Jazz
("Ausgabefehler") wurde behoben.
Code: Select all
function Trig_Ability_Streak_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0S6'
endfunction
function Streak_Valid_Target takes nothing returns boolean
local unit u = GetFilterUnit()
local boolean valid = true
set valid = valid and u != udg__Caster
//set valid = valid and IsUnitEnemy(u, GetOwningPlayer(udg__Caster) )
set valid = valid and IsUnitAliveBJ(u)
set valid = valid and not IsUnitWard(u)
set valid = valid and not IsUnitPhased(u)
set valid = valid and not IsUnitType(u, UNIT_TYPE_STRUCTURE)
set valid = valid and not IsUnitInGroup(u, udg__ExcludeGroup)
set valid = valid and DistanceBetween(GetUnitX(u), GetUnitY(u), udg__CenterX, udg__CenterY) < udg__Damage
set valid = valid and DistanceBetweenUnits(u, udg__Caster) < udg__Damage
set valid = valid and GetUnitTypeId(u) != 'h01E'
set u = null
return valid
endfunction
function Streak_UnitLoop takes nothing returns nothing
local unit u = GetEnumUnit()
if (udg__Target == null or DistanceBetweenUnits(u,udg__Caster) < DistanceBetweenUnits(udg__Target, udg__Caster) ) then
set udg__Target = u
endif
set u = null
endfunction
function Streak_RodLoop takes nothing returns nothing
local unit u = GetEnumUnit()
local real d = 0
if ( IsUnitAliveBJ(u) and DistanceBetween(GetUnitX(u), GetUnitY(u), udg__CenterX, udg__CenterY) < udg__Damage) then
set d = DistanceBetweenUnits(u,udg__Caster)
if (d <= udg__Damage and d <= udg__Range + 2.5 * GetUnitState(u, UNIT_STATE_MANA) ) then
if (udg__Target == null or DistanceBetweenUnits(u,udg__Caster) < DistanceBetweenUnits(udg__Target, udg__Caster) ) then
set udg__Target = u
endif
endif
endif
set u = null
endfunction
function Streak_NextStep takes string key returns nothing
local real x1 = GetUnitX(udg__Caster)
local real y1 = GetUnitY(udg__Caster)
local real x2 = GetStoredReal(udg_Cache, key, "TargetX")
local real y2 = GetStoredReal(udg_Cache, key, "TargetY")
local real z1 = 0
local real range = GetStoredReal(udg_Cache, key, "Range")
local unit target = ToUnit(InstGetHandle(key, "Target"))
local location node = null
local real angle = 0
local lightning bolt = null
if (target != null) then
set x2 = GetUnitX(target)
set y2 = GetUnitY(target)
endif
set udg__CenterX = x2
set udg__CenterY = y2
set udg__Target = null
set udg__Range = range
set udg__Damage = DistanceBetween(x1, y1, x2, y2) - 1.0
call ForTempGroup( GetUnitsInRange(x1, y1, range , Condition(function Streak_Valid_Target)),function Streak_UnitLoop )
if (udg__Target == null) then
call ForGroup(udg_A_LightningRods, function Streak_RodLoop)
endif
//Before SetFlyHeight
set z1 = GetTerrainZ(x1, y1) + GetUnitFlyHeight(udg__Caster) + 50
if (udg__Target == null) then
if (DistanceBetween(x1, y1, x2, y2) > range) then
set angle = AngleBetween(x1, y1, x2, y2)
set x2 = x1 + range * Cos(angle)
set y2 = y1 + range * Sin(angle)
call StoreReal(udg_Cache, key, "LastX", x2)
call StoreReal(udg_Cache, key, "LastY", y2)
else
call StoreReal(udg_Cache, key, "LastX", x2)
call StoreReal(udg_Cache, key, "LastY", y2)
endif
call InstSaveHandle(key, "Next", null)
call SetUnitFlyHeight(udg__Caster, 0, RAbsBJ( GetUnitFlyHeight(udg__Caster) ) / ( DistanceBetween(x1, y1, x2, y2) / 1500 ) )
else
call InstSaveHandle(key, "Next", udg__Target)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\Bolt\\BoltImpact.mdl",udg__Target,"origin"))
if ( IsUnitEnemy(udg__Target, GetOwningPlayer(udg__Caster) ) ) then
call CastOnUnit(udg__Target, GetOwningPlayer(udg__Caster), 'A0NA', 4, "thunderbolt")
endif
call SetUnitFlyHeight(udg__Caster, GetUnitFlyHeight(udg__Target), RAbsBJ( GetUnitFlyHeight(udg__Target) - GetUnitFlyHeight(udg__Caster) ) / ( DistanceBetweenUnits(udg__Target, udg__Caster) / 1500 ) )
endif
call StoreReal(udg_Cache, key, "StartX", x1)
call StoreReal(udg_Cache, key, "StartY", y1)
call StoreReal(udg_Cache, key, "StartZ", z1)
set bolt = AddLightningEx("FORK", true, x1, y1, z1, x1, y1, z1)
set node = Location(HtoR(InstGetHandle(key, "Bolts")), HtoR(bolt))
call InstSaveHandle(key, "Bolts", node)
set target = null
set node = null
set bolt = null
endfunction
function Streak_ClearBlurs_Timer takes nothing returns nothing
local string key = GetDataKey(GetExpiredTimer())
local location n = ToLocation ( InstGetHandle(key, "Next") )
local location first = ToLocation ( InstGetHandle(key, "First") )
local unit u = ToUnit( RtoH(GetLocationY(n)) )
local integer i = 0
if (ToLocation( RtoH(GetLocationX(n)) ) == first) then
call SetUnitVertexColor(u, 255,255, 255, 0 )
call ClearDataKey(key)
call DestroyTimer(GetExpiredTimer())
else
call InstSaveHandle(key, "Next", ToLocation( RtoH(GetLocationX(n)) ) )
call SetUnitAnimation(u, "stand ready")
loop
call SetUnitVertexColor(u, 255,255, 255, R2I( 255 * I2R(i) / 20 ) )
set n = ToLocation( RtoH(GetLocationX(n)) )
exitwhen n == first
set i = i + 1
set u = ToUnit( RtoH(GetLocationY(n)) )
endloop
endif
set n = null
set first = null
set u = null
endfunction
function Streak_ClearBlurs takes string keyCaster returns nothing
local timer t = CreateTimer()
local string key = CreateDataKey(t)
local location n = ToLocation ( InstGetHandle(keyCaster, "StreakClones") )
call InstSaveHandle(key, "First", n)
call InstSaveHandle(key, "Next", n)
call TimerStart(t, TimerGetTimeout(GetExpiredTimer()), true, function Streak_ClearBlurs_Timer)
set n = null
set t = null
endfunction
function Streak_UpdateBlur takes string key, real x,real y, real z, real facing returns nothing
local location n = ToLocation ( InstGetHandle(key, "StreakClones") )
local unit u = ToUnit( RtoH(GetLocationY(n)) )
local location first = n
local integer i = 1
call SetUnitPosition(u, x, y)
call SetUnitFlyHeight(u, z, 10000)
call SetUnitFacing(u, facing)
//call ShowUnit(u, true)
call SetUnitVertexColor(u, 255,255, 255, 255 )
call SetUnitAnimationByIndex(u, 0)
call SetUnitAnimationByIndex(u, 8)
call InstSaveHandle(key, "StreakClones", ToLocation( RtoH(GetLocationX(n)) ) )
loop
set n = ToLocation( RtoH(GetLocationX(n)) )
exitwhen n == first
set u = ToUnit( RtoH(GetLocationY(n)) )
call SetUnitVertexColor(u, 255,255, 255, R2I( 255 * I2R(i) / 20 ) )
set i = i + 1
endloop
set u = null
set n = null
set first = null
endfunction
function Streak_Timer_Actions takes nothing returns nothing
local string key = GetDataKey(GetExpiredTimer())
local real dT = TimerGetTimeout(GetExpiredTimer())
local unit caster = ToUnit(InstGetHandle(key, "Caster"))
local unit next = ToUnit(InstGetHandle(key, "Next"))
local real x1 = GetUnitX(caster)
local real y1 = GetUnitY(caster)
local real x2 = 0
local real y2 = 0
local real dist = dT * 1500
local real angle = 0
local lightning bolt = ToLightning(RtoH(GetLocationY( ToLocation( InstGetHandle(key, "Bolts") ) ) ) )
local boolean done = false
local location node = null
local location nodeNext = null
local real efDist = GetStoredReal(udg_Cache, key, "EffectDist") + dist
if ( IsUnitDisabled(caster) ) then
set dist = 0
set done = true
set x2 = x1
set y2 = y1
endif
loop
exitwhen done
if (next != null) then
set x2 = GetUnitX(next)
set y2 = GetUnitY(next)
else
set x2 = GetStoredReal(udg_Cache, key, "LastX")
set y2 = GetStoredReal(udg_Cache, key, "LastY")
endif
exitwhen dist < DistanceBetween(x1, y1, x2, y2)
set dist = dist - DistanceBetween(x1, y1, x2, y2)
call MoveLightningEx(bolt, true, GetStoredReal(udg_Cache, key, "StartX"), GetStoredReal(udg_Cache, key, "StartY"), GetStoredReal(udg_Cache, key, "StartZ"), x2, y2, GetTerrainZ(x2, y2) + GetUnitFlyHeight(caster) + 50)
call SetUnitPosition(caster, x2, y2)
if (next == null or next == ToUnit(InstGetHandle(key, "Target")) ) then
set done = true
else
set udg__Caster = caster
call Streak_NextStep(key)
set next = ToUnit(InstGetHandle(key, "Next"))
set x1 = x2
set y1 = y2
set bolt = ToLightning(RtoH(GetLocationY( ToLocation( InstGetHandle(key, "Bolts") ) ) ) )
endif
exitwhen done
endloop
if (done) then
set node = ToLocation( InstGetHandle(key, "Bolts") )
loop
exitwhen node == null
set nodeNext = ToLocation(RtoH(GetLocationX(node)))
set bolt = ToLightning(RtoH(GetLocationY(node)))
call DestroyLightning(bolt)
call RemoveLocation(node)
set node = nodeNext
endloop
//call PauseUnit(caster, false)
call SetUnitPathing(caster, true)
call SetUnitTimeScale(caster, 1)
call SetUnitAnimation(caster, "stand ready")
call SetUnitFlyHeight(caster, 0, 10000)
call SetUnitPosition(caster, x1, y1)
call SetUnitPosition(caster, x2, y2)
call CheckUnitLandedInWater(caster, GetOwningPlayer(caster))
call Streak_ClearBlurs(CreateDataKey(caster))
set next = ToUnit(InstGetHandle(key, "Target"))
if (next == null) then
call IssuePointOrder( caster, "move", GetStoredReal(udg_Cache, key, "TargetX"), GetStoredReal(udg_Cache, key, "TargetY") )
else
call IssueTargetOrder( caster, "smart", next )
endif
call ClearDataKey(key)
call DestroyTimer(GetExpiredTimer())
else
set angle = AngleBetween(x1, y1, x2, y2)
set x2 = x1 + dist * Cos(angle)
set y2 = y1 + dist * Sin(angle)
call SetUnitPosition(caster, x2, y2)
call SetUnitFacingTimed(caster, angle * 180.0/bj_PI, 0.01)
call MoveLightningEx(bolt, true, GetStoredReal(udg_Cache, key, "StartX"), GetStoredReal(udg_Cache, key, "StartY"), GetStoredReal(udg_Cache, key, "StartZ"), x2, y2, GetTerrainZ(x2, y2) + GetUnitFlyHeight(caster) + 50)
if (efDist >= 30) then
if (GetUnitFlyHeight(caster) <= 50) then
call DestroyEffect(AddSpecialEffect( "custom\\Heroes\\Martyr\\StreakGround.mdx", x2, y2 ) )
endif
set efDist = efDist - 30
endif
call StoreReal(udg_Cache, key, "EffectDist", efDist)
call Streak_UpdateBlur(CreateDataKey(caster), GetUnitX(caster), GetUnitY(caster), GetUnitFlyHeight(caster), GetUnitFacing(caster))
endif
set caster = null
set next = null
set bolt = null
endfunction
function Trig_Ability_Streak_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit caster = GetTriggerUnit()
local unit target = GetSpellTargetUnit()
local integer level = GetUnitAbilityLevel(caster,GetSpellAbilityId())
local location tloc = null
local string key = CreateDataKey(t)
local lightning bolt = null
local location node = null
local location nodeFirst = null
local integer i = 0
set udg__Caster = caster
call StoreReal(udg_Cache, key, "Bolts", HtoR(null))
if (target == null) then
set tloc = GetSpellTargetLoc()
call StoreReal(udg_Cache, key, "TargetX", GetLocationX(tloc))
call StoreReal(udg_Cache, key, "TargetY", GetLocationY(tloc))
call InstSaveHandle(key, "Target", null)
call RemoveLocation(tloc)
set tloc = null
else
call InstSaveHandle(key, "Target", target)
set target = null
endif
call InstSaveHandle(key, "Caster", caster)
call StoreReal(udg_Cache, key, "Range", R('A0S6',"Range", level ) )
call InstSaveHandle(key, "Bolts", null)
call Streak_NextStep(key)
//call PauseUnit(caster, true)
call SetUnitPathing(caster, false)
call SetUnitAnimationByIndex(caster, 8)
call SetUnitTimeScale(caster, 3)
call TimerStart(t, 15.0 / 1500.0, true, function Streak_Timer_Actions)
set key = CreateDataKey(caster)
set node = ToLocation ( InstGetHandle(key, "StreakClones") )
if ( node == null) then
call UnitAddAbility(caster, 'Amrf')
call UnitRemoveAbility(caster, 'Amrf')
set target = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'n05E', GetUnitX(caster), GetUnitY(caster), GetUnitFacing(caster) )
set node = Location(HtoR(null), HtoR(target))
set nodeFirst = node
set i = 1
loop
call SetUnitTimeScale(target, 3)
call UnitAddAbility(target, 'Amrf')
call UnitRemoveAbility(target, 'Amrf')
//call ShowUnit(target, false)
set i = i + 1
exitwhen i >= 20
set target = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'n05E', GetUnitX(caster), GetUnitY(caster), GetUnitFacing(caster) )
set node = Location(HtoR(node), HtoR(target))
endloop
call InstSaveHandle(key, "StreakClones", node)
call MoveLocation(nodeFirst, HtoR(node), GetLocationY(nodeFirst))
else
//loop
// set target = ToUnit( RtoH(GetLocationY(node)) )
// call SetUnitPosition(target, GetUnitX(caster), GetUnitY(caster))
// call SetUnitFacing(target, GetUnitFacing(caster))
// set node = ToLocation( RtoH(GetLocationX(node)) )
// exitwhen node == null
//endloop
endif
set bolt = null
set caster = null
set target = null
set t = null
endfunction
//===========================================================================
function InitTrig_Ability_Streak takes nothing returns nothing
endfunction
Code: Select all
//! novjass
<code>
//! endnovjass
Code: Select all
library dotStack
private struct dotDat
unit source
unit target
integer dps
integer length
string fx
endstruct
globals
private constant real REPEATTIME=.5 //How often the periodic damage runs. DPS will automatically update.
private dotDat array dotDB
private integer dbIndex=-1
private timer time=CreateTimer()
endglobals
private function p takes nothing returns nothing
local dotDat tempDat
local integer index=0
local effect fx
loop
exitwhen index>dbIndex
set tempDat=dotDB[index]
set fx=AddSpecialEffect(tempDat.fx,GetUnitX(tempDat.target),GetUnitY(tempDat.target))
call DestroyEffect(fx)
call UnitDamageTarget(tempDat.source,tempDat.target,tempDat.dps*REPEATTIME,true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
set tempDat.length=tempDat.length-1
if tempDat.length<1 or GetWidgetLife(tempDat.target)<1 then
call tempDat.destroy()
set dotDB[index]=dotDB[dbIndex]
set dbIndex=dbIndex-1
if dbIndex==-1 then
call PauseTimer(time)
endif
endif
set index=index+1
endloop
endfunction
function addDot takes unit source, unit target, integer dps, integer length, string fx returns nothing
local dotDat tempDat=dotDat.create()
set tempDat.source=source
set tempDat.target=target
set tempDat.dps=dps
set tempDat.length=length
set tempDat.fx=fx
set dbIndex=dbIndex+1
set dotDB[dbIndex]=tempDat
if dbIndex==0 then
call TimerStart(time,REPEATTIME,true,function p)
endif
endfunction
endlibrary
If you're refering to me, because i dont want to rewrite all the code, only updating those I must update to the gamecacheDekar wrote:Why dont you just use a hashtable insead of gamecache?
That's not really difficult to begin with. You just need a proper naming scheme going in (which is all scopes do, append extra stuff to the front of every variable/function)The beauty of vjass and scopes is privatization so you don't have to worry about conflicts.
I know what a stack is - I have no idea how it applies to the spell.I don't know if you're familiar with the idea of a stack but here's a (simple) example
Code: Select all
call TimerStart(t, 15.0 / 1500.0, true, function Streak_Timer_Actions)
I take it c5 is going to be the deep breath before the plunge into d and/or e?and then try to get c5 out for testing.
When i do shit like that, both those values mean something to me, where as the resulting 0.01 doesn't. In this case, I believe its "I want him to update every 15 distance, and have him more 1500 distance a second"GeneralFunk wrote:What's the deal with the 15.0/1500.0, why not just 0.01?Code: Select all
call TimerStart(t, 15.0 / 1500.0, true, function Streak_Timer_Actions)
Kinda figured that. Good luck on d Yak!c5 is a quick compatability fix version so that there can be a playable EotA for the time being.
That's where I'd write ".01 //(15/1500)"DarnYak wrote:When i do shit like that, both those values mean something to me, where as the resulting 0.01 doesn't. In this case, I believe its "I want him to update every 15 distance, and have him more 1500 distance a second"GeneralFunk wrote:What's the deal with the 15.0/1500.0, why not just 0.01?Code: Select all
call TimerStart(t, 15.0 / 1500.0, true, function Streak_Timer_Actions)
DarnYak