Hello , as much as Adik is offlien like 3 years im gonna ask here 
I'm tryin to make it work but still... with this code
Everythings works well but when i try to shoot with item it will shoot everytime in same directions , any help would be appreciated
I'm tryin to make it work but still... with this code
JASS:
function ShootMauser takes nothing returns nothing
local unit a = GetTriggerUnit()
local integer b = 1000
local real i = 1
local real angle = Atan2(GetSpellTargetY() - GetUnitY(a), GetSpellTargetX() - GetUnitX(a))
//In the following actions
//The first parameter (a) is the caster
//The second parameter (I2Rblahblah) is the damage that will be dealt by the missile
//The third parameter I2R(b) is the ability level
//The boolean parameter are to set if the arrow will cause knockback or not
//The Fifth parameter is for the behavior of missiles (PIERCE, EXPLODE, PRISM or SINGLE)
//The sixth parameter is for the facing angle of the unit, the angle at which the arrow will fly to
//The seventh parameter is the height of the missile (default is 100)
//The eight parameter is wheter the missile will fly at a constant height(regardless of terrain height) or not(varying with terrain height). If set to true missiles will vanish if it hits the ground
call Arrow_Create(a, I2R(b), I2R(b), false, "SINGLE", angle, 100, true)
set a = null
endfunction
function Trig_shoot_system_Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I007' ) ) then
return false
endif
return true
endfunction
function Trig_shoot_system_Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I006' ) ) then
return false
endif
return true
endfunction
function Trig_shoot_system_Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00G' ) ) then
return false
endif
return true
endfunction
function Trig_shoot_system_Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I02F' ) ) then
return false
endif
return true
endfunction
function Trig_shoot_system_Func001Func001Func001Func001Func001Func001Func001Func001Func001C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00O' ) ) then
return false
endif
return true
endfunction
function Trig_shoot_system_Func001Func001Func001Func001Func001Func001Func001Func001C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00M' ) ) then
return false
endif
return true
endfunction
function Trig_shoot_system_Func001Func001Func001Func001Func001Func001Func001C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I003' ) ) then
return false
endif
return true
endfunction
function Trig_shoot_system_Func001Func001Func001Func001Func001Func001C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00S' ) ) then
return false
endif
return true
endfunction
function Trig_shoot_system_Func001Func001Func001Func001Func001C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I000' ) ) then
return false
endif
return true
endfunction
function Trig_shoot_system_Func001Func001Func001Func001C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00X' ) ) then
return false
endif
return true
endfunction
function Trig_shoot_system_Func001Func001Func001C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00W' ) ) then
return false
endif
return true
endfunction
function Trig_shoot_system_Func001Func001C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00U' ) ) then
return false
endif
return true
endfunction
function Trig_shoot_system_Func001C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I03D' ) ) then
return false
endif
return true
endfunction
function Trig_shoot_system_Actions takes nothing returns nothing
if ( Trig_shoot_system_Func001C() ) then
call BJDebugMsg("Mauser")
call ShootMauser()
else
if ( Trig_shoot_system_Func001Func001C() ) then
call BJDebugMsg("PDW")
else
if ( Trig_shoot_system_Func001Func001Func001C() ) then
call BJDebugMsg("Revolver")
else
if ( Trig_shoot_system_Func001Func001Func001Func001C() ) then
call BJDebugMsg("rpg")
else
if ( Trig_shoot_system_Func001Func001Func001Func001Func001C() ) then
call BJDebugMsg("Makarov")
else
if ( Trig_shoot_system_Func001Func001Func001Func001Func001Func001C() ) then
call BJDebugMsg("mk48")
else
if ( Trig_shoot_system_Func001Func001Func001Func001Func001Func001Func001C() ) then
call BJDebugMsg("M9")
else
if ( Trig_shoot_system_Func001Func001Func001Func001Func001Func001Func001Func001C() ) then
call BJDebugMsg("M40a3")
else
if ( Trig_shoot_system_Func001Func001Func001Func001Func001Func001Func001Func001Func001C() ) then
call BJDebugMsg("M240")
else
if ( Trig_shoot_system_Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001C() ) then
call BJDebugMsg("gold rev")
else
if ( Trig_shoot_system_Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001C() ) then
call BJDebugMsg("g17")
else
if ( Trig_shoot_system_Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001C() ) then
call BJDebugMsg("1911")
else
if ( Trig_shoot_system_Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001Func001C() ) then
call BJDebugMsg("bizon")
else
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endfunction
//===========================================================================
function InitTrig_shoot_system takes nothing returns nothing
set gg_trg_shoot_system = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_shoot_system, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddAction( gg_trg_shoot_system, function Trig_shoot_system_Actions )
endfunction
Everythings works well but when i try to shoot with item it will shoot everytime in same directions , any help would be appreciated