- Joined
- Apr 16, 2011
- Messages
- 158
hi,
I'm having some problems with my plasma field:
11 local hashtable gc = udg_HashCache
32 undeclared function DisBetweenPts
32 Cannot convert null to real
52 undeclared function KillTimer
69 undeclared variable udg_HashCache
What are the possible problems ?
thanks*
I'm having some problems with my plasma field:
11 local hashtable gc = udg_HashCache
32 undeclared function DisBetweenPts
32 Cannot convert null to real
52 undeclared function KillTimer
69 undeclared variable udg_HashCache
What are the possible problems ?
JASS:
function Trig_Plasma_Field_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A09H'
endfunction
function Trig_Plasma_Field_Targ takes nothing returns boolean
return GetWidgetLife(GetFilterUnit()) > 0.405 and not (IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) and IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)) and GetUnitAbilityLevel(GetFilterUnit(),'Aloc') == 0
endfunction
function Trig_Plasma_Field_Tick takes nothing returns nothing
local timer t = GetExpiredTimer()
local hashtable gc = udg_HashCache
local integer s = GetHandleId(t)
local unit u = LoadUnitHandle(gc,s,1)
local group g = CreateGroup()
local group hit = LoadGroupHandle(gc,s,2)
local boolexpr b = LoadBooleanExprHandle(gc,s,3)
local real c = LoadReal(gc,s,4)
local integer bc = LoadInteger(gc,s,5)
local unit p
local real pd
if bc == 0 then
set c = c+32
else
set c = c-32
endif
call SaveReal(gc,s,4,c)
call GroupEnumUnitsInRange(g,GetUnitX(u),GetUnitY(u),c,b)
call GroupRemoveUnit(g,u)
loop
exitwhen CountUnitsInGroup(g) == 0
set p = FirstOfGroup(g)
set pd = DistBetweenPts(GetUnitX(u),GetUnitY(u),GetUnitX(p),GetUnitY(p))
if (IsUnitEnemy(p,GetOwningPlayer(u)) and not IsUnitInGroup(p,hit)) and (pd < c+100 and pd > c-100) then
call GroupAddUnit(hit,p)
call UnitDamageTarget(u,p,(c/704)*LoadReal(gc,s,10),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\ChimaeraLightningMissile\\ChimaeraLightningMissile.mdl",p,"origin"))
endif
call GroupRemoveUnit(g,p)
set p = null
endloop
if bc == 0 then
if c > 700 then
call SaveInteger(gc,s,5,1)
call GroupClear(hit)
endif
else
if c <= 32 then
call DestroyEffect(LoadEffectHandle(gc,s,17))
call DestroyGroup(hit)
call DestroyBoolExpr(b)
call KillTimer(t)
call FlushChildHashtable(gc,s)
endif
endif
call DestroyGroup(g)
set t = null
set gc = null
set u = null
set g = null
set hit = null
set b = null
set p = null
endfunction
function Trig_Plasma_Field takes nothing returns nothing
local unit u = GetTriggerUnit()
local timer t = CreateTimer()
local hashtable gc = udg_HashCache
local integer s = GetHandleId(t)
local group hit = CreateGroup()
local boolexpr b = Condition(function Trig_Plasma_Field_Targ)
call DestroyEffect(AddSpecialEffectTarget("Effects\\PlasmaField.mdx",u,"origin"))
call SaveUnitHandle(gc,s,1,u)
call SaveGroupHandle(gc,s,2,hit)
call SaveBooleanExprHandle(gc,s,3,b)
call SaveEffectHandle(gc,s,17,AddSpecialEffectTarget("Effects\\LightningBall.mdx",u,"origin"))
call SaveReal(gc,s,10,35+35*I2R(GetUnitAbilityLevel(u,'A09H')))
call TimerStart(t,.04,true,function Trig_Plasma_Field_Tick)
set u = null
set t = null
set gc = null
set b = null
set hit = null
endfunction
function InitTrig_Plasma_Field takes nothing returns nothing
set gg_trg_Plasma_Field = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Plasma_Field, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Plasma_Field, Condition( function Trig_Plasma_Field_Conditions ) )
call TriggerAddAction( gg_trg_Plasma_Field, function Trig_Plasma_Field )
endfunction
thanks*