#1
Okay, so I had a spell trigger, and I changed some of the function names and messed with scope a bit. Then I changed the Registered Event from the BJ to what it is now, and it stopped working after all of those changes. This is what it is now, and it still wont work, any ideas?
#2
My walk animation in the above trigger never did work... How would I go about fixing that? hehe...
Also....
#3
Okay, so this is probably a pretty noob-esque question, but here it goes.
Im relatively new to Jass, and upon looking around in various forums to get a feel for the code, I've seen various uses of
I know that this is functionality from the JNGP, but I don't really seem to know how it works. I know that it makes it so that private funcs can't be seen outside, but waht else does it do, because it seems to not let me use function outside of the scope as well?
- Thanks for your time
Okay, so I had a spell trigger, and I changed some of the function names and messed with scope a bit. Then I changed the Registered Event from the BJ to what it is now, and it stopped working after all of those changes. This is what it is now, and it still wont work, any ideas?
JASS:
function bsLeapConditions takes nothing returns boolean
return GetSpellAbilityId() == 'A003'
endfunction
function bsLeapActions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit temp
local location loc = GetSpellTargetLoc()
local group enemies = CreateGroup()
local integer abiLevel = GetUnitAbilityLevel(u, 'A003')
local integer dmg = R2I(20 + abiLevel * 40)
local real coeff = 1
local real x
local real y
local real angle
local real distance
local real time
//if (IsLocPathable(loc) == false) then
// set loc = GetNearestPathableLoc(loc)
//call DisplayTextToPlayer( GetOwningPlayer(u), "|cffff5000Target Location is not pathable!|r" )
//endif
// set vars
set distance = DistanceBetweenPoints(GetUnitLoc(u), loc)
set time = distance / GetUnitMoveSpeed(GetTriggerUnit())
// initiate jump
call DCJS_Jump(u, loc, distance/3, time)
//animate walking
call SetUnitFacingToFaceLocTimed( u, loc, 0.50 )
call SetUnitAnimation( u, "walk" )
call SetUnitTimeScalePercent( u, 25.00 )
// wait until jump finishes
call PolledWait(time)
// end the animation
call SetUnitAnimation(u, "stand")
call SetUnitTimeScalePercent( u, 100.00 )
// find affected enemies
set loc = GetUnitLoc(u)
call GroupEnumUnitsInRangeOfLoc(enemies, loc, 350.0, null)
set x = GetUnitX(u)
set y = GetUnitY(u)
// loop the group, doing knockback
loop
set temp = FirstOfGroup(enemies)
exitwhen temp == null
if IsUnitEnemy(temp, GetOwningPlayer(u)) then
//damage units
call damageUnit(u, temp, dmg, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_PHYSICAL, coeff, false)
// knockback units
set angle = 57.29582 * Atan2(GetUnitY(temp) - y, GetUnitX(temp) - x)
call KnockbackTarget(temp, angle, 600, 60, true)
endif
call GroupRemoveUnit(enemies, temp)
endloop
// delete data
call RemoveLocation(loc)
call DestroyGroup(enemies)
// clear leaks
set enemies = null
set u = null
set temp = null
set loc = null
endfunction
//===========================================================================
function InitTrig_bsLeap takes nothing returns nothing
local integer i = 1
set gg_trg_bsLeap1 = CreateTrigger()
// register for all but players 1 and 7
loop
call TriggerRegisterPlayerUnitEvent(gg_trg_bsLeap1, Player(i), EVENT_PLAYER_UNIT_ATTACKED, null)
exitwhen i == 11
if (i == 5) then
set i = 7
else
set i = i + 1
endif
endloop
call TriggerAddAction(gg_trg_bsLeap1, function bsLeapActions)
call TriggerAddCondition(gg_trg_bsLeap1, Condition(function bsLeapConditions))
endfunction
#2
My walk animation in the above trigger never did work... How would I go about fixing that? hehe...
Also....
#3
Okay, so this is probably a pretty noob-esque question, but here it goes.
Im relatively new to Jass, and upon looking around in various forums to get a feel for the code, I've seen various uses of
Code:
scope blah initializer Init
// insert code/functionality here
endscope
I know that this is functionality from the JNGP, but I don't really seem to know how it works. I know that it makes it so that private funcs can't be seen outside, but waht else does it do, because it seems to not let me use function outside of the scope as well?
- Thanks for your time