- Joined
- Nov 29, 2023
- Messages
- 13
So i have this spell 'A02R' based off channel
I've attach a pic of what i meant by "the green casting overlay" being active
Has anybody encountered this issue?
- baseOrderId = orderString: "blink"
- TargetType: Point Target
- casting time: 0.0s
- followTrough time: 1.0s
- disableOtherAbilities: true
- manual cast -> the spell is casted as intented
- triggered cast via
JASS:
call IssuePointOrderLoc(u, "blink", GetUnitLoc(u))
- triggered cast via
JASS:
call IssuePointOrderLoc(u, "blink", PolarProjectionBJ(GetUnitLoc(u), 25/*or any number != 0*/, 260))
JASS:
function Trig_W4V2_AI_Conditions takes nothing returns boolean
//call BJDebugMsg("actual " + I2S(GetUnitTypeId(GetAttacker())) + " " + R2S(BlzGetUnitAbilityCooldownRemaining(GetAttacker(), 'A02R'))+ " " + I2S(GetUnitCurrentOrder(GetAttacker())))
//call BJDebugMsg("expected " + I2S('H00T') + " 0.0 " + "not " + I2S(OrderId("blink")))
return GetUnitTypeId(GetAttacker()) == 'H00T' and BlzGetUnitAbilityCooldownRemaining(GetAttacker(), 'A02R') == 0.0 and GetUnitCurrentOrder(GetAttacker()) != OrderId("blink")
endfunction
function Trig_W4V2_AI_Actions takes nothing returns nothing
local unit farthest = null
local real distanceF = 0
local real distanceC = 0
local unit c
local group g = CreateGroup()
local unit u = GetAttacker()
local location l = GetUnitLoc(u)
local location lc
local player p = GetOwningPlayer(u)
call GroupEnumUnitsInRangeOfLoc(g, l, 700, function True_Filter)
loop
set c = FirstOfGroup(g)
exitwhen c == null
call GroupRemoveUnit(g, c)
if (IsUnitEnemy(c, p) and UnitAlive(c) and GetUnitAbilityLevel(c,'Avul') < 1 ) then
set lc = GetUnitLoc(c)
set distanceC = DistanceBetweenPoints(l, lc)
if (distanceC > distanceF) then
set distanceF = distanceC
set farthest = c
endif
call RemoveLocation(lc)
endif
endloop
set farthest = null
if (farthest != null) then
set lc = GetUnitLoc(farthest)
else
set lc = PolarProjectionBJ(l, 25, 260)
endif
//call RemoveGuardPosition(u)
//call BJDebugMsg(R2S(GetLocationX(lc)) + " " + R2S(GetLocationY(lc)))
//call IssuePointOrder(u, "blink", GetLocationX(lc), GetLocationY(lc))
//Test 2. this works!
call IssuePointOrderLoc(u, "blink", GetUnitLoc(u) )
//Test 3. this doesnt work!
//call IssuePointOrderLoc(u, "blink", PolarProjectionBJ(GetUnitLoc(u), 25, 260) )
call BJDebugMsg("aaaaa")
call DestroyGroup(g)
call RemoveLocation(lc)
call RemoveLocation(l)
set lc = null
set l = null
set u = null
set c = null
set farthest = null
set g = null
set p = null
endfunction
//===========================================================================
function InitTrig_W4V2_AI takes nothing returns nothing
set gg_trg_W4V2_AI = CreateTrigger( )
//call DisableTrigger( gg_trg_W4V2_AI )
call TriggerRegisterAnyUnitEventBJ( gg_trg_W4V2_AI, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_W4V2_AI, Condition( function Trig_W4V2_AI_Conditions ) )
call TriggerAddAction( gg_trg_W4V2_AI, function Trig_W4V2_AI_Actions )
endfunction
I've attach a pic of what i meant by "the green casting overlay" being active
Has anybody encountered this issue?