Hi all, I'm new to all this and would like a bit of help with editing some existing spells if possible (war3 classic). I don't know JASS myself else I wouldn't be here.
For this one the actual issue is that in the game the damage gets applied 1st and the 'call LinearDisplacement' won't be applied if the units dies. I'm figuring the damage gets applied before the linear displacement. Either that or it has to do with some other system elsewhere because this is a consistent issue with other abilities as well, if the damage is enough to kill the unit any displacement the spell has won't trigger. Or maybe it's something about the unit death triggers but anyways I'll post the triggers just in case it's the spell in case anyone can spot anything wrong with it.
As for this one, the problem is that it does 0.1 ministuns but there's no wait time in between each one and it acts like a full stun instead.
For this one the actual issue is that in the game the damage gets applied 1st and the 'call LinearDisplacement' won't be applied if the units dies. I'm figuring the damage gets applied before the linear displacement. Either that or it has to do with some other system elsewhere because this is a consistent issue with other abilities as well, if the damage is enough to kill the unit any displacement the spell has won't trigger. Or maybe it's something about the unit death triggers but anyways I'll post the triggers just in case it's the spell in case anyone can spot anything wrong with it.
JASS:
function Luffy_W takes nothing returns nothing
local integer Time = SpellTime( )
local integer HandleID = MUIHandle( )
local real DMG
if Time == 1 then
set DMG = 175 + 225 * GetInt( "ALvL" )
if GetUnitTypeId( GetUnit( "Caster" ) ) != 'N002' then
set DMG = DMG + 125 + 115 * GetInt( "ALvL" )
call PlaySoundOnUnit( Sounds[ 127 ], 100, GetUnit( "Caster" ) )
else
call PlaySoundOnUnit( Sounds[ 123 ], 100, GetUnit( "Caster" ) )
endif
call LinearDisplacement( GetUnit( "Target" ), GetUnitsAngle( GetUnit( "Caster" ), GetUnit( "Target" ) ), 200, .01, .01, false, false, "origin", "" )
call DamageUnit( GetUnit( "Caster" ), GetUnit( "Target" ), DMG, "physical" )
call CC_Unit( GetUnit( "Target" ), 1.5, "stun", true )
endif
if Time == 5 then
call SetUnitFacing( GetUnit( "Target" ), GetUnitsAngle( GetUnit( "Target" ), GetUnit( "Caster" ) ) )
call DestroyEffect( AddSpecialEffect( "war3mapImported\\explosion.mdx", GetUnitX( GetUnit( "Target" ) ), GetUnitY( GetUnit( "Target" ) ) ) )
endif
if Time == 50 or Stop_Spell( 2 ) then
call CleanMUI( GetExpiredTimer( ) )
endif
endfunction
As for this one, the problem is that it does 0.1 ministuns but there's no wait time in between each one and it acts like a full stun instead.
JASS:
function Luffy_E takes nothing returns nothing
local integer Time = SpellTime( )
local integer HandleID = MUIHandle( )
local real DMG
if Time == 1 then
if GetUnitTypeId( GetUnit( "Caster" ) ) != 'N002' then
call PlaySoundOnUnit( Sounds[ 128 ], 100, GetUnit( "Caster" ) )
else
call PlaySoundOnUnit( Sounds[ 124 ], 100, GetUnit( "Caster" ) )
endif
call SaveReal( HashTable, HandleID, StringHash( "Angle" ), GetUnitFacing( GetUnit( "Caster" ) ) )
call SaveReal( HashTable, HandleID, StringHash( "CastX" ), NewX( GetUnitX( GetUnit( "Caster" ) ), 200, GetReal( "Angle" ) ) )
call SaveReal( HashTable, HandleID, StringHash( "CastY" ), NewY( GetUnitY( GetUnit( "Caster" ) ), 200, GetReal( "Angle" ) ) )
endif
if Counter( 0, 10 ) then
set DMG = 100 + 100 * GetInt( "ALvL" )
call SaveInteger( HashTable, HandleID, StringHash( "Gatling_Hits" ), GetInt( "Gatling_Hits" ) + 1 )
if GetUnitTypeId( GetUnit( "Caster" ) ) != 'N002' then
set DMG = DMG + 2 * GetHeroLevel( GetUnit( "Caster" ) ) * GetInt( "ALvL" )
endif
call DestroyEffect( AddSpecialEffect( "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl", GetReal( "CastX" ), GetReal( "CastY" ) ) )
call DestroyAoEDestruct( GetReal( "CastX" ), GetReal( "CastY" ), 350 )
call EnumUnitsAOE( SpellGroup, GetReal( "CastX" ), GetReal( "CastY" ), 350 )
loop
set SysUnit = FirstOfGroup( SpellGroup )
exitwhen SysUnit == null
if UnitLife( SysUnit ) > 0 then
if IsUnitEnemyEx( GetUnit( "Caster" ), SysUnit ) then
call DamageUnit( GetUnit( "Caster" ), SysUnit, DMG / 10, "physical" )
call StunUnit2( GetUnit( "Caster" ),SysUnit, 20 )
endif
endif
call GroupRemoveUnit( SpellGroup, SysUnit )
endloop
endif
if GetInt( "Gatling_Hits" ) == 50 or Stop_Spell( 0 ) or GetUnitOrder( GetUnit( "Caster" ) ) != "stampede" then
if GetUnitOrder( GetUnit( "Caster" ) ) == "stampede" then
call IssueImmediateOrder( GetUnit( "Caster" ), "stop" )
endif
call CleanMUI( GetExpiredTimer( ) )
endif
endfunction
Last edited: