- Joined
- Oct 12, 2011
- Messages
- 3,449
Hmmm... Today I upload my first custom ability, call it "earth pressure"... I made it by myself...
But the code doesn't work properly...
I need ur help to change my jass code... Mod says that it has many errors to fix.. Haha... I'm a noob so just help me... Thanks bro sist...
This is cast event
_____________________________________________
Damage trigger
________________________________________________
The ability does a knockback and here is the trigger
___________________________________________
I try to make the knockback has a duration but the trigger seems does not work. Here's the trigger
_________________________________________
And here's the description of my ability.
Descriptions:
- Creates some earth stomps with a spiral form.
- Each stomp deals 100 damage to 250 AoE and stuns for 2 seconds.
- Move all enemy units in the AoE to the center of stomp.
- Knocks a random one enemy's unit back in the area of stomp for 0.1 - 10 seconds ( I write this bcoz i can't make a working duration trigger.)
You can download here.
http://www.hiveworkshop.com/forums/spells-569/earth-pressure-v0-1-a-205223/#post2025380
My Questions:
- What's BJ function.?
- My code has many "red color". What does it mean ?
But the code doesn't work properly...
I need ur help to change my jass code... Mod says that it has many errors to fix.. Haha... I'm a noob so just help me... Thanks bro sist...
This is cast event
_____________________________________________
JASS:
function Trig_EarthCompoundCast_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
function Trig_EarthCompoundCast_Actions takes nothing returns nothing
set udg_EPCaster = GetSpellAbilityUnit()
set udg_EPPointNumber = 1
set udg_EPPoint[1] = GetUnitLoc(udg_EPCaster)
call EnableTrigger( gg_trg_EarthPressureDamage )
call EnableTrigger( gg_trg_EarthPressureKnockback )
call EnableTrigger( gg_trg_EarthPressureKnockedUnit )
call PolledWait( 10.00 )
call DisableTrigger( gg_trg_EarthPressureDamage )
call DisableTrigger( gg_trg_EarthPressureKnockback )
call DisableTrigger( gg_trg_EarthPressureKnockedUnit )
set udg_EPCaster = null
set udg_EPPointNumber = 0
set udg_EPKnockedUnitNumber = 0
set udg_EPKnockedUnitNumber2 = 0
set udg_EPKnockedUnitNumber2 = 0
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 100
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_EPKnockedUnit[GetForLoopIndexA()] = null
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
//===========================================================================
function InitTrig_EarthPressureCast takes nothing returns nothing
set gg_trg_EarthPressureCast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_EarthPressureCast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_EarthPressureCast, Condition( function Trig_EarthCompoundCast_Conditions ) )
call TriggerAddAction( gg_trg_EarthPressureCast, function Trig_EarthCompoundCast_Actions )
endfunction
Damage trigger
________________________________________________
JASS:
function Trig_EarthCompoundDamage_Func010001003001001 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction
function Trig_EarthCompoundDamage_Func010001003001002 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_EarthCompoundDamage_Func010001003001 takes nothing returns boolean
return GetBooleanAnd( Trig_EarthCompoundDamage_Func010001003001001(), Trig_EarthCompoundDamage_Func010001003001002() )
endfunction
function Trig_EarthCompoundDamage_Func010001003002 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_EPCaster)) == true )
endfunction
function Trig_EarthCompoundDamage_Func010001003 takes nothing returns boolean
return GetBooleanAnd( Trig_EarthCompoundDamage_Func010001003001(), Trig_EarthCompoundDamage_Func010001003002() )
endfunction
function Trig_EarthCompoundDamage_Func010A takes nothing returns nothing
call UnitDamageTargetBJ( udg_EPCaster, GetEnumUnit(), 100.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call SetUnitPositionLocFacingLocBJ( GetEnumUnit(), PolarProjectionBJ(udg_EPPoint[udg_EPPointNumber], 75.00, ( 180.00 + GetUnitFacing(GetEnumUnit()) )), udg_EPPoint[udg_EPPointNumber] )
set udg_EPKnockedUnit[udg_EPKnockedUnitNumber] = GetEnumUnit()
endfunction
function Trig_EarthCompoundDamage_Actions takes nothing returns nothing
set udg_EPPointNumber = ( udg_EPPointNumber + 1 )
set udg_EPKnockedUnitNumber = ( udg_EPKnockedUnitNumber + 1 )
set udg_EPPoint[udg_EPPointNumber] = PolarProjectionBJ(udg_EPPoint[1], ( 30.00 * I2R(udg_EPPointNumber) ), ( 30.00 * I2R(udg_EPPointNumber) ))
call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(udg_EPCaster), udg_EPPoint[udg_EPPointNumber], bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "stomp" )
call ForGroupBJ( GetUnitsInRangeOfLocMatching(250.00, udg_EPPoint[udg_EPPointNumber], Condition(function Trig_EarthCompoundDamage_Func010001003)), function Trig_EarthCompoundDamage_Func010A )
call TerrainDeformationRippleBJ( 1.00, true, udg_EPPoint[udg_EPPointNumber], 270.00, 270.00, 64, 1, 250.00 )
call AddSpecialEffectLocBJ( udg_EPPoint[udg_EPPointNumber], "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" )
call AddSpecialEffectLocBJ( udg_EPPoint[udg_EPPointNumber], "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" )
endfunction
//===========================================================================
function InitTrig_EarthPressureDamage takes nothing returns nothing
set gg_trg_EarthPressureDamage = CreateTrigger( )
call DisableTrigger( gg_trg_EarthPressureDamage )
call TriggerRegisterTimerEventPeriodic( gg_trg_EarthPressureDamage, 0.25 )
call TriggerAddAction( gg_trg_EarthPressureDamage, function Trig_EarthCompoundDamage_Actions )
endfunction
The ability does a knockback and here is the trigger
___________________________________________
JASS:
function Trig_EarthCompoundCrush_Actions takes nothing returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 100
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call SetUnitPositionLoc( udg_EPKnockedUnit[GetForLoopIndexA()], PolarProjectionBJ(GetUnitLoc(udg_EPKnockedUnit[GetForLoopIndexA()]), 5.00, ( 180.00 + GetUnitFacing(udg_EPKnockedUnit[GetForLoopIndexA()]) )) )
call AddSpecialEffectTargetUnitBJ( "origin", udg_EPKnockedUnit[GetForLoopIndexA()], "Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl" )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
//===========================================================================
function InitTrig_EarthPressureKnockback takes nothing returns nothing
set gg_trg_EarthPressureKnockback = CreateTrigger( )
call DisableTrigger( gg_trg_EarthPressureKnockback )
call TriggerRegisterTimerEventPeriodic( gg_trg_EarthPressureKnockback, 0.10 )
call TriggerAddAction( gg_trg_EarthPressureKnockback, function Trig_EarthCompoundCrush_Actions )
endfunction
I try to make the knockback has a duration but the trigger seems does not work. Here's the trigger
_________________________________________
JASS:
function Trig_EarthCompoundCrushedUnit_Actions takes nothing returns nothing
set udg_EPKnockedUnitNumber2 = ( udg_EPKnockedUnitNumber2 + 1 )
set udg_EPKnockedUnit[udg_EPKnockedUnitNumber2] = null
endfunction
//===========================================================================
function InitTrig_EarthPressureKnockedUnit takes nothing returns nothing
set gg_trg_EarthPressureKnockedUnit = CreateTrigger( )
call DisableTrigger( gg_trg_EarthPressureKnockedUnit )
call TriggerRegisterTimerEventPeriodic( gg_trg_EarthPressureKnockedUnit, 1.00 )
call TriggerAddAction( gg_trg_EarthPressureKnockedUnit, function Trig_EarthCompoundCrushedUnit_Actions )
endfunction
And here's the description of my ability.
Descriptions:
- Creates some earth stomps with a spiral form.
- Each stomp deals 100 damage to 250 AoE and stuns for 2 seconds.
- Move all enemy units in the AoE to the center of stomp.
- Knocks a random one enemy's unit back in the area of stomp for 0.1 - 10 seconds ( I write this bcoz i can't make a working duration trigger.)
You can download here.
http://www.hiveworkshop.com/forums/spells-569/earth-pressure-v0-1-a-205223/#post2025380
My Questions:
- What's BJ function.?
- My code has many "red color". What does it mean ?