- Joined
- Nov 21, 2012
- Messages
- 835
Strange bug: hero refuse orders, just follow his last target. Does not react to right-click (smart) order, staff of teleportation order, other ability is not casted (I tryed click few times at this bug-time). When hero dies, and reborn all control worked...
It happends when ability "Invunerable (anti-gravity)" activated. It happdends 1 time on last game I played (before, about 10 cast of this ability was succefull)
This ability is based on WindWalk. At cast time of "Invunerable (anti-gravity)" dummy casts SoulBurn-based spell on a Hero (to not allow hero cast other spells during "Invunerable")
Hero has also passive ability "Harbinger of Nibiru" (based on Evasion). It deals damage after some time after "Invunerable (anti-gravity)" is activated.
When I look at replay both buffs appeared right on hero (from "Invunerable " and "SoulBurn" abilities), and they dissapear as they should.
Only this control not worked. Model of hero is based on this custom model:
http://www.hiveworkshop.com/forums/models-530/power-lich-95113/
I use UnitIndexer.
this is run on event EVENT_PLAYER_UNIT_SPELL_EFFECT when "Invunerable (anti-gravity)" casted:
this is loop to deal damage from "Harbinger of Nibiru" spell:
You got any idea what can be wrong? Please remember this control bug appears only sometimes..
It happends when ability "Invunerable (anti-gravity)" activated. It happdends 1 time on last game I played (before, about 10 cast of this ability was succefull)
This ability is based on WindWalk. At cast time of "Invunerable (anti-gravity)" dummy casts SoulBurn-based spell on a Hero (to not allow hero cast other spells during "Invunerable")
Hero has also passive ability "Harbinger of Nibiru" (based on Evasion). It deals damage after some time after "Invunerable (anti-gravity)" is activated.
When I look at replay both buffs appeared right on hero (from "Invunerable " and "SoulBurn" abilities), and they dissapear as they should.
Only this control not worked. Model of hero is based on this custom model:
http://www.hiveworkshop.com/forums/models-530/power-lich-95113/
I use UnitIndexer.
this is run on event EVENT_PLAYER_UNIT_SPELL_EFFECT when "Invunerable (anti-gravity)" casted:
JASS:
function AntiGravity takes nothing returns nothing
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local unit d = CreateUnit(GetTriggerPlayer(), 'n010', x, y, 0.00)
local integer id = GetUnitUserData(d)
local real r
set udg_Spell_Caster[id] = GetTriggerUnit()
set udg_Spell_Level[id] = GetUnitAbilityLevel(udg_Spell_Caster[id], GetSpellAbilityId())
set r = I2R(udg_Spell_Level[id])
set udg_Spell_Damage[id] = ( 0.20 * r ) + 2.20
set udg_Spell_Duration[id] = 3.50 + ( 0.50 * r )
set udg_Spell_Counter[id] = 0
call SetUnitInvulnerable( udg_Spell_Caster[id], true ) //set invun
call UnitAddAbility(d, 'A0C4') //soul burn
call SetUnitAbilityLevel(d, 'A0C4', udg_Spell_Level[id])
call IssueTargetOrder( d, "soulburn", udg_Spell_Caster[id] )
if IsUnitGroupEmptyBJ(udg_Spell_Group_array[142]) then
call EnableTrigger( gg_trg_LoopAntiGravity )
endif
call GroupAddUnit(udg_Spell_Group_array[142], d )
set d=null
endfunction
this is loop to deal damage from "Harbinger of Nibiru" spell:
JASS:
//========================================
function Trig_LoopAntiGravity_Func001A takes nothing returns nothing
local unit d = GetEnumUnit()
local integer id = GetUnitUserData(d)
local player pla = GetOwningPlayer(d)
local real x
local real y
local integer harbringer
local real dmg
local unit u
// Harbringer of Nibiru -------
// Harbringer of Nibiru -------
if (udg_Spell_Counter[id] == 8) and (GetUnitAbilityLevel(udg_Spell_Caster[id], 'A0C7') > 0) then
set x = GetUnitX(udg_Spell_Caster[id])
set y = GetUnitY(udg_Spell_Caster[id])
set harbringer = GetUnitAbilityLevel(udg_Spell_Caster[id], 'A0C7')
set dmg = ( 10.00 * I2R(( harbringer * harbringer )) ) + 60.00
// ---increase spell by RobeOfTheMagi and InternallIntelligence -----
if HasItemZibi(udg_Spell_Caster[id], 'ward') then
set dmg = dmg * 1.25
elseif HasItemZibi(udg_Spell_Caster[id], 'arsc') then
set dmg = dmg * 1.50
endif
set bj_lastCreatedUnit = CreateUnit(pla, 'e01O', x, y, 0.00) //this is for visual effect only
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 2.00)
call GroupEnumUnitsInRange(udg_ug, x, y, 400.00, null)
loop
set u = FirstOfGroup(udg_ug)
exitwhen u == null
if IsUnitEnemy(u, pla) and IsUnitType(u, UNIT_TYPE_STRUCTURE) == false then
call UnitDamageTargetBJ( d, u, dmg, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC )
endif
call GroupRemoveUnit(udg_ug, u)
endloop
call GroupClear (udg_ug)
endif
//
set udg_Spell_Counter[id] = ( udg_Spell_Counter[id] + 1 )
set udg_Spell_Duration[id] = ( udg_Spell_Duration[id] - 0.25 )
// When the duration reaches 0 it means the spell is done
if udg_Spell_Duration[id] <= 0.00 then
// Clean up any data attached to this spell
call SetUnitInvulnerable( udg_Spell_Caster[id], false )
set udg_Spell_Counter[id] = 0
// Remove the dummy from the group and from the game
call GroupRemoveUnit(udg_Spell_Group_array[142], d )
call RemoveUnit( d )
if IsUnitGroupEmptyBJ(udg_Spell_Group_array[142]) then
call DisableTrigger( GetTriggeringTrigger() )
endif
endif
set d=null
set u=null
set pla=null
endfunction
//------------------------------------------
function Trig_LoopAntiGravity_Actions takes nothing returns boolean
call ForGroup( udg_Spell_Group_array[142], function Trig_LoopAntiGravity_Func001A )
return false
endfunction
//===========================================================================
function InitTrig_LoopAntiGravity takes nothing returns nothing
set gg_trg_LoopAntiGravity = CreateTrigger( )
call DisableTrigger( gg_trg_LoopAntiGravity )
call TriggerRegisterTimerEventPeriodic( gg_trg_LoopAntiGravity, 0.25 )
call TriggerAddCondition( gg_trg_LoopAntiGravity, Condition(function Trig_LoopAntiGravity_Actions ))
endfunction
You got any idea what can be wrong? Please remember this control bug appears only sometimes..