Doom-Angel
Jass User (Just started using NewGen)
- Reaction score
- 167
i tried to create bunch of dummies in so it would be creating them all in a big line starting from the target point going to both sides and i want this line of dummies to be vertical to the caster.
now i tried something which works sometimes but sometimes it doesn't and just creates a line which is not vertical to my caster from the target point.
code:
(btw ignore the comment parts - still under check for those)
anyway can anybody help me solving this half problem and find out why it's not going vertical all the time?
thanks in advance
now i tried something which works sometimes but sometimes it doesn't and just creates a line which is not vertical to my caster from the target point.
code:
JASS:
function Fire_Wall_Conditions takes nothing returns boolean
return (GetSpellAbilityId() == 039;ANcl039;)
endfunction
function CreateFireWall takes nothing returns boolean
local Data vars = ABCT_GetData()
local integer i = 0
local group g = CreateGroup()
local unit first
local boolean b
set vars.r = vars.r+50
set vars.moveX = vars.targetX+(vars.r)*Cos(vars.angle+90 * bj_DEGTORAD)
set vars.moveY = vars.targetY+(vars.r)*Sin(vars.angle+90 * bj_DEGTORAD)
// set b = IsPositionPathable(vars.moveX,vars.moveY)
// if(b) then
set vars.dummy[vars.i] = CreateUnit(GetOwningPlayer(vars.u),039;n001039;,vars.moveX,vars.moveY, 25.00)
call UnitApplyTimedLife(vars.dummy[vars.i],039;BTLF039;,5)
set vars.i = vars.i+1
// endif
set vars.moveX = vars.targetX+(vars.r)*Cos(vars.angle-90 * bj_DEGTORAD)
set vars.moveY = vars.targetY+(vars.r)*Sin(vars.angle-90 * bj_DEGTORAD)
// set b = IsPositionPathable(vars.moveX,vars.moveY)
//if(b) then
set vars.dummy[vars.i] = CreateUnit(GetOwningPlayer(vars.u),039;n001039;,vars.moveX,vars.moveY, 25.00)
call UnitApplyTimedLife(vars.dummy[vars.i],039;BTLF039;,4)
set vars.i = vars.i+1
//endif
loop
exitwhen(i>vars.i)
call GroupEnumUnitsInRange(g,GetUnitX(vars.dummy<i>),GetUnitY(vars.dummy<i>),50,null)
loop
set first = FirstOfGroup(g)
exitwhen(first == null)
if(IsUnitEnemy(first,GetOwningPlayer(vars.u)) and GetUnitState(first, UNIT_STATE_LIFE) > 0.405 and ModuloInteger(vars.counter, 15) == 0 ) then
call UnitDamageTarget(vars.u,first,50,true,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_FIRE,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIfb\\AIfbSpecialArt.mdl",first,"chest"))
endif
call GroupRemoveUnit(g,first)
endloop
set i = i+1
endloop
call DestroyGroup(g)
set vars.counter = vars.counter+1
return vars.i > 60
endfunction
function Fire_Wall_Actions takes nothing returns nothing
local Data vars = Data.create()
local location loc = GetSpellTargetLoc()
set vars.counter = 0
set vars.u = GetTriggerUnit()
set vars.x = GetUnitX(vars.u)
set vars.y = GetUnitY(vars.u)
set vars.targetX = GetLocationX(loc)
set vars.targetY = GetLocationY(loc)
set vars.r = 0
set vars.angle = GetUnitFacing(vars.u)
set vars.dummy[0] = CreateUnit(GetOwningPlayer(vars.u),039;n001039;,vars.targetX,vars.targetY, 25.00)
call UnitApplyTimedLife(vars.dummy[0],039;BTLF039;,4)
set vars.i = 1
call ABCT_Start(function CreateFireWall,vars,0.075)
call Data.destroy(vars)
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_Fire_Wall_U takes nothing returns nothing
set gg_trg_Fire_Wall_U = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Fire_Wall_U, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Inferno_U, Condition( function Fire_Wall_Conditions ) )
call TriggerAddAction( gg_trg_Fire_Wall_U, function Fire_Wall_Actions )
endfunction
</i></i>
(btw ignore the comment parts - still under check for those)
anyway can anybody help me solving this half problem and find out why it's not going vertical all the time?
thanks in advance