-- Mod Backfire by Junior_Djjr - juniordjjr.mixmods.com.br
if 8AF0: 6 = not get_int_from_ini_file("cleo\\Backfire.ini", "Config", "MinVehicleValue") then
6 = 60000
end
if not 4 = audiostream.Load3D("cleo\\backfire.mp3") then
if 8AF0: 7 = not get_int_from_ini_file("cleo\\Backfire.ini", "Config", "SoundID") then
7 = 1131
end
else
7 = -1
audiostream.Loop(4, false)
audiostream.volume(4) = 1.0
end
if 0AF0: 17 = not get_int_from_ini_file("cleo\\Backfire.ini", "Config", "byTuningModTurbo") then
else
17 = true
end
if 17 == true then
gosub(StoreHandlingBlocks)
end
while true do
wait(0)
Actor.Driving(player_actor)
if not continue then
0 = actor.CurrentCar(player_actor)
31 = car(0).struct
30 = 31 + 0x594 -- mSubClass
30 = read_memory(30, 4)
if 30 == 0 or 30 == 9 then
1 = car(0).model
29 = get_car_model_price(1)
if 29 > 6 then
:InitALS
29 = 31 + 0x284 -- SomethingChangingWithGearChanging...
28 = 31 + 0x966 -- AccPedal
27 = 31 + 0x280 -- RPM
30 = 31 + 0x37C -- bNitroActivated
8 = 31 + 0x428 -- Flags
GetVehicleDummyPosOffset(1, 0x6)
21 = 31 + 0x384 -- pHandling
21 = read_memory(21, 4)
21 = 21 + 0xCC -- ModelFlags
21 = read_memory(21, 4)
if not test_bit(21, 13) then
10 = -11
else
10 = 0
end
while Actor.Driving(player_actor) do
wait(0)
if not car(0).defined then
break
end
24 = read_memory(30, 1) -- bNitroActivated
if 24 == 0 then
continue
end
26 = read_memory(29, 1) -- SomethingChangingWithGearChanging...
22 = read_memory(27, 2) -- RPM
24 = car(0).speed
if 26 == 0 and 22 ~= 65535 and 22 > 100 and 24 > 5.0 then
gosub(BackFire)
end
25 = read_memory(28, 1) -- AccPedal
24 = read_memory(8, 1) -- Flags
if test_bit(24, 5) and 25 == 128 then
gosub(BackFire_Multi)
end
if not 23 then
if 25 == 128 then
23 = true
end
else
if 25 < 100 then
gosub(BackFire_Multi)
23 = false
end
end
end
else
if 17 == true then
if IsIndieHandling(0, 0) then
8 = 8 + 0xE5 -- NewInfosStart
8 = read_memory(8, 2)
if test_bit(8, 4) or test_bit(8, 5) or test_bit(8, 6) or test_bit(8, 7) then
gosub(InitALS)
else
gosub(WhileInCar)
end
else
gosub(WhileInCar)
end
else
gosub(WhileInCar)
end
end
else
gosub(WhileInCar)
end
if 7 < 0 then
audiostream.Release(4)
end
end
end
::WhileInCar::
while Actor.Driving(player_actor) do
wait(0)
end
return
::BackFire::
if 10 ~= 0 then
5 = attach_particle("GUNFLASH", car(0), 11, 12, 13, 0.0, -25.0, 0.0, 1)
remove_references_to_particle(5)
5 = attach_particle("GUNFLASH", car(0), 10, 12, 13, 0.0, -25.0, 0.0, 1)
remove_references_to_particle(5)
store_coords_from_car_to(0, 0, 14, 15, 16, 0.0, 12, 13)
gosub(PlaySound)
else
5 = attach_particle("GUNFLASH", car(0), 11, 12, 13, 0.0, -25.0, 0.0, 1)
remove_references_to_particle(5)
store_coords_from_car_to(0, 0, 14, 15, 16, 11, 12, 13)
gosub(PlaySound)
end
return
::BackFire_Multi::
19 = random_int_in_ranges(0, 4)
for 20 = 0, 19 do
18 = random_int_in_ranges(20, 300)
wait(18)
if not car(0).defined then
return
end
if 10 ~= 0 then
5 = attach_particle("GUNFLASH", car(0), 11, 12, 13, 0.0, -25.0, 0.0, 1)
remove_references_to_particle(5)
5 = attach_particle("GUNFLASH", car(0), 10, 12, 13, 0.0, -25.0, 0.0, 1)
remove_references_to_particle(5)
store_coords_from_car_to(0, 0, 14, 15, 16, 0.0, 12, 13)
gosub(PlaySound)
else
5 = attach_particle("GUNFLASH", car(0), 11, 12, 13, 0.0, -25.0, 0.0, 1)
remove_references_to_particle(5)
store_coords_from_car_to(0, 0, 14, 15, 16, 11, 12, 13)
gosub(PlaySound)
end
end
return
::PlaySound::
if 7 > -1 then
play_sound(7, 14, 15, 16)
else
audiostream.SetPosition(4, 16, 14, 15)
audiostream.PerformAction(4, PLAY)
end
return
::GetVehicleDummyPosOffset::
call_function(0x00403DA0, 1, 0)
0 = func_ret(0)
1 = 0xC
0 = 0x4
0 = 0x4
ret(1, 2, 3)
::Check_TurboIsInstalled::
28 = car(0).struct
28 = 28 + 0x384
28 = read_memory(28, 4)
28 = 28 + 0xE5
10 = read_memory(28, 2)
if test_bit(10, 4) or test_bit(10, 5) or test_bit(10, 6) or test_bit(10, 7) then
return true
else
return false
end
ret(0)
const
_pHandling = 0x384
_startOfHandlingBlock = 2
_endOfHandlingBlock = 3
end
::IsIndieHandling::
10 = car(0).struct
10 = 10 + _pHandling
10 = read_memory(10, 4)
if 10 >= 1 and 10 < 2 then
return false
else
return true
end
ret(1, 10)
::StoreHandlingBlocks::
_startOfHandlingBlock = read_memory(0x5BFA96, 4)
_startOfHandlingBlock = _startOfHandlingBlock + 0x14
11 = read_memory(_startOfHandlingBlock, 4)
if 11 == 0xFFFFFFFF then
11 = _startOfHandlingBlock + 8
12 = read_memory(11, 4)
11 = 11 + 16
13 = read_memory(11, 4)
11 = 11 + 20
14 = read_memory(11, 4)
12 = 12 * 14
_startOfHandlingBlock = _startOfHandlingBlock - 0x14
_startOfHandlingBlock = _startOfHandlingBlock + 13
_endOfHandlingBlock = _startOfHandlingBlock + 12
else
if _startOfHandlingBlock == 0xC2B9DC then
_endOfHandlingBlock = read_memory(0x6F531E, 4)
_endOfHandlingBlock = _endOfHandlingBlock + _startOfHandlingBlock
else
32 = 0
while 32 < 10000 do
wait(0)
show_text_highpriority("~r~Error: Apparently you have some Limit Adjuster with an incompatible handling's patch.", 1000)
end
end
end
return