Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'http://gtaxscripting.blogspot.com/
- 'http://www.facebook.com/GtaIVScripting
- 'https://www.youtube.com/user/GTAScripting
- 'Iron Man IV script by JulioNIB
- 'requested and help (tests, HUD, sounds, etc.) by
- 'H1Vltg3 (http://www.facebook.com/H1Vltg3 - https://www.youtube.com/user/IH1Vltg3I)
- 'HUD v2 and v3 by
- 'Wapeddell (http://www.facebook.com/WapeddellMods - https://www.youtube.com/user/wapeddell)
- 'Obs.: Some things in this script can be redundant, some variables im not using and i forgot to remove
- 'The classes, great part, are just used to hold the properties and dont have methods that they should
- 'Thx Rockstar for this amazing game
- Imports System
- Imports GTA
- Imports System.Windows.Forms
- Imports System.Drawing
- Imports System.Collections.Generic
- Imports System.IO
- 'Imports SlimDX.XInput
- Imports System.Text
- Imports ObjectsHandler
- Imports NAudio.Wave
- Public Class IronMan
- Inherits Script
- Shared myInterval As Double = 10
- Shared OH As ObjectsHandler
- Private Class NAudioPlayer
- Private wfr As WaveFileReader
- Private wc As WaveChannel32
- Private dso As DirectSoundOut
- Public Sub New(s As String)
- wfr = New WaveFileReader(s)
- wc = New WaveChannel32(wfr)
- dso = New DirectSoundOut
- dso.Init(wc)
- End Sub
- Public Sub volume(dVolumeMulti As Double)
- wc.Volume = dVolumeMulti
- End Sub
- Public Sub play()
- wc.Seek(0, SeekOrigin.Begin)
- dso.Play()
- End Sub
- End Class
- Private Class TDisplayMsg
- Private sMsg As String = ""
- Private time As Double = 3000
- Private timeCount As Double = 0
- Private bDisplay As Boolean = False
- Private x As Int16
- Public Sub Display(sMessage As String, Optional display_time As Double = 3000)
- bDisplay = False
- time = display_time
- timeCount = 0
- sMsg = sMessage + " "
- bDisplay = sMsg.Trim.Length > 0
- x = 840 - ((sMsg.Trim.Length / 2) * 10)
- End Sub
- Public Sub Tick(e As GraphicsEventArgs)
- If bDisplay AndAlso (sMsg.Length > 0) AndAlso (timeCount < time) Then
- timeCount += 20
- drawTextAuxEffect2(e, sMsg, x * height_Coef, 950, Color.LightBlue)
- End If
- End Sub
- End Class
- Shared DisplayMessage As TDisplayMsg = New TDisplayMsg
- Private jarvis_congrats_1 As NAudioPlayer
- Private jarvis_congrats_2 As NAudioPlayer
- Private jarvis_congrats_3 As NAudioPlayer
- Private jarvis_congrats_4 As NAudioPlayer
- Private jarvis_enemy As NAudioPlayer
- Private jarvis_warning As NAudioPlayer
- Private jarvis_warning_2 As NAudioPlayer
- Private jarvis_warning_3 As NAudioPlayer
- Private jarvisVolume As Double = 0.3
- Private timePlayJarvisWarn As Double = 0
- Private timePlayJarvisCongrats As Double = 0
- Private timeWaitLoad As Double = 500
- Private flying As Boolean = False
- Private bDrawDamageIndicator As Boolean = False
- Private myFlyHabs As Vehicle = Nothing
- Private myFlyHabsNormal As Vehicle = Nothing
- Private myFlyHabsHitObject As Vehicle = Nothing
- Private timeWaitCheckHighSpeed As Double = 0
- Private mySpeed As Double = 0
- Private myRealSpeed As Double = 0
- Private timeKeepHighSpeed As Double = 0
- Private camAux As Camera
- Private camXAttach As Double = -1
- Private camYAttach As Double = -2
- Private camZAttach As Double = 0.5
- Private timeResetFlight As Double = 0
- Private animSetFlight As AnimationSet
- Private animSetPointArm As AnimationSet
- Private animSetPunchKick As AnimationSet
- Private animSetPunch As AnimationSet
- Private myLastPos As GTA.Vector3
- Private vRotation As GTA.Vector3
- Private upAmount, downAmount, forwardAmount, backwardAmount As Double
- Private camMode As Int16 = 0
- Private bLandAnim As Boolean = False
- Private playerLandVel As Vector3
- Private timeLandAnim As Double = 0
- Private inAIrTime As Double = 0
- Private PTFXDamage As Int32
- Private lastHealth As Int16 = -999
- Private healthAux As Double = Player.Character.Health
- Private timeHeal As Double = 0
- Private GameTimeScale As Double = 1
- Private timeDisableMouseControl As Double = 0
- Private timeHideFlyAbs As Double = 0
- Private lastFlightZ As Double = 0
- Private lastFlightZ2 As Double = 0
- Private timeRestorePreventRagdoll As Double = 0
- Private WeapXSelection As Double = 0
- Private WeapYSelection As Double = 0
- Private timeCheckWSelect As Double = 0
- Private bDrawTextures As Boolean = False
- Private bFirstDraw As Boolean = False
- Private bArmorON As Boolean = False
- Private bShowMenu As Boolean = False
- Private bShowArmorMenu As Boolean = False
- Private bShowArmorOptionsMenu As Boolean = False
- Private armorMenuIndex As Int16 = 0
- Private armorOptionsMenuIndex As Int16 = 0
- Private menuIndex As Int16 = 0
- Private HUDIndex As Double = 0
- Private HUDName As String = "Simple"
- Private bPlayerFallingDamageProof As Boolean = True
- Private bNoFlightCollisionDetection As Boolean = False
- Private speedChange As Double = 0
- Private bAnTargetLocked As Boolean
- Private timeCheckTargetLocked As Double = 0
- Private timeCheckHair As Double = 0
- Private timeWaitAntiMeleeAnim As Double = 0
- Private GroundZDist As Double = 0
- Private maxEnemy, maxAlly As Int16
- Private lastXFlight As Double = 0
- 'armor delivery :)
- Private bUseArmorDelivery As Boolean = False
- Private heliDelivery As Vehicle = Nothing
- Private pilotDelivery As Ped = Nothing
- Private armorCase As GTA.Object = Nothing
- Private heliDeliveryModel As String = "maverick"
- Private pilotDeliveryModel As String = "m_y_nhelipilot"
- Private armorCaseModel As String = "bm_lev_guncase01b"
- Private ArmorDeliveryStatus As Int16 = 0
- Private heliDeliveryBlip As Blip = Nothing
- Private HeliDeliveryTimeCheckRoute As Double = 0
- Private DeliveryTime As Double = 0
- ' hotkeys
- Private hkSwitchGun, hkCannon, hkDarts, hkRockets, hkHandRep, hkChestRep, hkShowMenu, hkKick, hkPunch, hkSpawnAlly, hkSwitchCam, _
- hkUnlockFlightCam, hkWeaponSelectMenu, hkShoot, hkSpawnEnemy, hkNoWantedLevel, hkGodMode As Int32
- Private bNoWanted As Boolean = False
- Private bGodMode As Boolean = False
- ' textures
- Private texHUD, texBar, texCannon, texDarts, texRockets, texHandRep, texChestRep, texWSelect, _
- texCrossHair, texHudRing, texHUDBottom, texHUDLeft, texHUDRight, texHUDRight_FlightMode, texHUDTop, _
- texHUDBottonIcon1, texHUDBottonIcon1_2, texHUDBottonIcon2, texHUDBottonIcon2_2, _
- texHUDBottonIcon3, texHUDBottonIcon3_2, texHUDBottonIcon3_3, texHUDBottonIcon3_4, texHUDBottonIcon4, texHUDBottonIcon4_2, _
- texHUDBottonIcon5, texHUDBottonIcon5_2, texHUDHearthIndicator, _
- texHUDRIGHT_Damage, texHUDLEFT_FlightMode, texHUDLEFT_MissileAlarm, texHUD_ThrusterBar As Texture
- Shared damageTime As Int16 = 255
- Shared lowHealthIndicator As Int16 = 255
- Private bMissileAlarm As Boolean = False
- Private hudRotation As Double = 0
- Private Class TTexNumber
- Public tex As Texture
- Public Sub New(sFile As String)
- Try
- tex = New Texture(File.ReadAllBytes(sFile))
- Catch
- End Try
- End Sub
- End Class
- Private texNumbers As New List(Of TTexNumber)
- Shared TRandom As Random = New Random(System.DateTime.Now.Millisecond)
- Private speedSlow As Double = 20
- Private speedFast As Double = 50
- Private FlightTurningRight As Double = 0
- Private FlightTurningLeft As Double = 0
- Shared width_Coef, height_Coef As Double
- Private lastZPos As Double = 0
- Private bFast As Boolean = False
- Private timeActivateDown As Double = 0
- Private timeOfFlight As Double = 0
- Private heightFix As Double = 0
- Private timeRestartFlight As Double = 0
- Private smokeTime As Double = 0
- Private bAdaptToFlightHeading As Boolean = True
- Private FlightSpeedChange As Vector3
- Private camAimPosition As Vector3
- Private camAimMoveEase As Double = 0.1
- Private bResetCamAim As Boolean = True
- Private camLastZDiff As Double = 0
- Private camLastXMove As Double = 0
- Private timeClearTask As Double = 0
- Private timeShooting As Double = 0
- ' gun switch
- Private gunMode As Int16 = 0
- 'Private IDsndGunSwitch As Int32 = 0
- Private WeaponSelectTime As Double = 0
- Private bShowingWeaponSelector As Boolean = False
- Private timeKeeArmAnim As Double = 0
- Private weaponHeat0 As Double = 0
- Private weaponHeat1 As Double = 0
- Private weaponHeat2 As Double = 0
- Private weaponHeat3 As Double = 0
- Private weaponHeat4 As Double = 0
- Private bBlinkWeaponHeat As Boolean = True
- Private timeWaitStartCannonShoot As Double = 0
- ' repulsor beam
- Private timeRepulsorBeamON As Double = 0
- Private timeWaitShootRepulsor As Double = 0
- Private timeWaitRepulsorSound As Double = 0
- Private pedsRepulsorHit As Ped()
- Private vehRepulsorHit As Vehicle()
- Private PTFXRepulsor As Int32 = 0
- Private repulsorDiameter As Double = 5
- Private repulsorChest As Boolean = False
- Private sndRepulsorStart As System.Media.SoundPlayer
- Private sndRepulsorBlast As System.Media.SoundPlayer
- Private repulsorLight As Light
- Private bWasAlive As Boolean = True
- Private bWasDead As Boolean = False
- Private timeKeepRepulsorSound As Double = 0
- Private bArrested As Boolean = False
- Private TimeDontCheckArrest As Double = 0
- Private bSoundOK As Boolean = True
- ' cannon
- 'Private IDsndCannon As Int32
- Private IDsndCannonRotate As Int32
- Private timeShootCannon As Double = 0
- Private timeShootSuperCannon As Double = 0
- Private cannPTFX1 As Int32
- ' jets
- Private PTFX_SmokeRB, PTFX_SmokeLB As Int32
- Private ptfxBootSize, ptfxLeftHandSize, ptfxRrightHandSize As Double
- Private IDsndJets1 As Int32
- Private jetSoundAux As GTA.Object = Nothing
- Private jetSoundDistance As Double = 0
- Private jetSoundDesiredDistance As Double = 0
- ' xbox
- 'Private XControl As Controller = New Controller(UserIndex.One)
- Private controllerState As Microsoft.Xna.Framework.Input.GamePadState
- Private lasPacketNumber As Int64
- Private timeWaitCheckXKeys As Double = 0
- Private lastAutoAimedPed As Ped = Nothing
- Private AutoAimedPed As Ped = Nothing
- Private autoAimPedList As Ped()
- Private timeCheckAutoAimPed As Double = 0
- Private timeWaitSearchAutoAImPed As Double = 0
- Private camFixAutoAimRot As Vector3
- Private bFixCamRotation As Boolean = False
- Private timeShowMenuDown As Double = 0
- Private timeWaitXControlCheck As Double = 0
- Private bMoveFDown, bMoveBDown, bMoveLDown, bMoveRDown, bJumpDown, bAttackDown, bAimDown, bActionDown, bCrouchDown, bEnterCarDown, _
- bEscDown, bPhoneDown, bRadarZoomDown, bReloadDown, bSeekCoverDown, bSoundHornDown, bSprintDown, _
- bDPadDown, bDPadLeft, bDPadRight As Boolean
- ' darts
- Private Class TDarts
- Public dart As GTA.Object = Nothing
- Public launched As Boolean = False
- Public targetReady As Boolean = False
- Public readyToBlowUp As Boolean = False
- Public target As Ped = Nothing
- Public targetVeh As Vehicle = Nothing
- Public targetSuperGuy As Ped = Nothing
- Public PTFXFlight, PTFXHit As Int32
- Public initial_direction As Vector3
- Public attachPos As Vector3
- Public IDsndMove As Int32 = 0
- Public timeOut As Double = 0
- Public attachBone As Bone = Bone.RightUpperarmRoll
- Public attachRotation As Vector3 = Vector3.Zero
- Public diameterMulti As Double = 1
- Public hiden As Boolean = False
- Public attached As Boolean = False
- Public Sub New()
- 'IDsndMove = Native.Function.Call(Of Int32)("get_sound_id")
- End Sub
- Public Sub attach(tped As Ped)
- If attached Then Exit Sub
- 'msg("attach darts", 15)
- If hiden Then OH.releaseObject(dart, True, False)
- stopPTFX(PTFXFlight)
- 'getGameSoundID(IDsndMove)
- Native.Function.Call("SET_OBJECT_RECORDS_COLLISIONS", dart, False)
- If playerArmor.weaponSet = 0 Then
- dart.AttachToPed(tped, attachBone, attachPos, attachRotation)
- Else
- Dim vecPos As Vector3
- vecPos.X = 0.15
- vecPos.Y = 0
- vecPos.Z = 0.6
- dart.AttachToPed(tped, Bone.Root, vecPos, attachRotation)
- End If
- dart.isOnFire = False
- hiden = False
- attached = True
- End Sub
- Public Sub Hide()
- If hiden Then Exit Sub
- 'msg("detach darts", 15)
- attached = False
- launched = False
- readyToBlowUp = False
- dart.isOnFire = False
- targetReady = False
- timeOut = 0
- Native.Function.Call("SET_OBJECT_RECORDS_COLLISIONS", dart, False)
- OH.hideObject(dart)
- hiden = True
- End Sub
- End Class
- Private DartsList As New List(Of TDarts)
- Private LaunchedDartsList As New List(Of TDarts)
- Private tmpDart As TDarts
- Private pedTargets As PedCollection = New PedCollection
- Private vehTargets As Vehicle()
- Private timeSearchForPedTargets As Double = 0
- Private indexCheckDartShoot As Double = -1
- Private targetObejctAux As GTA.Object = Nothing
- Private targetHUDRotation As Double = 0
- 'Shared IDsndLaunchDarts As Int32
- Private timeWaitLaunchDarts As Double = 0
- Private timeKeepArmorConfig As Double = 0
- ' ped enemy
- Private Class TSuperGuy
- Public p As Ped = Nothing
- Public r As GTA.Object = Nothing
- Public AimingTime As Double = 0
- Public AimCoolDown As Double = 0
- Public bLaunched As Boolean = False
- Public bLocked As Boolean = False
- Public flightDir As Vector3
- Public timeOut As Double = 0
- Public bReadyToBlowUp As Boolean = False
- 'Public IDLaunchSound as int32
- Public IDMoveSound As Int32
- Public PTFXMove As Int32
- Public followTime As Double = 0
- Public heli As Vehicle = Nothing
- Public blip As Blip
- Public isRagDoll As Boolean = False
- Public unstableTime As Double = 0
- Public ptfxL, ptfxR, ptfxDamage As Int32
- Private bCollision As Boolean = True
- Public targetPed As Ped = Nothing
- Public targetPedSecondary As Ped = Nothing
- Public enemy As Boolean = True
- Public timeToReact As Double = 0
- Public timeReacting As Double = 0
- Public reactDir As Vector3
- Public explosionEffectTIme As Double = 0
- Public stuckTime As Double = 0
- Public moveForce As Double = 1
- Private lastHealth As Int16 = -999
- Private ptfxCannon, ptfxCannonMuz As Int32
- Private timeIntervalShootCannon As Double = 10
- 'Public AIM_Robot As Boolean = False
- Public timeToExplode As Double = 2000
- Public heliPassenger As Boolean = False
- 'Public weaponSet As Int16 = 0
- Public removeTime As Double = -666
- Public armor As TArmor
- Public Sub collision(bcol As Boolean)
- If bCollision <> bcol Then
- Native.Function.Call("set_char_collision", p, bcol)
- bCollision = bcol
- End If
- End Sub
- Public Function lifeChanged() As Boolean
- If (lastHealth <> -999) AndAlso (lastHealth <> p.Health) Then
- lastHealth = p.Health
- Return True
- Else
- lastHealth = p.Health
- Return False
- End If
- End Function
- Public Sub shootCannonTick()
- If Not (heli Is Nothing) Then Exit Sub
- stopPTFX(ptfxCannon)
- stopPTFX(ptfxCannonMuz)
- If p.isRagdoll OrElse p.isGettingUp Then Exit Sub
- If timeIntervalShootCannon <= 0 Then
- timeIntervalShootCannon = 20
- Dim tmpPosIni, tmpPosFin As Vector3
- tmpPosIni = p.GetBonePosition(Bone.RightArmRoll) + p.Direction * 2
- If Not targetPed Is Nothing Then
- If (Math.Abs(targetPed.Position.Z - p.Position.Z) > 5) OrElse _
- (targetPed.Position.DistanceTo(p.Position) > 50) Then Exit Sub
- tmpPosFin = (targetPed.Position + Vector3.Normalize(targetPed.Position - p.Position) * 100).Around(targetPed.Velocity.DistanceTo(Vector3.Zero) * 10)
- ElseIf Not targetPedSecondary Is Nothing Then
- If (targetPedSecondary.Position.DistanceTo(p.Position) > 65) Then
- targetPedSecondary = Nothing
- Exit Sub
- End If
- If (Math.Abs(targetPedSecondary.Position.Z - p.Position.Z) > targetPedSecondary.Position.DistanceTo(p.Position) * 0.5) Then Exit Sub
- tmpPosFin = (targetPedSecondary.Position + Vector3.Normalize(targetPedSecondary.Position + Vector3.WorldDown * TRandom.NextDouble * 1.5 - p.Position) * 70).Around(2)
- If (targetPedSecondary.PedType = PedType.Cop) AndAlso Not targetPedSecondary.Metadata.shootingSG Then
- targetPedSecondary.Metadata.shootingSG = True
- targetPedSecondary.Task.ClearAllImmediately()
- targetPedSecondary.Task.ShootAt(p, ShootMode.Burst)
- End If
- Else
- tmpPosFin = tmpPosIni + p.Direction * 300
- End If
- 'If Not AIM_Robot Then
- ' ptfxCannon = Native.Function.Call(Of Int32)("START_PTFX_ON_ped", "muz_machine", p,
- ' -0.15, 0, 0.7, 0, 0, 90.0, 0.5)
- ' ptfxCannonMuz = Native.Function.Call(Of Int32)("START_PTFX_ON_ped", "wpn_bullet_trace", p,
- ' -0.15, 0, 0.7, -90.0, 0, 0, 1.0)
- 'Else
- ' ptfxCannon = Native.Function.Call(Of Int32)("START_PTFX_ON_ped", "muz_machine", p,
- ' 0, 0.2, 0.5, 0, 0, 90.0, 0.5)
- ' ptfxCannonMuz = Native.Function.Call(Of Int32)("START_PTFX_ON_ped", "wpn_bullet_trace", p,
- ' 0, 0.2, 0.5, -90.0, 0, 0, 1.0)
- 'End If
- Dim rot As Vector3 = Helper.DirectionToRotation(Vector3.Normalize(tmpPosFin - tmpPosIni), 0)
- If armor.timeWaitShootSuperCannon > 0 Then armor.timeWaitShootSuperCannon -= intervalFix()
- If Not armor.AIM_Robot Then
- If armor.superCannon AndAlso (armor.timeWaitShootSuperCannon <= 0) Then
- armor.timeWaitShootSuperCannon = 50
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_ped", "muz_machine", p,
- -0.2, 0.28, 0.8, 0, 0, 90.0, 0.5)
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_ped", "wpn_bullet_trace", p,
- -0.2, 0.28, 0.8, -90.0 + rot.X, 0, 0, 1.0)
- Native.Function.Call("FIRE_SINGLE_BULLET", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z, tmpPosFin.X, tmpPosFin.Y, tmpPosFin.Z, armor.superCannon_Power)
- Native.Function.Call("FIRE_SINGLE_BULLET", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z, tmpPosFin.X, tmpPosFin.Y, tmpPosFin.Z, armor.superCannon_Power)
- Native.Function.Call("FIRE_SINGLE_BULLET", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z, tmpPosFin.X, tmpPosFin.Y, tmpPosFin.Z, armor.superCannon_Power)
- Native.Function.Call("FIRE_SINGLE_BULLET", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z, tmpPosFin.X, tmpPosFin.Y, tmpPosFin.Z, armor.superCannon_Power)
- Native.Function.Call("FIRE_SINGLE_BULLET", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z, tmpPosFin.X, tmpPosFin.Y, tmpPosFin.Z, armor.superCannon_Power)
- Native.Function.Call("PLAY_SOUND_FROM_position", -1, "shotgun_fire", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z)
- End If
- If armor.handCannon OrElse armor.shoulderCannon Then
- If armor.weaponSet = 0 Then
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_ped", "muz_machine", p,
- -0.15, 0, 0.7, 0, 0, 90.0, 0.5)
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_ped", "wpn_bullet_trace", p,
- -0.15, 0, 0.7, -90.0 + rot.X, 0, 0, 1.0)
- Else
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_ped", "muz_machine", p,
- -0.2, 0.28, 0.8, 0, 0, 90.0, 0.5)
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_ped", "wpn_bullet_trace", p,
- -0.2, 0.28, 0.8, -90.0 + rot.X, 0, 0, 1.0)
- End If
- If armor.handCannon Then
- Native.Function.Call("FIRE_SINGLE_BULLET", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z, tmpPosFin.X, tmpPosFin.Y, tmpPosFin.Z, armor.handCannon_Damage)
- Native.Function.Call("PLAY_SOUND_FROM_position", -1, "shotgun_fire", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z)
- End If
- If armor.shoulderCannon Then
- Native.Function.Call("FIRE_SINGLE_BULLET", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z, tmpPosFin.X, tmpPosFin.Y, tmpPosFin.Z, armor.shoulderCannon_Damage)
- Native.Function.Call("PLAY_SOUND_FROM_position", -1, "shotgun_fire", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z)
- End If
- End If
- Else
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_ped", "muz_machine", p,
- 0, 0.2, 0.5, 0, 0, 90.0, 0.5)
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_ped", "wpn_bullet_trace", p,
- 0, 0.2, 0.5, -90.0 + rot.X, 0, 0, 1.0)
- Native.Function.Call("FIRE_SINGLE_BULLET", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z, tmpPosFin.X, tmpPosFin.Y, tmpPosFin.Z, 50)
- Native.Function.Call("PLAY_SOUND_FROM_position", -1, "shotgun_fire", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z)
- End If
- 'Native.Function.Call("PLAY_SOUND_FROM_position", IDMoveSound, "shotgun_fire", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z)
- 'Native.Function.Call("PLAY_SOUND_FROM_position", -1, "shotgun_fire", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z)
- 'If (targetPed = charCheck) AndAlso (TRandom.NextDouble < 0.3) Then
- ' charCheck.Health -= 1
- ' damageTime = 0
- 'End If
- Else
- timeIntervalShootCannon -= intervalFix()
- End If
- End Sub
- End Class
- Private tmpEnemy As TSuperGuy
- Private TSuperGuyList As New List(Of TSuperGuy)
- Private TSuperGuyExplodeList As New List(Of TSuperGuy)
- Private freeRocketList As New List(Of GTA.Object)
- Private explosionEffectTIme As Double = 0
- Private sndBeep As System.Media.SoundPlayer
- Private timeWaitBeep As Double = 50
- Private sndTargetSet As System.Media.SoundPlayer
- ' enemy blip list
- Private Class TEnemyBlip
- Public p As Ped = Nothing
- Public v As Vehicle = Nothing
- Public blip As Blip = Nothing
- End Class
- Private wantedLevel As Double = 0
- Private tmpTEnemyBlip As TEnemyBlip
- Private TEnemyBlipList As New List(Of TEnemyBlip)
- Private timeWaitSearchEnemy As Double = 0
- Private timeSetWanted As Double = 0
- Private copKillCont As Int16 = 0
- ' armors class
- Private Class TArmor
- Public name As String = ""
- Public file_name As String = ""
- Public model As Model
- Public anim_group As String = "move_player"
- Public removeHair As Boolean = True
- Public removeHead As Boolean = False
- Public component_0_Var As Int16 = 0
- Public component_1_Var As Int16 = 0
- Public component_2_Var As Int16 = 0
- Public component_3_Var As Int16 = 0
- Public component_4_Var As Int16 = 0
- Public component_5_Var As Int16 = 0
- Public component_6_Var As Int16 = 0
- Public component_7_Var As Int16 = 0
- Public component_8_Var As Int16 = 0
- Public component_9_Var As Int16 = 0
- Public enemy As Boolean = False
- Public ally As Boolean = False
- Public weaponSet As Int16 = 0
- Public img_preview As String = ""
- Public drawTexture As Boolean = False
- Public texMenu As Texture
- Public AIM_Robot As Boolean = False
- Public cannonHandOffset As Vector3
- Public cannonShoulderOffset As Vector3
- Public superCannonShoulderOffset As Vector3
- Public superCannon As Boolean = False
- Public shoulderCannon As Boolean = False
- Public handCannon As Boolean = True
- Public handCannon_ShootInterval As Double = 20
- Public shoulderCannon_ShootInterval As Double = 10
- Public superCannon_ShootInterval As Double = 100
- Public handCannon_Damage As Int16 = 100
- Public shoulderCannon_Damage As Int16 = 100
- Public superCannon_Power As Int16 = 100
- Public timeWaitShootSuperCannon As Double = 0
- Public bHandThrusters As Boolean = True
- Public bFootThrusters As Boolean = True
- Public bBackThrusters As Boolean = False
- Public bThrustersSound As Boolean = True
- Public back_rep_x_off As Double = 0.15
- Public back_rep_y_off As Double = -0.2
- Public back_rep_z_off As Double = -0.16
- Public back_rep_x_rot_off As Double = 0
- Public back_rep_y_rot_off As Double = 0
- Public back_rep_z_rot_off As Double = 192
- End Class
- Private tmpTArmor As TArmor
- Private TArmorList As New List(Of TArmor)
- Private TEnemyAllyArmorList As New List(Of TArmor)
- Shared playerArmor As TArmor
- Private iniFile As String
- Private Class TGameSounds
- Public id As Int32 = 0
- Public timeWait As Double = 0
- End Class
- Private tmpTGameSounds As TGameSounds
- Private TGameSoundsList As New List(Of TGameSounds)
- Private Class meleeAffected
- Public p As Ped = Nothing
- Public v As Vehicle = Nothing
- Public bApplyforce As Boolean = False
- End Class
- Private meleeAffectedList As New List(Of meleeAffected)
- Private tmpmeleeAffected As meleeAffected = Nothing
- Private meleeAffectedFront As meleeAffected = New meleeAffected
- Public Sub New()
- Me.Interval = myInterval
- 'offx = 100
- 'offy = 800
- 'offH = 59
- Wait(100)
- bWasAlive = Player.Character.Health > 0
- bWasDead = Player.Character.Health <= 0
- hkShowMenu = Settings.GetValueKey("hkShowMenu", "controls", Keys.D0)
- Game.Console.Print("Iron Man IV Script v1.1 by JulioNIB")
- Game.Console.Print("Armors and HUD images by H1Vltg3, Wapeddell and Quechus13")
- End Sub
- Private Sub loadAux()
- OH = New ObjectsHandler
- While Not Exists(OH.attachMaster)
- Wait(50)
- OH = New ObjectsHandler
- End While
- loadArmors()
- If Settings.GetValueString("start_with_armor", "general") = "" Then Settings.SetValue("start_with_armor", "general", "0")
- If Settings.GetValueString("initial_armor_model", "general") = "" Then Settings.SetValue("initial_armor_model", "general", "")
- If Settings.GetValueString("hkSwitchGun", "controls") = "" Then Settings.SetValue("hkSwitchGun", "controls", Keys.E)
- If Settings.GetValueString("hkCannon", "controls") = "" Then Settings.SetValue("hkCannon", "controls", Keys.D1)
- If Settings.GetValueString("hkDarts", "controls") = "" Then Settings.SetValue("hkDarts", "controls", Keys.D2)
- If Settings.GetValueString("hkRockets", "controls") = "" Then Settings.SetValue("hkRockets", "controls", Keys.D3)
- If Settings.GetValueString("hkHandRep", "controls") = "" Then Settings.SetValue("hkHandRep", "controls", Keys.D4)
- If Settings.GetValueString("hkChestRep", "controls") = "" Then Settings.SetValue("hkChestRep", "controls", Keys.D5)
- If Settings.GetValueString("hkShowMenu", "controls") = "" Then Settings.SetValue("hkShowMenu", "controls", Keys.D0)
- If Settings.GetValueString("hkKick", "controls") = "" Then Settings.SetValue("hkKick", "controls", Keys.Q)
- If Settings.GetValueString("hkPunch", "controls") = "" Then Settings.SetValue("hkPunch", "controls", Keys.R)
- If Settings.GetValueString("hkShoot", "controls") = "" Then Settings.SetValue("hkShoot", "controls", Keys.LButton)
- If Settings.GetValueString("hkSpawnAlly", "controls") = "" Then Settings.SetValue("hkSpawnAlly", "controls", Keys.NumPad0)
- If Settings.GetValueString("hkSpawnEnemy", "controls") = "" Then Settings.SetValue("hkSpawnEnemy", "controls", Keys.NumPad1)
- If Settings.GetValueString("hkSwitchCam", "controls") = "" Then Settings.SetValue("hkSwitchCam", "controls", Keys.X)
- If Settings.GetValueString("hkUnlockFlightCam", "controls") = "" Then Settings.SetValue("hkUnlockFlightCam", "controls", Keys.B)
- If Settings.GetValueString("hkWeaponSelectMenu", "controls") = "" Then Settings.SetValue("hkWeaponSelectMenu", "controls", Keys.MButton)
- If Settings.GetValueString("hkNoWantedLevel", "controls") = "" Then Settings.SetValue("hkNoWantedLevel", "controls", Keys.Subtract)
- If Settings.GetValueString("hkGodMode", "controls") = "" Then Settings.SetValue("hkGodMode", "controls", Keys.Add)
- If Settings.GetValueString("maxAlly", "general", "") = "" Then Settings.SetValue("maxAlly", "general", 1)
- If Settings.GetValueString("maxEnemy", "general", "") = "" Then Settings.SetValue("maxEnemy", "general", 2)
- If Settings.GetValueString("bUseArmorDelivery", "general", "") = "" Then Settings.SetValue("bUseArmorDelivery", "general", "0")
- If Settings.GetValueString("HUDIndex", "general", "") = "" Then Settings.SetValue("HUDIndex", "general", "1")
- If Settings.GetValueString("bNoFlightCollisionDetection", "general", "") = "" Then Settings.SetValue("bNoFlightCollisionDetection", "general", "0")
- If Settings.GetValueString("jarvisVolume", "general", "") = "" Then Settings.SetValue("jarvisVolume", "general", "0.3")
- Settings.Save()
- bArmorON = Settings.GetValueString("start_with_armor", "general") = "1"
- jarvisVolume = Double.Parse(Settings.GetValueString("jarvisVolume", "general", "0.3"))
- If bArmorON Then
- Dim tmpModelName As String = Settings.GetValueString("initial_armor_model", "general")
- For Each a As TArmor In TArmorList
- If a.model = tmpModelName Then
- playerArmor = a
- Game.FadeScreenOut(500, True)
- Try
- Wait(100)
- Player.Model = playerArmor.model
- Wait(500)
- Catch
- End Try
- Game.FadeScreenIn(500, False)
- Native.Function.Call("SET_CHAR_DEFAULT_COMPONENT_VARIATION", Player.Character, True)
- setArmorComponentVar()
- Exit For
- End If
- Next
- End If
- hkSwitchGun = Settings.GetValueKey("hkSwitchGun", "controls", Keys.E)
- hkCannon = Settings.GetValueKey("hkCannon", "controls", Keys.D1)
- hkDarts = Settings.GetValueKey("hkDarts", "controls", Keys.D2)
- hkRockets = Settings.GetValueKey("hkRockets", "controls", Keys.D3)
- hkHandRep = Settings.GetValueKey("hkHandRep", "controls", Keys.D4)
- hkChestRep = Settings.GetValueKey("hkChestRep", "controls", Keys.D5)
- hkShowMenu = Settings.GetValueKey("hkShowMenu", "controls", Keys.D0)
- hkKick = Settings.GetValueKey("hkKick", "controls", Keys.Q)
- hkPunch = Settings.GetValueKey("hkPunch", "controls", Keys.R)
- hkShoot = Settings.GetValueKey("hkShoot", "controls", Keys.LButton)
- hkSpawnAlly = Settings.GetValueKey("hkSpawnAlly", "controls", Keys.NumPad0)
- hkSpawnEnemy = Settings.GetValueKey("hkSpawnEnemy", "controls", Keys.NumPad1)
- hkSwitchCam = Settings.GetValueKey("hkSwitchCam", "controls", Keys.X)
- hkUnlockFlightCam = Settings.GetValueKey("hkUnlockFlightCam", "controls", Keys.B)
- hkWeaponSelectMenu = Settings.GetValueKey("hkWeaponSelectMenu", "controls", Keys.MButton)
- hkNoWantedLevel = Settings.GetValueKey("hkNoWantedLevel", "controls", Keys.Subtract)
- hkGodMode = Settings.GetValueKey("hkGodMode", "controls", Keys.Add)
- maxAlly = Settings.GetValueInteger("maxAlly", "general", 1)
- maxEnemy = Settings.GetValueInteger("maxEnemy", "general", 2)
- bUseArmorDelivery = Settings.GetValueString("bUseArmorDelivery", "general", "0") = "1"
- HUDIndex = Int16.Parse(Settings.GetValueString("HUDIndex", "general", "1"))
- bNoFlightCollisionDetection = Settings.GetValueString("bNoFlightCollisionDetection", "general", "0") = "1"
- switchHUDname()
- myFlyHabsNormal = Nothing
- While Not Exists(myFlyHabsNormal)
- myFlyHabsNormal = OH.createVehicle("faggio", Player.Character.Position.Around(20) + Vector3.WorldUp * 200)
- Wait(50)
- End While
- OH.hideVehicle(myFlyHabsNormal)
- myFlyHabsHitObject = Nothing
- While Not Exists(myFlyHabsHitObject)
- myFlyHabsHitObject = OH.createVehicle("airtug", Player.Character.Position.Around(25) + Vector3.WorldUp * 200)
- Wait(50)
- End While
- OH.hideVehicle(myFlyHabsHitObject)
- myFlyHabs = myFlyHabsNormal
- width_Coef = Game.Resolution.Width / 1680
- height_Coef = Game.Resolution.Height / 1050
- 'IDsndCannon = Native.Function.Call(Of Int32)("get_sound_id")
- IDsndCannonRotate = Native.Function.Call(Of Int32)("get_sound_id")
- 'IDsndGunSwitch = Native.Function.Call(Of Int32)("get_sound_id")
- 'IDsndJets1 = Native.Function.Call(Of Int32)("get_sound_id")
- 'IDsndLaunchDarts = Native.Function.Call(Of Int32)("get_sound_id")
- 'tmpTGameSounds = New TGameSounds
- 'tmpTGameSounds.id = IDsndCannon
- 'TGameSoundsList.Add(tmpTGameSounds)
- tmpTGameSounds = New TGameSounds
- tmpTGameSounds.id = IDsndCannonRotate
- TGameSoundsList.Add(tmpTGameSounds)
- 'tmpTGameSounds = New TGameSounds
- 'tmpTGameSounds.id = IDsndGunSwitch
- 'TGameSoundsList.Add(tmpTGameSounds)
- 'tmpTGameSounds = New TGameSounds
- 'tmpTGameSounds.id = IDsndLaunchDarts
- 'TGameSoundsList.Add(tmpTGameSounds)
- While Not createObject("cj_dart_1", GTA.Vector3.Zero + Vector3.WorldUp * 3, jetSoundAux, 50)
- Wait(10)
- End While
- Native.Function.Call("set_object_collision", jetSoundAux, False)
- jetSoundAux.Visible = False
- jetSoundAux.FreezePosition = True
- camAux = New Camera
- Wait(100)
- camAux.FOV = 40
- While Not createObject("cj_dart_6", Vector3.Zero + Vector3.WorldUp * 6, targetObejctAux, 50)
- Wait(10)
- End While
- targetObejctAux.FreezePosition = True
- targetObejctAux.Visible = False
- Native.Function.Call("SET_OBJECT_COLLISION", targetObejctAux, False)
- For c As Int16 = 1 To 10
- tmpDart = New TDarts
- While Not createObject("cj_dart_6", Vector3.Zero + Vector3.WorldUp * 9, tmpDart.dart, 50)
- Wait(0)
- End While
- If Exists(tmpDart.dart) Then DartsList.Add(tmpDart)
- Next
- sndRepulsorStart = New System.Media.SoundPlayer
- sndRepulsorBlast = New System.Media.SoundPlayer
- sndBeep = New System.Media.SoundPlayer
- sndTargetSet = New System.Media.SoundPlayer
- If Not Directory.Exists(".\Scripts\Iron man files\") Then Directory.CreateDirectory(".\Scripts\Iron man files\")
- sndRepulsorStart.SoundLocation = ".\scripts\iron man files\repulsorStart.wav"
- sndRepulsorBlast.SoundLocation = ".\scripts\iron man files\repulsorBlast.wav"
- sndBeep.SoundLocation = ".\scripts\iron man files\beep.wav"
- sndTargetSet.SoundLocation = ".\scripts\iron man files\targetSet.wav"
- Try
- sndRepulsorStart.LoadAsync()
- sndRepulsorBlast.LoadAsync()
- sndBeep.LoadAsync()
- sndTargetSet.LoadAsync()
- Catch
- bSoundOK = False
- Game.Console.Print("Error loading Iron Man IV sounds, check your Iron Man files folder...")
- End Try
- repulsorLight = New Light
- repulsorLight.Enabled = False
- Dim tmpbDrawTextures As Boolean = True
- Try
- Dim tmpTexNumber As TTexNumber
- For c As Int16 = 0 To 9
- tmpTexNumber = New TTexNumber(".\scripts\iron man files\" & Int16.Parse(c) & ".png")
- texNumbers.Add(tmpTexNumber)
- Next
- If Not loadHUD() Then Throw New Exception("Error loading HUD")
- Catch
- tmpbDrawTextures = False
- Game.Console.Print("Error loading Iron Man IV images, check your Iron Man files folder...")
- End Try
- animSetFlight = New AnimationSet("parachute")
- animSetPointArm = New AnimationSet("cop")
- animSetPunchKick = New AnimationSet("melee_player_unarmed")
- Native.Function.Call("REQUEST_ANIMS", "parachute")
- Native.Function.Call("REQUEST_ANIMS", "full_brake_for_landing")
- Native.Function.Call("REQUEST_ANIMS", "cop")
- If bArmorON Then
- Player.MaxHealth = 1000
- Player.Character.MaxHealth = 1000
- Player.Character.Health = 1000
- Player.Character.Weapons.RemoveAll()
- Player.Character.MakeProofTo(False, True, False, bNoFlightCollisionDetection OrElse bPlayerFallingDamageProof, True)
- End If
- getGameSoundID(IDsndJets1)
- If bSoundOK AndAlso tmpbDrawTextures Then
- Game.Console.Print("Iron Man IV Script loaded")
- Else
- Game.Console.Print("Iron Man IV Script loaded with errors :(")
- End If
- resetCamCfg()
- jarvis_congrats_1 = New NAudioPlayer(".\scripts\Iron man files\jarvis\j_c.wav")
- jarvis_congrats_2 = New NAudioPlayer(".\scripts\Iron man files\jarvis\j_c2.wav")
- jarvis_congrats_3 = New NAudioPlayer(".\scripts\Iron man files\jarvis\j_c3.wav")
- jarvis_congrats_4 = New NAudioPlayer(".\scripts\Iron man files\jarvis\j_c4.wav")
- jarvis_enemy = New NAudioPlayer(".\scripts\Iron man files\jarvis\j_enemy_alert.wav")
- jarvis_warning = New NAudioPlayer(".\scripts\Iron man files\jarvis\j_warning.wav")
- jarvis_warning_2 = New NAudioPlayer(".\scripts\Iron man files\jarvis\j_warning2.wav")
- jarvis_warning_3 = New NAudioPlayer(".\scripts\Iron man files\jarvis\j_warning3.wav")
- jarvis_congrats_1.volume(jarvisVolume)
- jarvis_congrats_2.volume(jarvisVolume)
- jarvis_congrats_3.volume(jarvisVolume)
- jarvis_congrats_4.volume(jarvisVolume)
- jarvis_enemy.volume(jarvisVolume)
- jarvis_warning.volume(jarvisVolume)
- jarvis_warning_2.volume(jarvisVolume)
- jarvis_warning_3.volume(jarvisVolume)
- bDrawTextures = tmpbDrawTextures
- End Sub
- Private Function controllerConnected()
- Return controllerState.IsConnected
- End Function
- Private Function loadHUD()
- If HUDIndex = 4 Then
- texCrossHair = New Texture(File.ReadAllBytes(".\scripts\Iron Man files\CrossHair.png"))
- Return True
- End If
- Dim sTmp As String = "Iron Man files\HUD " + HUDIndex.ToString
- Try
- texCannon = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\Bullets.png"))
- texDarts = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\darts.png"))
- texRockets = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\rockets.png"))
- texHandRep = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\rep_hand.png"))
- texChestRep = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\rep_chest.png"))
- texWSelect = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\wselect.png"))
- texHUD = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HUD.png"))
- texBar = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\bar.png"))
- texCrossHair = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\CrossHair.png"))
- texHudRing = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HUDRING.png"))
- texHUDLeft = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HUDLeft.png"))
- If HUDIndex = 1 Then texHUDBottom = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HUDBottom.png"))
- If (HUDIndex = 2) OrElse (HUDIndex = 3) Then texHUDLEFT_FlightMode = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HUDLEFT FlightMode.png"))
- If (HUDIndex = 2) OrElse (HUDIndex = 3) Then texHUDLEFT_MissileAlarm = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HUDLEFT MissileAlarm.png"))
- texHUDRight = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HUDRight.png"))
- If (HUDIndex = 2) OrElse (HUDIndex = 3) Then texHUDRIGHT_Damage = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HUDRIGHT_Damage.png"))
- If HUDIndex = 3 Then texHUDRight_FlightMode = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HUDRIGHT_flight_mode.png"))
- If HUDIndex = 3 Then texHUD_ThrusterBar = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\Thruster Bar.png"))
- texHUDTop = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HUDTop.png"))
- If (HUDIndex = 2) OrElse (HUDIndex = 3) Then
- texHUDBottonIcon1 = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HBI1.png"))
- texHUDBottonIcon1_2 = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HBI12.png"))
- texHUDBottonIcon2 = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HBI2.png"))
- texHUDBottonIcon2_2 = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HBI22.png"))
- texHUDBottonIcon3 = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HBI3.png"))
- texHUDBottonIcon3_2 = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HBI32.png"))
- texHUDBottonIcon3_3 = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HBI33.png"))
- texHUDBottonIcon3_4 = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HBI34.png"))
- texHUDBottonIcon4 = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HBI4.png"))
- texHUDBottonIcon4_2 = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HBI42.png"))
- texHUDBottonIcon5 = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HBI5.png"))
- texHUDBottonIcon5_2 = New Texture(File.ReadAllBytes(".\scripts\" + sTmp + "\HBI52.png"))
- End If
- Return True
- Catch
- Return False
- End Try
- End Function
- Private Sub switchHUDname()
- If HUDIndex = 1 Then
- HUDName = "v1.0"
- ElseIf HUDIndex = 2 Then
- HUDName = "v2.0"
- ElseIf HUDIndex = 3 Then
- HUDName = "v3.0"
- Else
- HUDName = "None"
- End If
- End Sub
- Private Sub resetCamCfg()
- Native.Function.Call("UNATTACH_CAM", camAux)
- Native.Function.Call("ATTACH_CAM_TO_PED", camAux, Player.Character)
- Native.Function.Call("SET_CAM_ATTACH_OFFSET", camAux, -1.0, -2.0, 0.5)
- Native.Function.Call("SET_CAM_ATTACH_OFFSET_IS_RELATIVE", camAux, True)
- Native.Function.Call("SET_CAM_PROPAGATE", camAux, True)
- End Sub
- Private Function createObject(sModelName As String, position As Vector3, ByRef returnObj As GTA.Object, timeOut As Int16) As Boolean
- returnObj = World.CreateObject(sModelName, position)
- Wait(timeOut)
- Return Exists(returnObj)
- End Function
- Private Function createVehicle(sModelName As String, position As Vector3, ByRef returnVeh As Vehicle, timeOut As Int16) As Boolean
- returnVeh = World.CreateVehicle(sModelName, position)
- Wait(timeOut)
- Return Exists(returnVeh)
- End Function
- Private Function createPed(sModelName As String, position As Vector3, ByRef returnPed As Ped, timeOut As Int16) As Boolean
- If sModelName <> "" Then
- returnPed = World.CreatePed(sModelName, position)
- Else
- returnPed = World.CreatePed(position)
- End If
- Wait(timeOut)
- Return Exists(returnPed)
- End Function
- Shared Sub msg(ByVal sMsg As String, ByVal time As Int32)
- 'Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", sMsg, time, 1)
- DisplayMessage.Display(sMsg, time)
- End Sub
- Private Sub setArmorComponentVar()
- Native.Function.Call("SET_CHAR_COMPONENT_VARIATION", Player.Character, 0, playerArmor.component_0_Var, 0)
- Native.Function.Call("SET_CHAR_COMPONENT_VARIATION", Player.Character, 1, playerArmor.component_1_Var, 0) '15
- Native.Function.Call("SET_CHAR_COMPONENT_VARIATION", Player.Character, 2, playerArmor.component_2_Var, 0) '7
- Native.Function.Call("SET_CHAR_COMPONENT_VARIATION", Player.Character, 3, playerArmor.component_3_Var, 0)
- Native.Function.Call("SET_CHAR_COMPONENT_VARIATION", Player.Character, 4, playerArmor.component_4_Var, 0) '1
- Native.Function.Call("SET_CHAR_COMPONENT_VARIATION", Player.Character, 5, playerArmor.component_5_Var, 0) '5
- Native.Function.Call("SET_CHAR_COMPONENT_VARIATION", Player.Character, 6, playerArmor.component_6_Var, 0)
- Native.Function.Call("SET_CHAR_COMPONENT_VARIATION", Player.Character, 7, playerArmor.component_7_Var, 0)
- Native.Function.Call("SET_CHAR_COMPONENT_VARIATION", Player.Character, 8, playerArmor.component_8_Var, 0) '1
- Native.Function.Call("SET_CHAR_COMPONENT_VARIATION", Player.Character, 9, playerArmor.component_9_Var, 0)
- End Sub
- Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown
- If e.Key = hkShowMenu Then
- bShowArmorMenu = False
- bShowArmorOptionsMenu = False
- If ArmorDeliveryStatus = 0 Then
- bShowMenu = Not bShowMenu
- Else
- bShowMenu = False
- End If
- End If
- If bShowMenu OrElse bShowArmorMenu OrElse bShowArmorOptionsMenu Then checkMenu(e.Key)
- If Not bArmorON Then Exit Sub
- fakeKeydown(e)
- End Sub
- Private Sub keyUp(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyUp
- If (e.Key = hkWeaponSelectMenu) Then
- resetPlayerControl()
- End If
- End Sub
- Private Sub switchGodMode()
- bGodMode = Not bGodMode
- If bGodMode Then
- Player.Character.MakeProofTo(True, True, True, True, True)
- If Not bShowMenu Then msg("Invincible Iron Man...", 2000)
- Else
- Player.Character.MakeProofTo(False, True, False, bNoFlightCollisionDetection OrElse bPlayerFallingDamageProof, True)
- If Not bShowMenu Then msg("Normal Iron Man...", 2000)
- End If
- End Sub
- Private Sub switchNoWanted()
- bNoWanted = Not bNoWanted
- If bNoWanted Then
- Player.WantedLevel = 0
- Native.Function.Call("SET_MAX_WANTED_LEVEL", 6)
- Native.Function.Call("ALTER_WANTED_LEVEL", Player, 0)
- Native.Function.Call("APPLY_WANTED_LEVEL_CHANGE_NOW", Player)
- For c As Int16 = TEnemyBlipList.Count - 1 To 0 Step -1
- If Exists(TEnemyBlipList(c).p) AndAlso TEnemyBlipList(c).p.PedType = PedType.Cop Then
- If Exists(TEnemyBlipList(c).blip) Then TEnemyBlipList(c).blip.Delete()
- TEnemyBlipList(c).p.NoLongerNeeded()
- TEnemyBlipList.RemoveAt(c)
- End If
- Next
- If Not bShowMenu Then msg("Never Wanted mode ON...", 2000)
- Else
- If Not bShowMenu Then msg("Never Wanted mode OFF...", 2000)
- End If
- End Sub
- Private Sub checkMenu(key As Keys)
- If bShowArmorOptionsMenu Then
- checkArmorOptionMenu(key)
- Exit Sub
- End If
- If bShowArmorMenu Then
- checkArmorIndex(key)
- Exit Sub
- End If
- If key = Keys.Left Then menuIndex -= 1
- If key = Keys.Right Then menuIndex += 1
- If menuIndex > 9 Then menuIndex = 0
- If menuIndex < 0 Then menuIndex = 9
- If key = Keys.Enter Then
- If (menuIndex = 8) AndAlso Not bArmorON Then
- msg("You need to equip an armor first", 3000)
- Exit Sub
- End If
- If menuIndex = 0 Then
- bShowArmorMenu = True
- bShowMenu = False
- ElseIf menuIndex = 1 Then
- switchGodMode()
- ElseIf menuIndex = 2 Then
- switchNoWanted()
- ElseIf menuIndex = 3 Then
- createNewTSuperGuy(Nothing, True, True)
- ElseIf menuIndex = 4 Then
- createNewTSuperGuy(Nothing, False, True)
- ElseIf menuIndex = 5 Then
- bDrawTextures = False
- HUDIndex += 1
- If HUDIndex > 4 Then HUDIndex = 1
- bDrawTextures = loadHUD()
- bFirstDraw = bDrawTextures
- switchHUDname()
- Settings.SetValue("HUDIndex", "general", HUDIndex.ToString)
- Settings.Save()
- ElseIf menuIndex = 6 Then
- bNoFlightCollisionDetection = Not bNoFlightCollisionDetection
- If bNoFlightCollisionDetection Then
- Settings.SetValue("bNoFlightCollisionDetection", "general", "1")
- Else
- Settings.SetValue("bNoFlightCollisionDetection", "general", "0")
- End If
- Settings.Save()
- ElseIf menuIndex = 7 Then
- jarvisVolume += 0.1
- If jarvisVolume > 1.0 Then jarvisVolume = 0.1
- Settings.SetValue("jarvisVolume", "general", jarvisVolume.ToString)
- Settings.Save()
- jarvis_congrats_1.volume(jarvisVolume)
- jarvis_congrats_2.volume(jarvisVolume)
- jarvis_congrats_3.volume(jarvisVolume)
- jarvis_congrats_4.volume(jarvisVolume)
- jarvis_enemy.volume(jarvisVolume)
- jarvis_warning.volume(jarvisVolume)
- jarvis_warning_2.volume(jarvisVolume)
- jarvis_warning_3.volume(jarvisVolume)
- jarvis_congrats_1.play()
- ElseIf menuIndex = 8 Then
- bShowArmorOptionsMenu = True
- bShowMenu = False
- Else
- bShowMenu = False
- End If
- End If
- End Sub
- Private Sub checkArmorIndex(key As Keys)
- If key = Keys.Left Then armorMenuIndex -= 1
- If key = Keys.Right Then armorMenuIndex += 1
- If armorMenuIndex >= TArmorList.Count Then armorMenuIndex = 0
- If armorMenuIndex < 0 Then armorMenuIndex = TArmorList.Count - 1
- 'If (armorMenuIndex < TArmorList.Count) AndAlso TArmorList(armorMenuIndex).AIM_Robot Then
- ' If key = Keys.Right Then armorMenuIndex += 1 Else armorMenuIndex -= 1
- 'End If
- 'If armorMenuIndex > TArmorList.Count Then armorMenuIndex = 0
- 'If armorMenuIndex < 0 Then armorMenuIndex = TArmorList.Count
- If key = Keys.Enter Then
- bShowArmorMenu = False
- If Not bUseArmorDelivery OrElse (armorMenuIndex = TArmorList.Count - 1) Then
- resetHeliDelivery()
- switchArmor()
- ElseIf ArmorDeliveryStatus = 0 Then
- ArmorDeliveryStatus = 1
- checkHeliDeliveryExists(Player.Character.Position.Around(50).ToGround + Vector3.WorldUp * 100)
- heliDelivery.FreezePosition = False
- Native.Function.Call("SET_CAR_COLLISION", heliDelivery, True)
- heliDelivery.Position = Player.Character.Position.Around(200)
- heliDelivery.PlaceOnNextStreetProperly()
- heliDelivery.Position = heliDelivery.Position + Vector3.WorldUp * 70
- pilotDelivery.Task.ClearAll()
- pilotDelivery.Task.AlwaysKeepTask = True
- pilotDelivery.Task.DriveTo(Player.Character.Position + Vector3.WorldUp * 150, 50, True)
- heliDelivery.EngineRunning = True
- heliDeliveryBlip = armorCase.AttachBlip
- heliDeliveryBlip.Color = BlipColor.Green
- HeliDeliveryTimeCheckRoute = 2000
- DeliveryTime = 0
- End If
- End If
- End Sub
- Private Sub checkArmorOptionMenu(key As Keys)
- If key = Keys.Left Then armorOptionsMenuIndex -= 1
- If key = Keys.Right Then armorOptionsMenuIndex += 1
- If armorOptionsMenuIndex < 0 Then armorOptionsMenuIndex = 12
- If armorOptionsMenuIndex > 12 Then armorOptionsMenuIndex = 0
- If key = Keys.Enter Then
- If Not bArmorON Then
- bShowArmorOptionsMenu = False
- bShowMenu = False
- Exit Sub
- End If
- If armorOptionsMenuIndex = 12 Then
- bShowArmorOptionsMenu = False
- Exit Sub
- End If
- If armorOptionsMenuIndex = 0 Then
- playerArmor.handCannon = Not playerArmor.handCannon
- If playerArmor.handCannon Then
- playerArmor.shoulderCannon = False
- playerArmor.superCannon = False
- End If
- End If
- If armorOptionsMenuIndex = 1 Then
- playerArmor.shoulderCannon = Not playerArmor.shoulderCannon
- If playerArmor.shoulderCannon Then
- playerArmor.handCannon = False
- playerArmor.superCannon = False
- End If
- End If
- If armorOptionsMenuIndex = 2 Then
- playerArmor.superCannon = Not playerArmor.superCannon
- If playerArmor.superCannon Then
- playerArmor.shoulderCannon = False
- playerArmor.handCannon = False
- End If
- End If
- If armorOptionsMenuIndex = 3 Then playerArmor.bHandThrusters = Not playerArmor.bHandThrusters
- If armorOptionsMenuIndex = 4 Then playerArmor.bFootThrusters = Not playerArmor.bFootThrusters
- If armorOptionsMenuIndex = 5 Then playerArmor.bBackThrusters = Not playerArmor.bBackThrusters
- saveArmorCFG(playerArmor)
- End If
- If key = Keys.Add Then
- If armorOptionsMenuIndex = 6 Then playerArmor.back_rep_x_off += 0.01
- If armorOptionsMenuIndex = 7 Then playerArmor.back_rep_y_off += 0.01
- If armorOptionsMenuIndex = 8 Then playerArmor.back_rep_z_off += 0.01
- If armorOptionsMenuIndex = 9 Then playerArmor.back_rep_x_rot_off += 1
- If armorOptionsMenuIndex = 10 Then playerArmor.back_rep_y_rot_off += 1
- If armorOptionsMenuIndex = 11 Then playerArmor.back_rep_z_rot_off += 1
- saveArmorCFG(playerArmor)
- End If
- If key = Keys.Subtract Then
- If armorOptionsMenuIndex = 6 Then playerArmor.back_rep_x_off -= 0.01
- If armorOptionsMenuIndex = 7 Then playerArmor.back_rep_y_off -= 0.01
- If armorOptionsMenuIndex = 8 Then playerArmor.back_rep_z_off -= 0.01
- If armorOptionsMenuIndex = 9 Then playerArmor.back_rep_x_rot_off -= 1
- If armorOptionsMenuIndex = 10 Then playerArmor.back_rep_y_rot_off -= 1
- If armorOptionsMenuIndex = 11 Then playerArmor.back_rep_z_rot_off -= 1
- saveArmorCFG(playerArmor)
- End If
- End Sub
- Private Sub checkHeliDeliveryExists(pos As Vector3)
- If Not Exists(heliDelivery) Then
- While Not createVehicle(heliDeliveryModel, pos, heliDelivery, 50)
- Wait(0)
- End While
- heliDelivery.Color = ColorIndex.Black
- End If
- heliDelivery.MakeProofTo(False, False, False, True, True)
- If Not Exists(pilotDelivery) Then
- While Not createPed(pilotDeliveryModel, pos.Around(10), pilotDelivery, 50)
- Wait(0)
- End While
- End If
- pilotDelivery.WarpIntoVehicle(heliDelivery, VehicleSeat.Driver)
- If Not Exists(armorCase) Then
- While Not createObject(armorCaseModel, pos.Around(10), armorCase, 50)
- Wait(10)
- End While
- End If
- armorCase.AttachToVehicle(heliDelivery, Vector3.RelativeFront * 2, Vector3.Zero)
- End Sub
- Private Sub resetHeliDelivery()
- If Not bUseArmorDelivery Then Exit Sub
- checkHeliDeliveryExists(Player.Character.Position.Around(200))
- armorCase.AttachToVehicle(heliDelivery, Vector3.RelativeFront * 2, Vector3.Zero)
- Native.Function.Call("SET_CAR_COLLISION", heliDelivery, False)
- heliDelivery.FreezePosition = True
- heliDelivery.Position = Vector3.Zero
- If Exists(heliDeliveryBlip) Then heliDeliveryBlip.Delete()
- End Sub
- Private Sub switchArmor()
- Game.FadeScreenOut(500, True)
- Try
- Dim camPos As Vector3 = Game.CurrentCamera.Position
- Dim camRot As Vector3 = Game.CurrentCamera.Rotation
- Wait(100)
- Dim bWasFlying As Boolean = flying
- If bWasFlying Then switchFlight()
- If armorMenuIndex = TArmorList.Count - 1 Then
- Player.Model = "player"
- Player.MaxHealth = 100
- Player.Character.MaxHealth = 100
- Player.Character.Health = 100
- Player.Character.MakeProofTo(False, False, False, False, False)
- Native.Function.Call("SET_CHAR_DEFAULT_COMPONENT_VARIATION", Player.Character, True)
- Native.Function.Call("SET_ANIM_GROUP_FOR_CHAR", Player.Character, "move_player")
- playerArmor = Nothing
- Else
- playerArmor = TArmorList(armorMenuIndex)
- Player.Model = playerArmor.model
- Wait(500)
- Player.Character.FreezePosition = False
- Player.MaxHealth = 1000
- Player.Character.MaxHealth = 1000
- Player.Character.Health = 1000
- Player.Character.MakeProofTo(False, True, False, bNoFlightCollisionDetection OrElse bPlayerFallingDamageProof, True)
- Native.Function.Call("SET_CHAR_DEFAULT_COMPONENT_VARIATION", Player.Character, True)
- setArmorComponentVar()
- reattachDarts()
- Native.Function.Call("SET_ANIM_GROUP_FOR_CHAR", Player.Character, playerArmor.anim_group)
- bFirstDraw = True
- End If
- bArmorON = armorMenuIndex < TArmorList.Count - 1
- bShowArmorMenu = False
- If bWasFlying Then switchFlight()
- If Exists(Game.DefaultCamera) Then
- Native.Function.Call("SET_CAM_POS", Game.DefaultCamera, camPos.X, camPos.Y, camPos.Z)
- Native.Function.Call("SET_CAM_ROT", Game.DefaultCamera, camRot.X, camRot.Y, camRot.Z)
- End If
- If Not bArmorON Then
- Player.Character.Animation.Play(animSetFlight, "", 5.0, AnimationFlags.Unknown05)
- While TEnemyBlipList.Count > 0
- Try
- TEnemyBlipList(0).blip.Delete()
- Catch
- End Try
- Try
- TEnemyBlipList(0).p.NoLongerNeeded()
- Catch
- End Try
- TEnemyBlipList.RemoveAt(0)
- Wait(5)
- End While
- End If
- Catch
- End Try
- lastHealth = 0
- Game.FadeScreenIn(500)
- End Sub
- Private Sub resetPlayerControl()
- bShowingWeaponSelector = False
- Native.Function.Call("SET_PLAYER_CONTROL", Player, True)
- GameTimeScale = 1.0
- End Sub
- Private Sub reattachDarts()
- Native.Function.Call("play_sound_from_ped", -1, "general_explosions_debris_1", Player.Character)
- 'taskResetSoundID(IDsndGunSwitch)
- For Each d As TDarts In DartsList
- d.target = Nothing
- d.targetVeh = Nothing
- d.targetSuperGuy = Nothing
- Next
- If gunMode = 1 Then
- For c As Int16 = 0 To DartsList.Count - 1
- If c Mod 2 = 0 Then
- DartsList(c).attachPos = Vector3.WorldUp * 0.15 + Vector3.RelativeFront * 0.1 + Vector3.RelativeRight * 0.1
- Else
- DartsList(c).attachPos = Vector3.WorldUp * 0.15 + Vector3.RelativeFront * 0.1 + Vector3.RelativeRight * -0.2
- End If
- DartsList(c).attachBone = Bone.RightUpperarmRoll
- DartsList(c).attachRotation.Z = -80
- DartsList(c).attachRotation.Y = -80 * (3.15 / 180)
- DartsList(c).attachRotation.X = 0
- DartsList(c).Hide()
- Next
- ElseIf gunMode = 2 Then
- For c As Int16 = 0 To DartsList.Count - 1
- If c Mod 2 = 0 Then
- DartsList(c).attachPos = Vector3.RelativeTop * 0.05
- Else
- DartsList(c).attachPos = Vector3.RelativeTop * -0.1
- End If
- DartsList(c).attachBone = Bone.LeftHand
- DartsList(c).attachRotation.Z = 0
- DartsList(c).attachRotation.Y = -80 * (3.15 / 180)
- DartsList(c).attachRotation.X = 0
- DartsList(c).Hide()
- Next
- End If
- End Sub
- Private Sub switchFlight(Optional bExplosioResult As Boolean = False, Optional bWaterImpact As Boolean = False)
- If Not bWaterImpact AndAlso ((timeRestartFlight > 0) OrElse (Player.Character.Health <= 0) OrElse _
- (Exists(Player.Character.CurrentVehicle) AndAlso (Player.Character.CurrentVehicle.Model <> myFlyHabs.Model))) Then Exit Sub
- timeRestartFlight = 200
- flying = Not flying
- stopPTFX(PTFX_SmokeLB)
- stopPTFX(PTFX_SmokeRB)
- If flying AndAlso Player.Character.isRagdoll AndAlso Native.Function.Call(Of Boolean)("is_char_in_water", Player.Character) Then
- flying = False
- Exit Sub
- End If
- If flying Then
- Player.Character.isRagdoll = False
- If Native.Function.Call(Of Boolean)("is_char_in_water", Player.Character) Then
- Player.Character.Position = Player.Character.Position + Vector3.WorldUp * 2
- End If
- timeHideFlyAbs = 0
- OH.releaseVehicle(myFlyHabs, True, False)
- Dim tmpVehList As Vehicle() = World.GetVehicles(Player.Character.Position, 10)
- For Each v As Vehicle In tmpVehList
- If Exists(v) AndAlso (v <> myFlyHabs) Then
- v.isRequiredForMission = True
- End If
- Next
- Dim tmpWarPos As Vector3 = Player.Character.Position + Vector3.WorldUp * 0.5
- Native.Function.Call("set_car_collision", myFlyHabs, False)
- myFlyHabs.FreezePosition = False
- myFlyHabs.Position = tmpWarPos
- myFlyHabs.FreezePosition = True
- myFlyHabs.Heading = Player.Character.Heading
- Player.Character.Task.ClearAll()
- Player.Character.Animation.Play(animSetFlight, "full_brake_for_landing", 5.0, AnimationFlags.Unknown05)
- myFlyHabs.MakeProofTo(True, True, True, False, True)
- myFlyHabs.CanBeDamaged = False
- myFlyHabs.CanBeVisiblyDamaged = False
- mySpeed = myFlyHabs.Speed
- myLastPos = Player.Character.Position
- myLastPos.Z += 2
- vRotation = myFlyHabs.Rotation
- upAmount = 0
- downAmount = 0
- forwardAmount = 0
- backwardAmount = 0
- lastZPos = myLastPos.Z
- bFast = False
- Player.Character.Weapons.RemoveAll()
- jetSoundDistance = 10
- jetSoundDesiredDistance = 10
- If Not Exists(jetSoundAux) Then
- createObject("cj_dart_1", GTA.Vector3.Zero + Vector3.WorldUp * 3, jetSoundAux, 50)
- Else
- jetSoundAux.FreezePosition = False
- If getGameSoundID(IDsndJets1) Then _
- Native.Function.Call("play_sound_from_object", IDsndJets1, "GENERAL_WEAPONS_ROCKET_LOOP", jetSoundAux)
- End If
- If Not bAimDown Then heightFix = 6
- Player.Character.WarpIntoVehicle(myFlyHabs, VehicleSeat.Driver)
- Native.Function.Call("set_car_collision", myFlyHabs, True)
- myFlyHabs.FreezePosition = False
- myFlyHabs.Position = tmpWarPos
- Else
- Dim tmpVel As Vector3 = myFlyHabs.Velocity
- If Exists(jetSoundAux) Then jetSoundAux.FreezePosition = True
- getGameSoundID(IDsndJets1)
- myFlyHabs.Visible = False
- Native.Function.Call("set_car_collision", myFlyHabs, False)
- myFlyHabs.FreezePosition = True
- Player.Character.Task.ClearAllImmediately()
- lastFlightZ2 = Player.Character.Position.Z
- 'crashEffect()
- If bWaterImpact Then
- Player.Character.Velocity = tmpVel / 2 + Vector3.WorldUp
- Player.Character.Euphoria.BodyBalance.Start(1000)
- ElseIf Not bExplosioResult Then
- Player.Character.Velocity = tmpVel
- 'If (World.GetGroundPosition(Player.Character.Position, GroundType.NextBelowCurrent).DistanceTo(Player.Character.Position) > 2) Then
- 'Player.Character.Animation.Play(animSetFlight, "full_brake_for_landing", 5.0, AnimationFlags.Unknown05)
- 'End If
- If tmpVel.Length <= speedSlow Then
- Player.Character.Animation.Play(animSetFlight, "full_brake_for_landing", 5.0, AnimationFlags.Unknown05)
- ElseIf tmpVel.Length > speedFast Then
- Player.Character.Animation.Play(animSetFlight, "free_fall", 5.0, AnimationFlags.Unknown05)
- Else
- Player.Character.Animation.Play(animSetFlight, "free_fall_deccelerate", 5.0, AnimationFlags.Unknown05)
- End If
- playerLandVel = Player.Character.Velocity
- playerLandVel.Z = 0
- bLandAnim = True
- timeLandAnim = 0
- End If
- timeHideFlyAbs = 500
- End If
- timeResetFlight = -666
- timeOfFlight = 0
- End Sub
- Private Sub playLandAnim()
- If flying Then Exit Sub
- 'Dim tmpVel As GTA.Vector3 = Player.Character.Velocity
- 'tmpVel.Z = 0
- 'If animSetFlight.isInMemory Then
- 'If tmpVel.DistanceTo(GTA.Vector3.Zero) < 30 Then
- If Player.Character.Animation.isPlaying(animSetFlight, "full_brake_for_landing") Then
- Player.Character.Velocity = Player.Character.Direction
- 'If tmpZ > 0 Then
- Player.Character.Animation.Play(animSetFlight, "land_safe", 10.0, AnimationFlags.Unknown01)
- crashEffect()
- 'ElseIf tmpVel.DistanceTo(GTA.Vector3.Zero) < 50 Then
- ElseIf Player.Character.Animation.isPlaying(animSetFlight, "free_fall_deccelerate") Then
- Player.Character.Velocity /= 2
- Player.Character.Animation.Play(animSetFlight, "land_fast", 5.0, AnimationFlags.Unknown01)
- Else
- Player.Character.Animation.Play(animSetFlight, "land_fast", 20.0, AnimationFlags.Unknown01)
- Wait(100)
- Dim tmpTimeOut As Double = 0
- While (tmpTimeOut < 300) AndAlso (Player.Character.Animation.GetCurrentAnimationTime(animSetFlight, "land_fast") < 0.3)
- Wait(10)
- tmpTimeOut += 10
- End While
- Player.Character.Animation.Play(animSetFlight, "land_fast", 5.0, AnimationFlags.Unknown01)
- End If
- Wait(500)
- 'End If
- End Sub
- Private Sub crashEffect()
- If (lastXFlight <= -30) OrElse (Math.Abs(lastFlightZ2 - Player.Character.Position.Z) > 0.5) OrElse (Math.Abs(lastFlightZ2 - Player.Character.Position.Z) > 5) Then
- Dim tmpVel As Vector3 = Player.Character.Velocity
- Dim tmpHitObject As Vehicle = myFlyHabsHitObject
- If Math.Abs(lastFlightZ2 - Player.Character.Position.Z) < 10 Then
- tmpHitObject = myFlyHabs
- End If
- If tmpHitObject = myFlyHabsHitObject Then
- Dim tmpPosIni As Vector3 = Player.Character.Position + Vector3.WorldUp * 2
- Dim tmpPosFin As Vector3 = Player.Character.Position + Vector3.WorldDown
- Dim dmg As Int16 = Math.Abs(Math.Round(lastFlightZ2 - Player.Character.Position.Z)) * 5
- Native.Function.Call("FIRE_SINGLE_BULLET", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z, tmpPosFin.X, tmpPosFin.Y, tmpPosFin.Z, dmg)
- End If
- If (lastXFlight > -30) AndAlso Not Player.Character.Animation.isPlaying(animSetFlight, "full_brake_for_landing") Then Exit Sub
- Player.Character.PreventRagdoll = True
- Player.Character.FreezePosition = True
- Player.CanControlCharacter = False
- Dim tmpVList As New List(Of Vehicle)
- For Each v As Vehicle In World.GetVehicles(Player.Character.Position, 15)
- If Exists(v) AndAlso (v <> myFlyHabs) AndAlso (v <> myFlyHabsHitObject) Then
- v.isRequiredForMission = True
- tmpVList.Add(v)
- If Player.Character.isTouching(v) Then v.ApplyForce(Vector3.WorldDown * 5)
- v.CanBeVisiblyDamaged = True
- v.CanBeDamaged = True
- v.MakeProofTo(False, False, False, False, False)
- End If
- Next
- If tmpHitObject = myFlyHabsHitObject Then
- Native.Function.Call("UNATTACH_CAM", camAux)
- camAux.Position = Game.CurrentCamera.Position '+ Vector3.WorldDown
- camAux.LookAt(Player.Character)
- camAux.Activate()
- Game.TimeScale = 0.5
- End If
- Native.Function.Call("set_char_collision", Player.Character, False)
- tmpHitObject.CanBeDamaged = False
- tmpHitObject.CanBeVisiblyDamaged = False
- tmpHitObject.MakeProofTo(True, True, True, True, True)
- OH.releaseVehicle(tmpHitObject, True, False)
- tmpHitObject.Position = Player.Character.Position + Vector3.WorldUp * (tmpHitObject.Model.GetDimensions.Y * 1.5)
- Wait(50)
- tmpHitObject.Rotation = Vector3.RelativeRight * 90
- tmpHitObject.FreezePosition = False
- tmpHitObject.ApplyForce(Vector3.WorldDown * 200)
- Dim timeOut As Double = 0
- While (timeOut < 150)
- Wait(10)
- timeOut += 10
- End While
- For Each v As Vehicle In tmpVList
- If Exists(v) Then
- v.Speed = 0
- v.isRequiredForMission = False
- End If
- Next
- Wait(100)
- OH.hideVehicle(tmpHitObject)
- Native.Function.Call("set_char_collision", Player.Character, True)
- Player.Character.FreezePosition = False
- Wait(500)
- If tmpHitObject = myFlyHabsHitObject Then
- For tmpTimeScale As Double = 0.5 To 1 Step 0.01
- Game.TimeScale = tmpTimeScale
- camAux.Position += Vector3.Normalize(Game.DefaultCamera.Position - camAux.Position) * 0.05
- Wait(10)
- Next
- resetCamCfg()
- camAux.Deactivate()
- End If
- Player.CanControlCharacter = True
- timeRestorePreventRagdoll = 500
- 'Player.Character.Velocity = tmpVel
- End If
- End Sub
- Private Sub tryFixRotation(ByVal rot As GTA.Vector3, ByVal item As Int16, ByVal ease As Double)
- If Game.isKeyPressed(hkUnlockFlightCam) OrElse Game.isGameKeyPressed(GameKey.LookBehind) Then
- timeDisableMouseControl = 100
- End If
- If timeDisableMouseControl > 0 Then
- timeDisableMouseControl -= intervalFix()
- Exit Sub
- End If
- If Exists(Game.DefaultCamera) Then
- 'If (item = 0) OrElse (item = 2) Then
- ' rot.Y -= ((rot.Y - Game.DefaultCamera.Rotation.Y) * ease)
- 'End If
- Dim bCloseToWater As Boolean = (Player.Character.Position.Z < 3)
- If (item = 0) OrElse (item = 1) Then
- 'If (padState.ThumbSticks.Right.Y <> 0) OrElse (Game.Mouse.Movement.Y <> 0) Then
- 'If (XControl.IsConnected AndAlso (XControl.GetState().Gamepad.RightThumbY <> 0)) OrElse (Game.Mouse.Movement.Y <> 0) Then
- If (controllerConnected() AndAlso (controllerState.ThumbSticks.Right.Y <> 0)) OrElse (Game.Mouse.Movement.Y <> 0) Then
- Dim tmpRotX As Double = rot.X
- rot.X -= ((rot.X - Game.DefaultCamera.Rotation.X) * 0.5)
- If bCloseToWater And (rot.X < tmpRotX) Then rot.X = tmpRotX
- End If
- End If
- If (item = 0) OrElse (item = 3) Then
- Dim tmpDif As Double = ((rot.Z - Game.DefaultCamera.Rotation.Z) * ease)
- If bAdaptToFlightHeading Then
- If rot.Z - Game.DefaultCamera.Rotation.Z < -20 Then
- rot.Z += 10
- If rot.Z > Game.DefaultCamera.Rotation.Z Then
- rot.Z = Game.DefaultCamera.Rotation.Z
- bAdaptToFlightHeading = False
- End If
- ElseIf rot.Z - Game.DefaultCamera.Rotation.Z > 20 Then
- rot.Z -= 10
- If rot.Z < Game.DefaultCamera.Rotation.Z Then
- rot.Z = Game.DefaultCamera.Rotation.Z
- bAdaptToFlightHeading = False
- End If
- Else
- bAdaptToFlightHeading = False
- End If
- Else
- If (Math.Abs(Game.DefaultCamera.Rotation.Z - rot.Z) > 100) Then
- rot.Z = Game.DefaultCamera.Rotation.Z
- Else
- rot.Z -= tmpDif
- End If
- End If
- If myRealSpeed > speedSlow Then
- If (tmpDif > 0.2) AndAlso (rot.Y < tmpDif) Then rot.Y += 2
- If (tmpDif < -0.2) AndAlso (rot.Y > tmpDif) Then rot.Y -= 2
- If rot.Y > 60 Then rot.Y = 60
- If rot.Y < -60 Then rot.Y = -60
- If rot.Y < -8 Then FlightTurningLeft = 50
- If rot.Y > 8 Then FlightTurningRight = 50
- End If
- If Math.Abs(tmpDif) <= 0.1 Then
- If rot.Y > 0 Then
- rot.Y -= 1.5
- If rot.Y <= 0 Then rot.Y = 0
- End If
- If rot.Y < 0 Then
- rot.Y += 1.5
- If rot.Y >= 0 Then rot.Y = 0
- End If
- End If
- End If
- If Not bAimDown And (myFlyHabs.Speed > speedSlow) Then
- If bCloseToWater Then
- If rot.X < 0 Then
- rot.X += rot.X * -0.2
- If rot.X > 0 Then rot.X = 0
- End If
- Else
- If rot.X > 70 Then
- rot.X = 70
- End If
- If rot.X < -80 Then
- rot.X = -80
- End If
- End If
- If Not bFast Then
- bFast = True
- mySpeed = myFlyHabs.Speed
- End If
- If timeKeepHighSpeed < 1000 Then timeKeepHighSpeed += myInterval
- Else
- If rot.X > 15 Then
- rot.X = 15
- End If
- If rot.X < -40 Then
- rot.X = -40
- End If
- bFast = False
- End If
- If bAimDown AndAlso (myRealSpeed > speedSlow) Then rot.X = Game.DefaultCamera.Rotation.X
- vRotation = rot
- End If
- End Sub
- Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick
- 'If Game.isKeyPressed(Keys.Left) Then offx -= 1
- 'If Game.isKeyPressed(Keys.Right) Then offx += 1
- 'If Game.isKeyPressed(Keys.Up) Then offy -= 1
- 'If Game.isKeyPressed(Keys.Down) Then offy += 1
- 'If Game.isKeyPressed(Keys.Subtract) Then offH -= 1
- 'If Game.isKeyPressed(Keys.Add) Then offH += 1
- 'If Game.isKeyPressed(Keys.NumPad4) Then offR -= 1
- 'If Game.isKeyPressed(Keys.NumPad6) Then offR += 1
- controllerState = Microsoft.Xna.Framework.Input.GamePad.GetState(Microsoft.Xna.Framework.PlayerIndex.One)
- If bArmorON AndAlso (timeWaitAntiMeleeAnim <= 0) AndAlso ((Native.Function.Call(Of Boolean)("IS_CHAR_PLAYING_ANIM", Player.Character, "move_melee", "walk") OrElse _
- Native.Function.Call(Of Boolean)("IS_CHAR_PLAYING_ANIM", Player.Character, "move_melee", "idle") OrElse _
- Native.Function.Call(Of Boolean)("IS_CHAR_PLAYING_ANIM", Player.Character, "move_melee", "idle_outro"))) Then
- Player.Character.Task.ClearAllImmediately()
- timeWaitAntiMeleeAnim = 50
- End If
- If timeWaitAntiMeleeAnim > 0 Then timeWaitAntiMeleeAnim -= intervalFix()
- If controllerConnected() Then
- If controllerState.IsButtonDown(Microsoft.Xna.Framework.Input.Buttons.LeftShoulder) AndAlso _
- controllerState.IsButtonDown(Microsoft.Xna.Framework.Input.Buttons.RightShoulder) Then
- timeShowMenuDown += intervalFix()
- If timeShowMenuDown > 100 Then
- timeShowMenuDown = 0
- bShowMenu = Not bShowMenu
- End If
- Else
- If timeShowMenuDown > 0 Then timeShowMenuDown -= intervalFix()
- End If
- If bShowArmorMenu OrElse bShowMenu OrElse bShowArmorOptionsMenu Then
- If timeWaitXControlCheck <= 0 Then
- If controllerState.IsButtonDown(Microsoft.Xna.Framework.Input.Buttons.DPadRight) Then
- timeWaitXControlCheck = 50
- checkMenu(Keys.Right)
- ElseIf controllerState.IsButtonDown(Microsoft.Xna.Framework.Input.Buttons.DPadLeft) Then
- timeWaitXControlCheck = 50
- checkMenu(Keys.Left)
- ElseIf controllerState.IsButtonDown(Microsoft.Xna.Framework.Input.Buttons.A) Then
- timeWaitXControlCheck = 50
- checkMenu(Keys.Enter)
- End If
- Else
- If timeWaitXControlCheck > 0 Then
- timeWaitXControlCheck -= intervalFix()
- Exit Sub
- End If
- End If
- End If
- End If
- If timeWaitLoad > 0 Then
- timeWaitLoad -= intervalFix()
- If timeWaitLoad <= 0 Then loadAux()
- Exit Sub
- End If
- If timeHideFlyAbs > 0 Then
- timeHideFlyAbs -= intervalFix()
- If timeHideFlyAbs <= 0 Then OH.hideVehicle(myFlyHabs)
- End If
- If timeCheckHair <= 0 Then
- timeCheckHair = 300
- If bArmorON Then
- Native.Function.Call("SET_DRAW_PLAYER_COMPONENT", 0, Not playerArmor.removeHead AndAlso (camMode <> 1))
- Native.Function.Call("SET_DRAW_PLAYER_COMPONENT", 7, Not playerArmor.removeHair AndAlso (camMode <> 1))
- Else
- Native.Function.Call("SET_DRAW_PLAYER_COMPONENT", 0, True)
- Native.Function.Call("SET_DRAW_PLAYER_COMPONENT", 7, True)
- End If
- GroundZDist = Player.Character.Position.DistanceTo(World.GetGroundPosition(Player.Character.Position))
- Else
- timeCheckHair -= intervalFix()
- End If
- If bArmorON Then
- If timeCheckTargetLocked <= 0 Then
- timeCheckTargetLocked = 100
- bAnTargetLocked = False
- For Each d As TDarts In DartsList
- bAnTargetLocked = d.targetReady
- If bAnTargetLocked Then Exit For
- Next
- If flying Then lastXFlight = myFlyHabs.Rotation.X
- Else
- timeCheckTargetLocked -= intervalFix()
- End If
- End If
- If flying Then
- If Not bGodMode AndAlso Not bNoFlightCollisionDetection Then
- If (speedChange > 0) Then
- Dim bTmp As Boolean = bPlayerFallingDamageProof
- bPlayerFallingDamageProof = (speedChange - myFlyHabs.Speed) < 10
- If bTmp <> bPlayerFallingDamageProof Then _
- Player.Character.MakeProofTo(False, True, False, bPlayerFallingDamageProof, True)
- End If
- speedChange = myFlyHabs.Speed
- End If
- 'If myFlyHabs.Speed > speedFast Then
- ' If (timeWaitCheckHighSpeed <= 0) AndAlso (myFlyHabs <> myFlyHabsHitObject) Then
- ' For Each v As Vehicle In World.GetVehicles(myFlyHabs.Position, 15)
- ' If Exists(v) Then v.isRequiredForMission = True
- ' Next
- '
- ' Native.Function.Call("detach_car", myFlyHabsHitObject, False)
- ' myFlyHabsHitObject.FreezePosition = False
- ' Native.Function.Call("set_car_collision", myFlyHabs, False)
- ' myFlyHabsHitObject.Position = myFlyHabs.Position
- ' myFlyHabsHitObject.Velocity = myFlyHabs.Velocity
- ' myFlyHabsHitObject.Rotation = myFlyHabs.Rotation
- ' myFlyHabs.FreezePosition = True
- ' myFlyHabs = myFlyHabsHitObject
- ' Player.Character.WarpIntoVehicle(myFlyHabsHitObject, VehicleSeat.Driver)
- ' Native.Function.Call("set_car_collision", myFlyHabs, True)
- ' Player.Character.Animation.Play(animSetFlight, "free_fall_fast", 8.0, AnimationFlags.Unknown05)
- ' End If
- 'ElseIf myFlyHabs <> myFlyHabsNormal Then
- ' For Each v As Vehicle In World.GetVehicles(myFlyHabs.Position, 15)
- ' If Exists(v) Then v.isRequiredForMission = True
- ' Next
- '
- ' Native.Function.Call("detach_car", myFlyHabsNormal, False)
- ' myFlyHabsNormal.FreezePosition = False
- ' Native.Function.Call("set_car_collision", myFlyHabs, False)
- ' myFlyHabsNormal.Position = myFlyHabs.Position
- ' myFlyHabsNormal.Velocity = myFlyHabs.Velocity
- ' myFlyHabsNormal.Rotation = myFlyHabs.Rotation
- ' myFlyHabs.FreezePosition = True
- ' myFlyHabs = myFlyHabsNormal
- ' Player.Character.WarpIntoVehicle(myFlyHabsNormal, VehicleSeat.Driver)
- ' Native.Function.Call("set_car_collision", myFlyHabs, True)
- ' Player.Character.Animation.Play(animSetFlight, "free_fall_deccelerate", 8.0, AnimationFlags.Unknown05)
- ' timeWaitCheckHighSpeed = 500
- 'End If
- 'ElseIf myFlyHabs <> myFlyHabsNormal Then
- ' Native.Function.Call("detach_car", myFlyHabsNormal, False)
- ' myFlyHabsNormal.FreezePosition = False
- ' Native.Function.Call("set_car_collision", myFlyHabs, False)
- ' Native.Function.Call("set_car_collision", myFlyHabsNormal, False)
- ' myFlyHabs.FreezePosition = True
- ' myFlyHabsNormal.FreezePosition = True
- ' myFlyHabs = myFlyHabsNormal
- End If
- If timeWaitCheckHighSpeed > 0 Then timeWaitCheckHighSpeed -= intervalFix()
- keepArmorConfig()
- ' search for enemies
- If bArmorON Then searchEnemies()
- ' superGuy tick
- Try
- superGuyTick()
- Catch
- End Try
- If bUseArmorDelivery AndAlso Exists(heliDelivery) Then
- If ArmorDeliveryStatus = 1 Then
- If heliDelivery.Position.DistanceTo2D(Player.Character.Position) < 10 Then
- ArmorDeliveryStatus = 2
- armorCase.Detach()
- pilotDelivery.Task.DriveTo((heliDelivery.Position + Vector3.WorldUp * 300).Around(300), 80, True)
- End If
- If (DeliveryTime > 200) Then
- If Game.isKeyPressed(Keys.Enter) Then
- switchArmor()
- resetHeliDelivery()
- ArmorDeliveryStatus = 0
- End If
- Else
- DeliveryTime += intervalFix()
- End If
- msg("Press enter to skip delivery...", 100)
- ElseIf (ArmorDeliveryStatus = 2) Then
- If (heliDelivery.Position.DistanceTo(Player.Character.Position) > 220) OrElse ((heliDelivery.Position.DistanceTo(Player.Character.Position) > 100) AndAlso Not heliDelivery.isOnScreen) Then
- ArmorDeliveryStatus = 0
- resetHeliDelivery()
- End If
- If Not armorCase.isAttachedSomewhere Then msg("Press enter to skip delivery...", 100)
- End If
- If Exists(armorCase) AndAlso Not armorCase.isAttachedSomewhere AndAlso (Player.Character.Position.DistanceTo(armorCase.Position) < 2) Then
- switchArmor()
- resetHeliDelivery()
- ArmorDeliveryStatus = 0
- End If
- End If
- If bWasAlive AndAlso (Player.Character.Health <= 0) Then
- camMode = 0
- gunMode = 0
- For Each en As TSuperGuy In TSuperGuyList
- Try
- If Exists(en.r) Then
- en.r.Detach()
- en.r.FreezePosition = True
- en.r.Visible = False
- Native.Function.Call("set_object_collision", en.r, False)
- freeRocketList.Add(en.r)
- End If
- stopPTFX(en.PTFXMove)
- Native.Function.Call("stop_sound", en.IDMoveSound)
- If Exists(en.p) Then en.p.NoLongerNeeded()
- If Exists(en.heli) Then en.heli.NoLongerNeeded()
- en.p = Nothing
- en.heli = Nothing
- Catch
- End Try
- Next
- TSuperGuyList.Clear()
- Player.Character.FreezePosition = False
- End If
- bWasAlive = Player.Character.Health > 0
- If (bArrested AndAlso Not Native.Function.Call(Of Boolean)("IS_PLAYER_BEING_ARRESTED")) OrElse (bWasDead AndAlso (Player.Character.Health > 0)) Then
- bArrested = False
- TimeDontCheckArrest = 15000
- stopPTFX(PTFXDamage)
- Wait(2000)
- Player.Character.FreezePosition = False
- If bArmorON Then
- Player.MaxHealth = 1000
- Player.Character.MaxHealth = 1000
- Player.Character.Health = 1000
- setArmorComponentVar()
- End If
- End If
- bWasDead = Player.Character.Health <= 0
- If TimeDontCheckArrest > 0 Then TimeDontCheckArrest -= intervalFix()
- If TimeDontCheckArrest <= 0 Then _
- bArrested = Native.Function.Call(Of Boolean)("IS_PLAYER_BEING_ARRESTED")
- If Not bArmorON Then Exit Sub
- If timeRestorePreventRagdoll > 0 Then
- timeRestorePreventRagdoll -= intervalFix()
- If timeRestorePreventRagdoll <= 0 Then Player.Character.PreventRagdoll = False
- End If
- lastFlightZ = Player.Character.Position.Z
- If bNoWanted AndAlso Native.Function.Call(Of Boolean)("IS_WANTED_LEVEL_GREATER", Player, 0) Then
- Player.WantedLevel = 0
- End If
- If controllerConnected() Then
- If controllerState.IsButtonDown(Microsoft.Xna.Framework.Input.Buttons.LeftShoulder) Then meleeAttack(hkKick)
- If controllerState.IsButtonDown(Microsoft.Xna.Framework.Input.Buttons.RightShoulder) Then meleeAttack(hkPunch)
- End If
- If copKillCont > 20 Then
- copKillCont = 0
- If TSuperGuyList.Count = 0 Then createNewTSuperGuy(Nothing)
- End If
- If flying AndAlso (Native.Function.Call(Of Boolean)("IS_CHAR_IN_WATER", Player.Character) OrElse (Player.Character.CurrentVehicle <> myFlyHabs)) Then
- timePlayJarvisWarn = TRandom.Next(200, 400)
- switchFlight(False, True)
- End If
- If timePlayJarvisWarn > 0 Then
- timePlayJarvisWarn -= intervalFix()
- If timePlayJarvisWarn <= 0 Then
- If bArmorON Then
- Dim s As Int16 = TRandom.Next(0, 20)
- If s < 7 Then
- jarvis_warning.play()
- ElseIf s < 13 Then
- jarvis_warning_2.play()
- Else
- jarvis_warning_3.play()
- End If
- End If
- End If
- End If
- If timePlayJarvisCongrats > 0 Then
- timePlayJarvisCongrats -= intervalFix()
- If timePlayJarvisCongrats <= 0 Then
- If bArmorON Then
- Dim s As Int16 = TRandom.Next(0, 30)
- If s < 7 Then
- jarvis_congrats_1.play()
- ElseIf s < 13 Then
- jarvis_congrats_2.play()
- ElseIf s < 20 Then
- jarvis_congrats_3.play()
- Else
- jarvis_congrats_4.play()
- End If
- End If
- End If
- End If
- Native.Function.Call("CANCEL_CURRENTLY_PLAYING_AMBIENT_SPEECH", Player.Character)
- If timeKeepRepulsorSound > 0 Then timeKeepRepulsorSound -= intervalFix()
- If (lastHealth <> -999) AndAlso ((lastHealth - Player.Character.Health) > 10) Then
- stopPTFX(PTFXDamage)
- Dim tmpRand As Double = TRandom.NextDouble
- If tmpRand < 0.3 Then
- PTFXDamage = Native.Function.Call(Of Int32)("START_PTFX_ON_ped_bone", "break_electrical", Player.Character,
- 0, 0, 0, 0, 0, 0, Bone.Head, 0.5)
- ElseIf tmpRand < 0.6 Then
- PTFXDamage = Native.Function.Call(Of Int32)("START_PTFX_ON_ped_bone", "break_electrical", Player.Character,
- 0, 0, 0.2, 0, 0, 0, Bone.Pelvis, 0.7)
- ElseIf tmpRand < 0.75 Then
- PTFXDamage = Native.Function.Call(Of Int32)("START_PTFX_ON_ped_bone", "break_electrical", Player.Character,
- 0, 0, 0, 0, 0, 0, Bone.LeftHand, 0.5)
- Else
- PTFXDamage = Native.Function.Call(Of Int32)("START_PTFX_ON_ped_bone", "break_electrical", Player.Character,
- 0, 0, 0, 0, 0, 0, Bone.RightHand, 0.5)
- End If
- damageTime = 100
- End If
- lastHealth = Player.Character.Health
- healthAux = lastHealth
- If timeHeal <= 0 Then
- timeHeal = 200
- If Player.Character.Health < 1000 Then
- healthAux += 10
- Player.MaxHealth = 1000
- Player.Character.MaxHealth = 1000
- Player.Character.Health = healthAux
- End If
- Else
- timeHeal -= intervalFix()
- End If
- Game.TimeScale = GameTimeScale
- If bShowingWeaponSelector Then
- If WeaponSelectTime < 500 Then
- WeaponSelectTime += intervalFix()
- Else
- resetPlayerControl()
- End If
- End If
- ' reset global sounds IDs
- For Each s As TGameSounds In TGameSoundsList
- If s.timeWait > 0 Then
- s.timeWait -= intervalFix()
- If s.timeWait <= 0 Then getGameSoundID(s.id)
- End If
- Next
- If Game.isGameKeyPressed(GameKey.Jump) Then
- If (timeActivateDown > 100) Then
- switchFlight()
- bAdaptToFlightHeading = True
- timeActivateDown = 0
- Else
- timeActivateDown += intervalFix()
- End If
- Else
- timeActivateDown = 0
- End If
- If Exists(Player.Character.CurrentVehicle) AndAlso (Player.Character.CurrentVehicle <> myFlyHabs) Then
- Exit Sub
- End If
- ' melee attacks
- If Not Player.Character.isRagdoll Then
- Dim kickAnimTime As Double = Player.Character.Animation.GetCurrentAnimationTime(animSetPunchKick, "low_kick_r_long")
- Dim punchAnimTime As Double = Player.Character.Animation.GetCurrentAnimationTime(animSetPunchKick, "uppercut_r")
- If (punchAnimTime > 0) OrElse (kickAnimTime > 0) Then
- Dim bPunchAttack As Boolean = (punchAnimTime >= 0.3) AndAlso (punchAnimTime <= 0.5)
- Dim bKickAttack As Boolean = (kickAnimTime >= 0.3) AndAlso (kickAnimTime <= 0.7)
- If Exists(meleeAffectedFront.p) Then
- Player.Character.Heading = Helper.DirectionToHeading(meleeAffectedFront.p.Position - Player.Character.Position)
- End If
- If Exists(meleeAffectedFront.v) Then
- Player.Character.Heading = Helper.DirectionToHeading(meleeAffectedFront.v.Position - Player.Character.Position)
- End If
- 'If (kickAnimTime > 0.2) AndAlso (kickAnimTime < 0.55) Then
- ' PTFX_RB = Native.Function.Call(Of Int32)("START_PTFX_ON_PED_BONE", "muz_smg", Player.Character, 0.08, 0.05, 0.0, 90.0, 0, 0, Bone.RightFoot, 0.5)
- 'ElseIf (punchAnimTime > 0.2) AndAlso (punchAnimTime < 0.7) Then
- ' PTFX_LB = Native.Function.Call(Of Int32)("START_PTFX_ON_PED_BONE", "muz_smg", Player.Character, 0.08, 0.05, 0.0, 90.0, 0, 0, Bone.LeftFoot, 0.5)
- ' PTFX_RB = Native.Function.Call(Of Int32)("START_PTFX_ON_PED_BONE", "muz_smg", Player.Character, 0.08, 0.05, 0.0, 90.0, 0, 0, Bone.RightFoot, 0.5)
- 'End If
- If playerArmor.bFootThrusters AndAlso (kickAnimTime > 0.2) AndAlso (kickAnimTime < 0.55) Then
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_PED_BONE", "muz_smg", Player.Character, 0.08, 0.05, 0.0, 90.0, 0, 0, Bone.RightFoot, 0.5)
- ElseIf playerArmor.bHandThrusters AndAlso (punchAnimTime > 0.2) AndAlso (punchAnimTime < 0.7) Then
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_PED_BONE", "muz_smg", Player.Character, 0.08, 0.05, 0.0, 90.0, 0, 0, Bone.LeftFoot, 0.5)
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_PED_BONE", "muz_smg", Player.Character, 0.08, 0.05, 0.0, 90.0, 0, 0, Bone.RightFoot, 0.5)
- End If
- If bPunchAttack OrElse bKickAttack Then
- If bPunchAttack Then
- Player.Character.Velocity = (Player.Character.Direction * 4 + Vector3.WorldUp * 0.5)
- Else
- Player.Character.Velocity = (Player.Character.Direction * 4 + Vector3.WorldUp * 0.5)
- End If
- For Each m As meleeAffected In meleeAffectedList
- If Exists(m.p) AndAlso m.p.isTouching(Player.Character) Then
- m.p.PreventRagdoll = False
- m.p.ForceRagdoll(3000, True)
- m.bApplyforce = True
- ElseIf Exists(m.v) AndAlso Player.Character.isTouching(m.v) Then
- m.v.ApplyForce(Player.Character.Direction * 10 + Vector3.WorldUp * 2, Vector3.WorldUp + Vector3.WorldNorth)
- m.v = Nothing
- 'Native.Function.Call("stop_sound", IDsndGunSwitch)
- 'Native.Function.Call("play_sound_from_ped", IDsndGunSwitch, "collisions_collisions_bullet_hit_car_7", Player.Character)
- Native.Function.Call("play_sound_from_ped", -1, "collisions_collisions_bullet_hit_car_7", Player.Character)
- End If
- Next
- For Each m As meleeAffected In meleeAffectedList
- If Exists(m.p) AndAlso m.bApplyforce Then
- If bKickAttack Then
- m.p.ApplyForce(Player.Character.Direction * 7 + Vector3.WorldUp * 3, Vector3.WorldNorth * 2)
- Else
- m.p.ApplyForce(Player.Character.Direction * 5 + Vector3.WorldUp * 7, Vector3.WorldNorth * 2)
- End If
- m.p = Nothing
- 'Native.Function.Call("stop_sound", IDsndGunSwitch)
- 'Native.Function.Call("play_sound_from_ped", IDsndGunSwitch, "baseballbat_uppercut", Player.Character)
- Native.Function.Call("play_sound_from_ped", -1, "baseballbat_uppercut", Player.Character)
- End If
- Next
- End If
- End If
- End If
- If bLandAnim Then
- If (World.GetGroundPosition(Player.Character.Position, GroundType.NextBelowCurrent).DistanceTo(Player.Character.Position) <= 2) OrElse _
- ((timeLandAnim > 100) AndAlso (Player.Character.Velocity.Z > -0.5)) Then
- bLandAnim = False
- playLandAnim()
- Else
- Player.Character.ApplyForce(playerLandVel * 0.1 + Vector3.WorldDown * 2.5)
- timeLandAnim += intervalFix()
- End If
- End If
- If timeRestartFlight > 0 Then timeRestartFlight -= intervalFix()
- If Player.Character.Weapons.Current.Type <> Weapon.Unarmed Then _
- Player.Character.Weapons.RemoveAll()
- checkKeys()
- If bAimDown Then
- If bResetCamAim Then
- bResetCamAim = False
- camAimMoveEase = 0.1
- If camMode = 0 Then
- If Exists(Game.DefaultCamera) Then
- 'camAux.Position = Game.DefaultCamera.Position
- camAux.Direction = Game.DefaultCamera.Direction
- camAux.FOV = Game.CurrentCamera.FOV
- Else
- 'camAux.Position = Game.CurrentCamera.Position
- camAux.Direction = Game.CurrentCamera.Direction
- camAux.FOV = Game.CurrentCamera.FOV
- End If
- camAimPosition = Player.Character.Position + GTA.Vector3.WorldUp - camAux.Direction * 4 + rotateVec(camAux.Direction, -45) * 2
- If Not camAux.isActive Then
- resetCamCfg()
- camAux.Activate()
- End If
- End If
- End If
- Else
- bResetCamAim = True
- End If
- If bAimDown Then timeClearTask = 500
- If timeClearTask > 0 Then
- timeClearTask -= intervalFix()
- Player.Character.Task.ClearAll()
- End If
- If flying AndAlso (explosionEffectTIme <= 0) Then
- If Player.Character.CurrentVehicle = myFlyHabs Then
- Dim groundDist As Double = World.GetGroundPosition(myFlyHabs.Position, GroundType.NextBelowCurrent).DistanceTo(myFlyHabs.Position)
- If (timeOfFlight > 200) AndAlso Not bMoveFDown AndAlso (((FlightSpeedChange - myFlyHabs.Velocity).Length > 10) OrElse (lastXFlight <= -40)) AndAlso _
- (groundDist <= 1.2) Then
- switchFlight()
- Exit Sub
- End If
- If groundDist < 1.1 Then myFlyHabs.ApplyForce(Vector3.WorldUp)
- FlightSpeedChange = myFlyHabs.Velocity
- If timeOfFlight < 200 Then timeOfFlight += intervalFix()
- If camMode = 0 Then
- If playerArmor.bFootThrusters Then
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_PED_BONE", "muz_smg", Player.Character, 0.08, 0.05, 0.0, 90.0, 0, 0, Bone.LeftFoot, 0.5 * ptfxBootSize)
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_PED_BONE", "muz_smg", Player.Character, 0.08, 0.05, 0.0, 90.0, 0, 0, Bone.RightFoot, 0.5 * ptfxBootSize)
- If smokeTime <= 0 Then
- smokeTime = 100
- stopPTFX(PTFX_SmokeLB)
- stopPTFX(PTFX_SmokeRB)
- If myFlyHabs.Speed > speedSlow Then
- PTFX_SmokeLB = Native.Function.Call(Of Int32)("START_PTFX_ON_PED_BONE", "shot_directed_steam", Player.Character, 0.08, 0.05, 0.0, 1.0, 90.0, 50.0, Bone.LeftFoot, 0.5 * ptfxBootSize)
- PTFX_SmokeRB = Native.Function.Call(Of Int32)("START_PTFX_ON_PED_BONE", "shot_directed_steam", Player.Character, 0.08, 0.05, 0.0, 1.0, 90.0, 50.0, Bone.RightFoot, 0.5 * ptfxBootSize)
- Else
- PTFX_SmokeLB = Native.Function.Call(Of Int32)("START_PTFX_ON_PED_BONE", "shot_directed_steam", Player.Character, 0.08, 0.05, 0.0, 1.0, 90.0, 50.0, Bone.LeftFoot, 0.1 * ptfxBootSize)
- PTFX_SmokeRB = Native.Function.Call(Of Int32)("START_PTFX_ON_PED_BONE", "shot_directed_steam", Player.Character, 0.08, 0.05, 0.0, 1.0, 90.0, 50.0, Bone.RightFoot, 0.1 * ptfxBootSize)
- End If
- Else
- smokeTime -= intervalFix()
- End If
- End If
- If playerArmor.bHandThrusters AndAlso Not Player.Character.Animation.isPlaying(animSetPointArm, "dir_traffic_idle") Then
- 'PTFX_LH = Native.Function.Call(Of Int32)("START_PTFX_ON_PED_BONE", "muz_smg", Player.Character, 0, 0, 0.0, 0.0, 0.0, 90.0, Bone.LeftHand, 0.2 * ptfxLeftHandSize)
- 'PTFX_RH = Native.Function.Call(Of Int32)("START_PTFX_ON_PED_BONE", "muz_smg", Player.Character, 0, 0, 0.0, 0.0, 0.0, 90.0, Bone.RightHand, 0.2 * ptfxRrightHandSize)
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_PED_BONE", "muz_smg", Player.Character, 0, 0, 0.0, 0.0, 0.0, 90.0, Bone.LeftHand, 0.2 * ptfxLeftHandSize)
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_PED_BONE", "muz_smg", Player.Character, 0, 0, 0.0, 0.0, 0.0, 90.0, Bone.RightHand, 0.2 * ptfxRrightHandSize)
- End If
- If playerArmor.bBackThrusters Then
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_PED_BONE", "muz_smg", Player.Character, playerArmor.back_rep_x_off, _
- playerArmor.back_rep_y_off, _
- playerArmor.back_rep_z_off, _
- playerArmor.back_rep_x_rot_off, _
- playerArmor.back_rep_y_rot_off, _
- playerArmor.back_rep_z_rot_off, Bone.Spine, 0.7 * ptfxBootSize)
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_PED_BONE", "muz_smg", Player.Character, playerArmor.back_rep_x_off, _
- playerArmor.back_rep_y_off, _
- playerArmor.back_rep_z_off * -1, _
- playerArmor.back_rep_x_rot_off, _
- playerArmor.back_rep_y_rot_off, _
- playerArmor.back_rep_z_rot_off, Bone.Spine, 0.7 * ptfxBootSize)
- End If
- End If
- myFlyHabs.EngineRunning = False
- KeyboardControlTick()
- mySpeed = Math.Round(mySpeed, 2)
- If mySpeed < 0 Then mySpeed = 0
- If mySpeed > 300 Then mySpeed = 300
- myFlyHabs.isOnFire = False
- timeResetFlight = -666
- If (Not bAimDown) OrElse (timeKeepHighSpeed > 0) Then
- If bAimDown Then timeKeepHighSpeed -= myInterval
- Native.Function.Call("SET_CAR_FORWARD_SPEED", myFlyHabs, mySpeed)
- lastZPos = myFlyHabs.Position.Z
- Else
- 'If bMoveBDown Then
- 'Native.Function.Call("SET_CAR_FORWARD_SPEED", myFlyHabs, 0)
- 'Else
- Native.Function.Call("SET_CAR_FORWARD_SPEED", myFlyHabs, mySpeed)
- 'End If
- End If
- If Not Player.Character.Animation.isPlaying(animSetPointArm, "dir_traffic_idle") Then
- If (myFlyHabs.Speed <= speedSlow) Then
- If animSetFlight.isInMemory AndAlso Not Player.Character.Animation.isPlaying(animSetFlight, "full_brake_for_landing") Then _
- Player.Character.Animation.Play(animSetFlight, "full_brake_for_landing", 5.0, AnimationFlags.Unknown05)
- jetSoundDesiredDistance = 35
- ElseIf FlightTurningLeft > 0 Then
- If animSetFlight.isInMemory AndAlso Not Player.Character.Animation.isPlaying(animSetFlight, "free_fall_veer_left") Then _
- Player.Character.Animation.Play(animSetFlight, "free_fall_veer_left", 8.0, AnimationFlags.Unknown05)
- 'Native.Function.Call("SET_CHAR_ANIM_SPEED", Player.Character, animSetFlight.Name, "free_fall_veer_left", 0.1)
- ElseIf FlightTurningRight > 0 Then
- If animSetFlight.isInMemory AndAlso Not Player.Character.Animation.isPlaying(animSetFlight, "free_fall_veer_right") Then _
- Player.Character.Animation.Play(animSetFlight, "free_fall_veer_right", 8.0, AnimationFlags.Unknown05)
- 'Native.Function.Call("SET_CHAR_ANIM_SPEED", Player.Character, animSetFlight.Name, "free_fall_veer_right", 0.1)
- ElseIf myFlyHabs.Speed > speedFast Then
- If animSetFlight.isInMemory AndAlso Not Player.Character.Animation.isPlaying(animSetFlight, "free_fall_fast") Then _
- Player.Character.Animation.Play(animSetFlight, "free_fall_fast", 3.0, AnimationFlags.Unknown05)
- jetSoundDesiredDistance = 15
- ElseIf myFlyHabs.Speed > speedSlow Then
- If animSetFlight.isInMemory AndAlso Not Player.Character.Animation.isPlaying(animSetFlight, "free_fall_deccelerate") Then _
- Player.Character.Animation.Play(animSetFlight, "free_fall_deccelerate", 3.0, AnimationFlags.Unknown05)
- jetSoundDesiredDistance = 25
- End If
- End If
- If FlightTurningRight > 0 Then FlightTurningRight -= intervalFix()
- If FlightTurningLeft > 0 Then FlightTurningLeft -= intervalFix()
- If jetSoundDistance > jetSoundDesiredDistance Then
- jetSoundDistance -= 0.5
- If jetSoundDistance < jetSoundDesiredDistance Then jetSoundDistance = jetSoundDesiredDistance
- ElseIf jetSoundDistance < jetSoundDesiredDistance Then
- jetSoundDistance += 0.5
- If jetSoundDistance > jetSoundDesiredDistance Then jetSoundDistance = jetSoundDesiredDistance
- End If
- If Exists(jetSoundAux) Then jetSoundAux.Position = Player.Character.Position - Game.CurrentCamera.Direction * jetSoundDistance
- Else
- If timeResetFlight <= 0 Then
- If Player.Character.isAlive Then
- 'camAux.Position = Game.CurrentCamera.Position - Player.Character.Direction * 5
- camAux.LookAt(Player.Character)
- timeResetFlight = 100
- Else
- flying = False
- End If
- End If
- End If
- If timeResetFlight > 0 Then
- timeResetFlight -= myInterval
- 'camAux.Position = Player.Character.Position - Player.Character.Direction * 5
- If (timeResetFlight <= 0) AndAlso (timeResetFlight <> -666) Then
- timeResetFlight = -666
- myFlyHabs.Position = Player.Character.Position
- myFlyHabs.Heading = Player.Character.Heading
- mySpeed = Player.Character.Velocity.DistanceTo(GTA.Vector3.Zero)
- Player.Character.WarpIntoVehicle(myFlyHabs, VehicleSeat.Driver)
- camAux.Deactivate()
- End If
- End If
- If (Player.Character.Position.DistanceTo(myLastPos) < 0.3) _
- AndAlso Not (Game.isGameKeyPressed(GameKey.MoveForward)) Then mySpeed /= 4
- myLastPos = Player.Character.Position
- End If
- If explosionEffectTIme > 0 Then
- explosionEffectTIme -= intervalFix()
- If Not Player.Character.isRagdoll Then explosionEffectTIme = 0
- If (explosionEffectTIme <= 0) AndAlso Not flying AndAlso _
- (World.GetGroundPosition(Player.Character.Position, GroundType.NextBelowCurrent).DistanceTo(Player.Character.Position) > 5) Then
- switchFlight()
- End If
- End If
- If bAimDown AndAlso (Player.Character.Health > 0) AndAlso controllerConnected() Then
- Dim tmpThumbLength As Double = controllerState.ThumbSticks.Right.Length
- If tmpThumbLength > 0 Then
- If timeCheckAutoAimPed <= 0 Then
- timeCheckAutoAimPed = 100
- autoAimPedList = World.GetPeds(Player.Character.Position + Game.CurrentCamera.Direction * 50, 50)
- Else
- timeCheckAutoAimPed -= intervalFix()
- End If
- If (timeWaitSearchAutoAImPed <= 0) AndAlso (tmpThumbLength > 0.1) Then '(Not Exists(AutoAimedPed) OrElse (tmpThumbLength > 0.1)) Then
- Dim tmpPosCompare As Vector3
- Dim tmpDist As Double
- Dim tmpRotation As Vector3
- AutoAimedPed = Nothing
- tmpRotation = Game.CurrentCamera.Rotation
- tmpRotation.Z -= controllerState.ThumbSticks.Right.X * 10
- tmpRotation.X += controllerState.ThumbSticks.Right.Y * 5
- tmpRotation = Helper.RotationToDirection(tmpRotation)
- For Each p As Ped In autoAimPedList
- If Exists(p) AndAlso (p.Health > 0) AndAlso (p <> Player.Character) AndAlso (p <> lastAutoAimedPed) AndAlso p.isOnScreen Then
- tmpDist = p.Position.DistanceTo(Game.CurrentCamera.Position)
- tmpPosCompare = Game.CurrentCamera.Position + tmpRotation * tmpDist
- If p.Position.DistanceTo(tmpPosCompare) < 2 Then
- lastAutoAimedPed = p
- AutoAimedPed = p
- timeWaitSearchAutoAImPed = 100
- Exit For
- End If
- End If
- Next
- If timeWaitSearchAutoAImPed <> 100 Then
- For Each p As Ped In autoAimPedList
- If Exists(p) AndAlso (p.Health > 0) AndAlso (p <> Player.Character) AndAlso (p <> lastAutoAimedPed) AndAlso p.isOnScreen Then
- tmpDist = p.Position.DistanceTo(Game.CurrentCamera.Position)
- tmpPosCompare = Game.CurrentCamera.Position + tmpRotation * tmpDist
- If p.Position.DistanceTo(tmpPosCompare) < 3 Then
- lastAutoAimedPed = p
- AutoAimedPed = p
- timeWaitSearchAutoAImPed = 100
- Exit For
- End If
- End If
- Next
- End If
- If timeWaitSearchAutoAImPed <> 100 Then
- lastAutoAimedPed = Nothing
- 'AutoAimedPed = Nothing
- End If
- End If
- End If
- If Exists(AutoAimedPed) Then
- If AutoAimedPed.Health <= 0 Then AutoAimedPed = Nothing
- If Not flying Then
- Player.Character.Heading = Game.CurrentCamera.Heading
- Else
- myFlyHabs.Rotation = Game.CurrentCamera.Rotation
- End If
- End If
- Else
- AutoAimedPed = Nothing
- End If
- If timeWaitSearchAutoAImPed > 0 Then timeWaitSearchAutoAImPed -= intervalFix()
- If (((camMode = 0) AndAlso bAimDown) OrElse (camMode = 1)) AndAlso Exists(Game.DefaultCamera) Then
- If camMode = 0 Then
- If Not bMoveBDown AndAlso Not bMoveLDown AndAlso Not bMoveRDown Then
- If (gunMode <> 3) AndAlso (gunMode <> 4) Then
- camAimPosition = Player.Character.GetOffsetPosition(Vector3.RelativeLeft * 0.6 + Vector3.RelativeTop) - Game.DefaultCamera.Direction * 2
- Else
- camAimPosition = Player.Character.GetOffsetPosition(Vector3.RelativeLeft * 0.5 + Vector3.RelativeTop) - Game.DefaultCamera.Direction
- End If
- Else
- camAimPosition = Player.Character.Position + Vector3.WorldUp - rotateVec(camAux.Direction, -25) * 3
- End If
- ElseIf camMode = 1 Then
- Dim tmpDirOffset As Double = Player.Character.Velocity.DistanceTo(Vector3.Zero)
- If tmpDirOffset < 0.1 Then tmpDirOffset = 0.1
- If Not flying Then
- camAimPosition = Player.Character.Position + GTA.Vector3.WorldUp * 0.7
- Else
- camAimPosition = Player.Character.GetBonePosition(Bone.Head) + Player.Character.Direction * tmpDirOffset
- End If
- End If
- If Not flying AndAlso Not bMoveFDown AndAlso Not bMoveBDown AndAlso (bMoveLDown OrElse bMoveRDown) Then
- If bMoveRDown Then
- 'Native.Function.Call("SET_CAM_ATTACH_OFFSET", camAux, 3.0, 1.5, 0.5)
- If camXAttach < 3 Then camXAttach += 0.5
- If camYAttach < 1 Then camYAttach += 0.3
- ElseIf bMoveLDown Then
- 'Native.Function.Call("SET_CAM_ATTACH_OFFSET", camAux, -3.0, 1.5, 0.5)
- If camXAttach > -3 Then camXAttach -= 0.5
- If camYAttach < 1 Then camYAttach += 0.3
- End If
- Else
- 'Native.Function.Call("SET_CAM_ATTACH_OFFSET", camAux, -1.0, -2.0, 0.5)
- Dim camX As Double = -0.7
- Dim camY As Double = -2
- If (gunMode = 3) OrElse (gunMode = 4) Then
- camX = -0.6
- camY = -3.5
- End If
- If camXAttach > camX Then
- camXAttach -= 0.1
- If camXAttach < camX Then camXAttach = camX
- End If
- If camXAttach < camX Then
- camXAttach += 0.1
- If camXAttach > camX Then camXAttach = camX
- End If
- If (gunMode = 4) Then
- Dim tmpRotX As Double = (camY + Math.Abs(Game.CurrentCamera.Rotation.X / 40))
- If camYAttach > tmpRotX Then
- camYAttach -= 0.1
- If camYAttach < tmpRotX Then camYAttach = tmpRotX
- End If
- If camYAttach < tmpRotX Then
- camYAttach += 0.1
- If camYAttach > tmpRotX Then camYAttach = tmpRotX
- End If
- Else
- camYAttach = camY
- End If
- End If
- If (gunMode = 4) Then _
- camZAttach = 0.5 - Game.CurrentCamera.Rotation.X / 60
- If camMode = 1 Then
- camXAttach = 0
- camYAttach = 0
- camZAttach = 0.7
- End If
- Native.Function.Call("SET_CAM_ATTACH_OFFSET", camAux, camXAttach, camYAttach, camZAttach)
- Dim tmpPos As Vector3 = camAux.Position
- tmpPos.X += (camAimPosition.X - tmpPos.X) * 0.5
- tmpPos.Y += (camAimPosition.Y - tmpPos.Y) * 0.5
- tmpPos.Z += (camAimPosition.Z - tmpPos.Z) * 0.5
- If camAimMoveEase < 1 Then
- camAimMoveEase += 0.02
- If camAimMoveEase > 1 Then camAimMoveEase = 1
- End If
- 'camAux.Position = tmpPos
- tmpPos = camAux.Rotation
- Dim tmpRot As Vector3
- If Exists(AutoAimedPed) Then
- tmpRot = Helper.DirectionToRotation(Vector3.Normalize(AutoAimedPed.Position - Game.CurrentCamera.Position), 0)
- Else
- tmpRot = Game.DefaultCamera.Rotation
- End If
- tmpPos.X += (tmpRot.X - tmpPos.X) * 0.5
- tmpPos.Y += (tmpRot.Y - tmpPos.Y) * 0.5
- If Math.Abs(tmpRot.Z - tmpPos.Z) < 50 Then
- tmpPos.Z += (tmpRot.Z - tmpPos.Z) * 0.5
- Else
- tmpPos.Z = tmpRot.Z
- End If
- 'If (Game.Mouse.Movement.X <> 0) OrElse (padState.ThumbSticks.Left.X <> 0) Then
- 'If (Game.Mouse.Movement.X <> 0) OrElse (XControl.IsConnected AndAlso (XControl.GetState.Gamepad.LeftThumbX <> 0)) Then
- If (Game.Mouse.Movement.X <> 0) OrElse (controllerConnected() AndAlso (controllerState.ThumbSticks.Left.X <> 0)) Then
- camLastXMove = 300
- Else
- If camLastXMove > 0 Then camLastXMove -= intervalFix()
- End If
- If (camMode = 1) AndAlso (tmpPos.X < -40) Then tmpPos.X = -40
- camAux.Rotation = tmpPos
- If Not bMoveBDown AndAlso Not bMoveLDown AndAlso Not bMoveRDown Then
- If Not flying Then
- Player.Character.Heading = camAux.Heading
- ElseIf Not bAimDown Then
- If camMode = 0 Then myFlyHabs.Heading = camAux.Heading
- End If
- End If
- If Not camAux.isActive Then
- resetCamCfg()
- camAux.Activate()
- End If
- ElseIf camAux.isActive Then
- camAux.Deactivate()
- End If
- gunsTick()
- If bShowingWeaponSelector Then
- If timeCheckWSelect <= 0 Then
- Dim tmpPrevGunMode As Int16 = gunMode
- WeapXSelection += Game.Mouse.Movement.X
- WeapYSelection += Game.Mouse.Movement.Y
- If (WeapXSelection > 0.05) Then
- If gunMode = 4 Then
- gunMode = 0
- ElseIf gunMode = 0 Then
- gunMode = 1
- ElseIf gunMode = 3 Then
- gunMode = 2
- End If
- ElseIf (WeapXSelection < -0.05) Then
- If gunMode = 0 Then
- gunMode = 4
- ElseIf gunMode = 1 Then
- gunMode = 0
- ElseIf gunMode = 2 Then
- gunMode = 3
- ElseIf gunMode = 3 Then
- gunMode = 4
- End If
- End If
- If (WeapYSelection < -0.05) Then
- If gunMode = 2 Then
- gunMode = 1
- ElseIf gunMode = 3 Then
- gunMode = 4
- ElseIf gunMode = 1 Then
- gunMode = 0
- ElseIf gunMode = 4 Then
- gunMode = 0
- End If
- ElseIf (WeapYSelection > 0.05) Then
- If gunMode = 1 Then
- gunMode = 2
- ElseIf gunMode = 4 Then
- gunMode = 3
- End If
- End If
- If Math.Abs(WeapXSelection) > 0.05 Then WeapXSelection = 0
- If Math.Abs(WeapYSelection) > 0.05 Then WeapYSelection = 0
- If tmpPrevGunMode <> gunMode Then
- timeCheckWSelect = 20
- reattachDarts()
- End If
- Else
- timeCheckWSelect -= intervalFix()
- End If
- Else
- WeapXSelection = 0
- WeapYSelection = 0
- End If
- weaponHeat0 -= 0.2
- weaponHeat1 -= 0.2
- weaponHeat2 -= 0.2
- weaponHeat3 -= 0.2
- weaponHeat4 -= 0.2
- If weaponHeat0 < 0 Then weaponHeat0 = 0
- If weaponHeat1 < 0 Then weaponHeat1 = 0
- If weaponHeat2 < 0 Then weaponHeat2 = 0
- If weaponHeat3 < 0 Then weaponHeat3 = 0
- If weaponHeat4 < 0 Then weaponHeat4 = 0
- 'msg(weaponHeat0.ToString & " " & weaponHeat1.ToString & " " & weaponHeat2.ToString & " " & weaponHeat3.ToString & " " & weaponHeat4.ToString & " ", 15)
- If flying Then
- myRealSpeed = myFlyHabs.Speed
- Else
- myRealSpeed = Player.Character.Velocity.DistanceTo(Vector3.Zero)
- End If
- If (Player.Character.Health <= 0) AndAlso Player.Character.isAlive Then Player.Character.Die()
- controlKeyCheck()
- End Sub
- Private Sub controlKeyCheck()
- 'If Not XControl.IsConnected Then Exit Sub
- If Not controllerConnected() Then Exit Sub
- 'If lasPacketNumber <> XControl.GetState.PacketNumber Then
- 'lasPacketNumber = XControl.GetState.PacketNumber
- If lasPacketNumber <> controllerState.PacketNumber Then
- lasPacketNumber = controllerState.PacketNumber
- If timeWaitCheckXKeys <= 0 Then
- timeWaitCheckXKeys = 50
- 'bDPadDown = XControl.GetState.Gamepad.Buttons = GamepadButtonFlags.DPadDown
- 'bDPadLeft = XControl.GetState.Gamepad.Buttons = GamepadButtonFlags.DPadLeft
- 'bDPadRight = XControl.GetState.Gamepad.Buttons = GamepadButtonFlags.DPadRight
- bDPadDown = controllerState.DPad.Down
- bDPadLeft = controllerState.DPad.Left
- bDPadRight = controllerState.DPad.Right
- fakeKeydown(Nothing)
- End If
- End If
- If timeWaitCheckXKeys > 0 Then timeWaitCheckXKeys -= intervalFix()
- End Sub
- Private Sub fakeKeydown(e As GTA.KeyEventArgs)
- ' If e.Key = Keys.NumPad0 Then
- ' Dim f As StreamWriter
- ' Dim s As String
- '
- ' If Not File.Exists("c:\test.txt") Then File.CreateText("c:\test.txt").Dispose()
- '
- ' s = File.ReadAllText("c:\test.txt")
- '
- ' f = File.CreateText("c:\test.txt")
- '
- ' f.WriteLine(s)
- ' f.WriteLine("drawSpriteAux(e, texBar, " & offx.ToString & ", " & offy.ToString & ", 10, " & offH.ToString & ", Helper.DegreeToRadian(" & offR.ToString & "), Color.White)")
- '
- ' f.Dispose()
- '
- ' tmpline = New tline
- ' tmpline.x = offx
- ' tmpline.y = offy
- ' tmpline.h = offH
- ' tmpline.r = offR
- ' tlineList.Add(tmpline)
- '
- ' msg("saved", 1000)
- ' End If
- '
- ' If e.Key = Keys.Delete AndAlso tlineList.Count > 0 Then tlineList.RemoveAt(tlineList.Count - 1)
- Dim key As Keys
- If Exists(e) Then key = e.Key Else key = Keys.None
- If Not bShowArmorOptionsMenu AndAlso (key = hkNoWantedLevel) Then
- switchNoWanted()
- End If
- If Not bShowArmorOptionsMenu AndAlso (key = hkGodMode) Then
- switchGodMode()
- End If
- If key = hkSpawnAlly Then createNewTSuperGuy(Nothing, True, True)
- If key = hkSpawnEnemy Then createNewTSuperGuy(Nothing, False, True)
- If (key = hkWeaponSelectMenu) AndAlso (flying OrElse (Not flying AndAlso Not Exists(Player.Character.CurrentVehicle))) Then
- Native.Function.Call("SET_PLAYER_CONTROL", Player, False)
- GameTimeScale = 0.3
- WeaponSelectTime = 0
- bShowingWeaponSelector = True
- Player.IgnoredByEveryone = False
- End If
- If (key = hkKick) OrElse (key = hkPunch) Then
- meleeAttack(e.Key)
- End If
- 'If (key = hkCannon) OrElse (key = hkDarts) OrElse (key = hkRockets) OrElse (key = hkHandRep) OrElse (key = hkChestRep) OrElse (key = hkSwitchGun) _
- ' OrElse (Microsoft.Xna.Framework.Input.GamePad.GetState(Microsoft.Xna.Framework.PlayerIndex.One).DPad.Down = Microsoft.Xna.Framework.Input.ButtonState.Pressed) OrElse _
- ' (Microsoft.Xna.Framework.Input.GamePad.GetState(Microsoft.Xna.Framework.PlayerIndex.One).DPad.Left = Microsoft.Xna.Framework.Input.ButtonState.Pressed) OrElse _
- ' (Microsoft.Xna.Framework.Input.GamePad.GetState(Microsoft.Xna.Framework.PlayerIndex.One).DPad.Right = Microsoft.Xna.Framework.Input.ButtonState.Pressed) Then
- If (key = hkCannon) OrElse (key = hkDarts) OrElse (key = hkRockets) OrElse (key = hkHandRep) OrElse (key = hkChestRep) OrElse (key = hkSwitchGun) _
- OrElse (controllerConnected() AndAlso (bDPadDown OrElse _
- bDPadLeft OrElse _
- bDPadRight)) Then
- If key = hkCannon Then gunMode = 0
- If key = hkDarts Then gunMode = 1
- If key = hkRockets Then gunMode = 2
- If key = hkHandRep Then gunMode = 3
- If key = hkChestRep Then gunMode = 4
- 'If (key = hkSwitchGun) OrElse (Microsoft.Xna.Framework.Input.GamePad.GetState(Microsoft.Xna.Framework.PlayerIndex.One).DPad.Down = Microsoft.Xna.Framework.Input.ButtonState.Pressed) Then
- If (key = hkSwitchGun) OrElse bDPadDown Then
- gunMode += 1
- If gunMode > 4 Then gunMode = 0
- End If
- 'If (Microsoft.Xna.Framework.Input.GamePad.GetState(Microsoft.Xna.Framework.PlayerIndex.One).DPad.Left = Microsoft.Xna.Framework.Input.ButtonState.Pressed) Then
- If bDPadLeft Then
- gunMode -= 1
- If gunMode < 0 Then gunMode = 4
- End If
- 'If (Microsoft.Xna.Framework.Input.GamePad.GetState(Microsoft.Xna.Framework.PlayerIndex.One).DPad.Right = Microsoft.Xna.Framework.Input.ButtonState.Pressed) Then
- If bDPadRight Then
- gunMode += 1
- If gunMode > 4 Then gunMode = 0
- End If
- reattachDarts()
- End If
- If key = hkSwitchCam Then
- camMode += 1
- If camMode > 1 Then camMode = 0
- If camMode = 1 Then
- Dim tmpSpeed As Double = myFlyHabs.Speed
- myFlyHabs.FreezePosition = True
- camAux.Rotation = Game.DefaultCamera.Rotation
- myFlyHabs.Rotation = camAux.Rotation
- Wait(10)
- If Not camAux.isActive Then
- resetCamCfg()
- camAux.Activate()
- End If
- 'camAux.Position = Player.Character.Position + GTA.Vector3.WorldUp + camAux.Direction * 0.1
- camAux.Rotation = Game.CurrentCamera.Rotation
- myFlyHabs.FreezePosition = False
- myFlyHabs.Speed = tmpSpeed
- Player.Character.Visible = False
- Else
- If camAux.isActive Then camAux.Deactivate()
- Player.Character.Visible = True
- End If
- End If
- If (((weaponHeat1 + 20 < 100) AndAlso (gunMode = 1)) OrElse ((weaponHeat2 + 10 < 100) AndAlso (gunMode = 2))) AndAlso _
- (bAttackDown OrElse (key = hkShoot)) Then
- indexCheckDartShoot = 0
- If (gunMode = 2) AndAlso (playerArmor.weaponSet = 0) Then timeWaitLaunchDarts = 100
- End If
- If bAimDown AndAlso (myRealSpeed <= speedSlow) AndAlso ((((weaponHeat3 + 40) < 100) AndAlso (gunMode = 3)) OrElse (((weaponHeat4 + 55) < 100) AndAlso (gunMode = 4))) AndAlso _
- (bAttackDown OrElse (key = hkShoot)) Then
- Dim timeOut As Double = 0
- If (gunMode = 3) Then
- 'animSetGunAim = New AnimationSet("melee_gun")
- 'Native.Function.Call("REQUEST_ANIMS", "melee_gun")
- 'Native.Function.Call("TASK_PLAY_ANIM_SECONDARY_UPPER_BODY", Player.Character, "hold_pistol", "melee_gun", 8.0, 1, 0, 0, 0, -1)
- If Not Player.Character.Animation.isPlaying(animSetPointArm, "dir_traffic_idle") Then
- Player.Character.Animation.Play(animSetPointArm, "dir_traffic_idle", 3.5, AnimationFlags.Unknown06)
- timeWaitStartCannonShoot = 20
- End If
- While Not Player.Character.Animation.isPlaying(animSetPointArm, "dir_traffic_idle") AndAlso (timeOut < 1000)
- Wait(10)
- timeOut += intervalFix()
- End While
- repulsorDiameter = 40
- repulsorChest = False
- ElseIf (gunMode = 4) Then
- If Not Player.Character.Animation.isPlaying(animSetFlight, "full_brake_for_landing") Then _
- Player.Character.Animation.Play(animSetFlight, "full_brake_for_landing", 10.0, AnimationFlags.Unknown05)
- timeOut = 0
- While Not Player.Character.Animation.isPlaying(animSetFlight, "full_brake_for_landing") AndAlso (timeOut < 1000)
- Wait(10)
- timeOut += intervalFix()
- End While
- repulsorDiameter = 60
- repulsorChest = True
- End If
- timeWaitShootRepulsor = 200
- timeWaitRepulsorSound = 100
- timeRepulsorBeamON = 0
- pedsRepulsorHit = World.GetPeds(Game.CurrentCamera.Position + Game.CurrentCamera.Direction * 50, 55)
- vehRepulsorHit = World.GetVehicles(Game.CurrentCamera.Position + Game.CurrentCamera.Direction * 50, 55)
- For Each v As Vehicle In vehRepulsorHit
- v.Metadata.chestExp = False
- Next
- stopPTFX(PTFXRepulsor)
- If bSoundOK Then sndRepulsorStart.Play()
- End If
- End Sub
- Private Sub meleeAttack(key As Keys)
- If flying Then Exit Sub
- If Player.Character.Animation.isPlaying(animSetPunchKick, "low_kick_r_long") OrElse _
- Player.Character.Animation.isPlaying(animSetPunchKick, "uppercut_r") Then Exit Sub
- If (key = hkKick) Then
- If Not Player.Character.Animation.isPlaying(animSetPunchKick, "low_kick_r_long") Then
- Player.Character.Animation.Play(animSetPunchKick, "low_kick_r_long", 10.0, AnimationFlags.Unknown01)
- Else
- Exit Sub
- End If
- End If
- If (key = hkPunch) Then
- If Not Player.Character.Animation.isPlaying(animSetPunchKick, "uppercut_r") Then
- Player.Character.Animation.Play(animSetPunchKick, "uppercut_r", 10.0, AnimationFlags.Unknown01)
- Else
- Exit Sub
- End If
- End If
- meleeAffectedList.Clear()
- meleeAffectedFront.p = Nothing
- meleeAffectedFront.v = Nothing
- For Each p As Ped In World.GetPeds(Player.Character.Position + Player.Character.Direction, 5)
- If Exists(p) AndAlso (p <> Player.Character) AndAlso Not p.isRagdoll AndAlso (p.Health > 0) AndAlso (p.Position.DistanceTo(p.Position.ToGround) > 0.25) Then
- tmpmeleeAffected = New meleeAffected
- tmpmeleeAffected.p = p
- meleeAffectedList.Add(tmpmeleeAffected)
- If Not Exists(meleeAffectedFront.p) AndAlso (p.Position.DistanceTo(Player.Character.Position + Player.Character.Direction * 3) < 3) Then meleeAffectedFront.p = p
- End If
- Next
- For Each v As Vehicle In World.GetVehicles(Player.Character.Position + Player.Character.Direction, 7)
- If Exists(v) AndAlso (v <> Player.Character.CurrentVehicle) Then
- tmpmeleeAffected = New meleeAffected
- tmpmeleeAffected.v = v
- meleeAffectedList.Add(tmpmeleeAffected)
- If Not Exists(meleeAffectedFront.p) AndAlso Not Exists(meleeAffectedFront.v) AndAlso (v.Position.DistanceTo(Player.Character.Position + Player.Character.Direction * 3) < 3) Then meleeAffectedFront.v = v
- End If
- Next
- End Sub
- Private Sub KeyboardControlTick()
- Dim myRot As Vector3 = myFlyHabs.Rotation
- If bMoveFDown Then
- 'If bAimDown Then
- 'myFlyHabs.ApplyForce(myFlyHabs.Direction * forwardAmount)
- 'If mySpeed > myFlyHabs.Speed Then mySpeed -= (mySpeed - myFlyHabs.Speed) / 2
- 'If mySpeed < myFlyHabs.Speed Then mySpeed += (mySpeed - myFlyHabs.Speed) / 2
- 'If forwardAmount < 10 Then forwardAmount += 0.5
- 'Else
- mySpeed += 0.5
- If mySpeed > 100 Then mySpeed += 0.5
- 'If forwardAmount < 0.5 Then forwardAmount += 0.1
- 'End If
- Else
- If forwardAmount > 0 Then
- forwardAmount -= 0.5
- If forwardAmount < 0 Then forwardAmount = 0
- If bAimDown Then
- myFlyHabs.ApplyForce(myFlyHabs.Direction * forwardAmount)
- End If
- End If
- End If
- If bAimDown AndAlso (mySpeed > 60) Then
- mySpeed -= 1
- If mySpeed < 60 Then mySpeed = 60
- End If
- If bMoveBDown Then
- mySpeed -= 2
- If mySpeed < 0 Then
- myFlyHabs.ApplyForce(myFlyHabs.Direction * backwardAmount)
- lastZPos = myFlyHabs.Position.Z
- If backwardAmount > -10 Then backwardAmount -= 0.5
- End If
- Else
- If backwardAmount < 0 Then
- backwardAmount += 0.5
- If backwardAmount > 0 Then backwardAmount = 0
- myFlyHabs.ApplyForce(Game.CurrentCamera.Direction * backwardAmount)
- End If
- End If
- 'If bSprintDown OrElse (XControl.IsConnected AndAlso (XControl.GetState.Gamepad.Buttons = GamepadButtonFlags.RightShoulder)) Then
- If bSprintDown OrElse (controllerConnected() AndAlso _
- (controllerConnected() AndAlso controllerState.Buttons.RightShoulder)) Then
- myFlyHabs.ApplyForce(GTA.Vector3.WorldUp * upAmount)
- lastZPos = myFlyHabs.Position.Z
- If upAmount < 15 Then upAmount += 0.5
- Else
- If upAmount > 0 Then
- upAmount -= 1
- If upAmount < 0 Then upAmount = 0
- myFlyHabs.ApplyForce(GTA.Vector3.WorldUp * upAmount)
- lastZPos = myFlyHabs.Position.Z
- End If
- End If
- 'If bCrouchDown OrElse (XControl.IsConnected AndAlso (XControl.GetState.Gamepad.Buttons = GamepadButtonFlags.LeftShoulder)) Then
- If bCrouchDown OrElse (controllerConnected() AndAlso (controllerConnected() AndAlso controllerState.Buttons.LeftShoulder)) Then
- myFlyHabs.ApplyForce(GTA.Vector3.WorldDown * downAmount)
- lastZPos = myFlyHabs.Position.Z
- If downAmount < 15 Then downAmount += 0.5
- Else
- If downAmount > 0 Then
- downAmount -= 1
- If downAmount < 0 Then downAmount = 0
- myFlyHabs.ApplyForce(GTA.Vector3.WorldDown * downAmount)
- lastZPos = myFlyHabs.Position.Z
- End If
- End If
- If myRealSpeed <= speedSlow Then
- If bAimDown AndAlso (World.GetGroundPosition(Player.Character.Position, GroundType.NextBelowCurrent).DistanceTo(Player.Character.Position) < 1.5) Then
- If heightFix < (4 - World.GetGroundPosition(Player.Character.Position, GroundType.NextBelowCurrent).DistanceTo(Player.Character.Position)) Then heightFix += 0.8
- lastZPos = myFlyHabs.Position.Z
- ElseIf myFlyHabs.Position.Z - lastZPos < 0 Then
- myFlyHabs.ApplyForce(GTA.Vector3.WorldDown * ((myFlyHabs.Position.Z - lastZPos)))
- End If
- If bMoveLDown AndAlso (myFlyHabs.Speed <= speedSlow) Then
- myFlyHabs.ApplyForceRelative(GTA.Vector3.RelativeLeft * 4 + Vector3.RelativeTop * 2)
- End If
- If bMoveRDown AndAlso (myFlyHabs.Speed <= speedSlow) Then
- myFlyHabs.ApplyForceRelative(GTA.Vector3.RelativeRight * 4 + Vector3.RelativeTop * 2)
- End If
- If heightFix > 0 Then
- myFlyHabs.ApplyForce(GTA.Vector3.WorldUp * heightFix)
- heightFix -= 0.2
- End If
- End If
- If bMoveLDown Then
- ptfxRrightHandSize = 1.5
- ptfxLeftHandSize = 1.0
- ElseIf bMoveRDown Then
- ptfxLeftHandSize = 1.5
- ptfxRrightHandSize = 1.0
- Else
- ptfxLeftHandSize = 1.0
- ptfxRrightHandSize = 1.0
- End If
- If bMoveFDown Then
- If ptfxBootSize < 1.5 Then
- ptfxBootSize += 0.01
- If ptfxBootSize > 1.5 Then ptfxBootSize = 1.5
- End If
- Else
- ptfxLeftHandSize = 1.5
- ptfxRrightHandSize = 1.5
- ptfxBootSize = 1.0
- End If
- If Not Exists(AutoAimedPed) Then
- tryFixRotation(vRotation, 0, 0.5)
- myFlyHabs.Rotation = vRotation
- End If
- End Sub
- Private Sub searchEnemies()
- Try
- If timeWaitSearchEnemy <= 0 Then
- timeWaitSearchEnemy = 1000
- If (Player.WantedLevel > 0) OrElse Native.Function.Call(Of Boolean)("IS_WANTED_LEVEL_GREATER", Player, 0) OrElse _
- Native.Function.Call(Of Boolean)("ARE_ENEMY_PEDS_IN_AREA", Player.Character, _
- Player.Character.Position.X, Player.Character.Position.Y, Player.Character.Position.Z, 200.0) Then
- Dim bExists As Boolean
- For Each p As Ped In World.GetPeds(Player.Character.Position, 200)
- If Exists(p) AndAlso (p.Health > 0) Then
- If ((Player.WantedLevel > 0) OrElse Native.Function.Call(Of Boolean)("IS_WANTED_LEVEL_GREATER", Player, 0)) AndAlso (p.PedType = PedType.Cop) Then
- bExists = False
- For Each b As TEnemyBlip In TEnemyBlipList
- If b.p = p Then
- bExists = True
- Exit For
- End If
- Next
- If bExists Then Continue For
- Dim bChopperPassenger As Boolean = Exists(p.CurrentVehicle) AndAlso p.CurrentVehicle.Model.isHelicopter AndAlso _
- (p.CurrentVehicle.GetPedOnSeat(VehicleSeat.LeftRear) = p)
- tmpTEnemyBlip = New TEnemyBlip
- tmpTEnemyBlip.p = p
- tmpTEnemyBlip.blip = p.AttachBlip
- tmpTEnemyBlip.blip.Color = BlipColor.Orange
- tmpTEnemyBlip.blip.Friendly = False
- tmpTEnemyBlip.blip.Scale = 0.7
- TEnemyBlipList.Add(tmpTEnemyBlip)
- If bChopperPassenger Then
- bExists = False
- For Each s As TSuperGuy In TSuperGuyList
- If s.p = p Then
- bExists = True
- Exit For
- End If
- Next
- If Not bExists Then createNewTSuperGuy(p)
- End If
- End If
- End If
- Next
- End If
- For c As Int16 = TEnemyBlipList.Count - 1 To 0 Step -1
- If (Player.WantedLevel <= 0) Then
- If Exists(TEnemyBlipList(c).p) AndAlso (TEnemyBlipList(c).p.PedType = PedType.Cop) Then
- TEnemyBlipList(c).p.NoLongerNeeded()
- If Exists(TEnemyBlipList(c).v) Then TEnemyBlipList(c).v.NoLongerNeeded()
- TEnemyBlipList.RemoveAt(c)
- Continue For
- End If
- End If
- If Not Exists(TEnemyBlipList(c).p) OrElse (TEnemyBlipList(c).p.Health <= 0) Then
- If Exists(TEnemyBlipList(c).p) AndAlso (TEnemyBlipList(c).p.Health <= 0) Then
- If Not bNoWanted Then
- wantedLevel += 0.2
- If wantedLevel > 6 Then wantedLevel = 6
- Native.Function.Call("SET_MAX_WANTED_LEVEL", 6)
- Native.Function.Call("ALTER_WANTED_LEVEL_NO_DROP", Player, Math.Round(wantedLevel))
- Native.Function.Call("APPLY_WANTED_LEVEL_CHANGE_NOW", Player)
- copKillCont += 1
- End If
- End If
- If Exists(TEnemyBlipList(c).p) Then TEnemyBlipList(c).p.NoLongerNeeded()
- If Exists(TEnemyBlipList(c).v) Then TEnemyBlipList(c).v.NoLongerNeeded()
- TEnemyBlipList(c).blip.Delete()
- TEnemyBlipList.RemoveAt(c)
- End If
- Next
- Else
- timeWaitSearchEnemy -= intervalFix()
- End If
- Catch
- End Try
- End Sub
- Private Sub createNewTSuperGuy(p As Ped, Optional ally As Boolean = False, Optional bShowMsg As Boolean = False)
- Dim bPlayerFrozen = flying AndAlso (myRealSpeed <= speedSlow)
- Dim newPed As Boolean = False
- If bShowMsg Then
- bShowMenu = False
- If ally Then
- msg("Creating new ally", 3000)
- Else
- msg("Creating new enemy", 3000)
- End If
- End If
- Try
- If bPlayerFrozen Then myFlyHabs.FreezePosition = True
- 'If Not ally AndAlso Not bArmorON Then Throw New NonExistingObjectException
- Dim tmpCount As Int16 = 0
- For Each s As TSuperGuy In TSuperGuyList
- If (ally AndAlso Not s.enemy) OrElse (Not ally AndAlso s.enemy) Then tmpCount += 1
- Next
- If ally AndAlso (tmpCount >= maxAlly) Then
- If bShowMsg Then msg("Maximum number of Allies reached...", 2000)
- Throw New NonExistingObjectException
- ElseIf Not ally AndAlso (tmpCount >= maxEnemy) Then
- If bShowMsg Then msg("Maximum number of Enemies reached...", 2000)
- Throw New NonExistingObjectException
- End If
- Dim bNew As Boolean = Not Exists(p)
- Dim m As Model
- Dim bFound As Boolean = False
- Dim bAIM_Robot As Boolean = False
- Dim tmpArmorList As New List(Of TArmor)
- Dim tmpArmor As TArmor
- For c As Int16 = 0 To TEnemyAllyArmorList.Count - 1
- If (Not ally AndAlso TEnemyAllyArmorList(c).enemy) OrElse (ally AndAlso TEnemyAllyArmorList(c).ally) Then
- tmpArmorList.Add(TEnemyAllyArmorList(c))
- bFound = True
- End If
- Next
- If Not bFound Then
- If bShowMsg Then
- If ally Then
- msg("There is no armors to be used as ally", 3000)
- Else
- msg("There is no armors to be used as enemy", 3000)
- End If
- End If
- Throw New NonExistingObjectException
- End If
- TRandom.Next()
- TRandom.Next()
- tmpArmor = tmpArmorList(TRandom.Next(0, tmpArmorList.Count))
- m = tmpArmor.model
- bAIM_Robot = tmpArmor.AIM_Robot
- tmpEnemy = New TSuperGuy
- 'tmpEnemy.AIM_Robot = bAIM_Robot
- 'tmpEnemy.weaponSet = tmpArmor.weaponSet
- tmpEnemy.armor = tmpArmor
- Dim tmpPos As Vector3
- If Not Exists(p) Then
- tmpPos = World.GetNextPositionOnPavement(Player.Character.Position.Around(180))
- If tmpPos.DistanceTo(Player.Character.Position) > 180 Then tmpPos = Player.Character.Position.Around(180)
- newPed = True
- Native.Function.Call("REQUEST_MODEL", m.Hash)
- Dim timeOut As Double = 0
- While (timeOut < 500) AndAlso Not Native.Function.Call(Of Boolean)("HAS_MODEL_LOADED", m.Hash)
- timeOut += intervalFix()
- Wait(25)
- End While
- If Not ally Then
- p = World.CreatePed(m, Player.Character.Position.Around(10) + Vector3.WorldUp * 100)
- Else
- p = World.CreatePed(m, Player.Character.Position.Around(10) + Vector3.WorldUp * 100)
- End If
- End If
- If Not Exists(p) Then
- If bShowMsg Then
- If ally Then
- msg("Error creating new ally :(", 3000)
- Else
- msg("Error creating new enemy :(", 3000)
- End If
- End If
- Throw New NonExistingObjectException
- End If
- If newPed Then p.Position = tmpPos
- tmpEnemy.p = p
- tmpEnemy.r = Nothing
- If Not ally Then tmpEnemy.targetPed = Player.Character
- tmpEnemy.enemy = Not ally
- If freeRocketList.Count > 0 Then
- tmpEnemy.r = freeRocketList(0)
- freeRocketList.RemoveAt(0)
- End If
- If Not Exists(tmpEnemy.r) Then createObject("cj_dart_1", Vector3.Zero, tmpEnemy.r, 20)
- If Exists(tmpEnemy.r) Then
- Native.Function.Call("set_object_collision", tmpEnemy.r, True)
- tmpEnemy.r.Visible = False
- tmpEnemy.r.FreezePosition = False
- tmpEnemy.r.AttachToPed(tmpEnemy.p, Bone.LeftArmRoll, Vector3.Zero, Vector3.Zero)
- Native.Function.Call("SET_OBJECT_RECORDS_COLLISIONS", tmpEnemy.r, False)
- 'tmpEnemy.p.Weapons.RemoveAll()
- 'tmpEnemy.p.Weapons.RocketLauncher.Ammo = 0
- 'tmpEnemy.p.Weapons.RocketLauncher.Select()
- 'tmpEnemy.p.SetPathfinding(True, True, False)
- If Not bNew Then
- tmpEnemy.heliPassenger = Exists(p.CurrentVehicle) AndAlso p.CurrentVehicle.Model.isHelicopter
- If tmpEnemy.heliPassenger Then
- tmpEnemy.heli = p.CurrentVehicle
- End If
- tmpEnemy.blip = tmpEnemy.heli.AttachBlip
- Else
- tmpEnemy.blip = tmpEnemy.p.AttachBlip
- End If
- tmpEnemy.blip.Friendly = ally
- If Not ally Then
- tmpEnemy.blip.Color = BlipColor.Red
- If bArmorON Then jarvis_enemy.play()
- Else
- tmpEnemy.blip.Color = BlipColor.White
- End If
- tmpEnemy.p.MaxHealth = 1000
- tmpEnemy.p.Health = 1000
- tmpEnemy.p.BecomeMissionCharacter()
- tmpEnemy.p.PreventRagdoll = True
- tmpEnemy.p.MakeProofTo(False, True, False, True, True)
- TSuperGuyList.Add(tmpEnemy)
- End If
- Catch
- End Try
- If bPlayerFrozen Then myFlyHabs.FreezePosition = False
- End Sub
- 'superGuy tick
- Private Sub superGuyTick()
- Dim superGuy As TSuperGuy
- Dim bBeeped As Boolean = False
- Dim bAiming As Boolean = False
- For c As Int16 = TSuperGuyList.Count - 1 To 0 Step -1
- superGuy = TSuperGuyList(c)
- If Exists(superGuy.p) AndAlso Exists(superGuy.r) Then
- If superGuy.p.Position.DistanceTo(Player.Character.Position) > 300 Then
- superGuy.p.Die()
- superGuy.p = Nothing
- superGuy.heli = Nothing
- If Exists(superGuy.blip) Then superGuy.blip.Delete()
- Exit Sub
- End If
- If (superGuy.p.Health > 0) Then
- If Not Exists(superGuy.heli) Then
- stopPTFX(superGuy.ptfxL)
- stopPTFX(superGuy.ptfxR)
- 'If Not superGuy.AIM_Robot Then
- ' superGuy.ptfxL = Native.Function.Call(Of Int32)("START_PTFX_ON_PED_BONE", "muz_smg", superGuy.p, 0.08, 0.05, 0.0, 90.0, 0, 0, Bone.LeftFoot, 0.5)
- ' superGuy.ptfxR = Native.Function.Call(Of Int32)("START_PTFX_ON_PED_BONE", "muz_smg", superGuy.p, 0.08, 0.05, 0.0, 90.0, 0, 0, Bone.RightFoot, 0.5)
- 'Else
- ' superGuy.ptfxL = Native.Function.Call(Of Int32)("START_PTFX_ON_PED", "muz_smg", superGuy.p, 0.5, 0, 0.5, 0, 90.0, 0, 0.5)
- ' superGuy.ptfxR = Native.Function.Call(Of Int32)("START_PTFX_ON_PED", "muz_smg", superGuy.p, -0.5, 0, 0.5, 0, 90.0, 0, 0.5)
- 'End If
- If Not superGuy.armor.AIM_Robot Then
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_PED_BONE", "muz_smg", superGuy.p, 0.08, 0.05, 0.0, 90.0, 0, 0, Bone.LeftFoot, 0.5)
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_PED_BONE", "muz_smg", superGuy.p, 0.08, 0.05, 0.0, 90.0, 0, 0, Bone.RightFoot, 0.5)
- Else
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_PED", "muz_smg", superGuy.p, 0.5, 0, 0.5, 0, 90.0, 0, 0.5)
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_PED", "muz_smg", superGuy.p, -0.5, 0, 0.5, 0, 90.0, 0, 0.5)
- End If
- Else
- If (superGuy.heli <> superGuy.p.CurrentVehicle) Then
- superGuy.heli.NoLongerNeeded()
- superGuy.heli = Nothing
- superGuy.p.Die()
- End If
- End If
- If superGuy.heliPassenger AndAlso Not bArmorON Then Continue For
- If Exists(superGuy.p.CurrentVehicle) AndAlso superGuy.heliPassenger AndAlso (superGuy.p.CurrentVehicle <> superGuy.heli) Then
- superGuy.p = Nothing
- Continue For
- End If
- If superGuy.heliPassenger AndAlso Not Exists(superGuy.p.CurrentVehicle) Then
- superGuy.p = Nothing
- Continue For
- End If
- superGuy.p.CancelAmbientSpeech()
- If Not Exists(superGuy.p.CurrentVehicle) Then
- If Not superGuy.p.isRagdoll Then
- If superGuy.explosionEffectTIme > 0 Then
- superGuy.explosionEffectTIme -= intervalFix()
- If superGuy.explosionEffectTIme <= 0 Then superGuy.p.PreventRagdoll = True
- Continue For
- End If
- Dim tmpVel As Vector3 = superGuy.p.Velocity
- Dim superGuyDist As Double
- Dim tmpTarget As Ped = superGuy.targetPed
- Dim tmpSpeed As Double = superGuy.p.Velocity.DistanceTo(Vector3.Zero)
- tmpVel.Z = 0
- If (superGuyDist > 10) AndAlso (tmpVel.DistanceTo(Vector3.Zero) < 1) Then tmpVel = superGuy.p.Direction
- superGuy.p.Velocity = tmpVel
- If Not Exists(tmpTarget) Then tmpTarget = Player.Character
- superGuyDist = superGuy.p.Position.DistanceTo(tmpTarget.Position)
- If superGuyDist > 30 Then
- If tmpSpeed < 6 Then
- If superGuy.stuckTime < 1500 Then superGuy.stuckTime += intervalFix()
- Else
- superGuy.stuckTime -= intervalFix()
- End If
- Else
- superGuy.stuckTime = 0
- End If
- If superGuy.stuckTime > 1000 Then
- superGuy.collision(False)
- Else
- superGuy.collision(True)
- End If
- If (superGuyDist > 30) AndAlso (((World.GetGroundPosition(superGuy.p.Position + superGuy.p.Direction * 15, GroundType.Highest).Z + 5) > superGuy.p.Position.Z) OrElse _
- ((World.GetGroundPosition(superGuy.p.Position, GroundType.Highest).Z + 5) > superGuy.p.Position.Z)) Then
- If tmpSpeed < 2 Then
- superGuy.p.ApplyForce(Vector3.WorldUp * 5 - superGuy.p.Direction * 4)
- Else
- superGuy.p.ApplyForce(Vector3.WorldUp * 5 + superGuy.p.Direction * 4)
- End If
- Else
- If Exists(superGuy.targetPed) AndAlso superGuy.targetPed.isSittingInVehicle Then
- superGuy.p.ApplyForce(Vector3.WorldUp * (superGuy.targetPed.Position.Z - superGuy.p.Position.Z) * 0.2)
- Else
- superGuy.p.ApplyForce(Vector3.WorldUp * (Player.Character.Position.Z - superGuy.p.Position.Z))
- End If
- If superGuy.timeToReact > 0 Then
- superGuy.timeToReact -= intervalFix()
- If superGuy.timeToReact <= 0 Then
- superGuy.timeReacting = 500
- If TRandom.Next(1, 20) Mod 2 = 0 Then
- superGuy.reactDir = Vector3.RelativeLeft
- Else
- superGuy.reactDir = Vector3.RelativeRight
- End If
- End If
- Else
- If superGuy.enemy Then
- If superGuyDist > 180 Then
- superGuy.p.Position = superGuy.p.Position + superGuy.p.Direction * (superGuyDist - 180 + 10)
- superGuy.moveForce = 1
- ElseIf ((superGuy.targetPed <> Player.Character) AndAlso superGuyDist > 20) OrElse _
- ((superGuy.targetPed = Player.Character) AndAlso superGuyDist > 30) Then
- superGuy.p.ApplyForce(Vector3.Normalize(tmpTarget.Position - superGuy.p.Position) * superGuy.moveForce)
- superGuy.moveForce += 0.01
- ElseIf ((superGuy.targetPed <> Player.Character) AndAlso superGuyDist < 10) OrElse _
- ((superGuy.targetPed = Player.Character) AndAlso superGuyDist < 20) Then
- superGuy.p.ApplyForce(Vector3.Normalize(superGuy.p.Position - tmpTarget.Position) * 3)
- superGuy.moveForce = 1
- End If
- Else
- If superGuyDist > 180 Then superGuy.p.Position = superGuy.p.Position + superGuy.p.Direction * (superGuyDist - 180 + 10)
- If Exists(superGuy.targetPed) Then
- If superGuyDist > 20 Then
- superGuy.p.ApplyForce(Vector3.Normalize(tmpTarget.Position - superGuy.p.Position) * superGuy.moveForce)
- superGuy.moveForce += 0.01
- ElseIf superGuyDist < 10 Then
- superGuy.p.ApplyForce(Vector3.Normalize(superGuy.p.Position - tmpTarget.Position) * 3)
- superGuy.moveForce = 1
- End If
- ElseIf superGuyDist > 10 Then
- superGuy.p.ApplyForce(Vector3.Normalize(tmpTarget.Position - superGuy.p.Position) * superGuy.moveForce)
- superGuy.moveForce += 0.01
- ElseIf superGuyDist < 8 Then
- tmpVel = (Vector3.Normalize(superGuy.p.Position - tmpTarget.Position))
- tmpVel.Z = 0
- superGuy.p.Velocity = tmpVel
- 'superGuy.p.ApplyForce(Vector3.Normalize(superGuy.p.Position - tmpTarget.Position) * superGuy.p.Velocity.DistanceTo(Vector3.Zero))
- superGuy.moveForce = 1
- End If
- End If
- End If
- If superGuy.timeReacting > 0 Then
- superGuy.timeReacting -= intervalFix()
- superGuy.p.ApplyForceRelative(superGuy.reactDir * 0.5)
- End If
- If superGuy.lifeChanged Then
- stopPTFX(superGuy.ptfxDamage)
- If Not superGuy.armor.AIM_Robot Then
- If TRandom.NextDouble < 0.5 Then
- superGuy.ptfxDamage = Native.Function.Call(Of Int32)("START_PTFX_ON_ped_bone", "break_electrical", superGuy.p,
- 0, 0, 0, 0, 0, 0, Bone.Head, 0.5)
- Else
- superGuy.ptfxDamage = Native.Function.Call(Of Int32)("START_PTFX_ON_ped_bone", "break_electrical", superGuy.p,
- 0, 0, 0, 0, 0, 0, Bone.LeftHand, 0.2)
- End If
- Else
- 'superGuy.ptfxDamage = Native.Function.Call(Of Int32)("START_PTFX_ON_ped", "break_electrical", superGuy.p,
- ' 0, 0, 0.5, 0, 0, 0, 1.0)
- superGuy.ptfxDamage = Native.Function.Call(Of Int32)("START_PTFX_ON_ped_bone", "break_electrical", superGuy.p,
- 0, 0, 0, 0, 0, 0, Bone.Head, 0.5)
- End If
- End If
- If superGuy.p.Position.Z - World.GetGroundPosition(superGuy.p.Position, GroundType.Highest).Z < 10 Then _
- superGuy.p.ApplyForce(Vector3.WorldUp)
- End If
- If superGuy.moveForce > 10 Then superGuy.moveForce = 10
- If Not superGuy.armor.AIM_Robot Then
- If (tmpSpeed <= speedSlow * 1.2) OrElse _
- ((superGuy.p.Position + Vector3.Normalize(superGuy.p.Velocity)).DistanceTo(superGuy.p.Position + superGuy.p.Direction) > 1) Then
- If animSetFlight.isInMemory AndAlso Not superGuy.p.Animation.isPlaying(animSetFlight, "full_brake_for_landing") Then _
- superGuy.p.Animation.Play(animSetFlight, "full_brake_for_landing", 5.0, AnimationFlags.Unknown05)
- ElseIf tmpSpeed > speedFast * 0.8 Then
- If animSetFlight.isInMemory AndAlso Not superGuy.p.Animation.isPlaying(animSetFlight, "free_fall_fast") Then _
- superGuy.p.Animation.Play(animSetFlight, "free_fall_fast", 3.0, AnimationFlags.Unknown05)
- ElseIf tmpSpeed > speedSlow * 1.2 Then
- If animSetFlight.isInMemory AndAlso Not superGuy.p.Animation.isPlaying(animSetFlight, "free_fall_deccelerate") Then _
- superGuy.p.Animation.Play(animSetFlight, "free_fall_deccelerate", 3.0, AnimationFlags.Unknown05)
- End If
- ElseIf animSetFlight.isInMemory AndAlso Not superGuy.p.Animation.isPlaying(animSetFlight, "full_brake_for_landing") Then
- superGuy.p.Animation.Play(animSetFlight, "full_brake_for_landing", 5.0, AnimationFlags.Unknown05)
- End If
- If Exists(superGuy.targetPed) Then
- superGuy.p.Heading = Helper.DirectionToHeading(Vector3.Normalize(superGuy.targetPed.Position - superGuy.p.Position))
- ElseIf Exists(superGuy.targetPedSecondary) Then
- superGuy.p.Heading = Helper.DirectionToHeading(Vector3.Normalize(superGuy.targetPedSecondary.Position - superGuy.p.Position))
- Else
- superGuy.p.Heading = Helper.DirectionToHeading(Vector3.Normalize(Player.Character.Position - superGuy.p.Position))
- End If
- End If
- If superGuy.p.isRagdoll AndAlso Not superGuy.isRagDoll Then
- superGuy.isRagDoll = True
- superGuy.unstableTime = 500
- End If
- If superGuy.unstableTime > 0 Then
- superGuy.unstableTime -= intervalFix()
- If superGuy.unstableTime <= 0 Then
- superGuy.isRagDoll = False
- superGuy.p.isRagdoll = False
- superGuy.p.Task.ClearAllImmediately()
- superGuy.p.Animation.Play(animSetFlight, "full_brake_for_landing", 10.0, AnimationFlags.Unknown05)
- End If
- End If
- End If
- If Exists(superGuy.targetPed) Then
- If Not superGuy.bLaunched AndAlso (superGuy.targetPed.Health > 0) Then
- If superGuy.AimCoolDown > 0 Then
- superGuy.AimCoolDown -= intervalFix()
- If (superGuy.AimCoolDown < 200) Then
- superGuy.shootCannonTick()
- End If
- superGuy.AimingTime = 0
- ElseIf superGuy.AimingTime < 500 Then
- bAiming = superGuy.enemy AndAlso (superGuy.targetPed = Player.Character) AndAlso (superGuy.AimingTime > 100)
- If Exists(superGuy.heli) AndAlso (superGuy.p.CurrentVehicle = superGuy.heli) Then
- If (Math.Abs(superGuy.heli.GetOffsetPosition(Vector3.RelativeLeft).DistanceTo(superGuy.targetPed.Position) - superGuy.heli.Position.DistanceTo(superGuy.targetPed.Position)) < 0.2) OrElse _
- (Math.Abs(superGuy.heli.GetOffsetPosition(Vector3.RelativeRight).DistanceTo(superGuy.targetPed.Position) - superGuy.heli.Position.DistanceTo(superGuy.targetPed.Position)) < 0.2) Then _
- superGuy.AimingTime = 0
- Else
- If Exists(superGuy.targetPed) AndAlso (superGuy.p.GetOffsetPosition(Vector3.RelativeFront).DistanceTo(superGuy.targetPed.Position) > superGuy.p.Position.DistanceTo(superGuy.targetPed.Position)) Then _
- superGuy.AimingTime = 0
- End If
- If superGuy.p.Position.DistanceTo(superGuy.targetPed.Position) > 200 Then superGuy.AimingTime = 0
- If Not superGuy.p.isGettingUp AndAlso Not superGuy.p.isGettingIntoAVehicle AndAlso Not superGuy.p.isRagdoll Then
- If Not Exists(superGuy.p.CurrentVehicle) AndAlso (superGuy.p.Position.DistanceTo(superGuy.targetPed.Position) > 70) Then
- 'If superGuy.followTime > 500 Then
- ' superGuy.p.Task.ClearAll()
- ' superGuy.p.Task.RunTo(superGuy.targetPed.Position.Around(10).ToGround, True)
- ' superGuy.followTime = 0
- 'Else
- ' superGuy.followTime += intervalFix()
- 'End If
- superGuy.AimingTime = 0
- ElseIf Not Exists(superGuy.p.CurrentVehicle) AndAlso (superGuy.p.Position.DistanceTo(superGuy.targetPed.Position) < 10) Then
- 'If superGuy.followTime > 500 Then
- ' superGuy.p.Task.ClearAll()
- ' superGuy.p.Task.FleeFromChar(superGuy.targetPed, False, 5000)
- ' superGuy.followTime = 0
- 'Else
- ' superGuy.followTime += intervalFix()
- 'End If
- superGuy.AimingTime = 0
- Else
- 'If Not Exists(superGuy.p.CurrentVehicle) Then
- ' superGuy.p.Task.ClearAll()
- ' superGuy.p.Task.AimAt(superGuy.targetPed.Position, 1500)
- 'End If
- superGuy.AimingTime += intervalFix()
- 'superGuy.followTime = 0
- End If
- End If
- If (superGuy.AimingTime < 450) Then superGuy.shootCannonTick()
- Else
- superGuy.bLocked = True
- superGuy.bLaunched = True
- superGuy.AimingTime = 0
- superGuy.timeOut = 0
- superGuy.bReadyToBlowUp = False
- superGuy.r.FreezePosition = False
- superGuy.p.Velocity = Vector3.Zero
- superGuy.r.Detach()
- superGuy.flightDir = Vector3.Normalize(superGuy.targetPed.Position - superGuy.r.Position)
- superGuy.r.Velocity = superGuy.flightDir
- superGuy.r.ApplyForce(superGuy.flightDir * 15)
- superGuy.r.Visible = True
- superGuy.targetPed.Velocity = Vector3.Zero
- 'If getGameSoundID(superGuy.IDLaunchSound) Then _
- Native.Function.Call("play_sound_from_object", -1, "rocket_launch", superGuy.r)
- 'Native.Function.Call("play_sound_from_object", superGuy.IDLaunchSound, "rocket_launch", superGuy.r)
- If getGameSoundID(superGuy.IDMoveSound) Then _
- Native.Function.Call("play_sound_from_object", superGuy.IDMoveSound, "GENERAL_WEAPONS_ROCKET_LOOP", superGuy.r)
- 'Native.Function.Call("play_sound_from_object", superGuy.IDLaunchSound, "general_explosions_lows_grenade_explosion_r", superGuy.r)
- stopPTFX(superGuy.PTFXMove)
- superGuy.PTFXMove = Native.Function.Call(Of Int32)("START_PTFX_ON_OBJ", "weap_rocket_player", _
- superGuy.r, 0, 0, 0, 0, 0, 0, 1.0)
- superGuy.AimCoolDown = 500
- For Each s As TSuperGuy In TSuperGuyList
- If s.p = superGuy.p Then
- s.timeToReact = 500 * TRandom.NextDouble
- Exit For
- End If
- Next
- End If
- Else
- If Not superGuy.enemy Then
- For Each s As TSuperGuy In TSuperGuyList
- If s.p = superGuy.targetPed Then
- s.targetPed = superGuy.p
- Exit For
- End If
- Next
- End If
- If superGuy.bLocked Then
- superGuy.flightDir = Vector3.Normalize(superGuy.targetPed.Position - superGuy.r.Position)
- If superGuy.r.Position.DistanceTo(superGuy.p.Position) > (superGuy.targetPed.Position + superGuy.targetPed.Direction).DistanceTo(superGuy.p.Position) Then superGuy.bLocked = False
- End If
- If superGuy.r.Position.DistanceTo(superGuy.p.Position) < 10 Then
- superGuy.r.Velocity = (superGuy.flightDir * 40 + Vector3.WorldUp * 0.5)
- Else
- superGuy.r.ApplyForce(superGuy.flightDir * 15 + Vector3.WorldUp * 0.5)
- End If
- If superGuy.bLocked Then
- Dim tmpRot As Vector3 = Helper.DirectionToRotation(superGuy.flightDir, 0)
- tmpRot.Y += 90
- tmpRot.Z -= 90
- superGuy.r.Rotation = tmpRot
- End If
- If Not superGuy.bReadyToBlowUp AndAlso ((superGuy.r.Position.DistanceTo(superGuy.p.Position) > 10) OrElse (superGuy.r.Position.DistanceTo(superGuy.targetPed.Position) < 2)) Then
- superGuy.bReadyToBlowUp = True
- Native.Function.Call("SET_OBJECT_RECORDS_COLLISIONS", superGuy.r, True)
- End If
- If superGuy.bLocked AndAlso Not bBeeped AndAlso (superGuy.targetPed = Player.Character) Then
- If timeWaitBeep <= 0 Then
- timeWaitBeep = 10
- bBeeped = True
- If bSoundOK AndAlso bArmorON Then sndBeep.Play()
- Else
- timeWaitBeep -= intervalFix()
- End If
- bMissileAlarm = True
- End If
- If (superGuy.timeOut > 1000) OrElse Native.Function.Call(Of Boolean)("has_object_collided_with_anything", superGuy.r) Then
- 'Native.Function.Call("stop_sound", superGuy.IDLaunchSound)
- Native.Function.Call("stop_sound", superGuy.IDMoveSound)
- stopPTFX(superGuy.PTFXMove)
- World.AddExplosion(superGuy.r.Position)
- If superGuy.targetPed.Position.DistanceTo(superGuy.r.Position) < 5 Then
- For Each p As Ped In World.GetPeds(superGuy.r.Position, 5.0)
- If Exists(p) Then
- p.PreventRagdoll = False
- If p = Player.Character Then
- If Not bGodMode Then
- explosionEffectTIme = 500
- If flying Then
- switchFlight(True)
- superGuy.targetPed.Euphoria.BodyBalance.Start(2000)
- Else
- superGuy.targetPed.Euphoria.BodyBalance.Start(1000)
- End If
- timePlayJarvisWarn = TRandom.Next(200, 400)
- End If
- Else
- For Each s As TSuperGuy In TSuperGuyList
- If s.p = p Then s.explosionEffectTIme = 250
- Next
- p.ForceRagdoll(5000, False)
- End If
- p.ApplyForce(Vector3.Normalize(superGuy.flightDir) * 3, Vector3.WorldNorth * 0.5)
- 'p.Health -= (20 + (5 * TRandom.NextDouble()))
- If (p = Player.Character) AndAlso Not bGodMode Then
- damageTime = 0
- 'p.Health -= (40 + (5 * TRandom.NextDouble()))
- End If
- End If
- Next
- End If
- Native.Function.Call("SET_OBJECT_RECORDS_COLLISIONS", superGuy.r, False)
- superGuy.r.Visible = False
- getGameSoundID(superGuy.IDMoveSound)
- superGuy.r.AttachToPed(superGuy.p, Bone.LeftArmRoll, Vector3.Zero, Vector3.Zero)
- superGuy.bLaunched = False
- Else
- superGuy.timeOut += intervalFix()
- End If
- End If
- If superGuy.targetPed.Health <= 0 Then superGuy.targetPed = Nothing
- Else
- If superGuy.enemy Then
- superGuy.targetPed = Player.Character
- Else
- Dim tmpTarget As TSuperGuy = Nothing
- Dim tmpPossibleTarget As Ped = Nothing
- For Each s As TSuperGuy In TSuperGuyList
- If Exists(s.p) AndAlso s.enemy AndAlso (s.p.Health > 0) AndAlso (s.p.Position.DistanceTo(superGuy.p.Position) < 100) Then
- tmpTarget = s
- For Each s2 As TSuperGuy In TSuperGuyList
- If Not s2.enemy AndAlso (s2.targetPed = s.p) Then
- tmpTarget = Nothing
- tmpPossibleTarget = s.p
- Exit For
- End If
- Next
- If Exists(tmpTarget) Then
- superGuy.targetPed = tmpTarget.p
- Exit For
- End If
- End If
- Next
- If Not Exists(superGuy.targetPed) AndAlso Exists(tmpPossibleTarget) Then superGuy.targetPed = tmpPossibleTarget
- If Not Exists(superGuy.targetPed) AndAlso Not Exists(superGuy.targetPedSecondary) Then
- For Each en As TEnemyBlip In TEnemyBlipList
- If Exists(en.p) AndAlso (en.p.Health > 0) AndAlso (en.p.Position.DistanceTo(Player.Character.Position) < 60) Then
- superGuy.targetPedSecondary = en.p
- Exit For
- End If
- Next
- End If
- End If
- End If
- If Not Exists(superGuy.targetPed) AndAlso Exists(superGuy.targetPedSecondary) Then
- If superGuy.targetPedSecondary.Health <= 0 Then
- superGuy.targetPedSecondary = Nothing
- Else
- superGuy.shootCannonTick()
- End If
- End If
- ElseIf superGuy.removeTime = -666 Then
- superGuy.removeTime = 1000
- If Exists(superGuy.p) Then
- If Not Exists(superGuy.p.CurrentVehicle) Then superGuy.p.Task.ClearAllImmediately()
- superGuy.p.Die()
- superGuy.p.ForceRagdoll(50000, False)
- End If
- If superGuy.enemy AndAlso (superGuy.targetPed = Player.Character) AndAlso Not superGuy.heliPassenger Then
- timePlayJarvisCongrats = TRandom.Next(200, 400)
- End If
- ElseIf superGuy.removeTime > 0 Then
- superGuy.removeTime -= intervalFix()
- If superGuy.removeTime <= 0 Then removeSuperGuy(superGuy)
- End If
- Else
- If Exists(superGuy.p) Then
- If Not Exists(superGuy.p.CurrentVehicle) Then superGuy.p.Task.ClearAllImmediately()
- superGuy.p.Die()
- superGuy.p.ForceRagdoll(50000, False)
- End If
- removeSuperGuy(superGuy)
- End If
- Next
- If bAiming Then
- If timeWaitBeep <= 0 Then
- timeWaitBeep = 100
- If bSoundOK AndAlso bArmorON Then sndBeep.Play()
- bMissileAlarm = True
- Else
- timeWaitBeep -= intervalFix()
- End If
- End If
- For c As Int16 = TSuperGuyExplodeList.Count - 1 To 0 Step -1
- superGuy = TSuperGuyExplodeList(c)
- If superGuy.timeToExplode > 0 Then
- superGuy.timeToExplode -= intervalFix()
- If (superGuy.timeToExplode <= 1000) AndAlso Exists(superGuy.p) Then
- Dim tmpPos As Vector3 = superGuy.p.GetBonePosition(Bone.Head)
- Native.Function.Call("draw_corona", tmpPos.X, tmpPos.Y, tmpPos.Z, (1000 - superGuy.timeToExplode) * 0.2, 0, 0, 200, 200, 255)
- End If
- If superGuy.timeToExplode <= 0 Then
- If Exists(superGuy.p) Then
- Native.Function.Call("stop_ptfx", superGuy.ptfxDamage)
- World.AddExplosion(superGuy.p.GetBonePosition(Bone.Head), ExplosionType.Rocket, 1000, True, True, 1.5)
- superGuy.ptfxDamage = Native.Function.Call(Of Int32)("START_PTFX_ON_ped", "exp_ship_destroy", superGuy.p, 0, 0, 0, 0, 0, 0, 0.2)
- End If
- TSuperGuyExplodeList.RemoveAt(c)
- End If
- End If
- Next
- End Sub
- Private Sub removeSuperGuy(superGuy As TSuperGuy)
- If superGuy.heliPassenger Then createNewTSuperGuy(Nothing)
- If Exists(superGuy.p) Then
- If Not superGuy.heliPassenger AndAlso (TSuperGuyExplodeList.IndexOf(superGuy) < 0) Then TSuperGuyExplodeList.Add(superGuy)
- If superGuy.p.Health > 0 Then
- superGuy.p.Task.ClearAllImmediately()
- superGuy.p.Animation.Play(animSetFlight, "", 10)
- superGuy.p.isRagdoll = True
- End If
- superGuy.p.NoLongerNeeded()
- End If
- superGuy.removeTime = -666
- If Exists(superGuy.heli) Then superGuy.heli.NoLongerNeeded()
- 'getGameSoundID(superGuy.IDLaunchSound)
- getGameSoundID(superGuy.IDMoveSound)
- stopPTFX(superGuy.PTFXMove)
- superGuy.r.Detach()
- superGuy.r.FreezePosition = True
- superGuy.r.Visible = False
- Native.Function.Call("set_object_collision", superGuy.r, False)
- freeRocketList.Add(superGuy.r)
- superGuy.blip.Delete()
- Dim c As Int16 = TSuperGuyList.IndexOf(superGuy)
- If c >= 0 Then TSuperGuyList.RemoveAt(c)
- End Sub
- Private Sub gunsTick()
- If timeShooting > 0 Then
- timeShooting -= intervalFix()
- If timeShooting <= 0 Then
- If Not bNoWanted Then
- If timeSetWanted <= 0 Then
- timeSetWanted = 1000
- For Each p As Ped In World.GetPeds(Player.Character.Position, 100)
- If Exists(p) AndAlso (p.PedType = PedType.Cop) Then
- Native.Function.Call("SET_MAX_WANTED_LEVEL", 6)
- Native.Function.Call("ALTER_WANTED_LEVEL_NO_DROP", Player, 2)
- Native.Function.Call("APPLY_WANTED_LEVEL_CHANGE_NOW", Player)
- Exit For
- End If
- Next
- Else
- timeSetWanted -= intervalFix()
- End If
- End If
- End If
- End If
- For Each d As TDarts In DartsList
- If Exists(d.dart) Then
- If Not d.launched Then
- If bAimDown Then
- d.attach(Player.Character)
- Else
- d.Hide()
- End If
- End If
- Else
- createObject("cj_dart_6", Vector3.Zero + Vector3.WorldUp * 9, d.dart, 10)
- If Exists(d.dart) Then d.Hide()
- End If
- Next
- If bAimDown AndAlso (gunMode = 0) AndAlso (playerArmor.weaponSet = 1) Then
- Native.Function.Call("stop_sound", IDsndCannonRotate)
- Native.Function.Call("PLAY_SOUND_FROM_ped", IDsndCannonRotate, "general_weapons_minigun_loop", Player.Character)
- Else
- Native.Function.Call("stop_sound", IDsndCannonRotate)
- End If
- If bAimDown AndAlso ((gunMode = 0) OrElse (gunMode = 2) OrElse (gunMode = 3)) AndAlso bAttackDown AndAlso (myFlyHabs.Speed <= speedSlow) Then
- If gunMode <> 3 Then
- timeKeeArmAnim = 200
- Else
- timeKeeArmAnim = 400
- End If
- 'If (playerArmor.weaponSet = 0) Then
- ' If Not Player.Character.Animation.isPlaying(animSetPointArm, "dir_traffic_idle") Then _
- ' Player.Character.Animation.Play(animSetPointArm, "dir_traffic_idle", 3.5, AnimationFlags.Unknown06)
- 'End If
- If ((gunMode = 0) AndAlso playerArmor.handCannon) OrElse (gunMode = 3) OrElse ((gunMode = 2) AndAlso playerArmor.weaponSet = 0) Then
- If Not Player.Character.Animation.isPlaying(animSetPointArm, "dir_traffic_idle") Then
- Player.Character.Animation.Play(animSetPointArm, "dir_traffic_idle", 3.5, AnimationFlags.Unknown06)
- timeWaitStartCannonShoot = 20
- End If
- End If
- ElseIf timeKeeArmAnim > 0 Then
- timeKeeArmAnim -= intervalFix()
- 'If (playerArmor.weaponSet = 1) Then Native.Function.Call("stop_sound", IDsndCannonRotate)
- Else
- If Player.Character.Animation.isPlaying(animSetPointArm, "dir_traffic_idle") Then
- If Not flying Then
- Player.Character.Animation.Play(animSetPointArm, "", 1)
- Else
- Player.Character.Animation.Play(animSetFlight, "full_brake_for_landing", 5.0, AnimationFlags.Unknown05)
- End If
- End If
- End If
- If (gunMode = 1) OrElse (gunMode = 2) Then
- If bAimDown Then
- 'targetObejctAux.Position = Game.CurrentCamera.Position
- If Exists(targetObejctAux) Then
- targetObejctAux.Position = Player.Character.Position
- Dim tmpRot As Vector3 = Game.CurrentCamera.Rotation
- tmpRot.Y = targetHUDRotation
- targetObejctAux.Rotation = tmpRot
- targetHUDRotation += 10
- If targetHUDRotation > 360 Then targetHUDRotation = 0
- Else
- createObject("cj_dart_6", Vector3.Zero + Vector3.WorldUp * 6, targetObejctAux, 0)
- End If
- End If
- searchDartsTargets()
- DrawDartTargets()
- If timeWaitLaunchDarts > 0 Then
- If myRealSpeed <= speedSlow Then
- timeWaitLaunchDarts -= intervalFix()
- Else
- timeWaitLaunchDarts = 0
- End If
- Else
- launchDarts()
- End If
- checkDartsCollision()
- 'msg("time " & timeWaitLaunchDarts.ToString & " index " & indexCheckDartShoot.ToString & " launched count " & LaunchedDartsList.Count.ToString, 1000)
- End If
- If timeShootSuperCannon > 0 Then timeShootSuperCannon -= intervalFix()
- If (gunMode = 0) AndAlso (myRealSpeed < speedSlow) Then
- If bAimDown Then
- If Not flying AndAlso Not bLandAnim Then
- If playerArmor.shoulderCannon OrElse playerArmor.superCannon Then
- If Not Player.Character.Animation.isPlaying(animSetFlight, "full_brake_for_landing") Then _
- Player.Character.Animation.Play(animSetFlight, "full_brake_for_landing", 8, AnimationFlags.Unknown05)
- Else
- If Player.Character.Animation.isPlaying(animSetFlight, "full_brake_for_landing") Then _
- Player.Character.Animation.Play(animSetFlight, "", 8)
- End If
- End If
- If bAttackDown Then
- If (weaponHeat0 + 8) < 100 Then
- If timeShootCannon <= 0 Then
- If playerArmor.weaponSet = 0 Then
- timeShootCannon = 20
- Else
- timeShootCannon = 10
- End If
- Dim tmpPosIni As GTA.Vector3
- If camMode = 0 Then
- If flying OrElse (Player.Character.Velocity.DistanceTo(Vector3.Zero) > 1) Then
- tmpPosIni = Game.CurrentCamera.Position + Game.CurrentCamera.Direction * (Game.CurrentCamera.Position.DistanceTo(Player.Character.Position) + 2.5)
- Else
- tmpPosIni = Game.CurrentCamera.Position + Game.CurrentCamera.Direction * (Game.CurrentCamera.Position.DistanceTo(Player.Character.Position))
- End If
- Else
- tmpPosIni = Game.CurrentCamera.Position + Game.CurrentCamera.Direction
- End If
- Dim tmpDir As GTA.Vector3
- If Not flying AndAlso (Player.Character.Direction.DistanceTo2D(Game.CurrentCamera.Direction) > 1) Then
- tmpDir = Player.Character.Direction
- tmpDir.Z = Game.CurrentCamera.Direction.Z
- Else
- tmpDir = Game.CurrentCamera.Direction
- End If
- Dim tmpPosFin As GTA.Vector3
- If Exists(AutoAimedPed) Then
- tmpPosFin = AutoAimedPed.Position + Game.CurrentCamera.Direction * 2
- ElseIf Exists(Player.GetTargetedPed) Then
- tmpPosFin = Player.GetTargetedPed.Position + Game.CurrentCamera.Direction * 2
- Else
- tmpPosFin = (tmpPosIni + tmpDir * 300).Around(2)
- End If
- If (camMode = 0) Then
- If playerArmor.handCannon Then
- If Player.Character.Animation.isPlaying(animSetPointArm, "dir_traffic_idle") Then
- If timeWaitStartCannonShoot <= 0 Then
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_ped_bone", "muz_machine", Player.Character,
- playerArmor.cannonHandOffset.X, playerArmor.cannonHandOffset.Y, playerArmor.cannonHandOffset.Z, 0, 0, 45.0, Bone.LeftHand, 0.7)
- If Not flying Then
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_ped", "wpn_bullet_trace", Player.Character,
- playerArmor.cannonHandOffset.X, playerArmor.cannonHandOffset.Y + 1, playerArmor.cannonHandOffset.Z + 0.35, -90.0 + Game.CurrentCamera.Rotation.X, 0, 0, 1.0)
- End If
- Native.Function.Call("FIRE_SINGLE_BULLET", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z, tmpPosFin.X, tmpPosFin.Y, tmpPosFin.Z, playerArmor.handCannon_Damage)
- Native.Function.Call("PLAY_SOUND_FROM_position", -1, "eagle_shot_1", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z)
- weaponHeat0 += 2
- Else
- timeWaitStartCannonShoot -= intervalFix()
- End If
- Else
- Player.Character.Animation.Play(animSetPointArm, "dir_traffic_idle", 8, AnimationFlags.Unknown06)
- End If
- End If
- If playerArmor.shoulderCannon Then
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_ped", "muz_machine", Player.Character,
- playerArmor.cannonShoulderOffset.X, playerArmor.cannonShoulderOffset.Y, playerArmor.cannonShoulderOffset.Z, 0, 0, 90.0, 0.7)
- If Not flying Then _
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_ped", "wpn_bullet_trace", Player.Character,
- playerArmor.cannonShoulderOffset.X, playerArmor.cannonShoulderOffset.Y + 1, playerArmor.cannonShoulderOffset.Z, -90.0 + Game.CurrentCamera.Rotation.X, 0, 0, 1.0)
- Native.Function.Call("FIRE_SINGLE_BULLET", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z, tmpPosFin.X, tmpPosFin.Y, tmpPosFin.Z, playerArmor.shoulderCannon_Damage)
- Native.Function.Call("PLAY_SOUND_FROM_position", -1, "shotgun_fire", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z)
- weaponHeat0 += 1
- End If
- If playerArmor.superCannon AndAlso (timeShootSuperCannon <= 0) Then
- timeShootSuperCannon = 50
- Native.Function.Call(Of Int32)("trigger_PTFX_ON_ped_bone", "muz_machine", Player.Character,
- playerArmor.superCannonShoulderOffset.X, playerArmor.superCannonShoulderOffset.Y, playerArmor.superCannonShoulderOffset.Z, _
- 15.0, 13.0, 109.0, Bone.LeftUpperarmRoll, 1.0)
- Native.Function.Call("PLAY_SOUND_FROM_position", -1, "shotgun_fire", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z)
- Native.Function.Call("FIRE_SINGLE_BULLET", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z, tmpPosFin.X, tmpPosFin.Y, tmpPosFin.Z, playerArmor.superCannon_Power)
- Native.Function.Call("FIRE_SINGLE_BULLET", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z, tmpPosFin.X, tmpPosFin.Y, tmpPosFin.Z, playerArmor.superCannon_Power)
- Native.Function.Call("FIRE_SINGLE_BULLET", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z, tmpPosFin.X, tmpPosFin.Y, tmpPosFin.Z, playerArmor.superCannon_Power)
- Native.Function.Call("FIRE_SINGLE_BULLET", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z, tmpPosFin.X, tmpPosFin.Y, tmpPosFin.Z, playerArmor.superCannon_Power)
- Native.Function.Call("FIRE_SINGLE_BULLET", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z, tmpPosFin.X, tmpPosFin.Y, tmpPosFin.Z, playerArmor.superCannon_Power)
- weaponHeat0 += 1
- End If
- End If
- If timeShooting <= 0 Then
- timeShooting = 100
- timeSetWanted = 0
- End If
- Else
- timeShootCannon -= intervalFix()
- End If
- End If
- End If
- Else
- If Not flying AndAlso Not bLandAnim AndAlso Player.Character.Animation.isPlaying(animSetFlight, "full_brake_for_landing") Then _
- Player.Character.Animation.Play(animSetFlight, "", 8)
- End If
- End If
- ' repulsor beam
- If (gunMode = 3) OrElse (gunMode = 4) Then
- If bAimDown AndAlso (timeWaitShootRepulsor > 0) Then
- timeWaitShootRepulsor -= intervalFix()
- If timeWaitShootRepulsor <= 0 Then
- repulsorLight.Enabled = True
- timeRepulsorBeamON = 200
- timeKeepRepulsorSound = 1000
- If bSoundOK Then sndRepulsorBlast.Play()
- If gunMode = 3 Then
- weaponHeat3 += 20
- Else
- weaponHeat4 += 35
- End If
- If timeShooting <= 0 Then
- timeShooting = 100
- timeSetWanted = 0
- End If
- End If
- End If
- If timeWaitRepulsorSound > 0 Then
- timeWaitRepulsorSound -= intervalFix()
- If timeWaitRepulsorSound <= 0 Then
- End If
- End If
- If Not bAimDown Then
- timeWaitShootRepulsor = 0
- timeRepulsorBeamON = 0
- If flying Then myFlyHabs.FreezePosition = False
- Player.Character.FreezePosition = False
- repulsorLight.Enabled = False
- If Not flying AndAlso Player.Character.Animation.isPlaying(animSetFlight, "full_brake_for_landing") AndAlso Not bLandAnim Then _
- Player.Character.Animation.Play(animSetFlight, "", 10)
- End If
- If timeRepulsorBeamON > 0 Then
- myFlyHabs.FreezePosition = True
- Player.Character.FreezePosition = True
- Dim iniPos As Vector3
- Dim iniPosShoot As Vector3
- Dim iniDirection, tmpiniDirection As Vector3
- Dim tmpPos As Vector3
- If gunMode = 3 Then
- iniPos = Player.Character.GetBonePosition(Bone.LeftHand)
- ElseIf gunMode = 4 Then
- iniPos = Player.Character.Position + Vector3.WorldUp * 0.35
- End If
- iniPosShoot = iniPos + Game.CurrentCamera.Direction * 0.2
- tmpPos = iniPos
- If bAimDown Then
- If Not Exists(AutoAimedPed) Then
- iniDirection = Game.CurrentCamera.Direction
- Else
- iniDirection = Vector3.Normalize(AutoAimedPed.Position + Vector3.WorldUp * 0.25 - Game.CurrentCamera.Position)
- End If
- Else
- iniDirection = Player.Character.Direction
- iniDirection.Z = Game.CurrentCamera.Direction.Z
- End If
- If Not repulsorChest Then
- tmpPos += iniDirection * 0.5
- Else
- tmpPos += iniDirection * 0.8
- If flying Then tmpPos.Z += 0.15
- 'If myFlyHabs.Rotation.X < 0 Then tmpPos.Z = Player.Character.Position.Z + 0.2
- End If
- If Not flying Then
- If iniDirection.Z > 0.45 Then iniDirection.Z = 0.45
- If iniDirection.Z < -0.45 Then iniDirection.Z = -0.45
- End If
- Dim tmpSpace As Double = 0.2
- Dim shake As Double
- Dim tmpDiameter As Double = repulsorDiameter * 0.2
- 'If camMode = 1 Then tmpDiameter *= 0.2
- While tmpPos.DistanceTo(Player.Character.Position) < 50
- shake = 0.05 * TRandom.NextDouble()
- If tmpDiameter < repulsorDiameter Then
- tmpDiameter += 10
- If tmpDiameter > repulsorDiameter Then tmpDiameter = repulsorDiameter
- End If
- If Not repulsorChest Then
- Native.Function.Call("draw_corona", tmpPos.X, tmpPos.Y, tmpPos.Z + shake, tmpDiameter, 0, 0, 255, 100, 51)
- Else
- Native.Function.Call("draw_corona", tmpPos.X, tmpPos.Y, tmpPos.Z + shake, tmpDiameter, 0, 0, 122, 215, 242)
- End If
- tmpiniDirection = iniDirection * tmpSpace
- If Not flying Then
- If tmpiniDirection.Z > 0.45 Then tmpiniDirection.Z = 0.45
- If tmpiniDirection.Z < -0.45 Then tmpiniDirection.Z = -0.45
- End If
- tmpPos += tmpiniDirection
- If tmpSpace < 1 Then tmpSpace += 0.01
- End While
- tmpPos = iniPosShoot + iniDirection * 50
- If Not repulsorChest Then
- repulsorLight.Color = Color.FromArgb(255, 200, 180, 100)
- Else
- repulsorLight.Color = Color.FromArgb(255, 122, 215, 242)
- End If
- repulsorLight.Position = iniPos + iniDirection
- repulsorLight.Intensity = 50 + 50 * TRandom.NextDouble()
- Dim tmpDist As Double
- Dim tmpPosCompare As Vector3
- For Each p As Ped In pedsRepulsorHit
- If Exists(p) AndAlso (p <> Player.Character) AndAlso Not Exists(p.CurrentVehicle) Then
- 'If (p.Position.DistanceTo(tmpPos) <= 1) Then
- tmpDist = p.Position.DistanceTo(Player.Character.Position)
- tmpPosCompare = Player.Character.Position + iniDirection * tmpDist
- If (p.Position.DistanceTo(tmpPosCompare) <= 1) OrElse _
- ((AutoAimedPed = p) AndAlso (p.Position.DistanceTo(tmpPosCompare) < 2)) Then
- If Not p.isRagdoll Then
- p.PreventRagdoll = False
- p.ForceRagdoll(1000, True)
- End If
- If Not repulsorChest Then
- p.ApplyForce(iniDirection * 0.6, Vector3.WorldNorth * 0.5)
- Else
- p.ApplyForce(iniDirection * 1.2 + Vector3.WorldUp * 0.5, Vector3.WorldNorth * 0.5)
- World.AddExplosion(p.Position, ExplosionType.Default, 0.5, False, True, 0)
- End If
- If Not p.isOnFire Then
- p.isOnFire = True
- End If
- If Not repulsorChest Then
- Native.Function.Call("draw_corona", tmpPosCompare.X, tmpPosCompare.Y, tmpPosCompare.Z, tmpDiameter * (55 - tmpDist) * 0.2, 0, 0, 255, 100, 51)
- Else
- Native.Function.Call("draw_corona", tmpPosCompare.X, tmpPosCompare.Y, tmpPosCompare.Z, tmpDiameter * (55 - tmpDist) * 0.2, 0, 0, 122, 215, 242)
- End If
- End If
- End If
- Next
- For Each v As Vehicle In vehRepulsorHit
- If Exists(v) AndAlso (v <> myFlyHabs) Then
- tmpDist = v.Position.DistanceTo(Player.Character.Position)
- tmpPosCompare = Player.Character.Position + iniDirection * tmpDist
- If v.Position.DistanceTo(tmpPosCompare) <= 2 Then
- If repulsorChest Then
- v.ApplyForce(iniDirection * 0.4 + Vector3.WorldUp * 0.05)
- If Not v.Metadata.chestExp Then
- v.Metadata.chestExp = True
- World.AddExplosion(v.Position - iniDirection * 3, ExplosionType.Default, 1.0, False, True, 0)
- v.ApplyForce(Vector3.WorldUp, Vector3.WorldNorth)
- End If
- Else
- v.ApplyForce(iniDirection * 0.8 + Vector3.WorldUp * 0.05)
- End If
- v.PetrolTankHealth = -1
- If Not repulsorChest Then
- Native.Function.Call("draw_corona", tmpPosCompare.X, tmpPosCompare.Y, tmpPosCompare.Z, tmpDiameter * (75 - tmpDist) * 0.5, 0, 0, 255, 100, 51)
- Else
- Native.Function.Call("draw_corona", tmpPosCompare.X, tmpPosCompare.Y, tmpPosCompare.Z, tmpDiameter * (75 - tmpDist) * 0.5, 0, 0, 122, 215, 242)
- End If
- End If
- End If
- Next
- Native.Function.Call("FIRE_SINGLE_BULLET", iniPosShoot.X, iniPosShoot.Y, iniPosShoot.Z, tmpPos.X, tmpPos.Y, tmpPos.Z, 1)
- tmpPos = tmpPos.Around(0.2)
- Native.Function.Call("FIRE_SINGLE_BULLET", iniPosShoot.X, iniPosShoot.Y, iniPosShoot.Z, tmpPos.X, tmpPos.Y, tmpPos.Z, 1)
- tmpPos = tmpPos.Around(0.2)
- Native.Function.Call("FIRE_SINGLE_BULLET", iniPosShoot.X, iniPosShoot.Y, iniPosShoot.Z, tmpPos.X, tmpPos.Y, tmpPos.Z, 1)
- If repulsorChest Then
- Native.Function.Call("FIRE_SINGLE_BULLET", iniPosShoot.X, iniPosShoot.Y, iniPosShoot.Z, tmpPos.X, tmpPos.Y, tmpPos.Z, 1)
- tmpPos = tmpPos.Around(0.2)
- Native.Function.Call("FIRE_SINGLE_BULLET", iniPosShoot.X, iniPosShoot.Y, iniPosShoot.Z, tmpPos.X, tmpPos.Y, tmpPos.Z, 1)
- tmpPos = tmpPos.Around(0.2)
- Native.Function.Call("FIRE_SINGLE_BULLET", iniPosShoot.X, iniPosShoot.Y, iniPosShoot.Z, tmpPos.X, tmpPos.Y, tmpPos.Z, 1)
- End If
- stopPTFX(PTFXRepulsor)
- If Not repulsorChest Then
- PTFXRepulsor = Native.Function.Call(Of Int32)("START_PTFX_ON_PED_BONE", "break_sparks", Player.Character, 0, 0, 0, 0.0, 45.0, 0, Bone.LeftHand, 0.2)
- Else
- PTFXRepulsor = Native.Function.Call(Of Int32)("START_PTFX_ON_PED_BONE", "break_sparks", Player.Character, 0, 0.5, 0.3, -45.0, 0, 0, Bone.Root, 0.2)
- End If
- timeRepulsorBeamON -= intervalFix()
- If timeRepulsorBeamON <= 0 Then
- timeWaitShootRepulsor = 0
- repulsorLight.Enabled = False
- If flying Then myFlyHabs.FreezePosition = False
- Player.Character.FreezePosition = False
- If Not flying AndAlso Player.Character.Animation.isPlaying(animSetFlight, "full_brake_for_landing") Then Player.Character.Animation.Play(animSetFlight, "", 10)
- End If
- End If
- End If
- End Sub
- Private Sub searchDartsTargets()
- If (timeSearchForPedTargets <= 0) Then
- timeSearchForPedTargets = 125
- If LaunchedDartsList.Count = DartsList.Count Then Exit Sub
- If bAimDown Then
- Dim tmpDist As Double
- Dim tmpPos As Vector3
- If gunMode = 1 Then
- For c As Int16 = pedTargets.Count - 1 To 0 Step -1
- If Not Exists(pedTargets(c)) OrElse Not pedTargets(c).isOnScreen OrElse pedTargets(c).isDead Then
- pedTargets.RemoveAt(c)
- End If
- Next
- pedTargets.AddRange(World.GetPeds(Player.Character.Position + Game.CurrentCamera.Direction * 50, 100))
- Try
- pedTargets.RemoveDead()
- pedTargets.OrderByDistanceTo(Player.Character.Position)
- Catch
- End Try
- For c As Int16 = 0 To pedTargets.Count - 1
- If Exists(pedTargets(c)) AndAlso Exists(pedTargets(c)) AndAlso pedTargets(c).isAlive AndAlso (pedTargets(c) <> Player.Character) AndAlso pedTargets(c).isOnScreen Then
- Dim bExists As Boolean = False
- For Each d As TDarts In DartsList
- If (d.target = pedTargets(c)) Then
- bExists = True
- Exit For
- End If
- Next
- If bExists Then Continue For
- tmpDist = pedTargets(c).Position.DistanceTo(Game.CurrentCamera.Position) ' *** testar mira
- tmpPos = Game.CurrentCamera.Position + Game.CurrentCamera.Direction * tmpDist
- If pedTargets(c).Position.DistanceTo(tmpPos) <= 1 Then
- For Each d As TDarts In DartsList
- If Not d.launched AndAlso Not Exists(d.target) AndAlso (LaunchedDartsList.IndexOf(d) < 0) Then
- d.targetVeh = Nothing
- d.target = pedTargets(c)
- d.targetSuperGuy = Nothing
- d.targetReady = True
- bAnTargetLocked = True
- d.diameterMulti = 1
- If (timeKeepRepulsorSound <= 0) AndAlso bSoundOK Then sndTargetSet.Play()
- Exit For
- End If
- If DartsList.IndexOf(d) = DartsList.Count - 1 Then Exit For
- Next
- End If
- End If
- Next
- ElseIf gunMode = 2 Then
- vehTargets = World.GetVehicles(Player.Character.Position + Game.CurrentCamera.Direction * 100, 200)
- Dim bExists As Boolean = False
- For Each v As Vehicle In vehTargets
- If Exists(v) AndAlso (v <> myFlyHabs) AndAlso v.isOnScreen Then
- bExists = False
- For Each d As TDarts In DartsList
- If (d.targetVeh = v) Then
- bExists = True
- Exit For
- End If
- Next
- If bExists Then Continue For
- tmpDist = v.Position.DistanceTo(Player.Character.Position)
- tmpPos = Player.Character.Position + Game.CurrentCamera.Direction * tmpDist
- Native.Function.Call("DRAW_CHECKPOINT", tmpPos.X, tmpPos.Y, tmpPos.Z, 5, 0, 255, 0)
- If v.Position.DistanceTo(tmpPos) < 3 Then
- For Each d As TDarts In DartsList
- If Not Exists(d.targetVeh) AndAlso (LaunchedDartsList.IndexOf(d) < 0) Then
- d.target = Nothing
- d.targetVeh = v
- d.targetSuperGuy = Nothing
- d.targetReady = True
- bAnTargetLocked = True
- d.diameterMulti = v.Model.GetDimensions.Y / 3
- If (timeKeepRepulsorSound <= 0) AndAlso bSoundOK Then sndTargetSet.Play()
- Exit For
- End If
- Next
- End If
- End If
- Next
- For Each s As TSuperGuy In TSuperGuyList
- If Exists(s.p) Then
- tmpDist = s.p.Position.DistanceTo(Game.CurrentCamera.Position)
- tmpPos = Game.CurrentCamera.Position + Game.CurrentCamera.Direction * tmpDist
- If s.p.Position.DistanceTo(tmpPos) < 2 Then
- bExists = False
- For Each d As TDarts In DartsList
- If d.targetSuperGuy = s.p Then
- bExists = True
- Exit For
- End If
- Next
- If bExists Then Continue For
- For Each d As TDarts In DartsList
- If Not Exists(d.targetSuperGuy) AndAlso (LaunchedDartsList.IndexOf(d) < 0) Then
- d.target = Nothing
- d.targetVeh = Nothing
- d.targetSuperGuy = s.p
- d.targetReady = True
- bAnTargetLocked = True
- d.diameterMulti = 1
- If (timeKeepRepulsorSound <= 0) AndAlso bSoundOK Then sndTargetSet.Play()
- Exit For
- End If
- Next
- End If
- End If
- Next
- End If
- Else
- For Each d As TDarts In DartsList
- If Not d.launched Then
- d.target = Nothing
- d.targetVeh = Nothing
- d.targetSuperGuy = Nothing
- d.targetReady = False
- d.diameterMulti = 1
- End If
- Next
- End If
- Else
- timeSearchForPedTargets -= intervalFix()
- End If
- End Sub
- Private Sub keepArmorConfig()
- Try
- If timeKeepArmorConfig <= 0 Then
- timeKeepArmorConfig = 1000
- If bArmorON Then Player.Character.MakeProofTo(False, True, False, bNoFlightCollisionDetection OrElse bPlayerFallingDamageProof, True)
- If Exists(myFlyHabs) Then
- myFlyHabs.Visible = False
- myFlyHabs.MakeProofTo(True, True, True, False, True)
- myFlyHabs.CanBeDamaged = False
- myFlyHabs.CanBeVisiblyDamaged = False
- End If
- Else
- timeKeepArmorConfig -= intervalFix()
- End If
- Catch
- End Try
- End Sub
- Private Sub DrawDartTargets()
- For Each d As TDarts In DartsList
- If Not bAimDown AndAlso Not d.launched Then
- d.target = Nothing
- d.targetVeh = Nothing
- d.targetSuperGuy = Nothing
- timeSearchForPedTargets = 0
- End If
- If Not d.launched AndAlso (Exists(d.target) OrElse Exists(d.targetVeh) OrElse Exists(d.targetSuperGuy)) Then
- If (Exists(d.target) AndAlso (Not d.target.isOnScreen OrElse d.target.isDead)) OrElse _
- (Exists(d.targetVeh) AndAlso (Not d.targetVeh.isOnScreen)) OrElse _
- (Exists(d.targetSuperGuy) AndAlso (Not d.targetSuperGuy.isOnScreen OrElse d.targetSuperGuy.isDead)) Then
- If Exists(d.target) Then d.target = Nothing
- If Exists(d.targetVeh) Then d.targetVeh = Nothing
- If Exists(d.targetSuperGuy) Then d.targetSuperGuy = Nothing
- d.targetReady = False
- Else
- If Exists(targetObejctAux) Then
- Dim tmpDist As Double
- Dim tmpPosHead As Vector3
- Dim tmpPos As Vector3
- Dim tmpXOff, tmpYOff As Double
- If Exists(d.target) Then
- tmpDist = d.target.Position.DistanceTo(Player.Character.Position) * 0.01
- tmpPosHead = d.target.GetBonePosition(Bone.Head)
- tmpXOff = 0.25
- tmpYOff = 0.25
- tmpPos = tmpPosHead + targetObejctAux.Position - targetObejctAux.GetOffsetPosition(Vector3.RelativeRight * tmpXOff)
- ElseIf Exists(d.targetVeh) Then
- tmpDist = d.targetVeh.Position.DistanceTo(Player.Character.Position) * 0.01
- tmpPosHead = d.targetVeh.Position
- tmpXOff = 1
- tmpYOff = 1
- tmpPos = tmpPosHead + targetObejctAux.Position - targetObejctAux.GetOffsetPosition(Vector3.RelativeRight * tmpXOff * d.diameterMulti)
- Native.Function.Call("draw_corona", tmpPosHead.X, tmpPosHead.Y, tmpPosHead.Z, tmpDist * 100 * 0.8, 0, 0, 255, 0, 0)
- Native.Function.Call("DRAW_CHECKPOINT", tmpPosHead.X, tmpPosHead.Y, tmpPosHead.Z, tmpDist * 0.8, 255, 0, 0)
- ElseIf Exists(d.targetSuperGuy) Then
- tmpDist = d.targetSuperGuy.Position.DistanceTo(Player.Character.Position) * 0.01
- tmpPosHead = d.targetSuperGuy.Position + Vector3.WorldUp * 0.2
- tmpXOff = 0.5
- tmpYOff = 0.5
- tmpPos = tmpPosHead + targetObejctAux.Position - targetObejctAux.GetOffsetPosition(Vector3.RelativeRight * tmpXOff)
- Else
- Exit Sub
- End If
- Native.Function.Call("draw_corona", tmpPos.X, tmpPos.Y, tmpPos.Z, tmpDist * 100, 0, 0, 255, 0, 0)
- Native.Function.Call("DRAW_CHECKPOINT", tmpPos.X, tmpPos.Y, tmpPos.Z, tmpDist, 255, 0, 0)
- tmpPos = tmpPosHead + targetObejctAux.Position - targetObejctAux.GetOffsetPosition(Vector3.RelativeLeft * tmpXOff * d.diameterMulti)
- Native.Function.Call("draw_corona", tmpPos.X, tmpPos.Y, tmpPos.Z, tmpDist * 100, 0, 0, 255, 0, 0)
- Native.Function.Call("DRAW_CHECKPOINT", tmpPos.X, tmpPos.Y, tmpPos.Z, tmpDist, 255, 0, 0)
- tmpPos = tmpPosHead + targetObejctAux.Position - targetObejctAux.GetOffsetPosition(Vector3.RelativeBottom * tmpYOff * d.diameterMulti)
- Native.Function.Call("draw_corona", tmpPos.X, tmpPos.Y, tmpPos.Z, tmpDist * 100, 0, 0, 255, 0, 0)
- Native.Function.Call("DRAW_CHECKPOINT", tmpPos.X, tmpPos.Y, tmpPos.Z, tmpDist, 255, 0, 0)
- tmpPos = tmpPosHead + targetObejctAux.Position - targetObejctAux.GetOffsetPosition(Vector3.RelativeTop * tmpYOff * d.diameterMulti)
- Native.Function.Call("draw_corona", tmpPos.X, tmpPos.Y, tmpPos.Z, tmpDist * 100, 0, 0, 255, 0, 0)
- Native.Function.Call("DRAW_CHECKPOINT", tmpPos.X, tmpPos.Y, tmpPos.Z, tmpDist, 255, 0, 0)
- End If
- End If
- End If
- Next
- End Sub
- Private Sub launchDarts()
- If ((gunMode = 1) AndAlso ((weaponHeat1 + 20) > 100)) OrElse ((gunMode = 2) AndAlso ((weaponHeat2 + 10) > 100)) Then indexCheckDartShoot = -1
- If indexCheckDartShoot > -1 Then
- If indexCheckDartShoot > DartsList.Count - 1 Then
- indexCheckDartShoot = -1
- Else
- If Not DartsList(indexCheckDartShoot).launched AndAlso DartsList(indexCheckDartShoot).targetReady Then
- If Exists(DartsList(indexCheckDartShoot).target) Then
- weaponHeat1 += 10
- DartsList(indexCheckDartShoot).initial_direction = Vector3.Normalize(DartsList(indexCheckDartShoot).target.GetBonePosition(Bone.Head) - DartsList(indexCheckDartShoot).dart.Position)
- ElseIf Exists(DartsList(indexCheckDartShoot).targetVeh) Then
- If timeShooting <= 0 Then
- timeShooting = 100
- timeSetWanted = 0
- End If
- weaponHeat2 += 10
- DartsList(indexCheckDartShoot).initial_direction = Vector3.Normalize(DartsList(indexCheckDartShoot).targetVeh.Position - DartsList(indexCheckDartShoot).dart.Position)
- ElseIf Exists(DartsList(indexCheckDartShoot).targetSuperGuy) Then
- If timeShooting <= 0 Then
- timeShooting = 100
- timeSetWanted = 0
- End If
- weaponHeat2 += 10
- DartsList(indexCheckDartShoot).initial_direction = Vector3.Normalize(DartsList(indexCheckDartShoot).targetSuperGuy.Position - DartsList(indexCheckDartShoot).dart.Position)
- Else
- DartsList(indexCheckDartShoot).target = Nothing
- DartsList(indexCheckDartShoot).targetVeh = Nothing
- DartsList(indexCheckDartShoot).targetSuperGuy = Nothing
- Exit Sub
- End If
- DartsList(indexCheckDartShoot).launched = True
- DartsList(indexCheckDartShoot).timeOut = 0
- stopPTFX(DartsList(indexCheckDartShoot).PTFXFlight)
- 'Native.Function.Call("stop_sound", )
- 'Native.Function.Call("stop_sound", DartsList(indexCheckDartShoot).IDsndMove)
- If Exists(DartsList(indexCheckDartShoot).target) Then
- DartsList(indexCheckDartShoot).PTFXFlight = Native.Function.Call(Of Int32)("START_PTFX_ON_OBJ", "shot_directed_steam", _
- DartsList(indexCheckDartShoot).dart, 0, 0, 0.1, 0, 0, 0, 0.3)
- 'Native.Function.Call("play_sound_from_object", IDsndLaunchDarts, "silenced_pistol_fire", DartsList(indexCheckDartShoot).dart)
- Native.Function.Call("play_sound_from_object", -1, "silenced_pistol_fire", DartsList(indexCheckDartShoot).dart)
- ElseIf Exists(DartsList(indexCheckDartShoot).targetVeh) Then
- DartsList(indexCheckDartShoot).PTFXFlight = Native.Function.Call(Of Int32)("START_PTFX_ON_OBJ", "weap_rocket_player", _
- DartsList(indexCheckDartShoot).dart, 0, 0, 0.1, 0, 0, 0, 0.5)
- 'Native.Function.Call("play_sound_from_object", DartsList(indexCheckDartShoot).IDsndMove, "GENERAL_WEAPONS_ROCKET_LOOP", DartsList(indexCheckDartShoot).dart)
- 'Native.Function.Call("play_sound_from_ped", IDsndLaunchDarts, "general_explosions_lows_grenade_explosion_r", Player.Character)
- Native.Function.Call("play_sound_from_ped", -1, "general_explosions_lows_grenade_explosion_r", Player.Character)
- ElseIf Exists(DartsList(indexCheckDartShoot).targetSuperGuy) Then
- DartsList(indexCheckDartShoot).PTFXFlight = Native.Function.Call(Of Int32)("START_PTFX_ON_OBJ", "weap_rocket_player", _
- DartsList(indexCheckDartShoot).dart, 0, 0, 0.1, 0, 0, 0, 0.5)
- 'Native.Function.Call("play_sound_from_object", DartsList(indexCheckDartShoot).IDsndMove, "GENERAL_WEAPONS_ROCKET_LOOP", DartsList(indexCheckDartShoot).dart)
- 'Native.Function.Call("play_sound_from_ped", IDsndLaunchDarts, "general_explosions_lows_grenade_explosion_r", Player.Character)
- Native.Function.Call("play_sound_from_ped", -1, "general_explosions_lows_grenade_explosion_r", Player.Character)
- End If
- DartsList(indexCheckDartShoot).dart.Detach()
- DartsList(indexCheckDartShoot).readyToBlowUp = False
- DartsList(indexCheckDartShoot).dart.Visible = True
- LaunchedDartsList.Add(DartsList(indexCheckDartShoot))
- End If
- indexCheckDartShoot += 1
- If indexCheckDartShoot > DartsList.Count - 1 Then indexCheckDartShoot = -1
- End If
- End If
- End Sub
- Private Sub checkDartsCollision()
- Dim d As TDarts
- For c As Int16 = LaunchedDartsList.Count - 1 To 0 Step -1
- d = LaunchedDartsList(c)
- If d.launched Then
- Dim tmpRot As Vector3
- If Not Exists(d.target) AndAlso Not Exists(d.targetVeh) AndAlso Not Exists(d.targetSuperGuy) Then
- d.dart.ApplyForce(d.initial_direction * 15)
- tmpRot = Helper.DirectionToRotation(d.initial_direction, 0)
- tmpRot.Y += 90
- tmpRot.Z -= 90
- d.dart.Rotation = tmpRot
- Else
- If Exists(d.target) Then
- d.initial_direction = Vector3.Normalize(d.target.GetBonePosition(Bone.Head) - d.dart.Position)
- ElseIf Exists(d.targetVeh) AndAlso (d.dart.Position.DistanceTo(Player.Character.Position) < d.targetVeh.Position.DistanceTo(Player.Character.Position)) Then
- d.initial_direction = Vector3.Normalize(d.targetVeh.Position - d.dart.Position)
- ElseIf Exists(d.targetSuperGuy) AndAlso (d.dart.Position.DistanceTo(Player.Character.Position) < d.targetSuperGuy.Position.DistanceTo(Player.Character.Position)) Then
- d.initial_direction = Vector3.Normalize(d.targetSuperGuy.Position - d.dart.Position)
- End If
- If Exists(d.target) AndAlso (d.dart.Position.DistanceTo(d.target.Position) > 5) Then
- d.dart.ApplyForce(d.initial_direction * 15 + Vector3.WorldUp * 0.5)
- ElseIf (Exists(d.targetVeh) AndAlso (d.dart.Position.DistanceTo(d.targetVeh.Position) > 5)) Then
- If d.targetVeh.Model.isHelicopter Then
- d.dart.ApplyForce(d.initial_direction * 25 + Vector3.WorldUp)
- Else
- If d.dart.Position.DistanceTo(d.targetVeh.Position) > 20 Then
- d.dart.ApplyForce(d.initial_direction * 25 + Vector3.WorldUp)
- If myRealSpeed > speedSlow Then _
- d.dart.ApplyForce(d.initial_direction * 25 + Vector3.WorldUp)
- Else
- d.dart.ApplyForce(d.initial_direction * 25)
- End If
- End If
- ElseIf (Exists(d.targetSuperGuy) AndAlso (d.dart.Position.DistanceTo(d.targetSuperGuy.Position) > 5)) Then
- d.dart.ApplyForce(d.initial_direction * 25 + Vector3.WorldUp)
- Else
- d.dart.Velocity = (d.initial_direction * 25)
- End If
- tmpRot = Helper.DirectionToRotation(d.initial_direction, 0)
- tmpRot.Y += 90
- tmpRot.Z -= 90
- d.dart.Rotation = tmpRot
- End If
- If Not d.readyToBlowUp AndAlso (d.dart.Position.DistanceTo(Player.Character.Position) > 2) Then
- Native.Function.Call("SET_OBJECT_RECORDS_COLLISIONS", d.dart, True)
- d.readyToBlowUp = True
- ElseIf d.readyToBlowUp Then
- If Native.Function.Call(Of Boolean)("HAS_OBJECT_COLLIDED_WITH_ANYTHING", d.dart) OrElse (d.timeOut >= 2000) Then
- Native.Function.Call("SET_OBJECT_RECORDS_COLLISIONS", d.dart, False)
- d.dart.FreezePosition = True
- stopPTFX(d.PTFXFlight)
- If Exists(d.target) Then
- stopPTFX(d.PTFXHit)
- 'd.PTFXHit = Native.Function.Call(Of Int32)("START_PTFX", "muz_pistol_large", _
- ' d.dart.Position.X, d.dart.Position.Y, d.dart.Position.Z, 0, 0, 90.0, 0.5)
- Native.Function.Call("trigger_PTFX", "muz_pistol_large", _
- d.dart.Position.X, d.dart.Position.Y, d.dart.Position.Z, 0, 0, 90.0, 0.5)
- Dim tmpPosIni, tmpPosFin As Vector3
- For Each p As Ped In World.GetPeds(d.dart.Position, 1.5)
- If Exists(p) AndAlso Not p.isDead Then
- Dim bSuperGuy As Boolean = False
- For Each s As TSuperGuy In TSuperGuyList
- If s.p = p Then
- bSuperGuy = True
- p.Health -= 50
- End If
- Next
- If Not bSuperGuy Then
- tmpPosIni = p.GetBonePosition(Bone.Head) - p.Direction * 1
- tmpPosFin = p.GetBonePosition(Bone.Head) + p.Direction * 2
- p.PreventRagdoll = False
- Native.Function.Call("FIRE_SINGLE_BULLET", tmpPosIni.X, tmpPosIni.Y, tmpPosIni.Z, tmpPosFin.X, tmpPosFin.Y, tmpPosFin.Z, 1000)
- If Not bNoWanted AndAlso p.PedType = PedType.Cop Then
- Native.Function.Call("SET_MAX_WANTED_LEVEL", 6)
- Native.Function.Call("ALTER_WANTED_LEVEL_NO_DROP", Player, 2)
- Native.Function.Call("APPLY_WANTED_LEVEL_CHANGE_NOW", Player)
- End If
- End If
- Exit For
- End If
- Next
- ElseIf Exists(d.targetVeh) OrElse Exists(d.targetSuperGuy) Then
- If Not bNoWanted Then
- For Each p As Ped In World.GetPeds(d.dart.Position, 6.0)
- If p.PedType = PedType.Cop Then
- Native.Function.Call("SET_MAX_WANTED_LEVEL", 6)
- Native.Function.Call("ALTER_WANTED_LEVEL_NO_DROP", Player, 2)
- Native.Function.Call("APPLY_WANTED_LEVEL_CHANGE_NOW", Player)
- End If
- Next
- End If
- World.AddExplosion(d.dart.Position, ExplosionType.Rocket, 100)
- If Exists(d.targetSuperGuy) Then
- Dim bHitSG As Boolean = False
- For Each s As TSuperGuy In TSuperGuyList
- bHitSG = (s.p = d.targetSuperGuy) AndAlso (s.p.Position.DistanceTo(d.dart.Position) <= 5)
- If bHitSG Then
- s.explosionEffectTIme = 250
- Exit For
- End If
- Next
- If bHitSG Then
- d.targetSuperGuy.PreventRagdoll = False
- d.targetSuperGuy.ForceRagdoll(5000, False)
- d.targetSuperGuy.ApplyForce(d.initial_direction * 3, Vector3.WorldNorth)
- d.targetSuperGuy.Health -= (20 + (5 * TRandom.NextDouble()))
- End If
- End If
- End If
- d.target = Nothing
- d.targetVeh = Nothing
- d.targetSuperGuy = Nothing
- Native.Function.Call("SET_OBJECT_RECORDS_COLLISIONS", d.dart, True)
- d.dart.FreezePosition = False
- d.Hide()
- LaunchedDartsList.RemoveAt(c)
- Else
- d.timeOut += intervalFix()
- End If
- End If
- Else
- d.dart.Visible = False
- End If
- Next
- End Sub
- Private Sub checkKeys()
- 'bMoveFDown, bMoveBDown, bMoveLDown, bMoveRDown, bJumpDown, bAttackDown, bAimDown, bActionDown, bCrouchDown, bEnterCarDown, _
- 'bEscDown, bPhoneDown, bRadarZoomDown, bReloadDown, bSeekCoverDown, bSoundHornDown, bSprintDown As Boolean
- 'padState = Microsoft.Xna.Framework.Input.GamePad.GetState(Microsoft.Xna.Framework.PlayerIndex.One)
- 'padStateOld = Microsoft.Xna.Framework.Input.GamePad.GetState(Microsoft.Xna.Framework.PlayerIndex.One)
- bMoveFDown = Game.isGameKeyPressed(GameKey.MoveForward)
- bMoveBDown = Game.isGameKeyPressed(GameKey.MoveBackward)
- bMoveLDown = Game.isGameKeyPressed(GameKey.MoveLeft)
- bMoveRDown = Game.isGameKeyPressed(GameKey.MoveRight)
- bJumpDown = Game.isGameKeyPressed(GameKey.Jump)
- bAimDown = Game.isGameKeyPressed(GameKey.Aim) OrElse (controllerConnected() AndAlso controllerState.Triggers.Left)
- 'bAimDown = Game.isGameKeyPressed(GameKey.Aim) OrElse (XControl.IsConnected AndAlso XControl.GetState.Gamepad.LeftTrigger)
- bSprintDown = Game.isGameKeyPressed(GameKey.Sprint)
- bActionDown = Game.isGameKeyPressed(GameKey.Action)
- bAttackDown = Game.isGameKeyPressed(GameKey.Attack) OrElse (controllerConnected() AndAlso controllerState.Triggers.Right)
- 'bAttackDown = Game.isGameKeyPressed(GameKey.Attack) OrElse (XControl.IsConnected AndAlso XControl.GetState.Gamepad.RightTrigger)
- bSeekCoverDown = Game.isGameKeyPressed(GameKey.SeekCover)
- bCrouchDown = Game.isGameKeyPressed(GameKey.Crouch)
- bEnterCarDown = Game.isGameKeyPressed(GameKey.EnterCar)
- bEscDown = Game.isGameKeyPressed(GameKey.Esc)
- bPhoneDown = Game.isGameKeyPressed(GameKey.Phone)
- bRadarZoomDown = Game.isGameKeyPressed(GameKey.RadarZoom)
- bReloadDown = Game.isGameKeyPressed(GameKey.Reload)
- bSoundHornDown = Game.isGameKeyPressed(GameKey.SoundHorn)
- bSoundHornDown = Game.isGameKeyPressed(GameKey.SoundHorn)
- End Sub
- Shared Function intervalFix()
- Return myInterval * (25 / Game.FPS)
- End Function
- Private Sub console_CMD(ByVal sender As Object, ByVal e As ConsoleEventArgs) Handles MyBase.ConsoleCommand
- End Sub
- Private Function rotateVec(ByVal vec As GTA.Vector3, ByVal angle As Double)
- angle = angle * (3.1415 / 180)
- Dim s As Double = System.Math.Sin(angle)
- Dim c As Double = System.Math.Cos(angle)
- vec.X = vec.X * c - vec.Y * s
- vec.Y = vec.X * s + vec.Y * c
- Return vec
- End Function
- Shared Function getGameSoundID(ByRef id As Int32) As Boolean
- Native.Function.Call("stop_sound", id)
- If id <> 0 Then
- Native.Function.Call("release_sound_id", id)
- End If
- id = Native.Function.Call(Of Int32)("get_sound_id")
- Return id > 0
- 'msg(id.ToString, 1000)
- End Function
- Private Sub taskResetSoundID(id As Int32)
- For Each s As TGameSounds In TGameSoundsList
- If s.id = id Then
- s.timeWait = 5000
- Exit For
- End If
- Next
- End Sub
- Shared Sub stopPTFX(ByRef PTFX As Int32)
- If PTFX <> 0 Then
- Native.Function.Call("stop_ptfx", PTFX)
- PTFX = 0
- End If
- End Sub
- ' draw the textures adapting the position, width and height to the user resolution
- Private Sub drawSpriteAux(ByVal e As GTA.GraphicsEventArgs, ByVal tex As Texture, ByVal x As Double, ByVal y As Double, ByVal w As Double, ByVal h As Double, _
- ByVal rot As Double, ByVal col As Drawing.Color, Optional ByVal square As Boolean = False)
- If square Then
- e.Graphics.DrawSprite(tex, x * width_Coef, y * height_Coef, w * width_Coef, h * width_Coef, rot, col)
- Else
- e.Graphics.DrawSprite(tex, x * width_Coef, y * height_Coef, w * width_Coef, w * height_Coef, rot, col)
- End If
- End Sub
- Private Sub drawSpriteAux2(ByVal e As GTA.GraphicsEventArgs, ByVal tex As Texture, ByVal x As Double, ByVal y As Double, ByVal w As Double, ByVal h As Double, _
- ByVal rot As Double, ByVal col As Drawing.Color, Optional ByVal square As Boolean = False)
- If square Then
- e.Graphics.DrawSprite(tex, x * height_Coef, y * height_Coef, w * height_Coef, w * height_Coef, rot, col)
- Else
- e.Graphics.DrawSprite(tex, x * height_Coef, y * height_Coef, w * height_Coef, h * height_Coef, rot, col)
- End If
- End Sub
- Private Sub drawLineAux(ByVal e As GTA.GraphicsEventArgs, ByVal xIni As Double, ByVal yIni As Double, ByVal xFin As Double, ByVal yFin As Double, _
- ByVal w As Double, ByVal col As Drawing.Color)
- e.Graphics.DrawLine(xIni * width_Coef, yIni * height_Coef, xFin * width_Coef, yFin * height_Coef, w * width_Coef, col)
- End Sub
- Private Sub drawTextAux(ByVal e As GTA.GraphicsEventArgs, ByVal text As String, ByVal x As Double, ByVal y As Double, ByVal col As Drawing.Color)
- e.Graphics.DrawText(text, x * width_Coef, y * height_Coef, col)
- End Sub
- Private Sub drawTextAuxEffect(ByVal e As GTA.GraphicsEventArgs, ByVal text As String, ByVal x As Double, ByVal y As Double, ByVal col As Drawing.Color)
- e.Graphics.DrawRectangle((x + 148) * width_Coef, (y + 11) * height_Coef, 400 * width_Coef, 29 * height_Coef, Color.FromArgb(100, 0, 0, 0))
- e.Graphics.DrawText(text, (x + 2) * width_Coef, (y + 2) * height_Coef, Color.Blue)
- e.Graphics.DrawText(text, x * width_Coef, y * height_Coef, col)
- End Sub
- Shared Sub drawTextAuxEffect2(ByVal e As GTA.GraphicsEventArgs, ByVal text As String, ByVal x As Double, ByVal y As Double, ByVal col As Drawing.Color)
- e.Graphics.DrawRectangle(840, (y + 11) * height_Coef, 1680 * width_Coef, 29 * height_Coef, Color.FromArgb(100, 0, 0, 0))
- e.Graphics.DrawText(text, (x + 2) * width_Coef, (y + 2) * height_Coef, Color.Blue)
- e.Graphics.DrawText(text, x * width_Coef, y * height_Coef, col)
- End Sub
- Private Sub drawSpriteNumber(ByVal e As GTA.GraphicsEventArgs, ByVal number As Double, ByVal x As Double, ByVal y As Double, ByVal rot As Double, _
- ByVal scale As Double, ByVal col As Color, disabledColor As Color)
- Dim int As Int64
- Dim unit, dozen, hundred, thousand As Int64
- Dim tColor As Color = col
- Dim hColor As Color = col
- Dim dColor As Color = col
- Dim uColor As Color = col
- int = Math.Truncate(number)
- unit = 0
- dozen = 0
- hundred = 0
- thousand = 0
- If int > 999 Then
- thousand = Math.Truncate(int / 1000)
- int -= thousand * 1000
- Else
- tColor = disabledColor
- End If
- If int > 99 Then
- hundred = Math.Truncate(int / 100)
- int -= hundred * 100
- ElseIf thousand = 0 Then
- hColor = disabledColor
- End If
- If int > 9 Then
- dozen = Math.Truncate(int / 10)
- int -= dozen * 10
- ElseIf hundred + thousand = 0 Then
- dColor = disabledColor
- End If
- If int > 0 Then
- unit = int
- End If
- Dim rotCoef As Double = rot * 12 / 45
- If tColor <> disabledColor Then drawSpriteAux2(e, texNumbers(thousand).tex, x, y, 20 * scale, 20 * scale, Helper.DegreeToRadian(rot), tColor)
- If hColor <> disabledColor Then drawSpriteAux2(e, texNumbers(hundred).tex, x + 12, y + rotCoef, 20 * scale, 20 * scale, Helper.DegreeToRadian(rot), hColor)
- If dColor <> disabledColor Then drawSpriteAux2(e, texNumbers(dozen).tex, x + 24, y + rotCoef * 2, 20 * scale, 20 * scale, Helper.DegreeToRadian(rot), dColor)
- drawSpriteAux2(e, texNumbers(unit).tex, x + 36, y + rotCoef * 3, 20 * scale, 20 * scale, Helper.DegreeToRadian(rot), uColor)
- End Sub
- Private Sub drawFrameAux(ByVal e As GTA.GraphicsEventArgs, x As Double, y As Double, w As Double, h As Double, lw As Double, col As Color)
- drawLineAux(e, x - (w / 2), y - (h / 2), x + (w / 2), y - (h / 2), 2, Color.FromArgb(150, 255, 255, 255))
- drawLineAux(e, x - (w / 2), y + (h / 2), x + (w / 2), y + (h / 2), 2, Color.FromArgb(150, 255, 255, 255))
- drawLineAux(e, x - (w / 2), y - (h / 2), x - (w / 2), y + (h / 2), 2, Color.FromArgb(150, 255, 255, 255))
- drawLineAux(e, x + (w / 2), y - (h / 2), x + (w / 2), y + (h / 2), 2, Color.FromArgb(150, 255, 255, 255))
- End Sub
- Private Sub firstDraw(ByVal e As GTA.GraphicsEventArgs, tex As Texture)
- Try
- e.Graphics.DrawSprite(tex, 0, 0, 2, 2, 0)
- Catch
- End Try
- End Sub
- Private Sub GraphicsEventHandler(ByVal sender As Object, ByVal e As GTA.GraphicsEventArgs) Handles MyBase.PerFrameDrawing
- If bArmorON AndAlso bFirstDraw Then
- bFirstDraw = False
- firstDraw(e, texCannon)
- firstDraw(e, texChestRep)
- firstDraw(e, texCrossHair)
- firstDraw(e, texDarts)
- firstDraw(e, texHandRep)
- firstDraw(e, texHUD)
- firstDraw(e, texHUD_ThrusterBar)
- firstDraw(e, texHUDBottom)
- firstDraw(e, texHUDBottonIcon1)
- firstDraw(e, texHUDBottonIcon1_2)
- firstDraw(e, texHUDBottonIcon2)
- firstDraw(e, texHUDBottonIcon2_2)
- firstDraw(e, texHUDBottonIcon3)
- firstDraw(e, texHUDBottonIcon3_2)
- firstDraw(e, texHUDBottonIcon3_3)
- firstDraw(e, texHUDBottonIcon3_4)
- firstDraw(e, texHUDBottonIcon4)
- firstDraw(e, texHUDBottonIcon4_2)
- firstDraw(e, texHUDBottonIcon5)
- firstDraw(e, texHUDBottonIcon5_2)
- firstDraw(e, texHUDHearthIndicator)
- firstDraw(e, texHUDLeft)
- firstDraw(e, texHUDLEFT_FlightMode)
- firstDraw(e, texHUDLEFT_MissileAlarm)
- firstDraw(e, texHUDRight)
- firstDraw(e, texHUDRIGHT_Damage)
- firstDraw(e, texHUDRight_FlightMode)
- firstDraw(e, texHudRing)
- firstDraw(e, texHUDTop)
- firstDraw(e, texRockets)
- For Each t As TTexNumber In texNumbers
- firstDraw(e, t.tex)
- Next
- For Each a As TArmor In TArmorList
- If a.drawTexture Then drawSpriteAux2(e, a.texMenu, 0, 0, 2, 2, 0, Color.White, True)
- Next
- End If
- If bArmorON AndAlso Not bDrawTextures AndAlso bAimDown AndAlso (Player.Character.Health > 0) Then
- drawLineAux(e, 825, 524, 855, 524, 2, Color.FromArgb(100, 150, 200, 255))
- drawLineAux(e, 825, 525, 855, 525, 2, Color.FromArgb(100, 0, 0, 200))
- drawLineAux(e, 839, 517, 839, 533, 2, Color.FromArgb(100, 150, 200, 255))
- drawLineAux(e, 840, 517, 840, 533, 2, Color.FromArgb(100, 0, 0, 200))
- drawLineAux(e, 837, 525, 843, 525, 2, Color.FromArgb(100, 255, 0, 0))
- End If
- If bArmorON AndAlso bDrawTextures AndAlso (Player.Character.Health > 0) Then
- ' For Each s As TSuperGuy In TSuperGuyList
- ' If Not Exists(s.p) Then Continue For
- ' If s.enemy Then
- ' drawSpriteNumber(e, s.p.Health, 20, 50 + 25 * TSuperGuyList.IndexOf(s), 0, 1, Color.Red, Color.FromArgb(255, 255, 150, 150))
- ' Else
- ' drawSpriteNumber(e, s.p.Health, 20, 50 + 25 * TSuperGuyList.IndexOf(s), 0, 1, Color.White, Color.LightGray)
- ' End If
- ' Next
- If HUDIndex <> 4 Then
- Dim statusColor As Color = Color.White
- Dim statusColorHelthBar As Color = Color.White
- If damageTime < 255 Then
- damageTime += 10
- If damageTime > 255 Then damageTime = 255
- statusColor = Color.FromArgb(255, 255, damageTime, damageTime)
- statusColorHelthBar = Color.FromArgb(255, 255, damageTime, damageTime)
- End If
- e.Graphics.DrawSprite(texHUDLeft, 120 * width_Coef, 520 * height_Coef, 300 * height_Coef, 1060 * height_Coef, 0, statusColor)
- If (HUDIndex = 2) OrElse (HUDIndex = 3) Then
- If flying Then e.Graphics.DrawSprite(texHUDLEFT_FlightMode, 150 * width_Coef, 520 * height_Coef, 400 * height_Coef, 1060 * height_Coef, 0, statusColor)
- If bMissileAlarm Then e.Graphics.DrawSprite(texHUDLEFT_MissileAlarm, 150 * width_Coef, 520 * height_Coef, 500 * height_Coef, 1060 * height_Coef, 0, statusColor)
- bMissileAlarm = False
- End If
- If HUDIndex = 1 Then
- e.Graphics.DrawSprite(texHUDRight, 1550 * width_Coef, 520 * height_Coef, 400 * height_Coef, 1060 * height_Coef, 0, statusColor)
- ElseIf HUDIndex = 2 Then
- e.Graphics.DrawSprite(texHUDRight, 1550 * width_Coef, 570 * height_Coef, 400 * height_Coef, 1060 * height_Coef, 0, statusColor)
- If (Player.Character.Health < 500) Then
- If bDrawDamageIndicator Then e.Graphics.DrawSprite(texHUDRIGHT_Damage, 1550 * width_Coef, 570 * height_Coef, 400 * height_Coef, 1060 * height_Coef, 0, statusColor)
- bDrawDamageIndicator = Not bDrawDamageIndicator
- End If
- ElseIf HUDIndex = 3 Then
- e.Graphics.DrawSprite(texHUDRight, 1300 * width_Coef, 800 * height_Coef, 800 * height_Coef, 1000 * height_Coef, 0, statusColor)
- If (Player.Character.Health < 500) Then
- If bDrawDamageIndicator Then e.Graphics.DrawSprite(texHUDRIGHT_Damage, 1301 * width_Coef, 800 * height_Coef, 810 * height_Coef, 1010 * height_Coef, 0, statusColor)
- bDrawDamageIndicator = Not bDrawDamageIndicator
- End If
- End If
- e.Graphics.DrawSprite(texHUDTop, 840 * width_Coef, 70 * height_Coef, 1680 * height_Coef, 100 * height_Coef, 0, statusColor)
- '*** bottom area start ***
- If HUDIndex = 1 Then
- e.Graphics.DrawSprite(texHUDBottom, 960 * width_Coef, 970 * height_Coef, 1400 * height_Coef, 100 * height_Coef, 0, statusColor)
- Else
- If Not bAimDown Then
- e.Graphics.DrawSprite(texHUDBottonIcon1, 960 * width_Coef, 970 * height_Coef, 1300 * height_Coef, 130 * height_Coef, 0, statusColor)
- Else
- e.Graphics.DrawSprite(texHUDBottonIcon1_2, 960 * width_Coef, 970 * height_Coef, 1300 * height_Coef, 130 * height_Coef, 0, statusColor)
- End If
- If bAnTargetLocked Then
- e.Graphics.DrawSprite(texHUDBottonIcon2_2, 960 * width_Coef, 970 * height_Coef, 1400 * height_Coef, 130 * height_Coef, 0, statusColor)
- Else
- e.Graphics.DrawSprite(texHUDBottonIcon2, 960 * width_Coef, 970 * height_Coef, 1400 * height_Coef, 130 * height_Coef, 0, statusColor)
- End If
- If Not flying Then
- e.Graphics.DrawSprite(texHUDBottonIcon3, 960 * width_Coef, 970 * height_Coef, 1400 * height_Coef, 130 * height_Coef, 0, statusColor)
- Else
- If myRealSpeed <= speedSlow Then
- e.Graphics.DrawSprite(texHUDBottonIcon3_2, 960 * width_Coef, 970 * height_Coef, 1400 * height_Coef, 130 * height_Coef, 0, statusColor)
- ElseIf mySpeed < speedFast Then
- e.Graphics.DrawSprite(texHUDBottonIcon3_3, 960 * width_Coef, 970 * height_Coef, 1400 * height_Coef, 130 * height_Coef, 0, statusColor)
- Else
- e.Graphics.DrawSprite(texHUDBottonIcon3_4, 960 * width_Coef, 970 * height_Coef, 1400 * height_Coef, 130 * height_Coef, 0, statusColor)
- End If
- If HUDIndex = 3 Then
- e.Graphics.DrawSprite(texHUDRight_FlightMode, 1300 * width_Coef, 800 * height_Coef, 800 * height_Coef, 1000 * height_Coef, 0, statusColor)
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 115 * width_Coef, 485 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 115 * width_Coef, 545 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 115 * width_Coef, 605 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 115 * width_Coef, 665 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- If bSprintDown OrElse (myRealSpeed > speedSlow) Then
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 130 * width_Coef, 485 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 130 * width_Coef, 545 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 130 * width_Coef, 605 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 130 * width_Coef, 665 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- End If
- If (myRealSpeed > speedFast * 0.8) Then
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 145 * width_Coef, 485 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 145 * width_Coef, 545 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 145 * width_Coef, 605 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 145 * width_Coef, 665 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- End If
- If myRealSpeed >= speedFast Then
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 160 * width_Coef, 485 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 160 * width_Coef, 545 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 160 * width_Coef, 605 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 160 * width_Coef, 665 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- If myRealSpeed > speedFast * 2 Then
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 175 * width_Coef, 485 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 175 * width_Coef, 545 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 175 * width_Coef, 605 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- e.Graphics.DrawSprite(texHUD_ThrusterBar, 175 * width_Coef, 665 * height_Coef, 25 * height_Coef, 50 * height_Coef, 0, statusColor)
- End If
- End If
- End If
- End If
- If bShowMenu OrElse bShowArmorMenu OrElse bShowArmorOptionsMenu Then
- e.Graphics.DrawSprite(texHUDBottonIcon4_2, 960 * width_Coef, 970 * height_Coef, 1400 * height_Coef, 130 * height_Coef, 0, statusColor)
- Else
- e.Graphics.DrawSprite(texHUDBottonIcon4, 960 * width_Coef, 970 * height_Coef, 1400 * height_Coef, 130 * height_Coef, 0, statusColor)
- End If
- If bDrawDamageIndicator AndAlso (Player.Character.Health < 500) Then
- e.Graphics.DrawSprite(texHUDBottonIcon5_2, 960 * width_Coef, 970 * height_Coef, 1400 * height_Coef, 130 * height_Coef, 0, statusColor)
- Else
- e.Graphics.DrawSprite(texHUDBottonIcon5, 960 * width_Coef, 970 * height_Coef, 1400 * height_Coef, 130 * height_Coef, 0, statusColor)
- End If
- End If
- '*** bottom area end ***
- If bShowingWeaponSelector Then
- drawSpriteAux2(e, texWSelect, 1680 / 2, 1050 / 2, 300, 300, 0, statusColor)
- If gunMode = 0 Then drawSpriteAux2(e, texCannon, (1680 / 2), (1050 / 2) - 115, 80, 80, 0, statusColor) Else drawSpriteAux2(e, texCannon, (1680 / 2), (1050 / 2) - 115, 60, 60, 0, Color.FromArgb(255, 100, 100, 100))
- If gunMode = 1 Then drawSpriteAux2(e, texDarts, (1680 / 2) + 110, (1050 / 2) - 35, 80, 80, 0, statusColor) Else drawSpriteAux2(e, texDarts, (1680 / 2) + 110, (1050 / 2) - 35, 50, 50, 0, Color.FromArgb(255, 100, 100, 100))
- If gunMode = 2 Then drawSpriteAux2(e, texRockets, (1680 / 2) + 70, (1050 / 2) + 87, 70, 70, 0, statusColor, True) Else drawSpriteAux2(e, texRockets, (1680 / 2) + 70, (1050 / 2) + 87, 50, 50, 0, Color.FromArgb(255, 100, 100, 100))
- If gunMode = 3 Then drawSpriteAux2(e, texHandRep, (1680 / 2) - 65, (1050 / 2) + 87, 80, 80, 0, statusColor) Else drawSpriteAux2(e, texHandRep, (1680 / 2) - 65, (1050 / 2) + 87, 50, 50, 0, Color.FromArgb(255, 100, 100, 100))
- If gunMode = 4 Then drawSpriteAux2(e, texChestRep, (1680 / 2) - 110, (1050 / 2) - 30, 80, 80, 0, statusColor) Else drawSpriteAux2(e, texChestRep, (1680 / 2) - 110, (1050 / 2) - 30, 50, 50, 0, Color.FromArgb(255, 100, 100, 100))
- End If
- drawSpriteAux2(e, texHudRing, 200, 880, 334, 334, hudRotation, statusColor)
- hudRotation += 0.01 + (1 * myRealSpeed / 500)
- If hudRotation > 360 Then hudRotation = 0
- If Player.Character.Health < (35 * Player.Character.Health / 100) Then
- drawSpriteAux2(e, texHUD, 200, 864, 367, 325, 0, Color.Red)
- statusColorHelthBar = Color.Red
- Else
- drawSpriteAux2(e, texHUD, 200, 864, 367, 325, 0, statusColor)
- End If
- Dim tmpH As Int16 = (Player.Character.Health * 100 / 1000)
- If tmpH > 1 Then drawSpriteAux2(e, texBar, 139, 767, 10, 59, Helper.DegreeToRadian(-29), statusColorHelthBar)
- If tmpH > 5 Then drawSpriteAux2(e, texBar, 149, 762, 10, 58, Helper.DegreeToRadian(-23), statusColorHelthBar)
- If tmpH > 10 Then drawSpriteAux2(e, texBar, 161, 758, 10, 57, Helper.DegreeToRadian(-15), statusColorHelthBar)
- If tmpH > 15 Then drawSpriteAux2(e, texBar, 173, 756, 10, 56, Helper.DegreeToRadian(-10), statusColorHelthBar)
- If tmpH > 20 Then drawSpriteAux2(e, texBar, 185, 755, 10, 55, Helper.DegreeToRadian(-3), statusColorHelthBar)
- If tmpH > 25 Then drawSpriteAux2(e, texBar, 195, 755, 10, 54, Helper.DegreeToRadian(-1), statusColorHelthBar)
- If tmpH > 30 Then drawSpriteAux2(e, texBar, 206, 756, 10, 53, Helper.DegreeToRadian(3), statusColorHelthBar)
- If tmpH > 35 Then drawSpriteAux2(e, texBar, 217, 758, 10, 52, Helper.DegreeToRadian(7), statusColorHelthBar)
- If tmpH > 40 Then drawSpriteAux2(e, texBar, 228, 760, 10, 51, Helper.DegreeToRadian(13), statusColorHelthBar)
- If tmpH > 45 Then drawSpriteAux2(e, texBar, 238, 764, 10, 50, Helper.DegreeToRadian(16), statusColorHelthBar)
- If tmpH > 50 Then drawSpriteAux2(e, texBar, 248, 768, 10, 49, Helper.DegreeToRadian(21), statusColorHelthBar)
- If tmpH > 55 Then drawSpriteAux2(e, texBar, 258, 773, 10, 48, Helper.DegreeToRadian(27), statusColorHelthBar)
- If tmpH > 60 Then drawSpriteAux2(e, texBar, 268, 779, 10, 47, Helper.DegreeToRadian(33), statusColorHelthBar)
- If tmpH > 65 Then drawSpriteAux2(e, texBar, 277, 786, 10, 46, Helper.DegreeToRadian(39), statusColorHelthBar)
- If tmpH > 70 Then drawSpriteAux2(e, texBar, 285, 793, 10, 45, Helper.DegreeToRadian(42), statusColorHelthBar)
- If tmpH > 75 Then drawSpriteAux2(e, texBar, 293, 801, 10, 44, Helper.DegreeToRadian(47), statusColorHelthBar)
- If tmpH > 80 Then drawSpriteAux2(e, texBar, 300, 810, 10, 43, Helper.DegreeToRadian(53), statusColorHelthBar)
- If tmpH > 85 Then drawSpriteAux2(e, texBar, 305, 820, 10, 42, Helper.DegreeToRadian(58), statusColorHelthBar)
- If tmpH > 90 Then drawSpriteAux2(e, texBar, 310, 829, 10, 41, Helper.DegreeToRadian(62), statusColorHelthBar)
- If tmpH > 95 Then drawSpriteAux2(e, texBar, 315, 839, 10, 40, Helper.DegreeToRadian(66), statusColorHelthBar)
- drawSpriteNumber(e, Player.Character.Health, 205, 715, 8, 1, statusColorHelthBar, Color.LightGray)
- 'For c As Int16 = 1 To Player.Character.Health / 1.1 Step 3
- ' drawSpriteAux2(e, texBar, 172, 897, 20, 341, Helper.DegreeToRadian(c - 25), statusColor)
- 'Next
- ' weapon indicator
- Dim wHeat As Int16
- Dim wBarColor As Color = statusColor
- If gunMode = 0 Then
- wHeat = Math.Round(weaponHeat0)
- If weaponHeat0 + 16 > 100 Then wBarColor = Color.Red
- End If
- If gunMode = 1 Then
- wHeat = Math.Round(weaponHeat1)
- If weaponHeat1 + 20 > 100 Then wBarColor = Color.Red
- End If
- If gunMode = 2 Then
- wHeat = Math.Round(weaponHeat2)
- If weaponHeat2 + 10 > 100 Then wBarColor = Color.Red
- End If
- If gunMode = 3 Then
- wHeat = Math.Round(weaponHeat3)
- If weaponHeat3 + 40 > 100 Then wBarColor = Color.Red
- End If
- If gunMode = 4 Then
- wHeat = Math.Round(weaponHeat4)
- If weaponHeat4 + 55 > 100 Then wBarColor = Color.Red
- End If
- If bBlinkWeaponHeat Then
- If 100 - wHeat > 15 Then drawSpriteAux2(e, texBar, 60, 880, 10, 71, Helper.DegreeToRadian(-87), wBarColor)
- If 100 - wHeat > 28 Then drawSpriteAux2(e, texBar, 60, 891, 10, 72, Helper.DegreeToRadian(-92), wBarColor)
- If 100 - wHeat > 32 Then drawSpriteAux2(e, texBar, 60, 902, 10, 73, Helper.DegreeToRadian(-96), wBarColor)
- If 100 - wHeat > 46 Then drawSpriteAux2(e, texBar, 61, 912, 10, 73, Helper.DegreeToRadian(-100), wBarColor)
- If 100 - wHeat > 60 Then drawSpriteAux2(e, texBar, 63, 921, 10, 73, Helper.DegreeToRadian(-104), wBarColor)
- If 100 - wHeat > 74 Then drawSpriteAux2(e, texBar, 65, 930, 10, 73, Helper.DegreeToRadian(-109), wBarColor)
- If 100 - wHeat > 88 Then drawSpriteAux2(e, texBar, 68, 938, 10, 73, Helper.DegreeToRadian(-112), wBarColor)
- Else
- If 100 - wHeat > 15 Then drawSpriteAux2(e, texBar, 60, 880, 10, 71, Helper.DegreeToRadian(-87), Color.White)
- If 100 - wHeat > 28 Then drawSpriteAux2(e, texBar, 60, 891, 10, 72, Helper.DegreeToRadian(-92), Color.White)
- If 100 - wHeat > 32 Then drawSpriteAux2(e, texBar, 60, 902, 10, 73, Helper.DegreeToRadian(-96), Color.White)
- If 100 - wHeat > 46 Then drawSpriteAux2(e, texBar, 61, 912, 10, 73, Helper.DegreeToRadian(-100), Color.White)
- If 100 - wHeat > 60 Then drawSpriteAux2(e, texBar, 63, 921, 10, 73, Helper.DegreeToRadian(-104), Color.White)
- If 100 - wHeat > 74 Then drawSpriteAux2(e, texBar, 65, 930, 10, 73, Helper.DegreeToRadian(-109), Color.White)
- If 100 - wHeat > 88 Then drawSpriteAux2(e, texBar, 68, 938, 10, 73, Helper.DegreeToRadian(-112), Color.White)
- End If
- bBlinkWeaponHeat = Not bBlinkWeaponHeat
- 'For c As Int16 = 1 To (100 - wHeat) / 3 Step 3
- ' drawSpriteAux2(e, texBar, 176, 890, 20, 345, Helper.DegreeToRadian(c - 115), statusColor)
- 'Next
- ' weapon icon
- If gunMode = 0 Then
- drawSpriteAux2(e, texCannon, 65, 837, 70, 70, 0, statusColor)
- ElseIf gunMode = 1 Then
- drawSpriteAux2(e, texDarts, 65, 837, 60, 60, 0, statusColor)
- ElseIf gunMode = 2 Then
- drawSpriteAux2(e, texRockets, 65, 837, 60, 60, 0, statusColor)
- ElseIf gunMode = 3 Then
- drawSpriteAux2(e, texHandRep, 65, 837, 90, 90, 0, statusColor)
- ElseIf gunMode = 4 Then
- drawSpriteAux2(e, texChestRep, 65, 837, 80, 80, 0, statusColor, True)
- End If
- Try
- If Player.Character.Position.Z < 10 Then
- drawSpriteNumber(e, Player.Character.Position.Z.ToString, 295, 930, 10, 1, statusColor, Color.LightGray)
- ElseIf Player.Character.Position.Z < 100 Then
- drawSpriteNumber(e, Player.Character.Position.Z.ToString, 300, 932, 10, 1, statusColor, Color.LightGray)
- ElseIf Player.Character.Position.Z < 1000 Then
- drawSpriteNumber(e, Player.Character.Position.Z.ToString, 305, 935, 10, 1, statusColor, Color.LightGray)
- Else
- drawSpriteNumber(e, Player.Character.Position.Z.ToString, 310, 937, 10, 1, statusColor, Color.LightGray)
- End If
- Catch
- End Try
- If myRealSpeed < 10 Then
- drawSpriteNumber(e, myRealSpeed, 277, 962, 25, 1, statusColor, Color.LightGray)
- ElseIf myRealSpeed < 100 Then
- drawSpriteNumber(e, myRealSpeed, 285, 965, 25, 1, statusColor, Color.LightGray)
- Else
- drawSpriteNumber(e, myRealSpeed, 289, 968, 25, 1, statusColor, Color.LightGray)
- End If
- 'For Each l As tline In tlineList
- 'drawSpriteAux(e, texBar, l.x, l.y, 10, l.h, Helper.DegreeToRadian(l.r), statusColor)
- 'Next
- 'drawSpriteAux(e, texBar, offx, offy, 10, offH, Helper.DegreeToRadian(offR), statusColor)
- 'drawTextAux(e, offx.ToString & " " & offy.ToString & " " & offR.ToString & " ", 10, 500, statusColor)
- End If
- If bAimDown Then drawSpriteAux(e, texCrossHair, 840, 525, 75, 75, 0, Color.White, True)
- End If
- Dim YOffset As Int16 = 0
- If bShowMenu Then
- If timeWaitLoad > 0 Then
- 'drawTextAuxEffect(e, "Loading Iron Man IV files, please wait...", 50, 70, Color.White)
- e.Graphics.DrawText("Loading Iron Man IV files, please wait...", 30, 30, Color.White)
- Exit Sub
- Else
- e.Graphics.DrawRectangle((178) * width_Coef, ((61 + 30 * menuIndex)) * height_Coef, 400 * width_Coef, 29 * height_Coef, Color.FromArgb(200, 0, 200, 255))
- drawTextAuxEffect(e, "Armors", 30, 50, Color.LightBlue)
- If Not bGodMode Then drawTextAuxEffect(e, "Invincible Iron Man: Off", 30, 80, Color.LightBlue) Else drawTextAuxEffect(e, "Invincible Iron Man: On", 30, 80, Color.LightBlue)
- If Not bNoWanted Then drawTextAuxEffect(e, "Never wanted mode: Off", 30, 110, Color.LightBlue) Else drawTextAuxEffect(e, "Never wanted mode: On", 30, 110, Color.LightBlue)
- drawTextAuxEffect(e, "Spawn ally", 30, 140, Color.LightBlue)
- drawTextAuxEffect(e, "Spawn enemy", 30, 170, Color.LightBlue)
- drawTextAuxEffect(e, "Actual HUD: " + HUDName, 30, 200, Color.LightBlue)
- drawTextAuxEffect(e, "Flight collision: " + (Not bNoFlightCollisionDetection).ToString, 30, 230, Color.LightBlue)
- drawTextAuxEffect(e, "J.A.R.V.I.S. volume: " + Math.Round(jarvisVolume, 1).ToString, 30, 260, Color.LightBlue)
- drawTextAuxEffect(e, "Current armor config", 30, 290, Color.LightBlue)
- drawTextAuxEffect(e, "Close", 30, 320, Color.LightBlue)
- 'drawLineAux(e, 30, 74 + 30 * menuIndex, 300, 75 + 30 * menuIndex, 3, Color.Blue)
- 'drawLineAux(e, 30, 72 + 30 * menuIndex, 300, 72 + 30 * menuIndex, 3, Color.LightBlue)
- YOffset = 320
- End If
- ElseIf bShowArmorMenu Then
- If (Player.Character.Health <= 0) Then
- bShowArmorMenu = False
- Exit Sub
- End If
- Dim tmpStart As Int16 = armorMenuIndex - 15
- If tmpStart < 0 Then tmpStart = 0
- For c As Int16 = tmpStart To tmpStart + 15
- If (c < TArmorList.Count) Then
- If c = armorMenuIndex Then
- 'drawLineAux(e, 30, 64 + YOffset, 270, 64 + YOffset, 3, Color.Blue)
- 'drawLineAux(e, 30, 62 + YOffset, 270, 62 + YOffset, 3, Color.LightBlue)
- e.Graphics.DrawRectangle((178) * width_Coef, (51 + YOffset) * height_Coef, 400 * width_Coef, 29 * height_Coef, Color.FromArgb(200, 0, 200, 255))
- If TArmorList(c).drawTexture Then drawSpriteAux2(e, TArmorList(c).texMenu, 600, 262 + YOffset, 400, 400, 0, Color.White, True)
- End If
- drawTextAuxEffect(e, TArmorList(c).name, 30, 40 + YOffset, Color.LightBlue)
- End If
- YOffset += 30
- Next
- If armorMenuIndex = TArmorList.Count Then
- drawLineAux(e, 30, 62 + YOffset, 270, 64 + YOffset, 3, Color.Blue)
- drawLineAux(e, 30, 62 + YOffset, 270, 62 + YOffset, 3, Color.LightBlue)
- End If
- ElseIf bShowArmorOptionsMenu Then
- If bArmorON AndAlso Exists(playerArmor) Then
- If armorOptionsMenuIndex < 12 Then
- If armorOptionsMenuIndex < 6 Then
- 'drawLineAux(e, 30, 70 + 30 * armorOptionsMenuIndex, 300, 70 + 30 * armorOptionsMenuIndex, 3, Color.Blue)
- 'drawLineAux(e, 30, 68 + 30 * armorOptionsMenuIndex, 300, 68 + 30 * armorOptionsMenuIndex, 3, Color.LightBlue)
- e.Graphics.DrawRectangle((178) * width_Coef, (51 + 30 * armorOptionsMenuIndex) * height_Coef, 400 * width_Coef, 29 * height_Coef, Color.FromArgb(200, 0, 200, 255))
- Else
- 'drawLineAux(e, 30, 94 + 30 * armorOptionsMenuIndex, 300, 94 + 30 * armorOptionsMenuIndex, 3, Color.Blue)
- 'drawLineAux(e, 30, 92 + 30 * armorOptionsMenuIndex, 300, 92 + 30 * armorOptionsMenuIndex, 3, Color.LightBlue)
- e.Graphics.DrawRectangle((178) * width_Coef, (81 + 30 * armorOptionsMenuIndex) * height_Coef, 400 * width_Coef, 29 * height_Coef, Color.FromArgb(200, 0, 200, 255))
- End If
- End If
- drawTextAuxEffect(e, "Hand cannon: " & playerArmor.handCannon.ToString, 30, 40 + YOffset, Color.LightBlue)
- YOffset += 30
- drawTextAuxEffect(e, "Shoulder cannon: " & playerArmor.shoulderCannon.ToString, 30, 40 + YOffset, Color.LightBlue)
- YOffset += 30
- drawTextAuxEffect(e, "Super cannon: " & playerArmor.superCannon.ToString, 30, 40 + YOffset, Color.LightBlue)
- YOffset += 30
- drawTextAuxEffect(e, "Hand thrusters: " & playerArmor.bHandThrusters.ToString, 30, 40 + YOffset, Color.LightBlue)
- YOffset += 30
- drawTextAuxEffect(e, "Foot thrusters: " & playerArmor.bFootThrusters.ToString, 30, 40 + YOffset, Color.LightBlue)
- YOffset += 30
- drawTextAuxEffect(e, "Back thrusters: " & playerArmor.bBackThrusters.ToString, 30, 40 + YOffset, Color.LightBlue)
- YOffset += 30
- drawTextAuxEffect(e, " Back thrusters config:", 30, 40 + YOffset, Color.LightBlue)
- YOffset += 30
- drawTextAuxEffect(e, " X offset: " & playerArmor.back_rep_x_off.ToString, 30, 40 + YOffset, Color.LightBlue)
- YOffset += 30
- drawTextAuxEffect(e, " Y offset: " & playerArmor.back_rep_y_off.ToString, 30, 40 + YOffset, Color.LightBlue)
- YOffset += 30
- drawTextAuxEffect(e, " Z offset: " & playerArmor.back_rep_z_off.ToString, 30, 40 + YOffset, Color.LightBlue)
- YOffset += 30
- drawTextAuxEffect(e, " X rot.: " & playerArmor.back_rep_x_rot_off.ToString, 30, 40 + YOffset, Color.LightBlue)
- YOffset += 30
- drawTextAuxEffect(e, " Y rot.: " & playerArmor.back_rep_y_rot_off.ToString, 30, 40 + YOffset, Color.LightBlue)
- YOffset += 30
- drawTextAuxEffect(e, " Z rot.: " & playerArmor.back_rep_z_rot_off.ToString, 30, 40 + YOffset, Color.LightBlue)
- YOffset += 40
- If armorOptionsMenuIndex = 12 Then
- 'drawLineAux(e, 30, 68 + YOffset, 300, 68 + YOffset, 3, Color.Blue)
- 'drawLineAux(e, 30, 70 + YOffset, 300, 70 + YOffset, 3, Color.LightBlue)
- e.Graphics.DrawRectangle((178) * width_Coef, (51 + YOffset) * height_Coef, 400 * width_Coef, 29 * height_Coef, Color.FromArgb(200, 0, 200, 255))
- End If
- drawTextAuxEffect(e, "Done!", 30, 40 + YOffset, Color.LightBlue)
- Else
- drawTextAuxEffect(e, "Error reading player armor data", 30, 40 + YOffset, Color.LightBlue)
- End If
- End If
- If bShowMenu OrElse bShowArmorMenu OrElse bShowArmorOptionsMenu Then
- YOffset += 50
- drawTextAuxEffect(e, "Controls:", 30, 40 + YOffset, Color.LightBlue)
- YOffset += 30
- drawTextAuxEffect(e, " Left/Right - Select armor", 30, 40 + YOffset, Color.LightBlue)
- YOffset += 30
- drawTextAuxEffect(e, " Enter - Switch to selected item", 30, 40 + YOffset, Color.LightBlue)
- YOffset += 30
- drawTextAuxEffect(e, "XBox 360 Controls:", 30, 40 + YOffset, Color.LightBlue)
- YOffset += 30
- drawTextAuxEffect(e, " D-Pad Left/Right - Select armor", 30, 40 + YOffset, Color.LightBlue)
- YOffset += 30
- drawTextAuxEffect(e, " A - Switch to selected item", 30, 40 + YOffset, Color.LightBlue)
- End If
- If Exists(DisplayMessage) Then DisplayMessage.Tick(e)
- End Sub
- Public Sub loadArmors()
- If Not Directory.Exists(".\Scripts\Iron Man Files\Armors\") Then Directory.CreateDirectory(".\Scripts\Iron Man Files\Armors\")
- Dim dirInfo As New IO.DirectoryInfo(".\Scripts\Iron Man Files\Armors\")
- Dim fileList As IO.FileInfo() = dirInfo.GetFiles("armor_*.ini")
- Dim f As IO.FileInfo
- For Each f In fileList
- iniFile = f.FullName
- checkIniExists()
- tmpTArmor = New TArmor
- tmpTArmor.file_name = f.FullName
- tmpTArmor.name = Read_INI_String("name", "general", "")
- tmpTArmor.model = Read_INI_String("model", "general", "")
- tmpTArmor.anim_group = Read_INI_String("anim_group", "general", "move_player")
- tmpTArmor.removeHead = Read_INI_String("removeHead", "general", "0") = "1"
- tmpTArmor.removeHair = Read_INI_String("removeHair", "general", "0") = "1"
- tmpTArmor.component_0_Var = Int16.Parse(Read_INI_String("component_0_Var", "general", "0"))
- tmpTArmor.component_1_Var = Int16.Parse(Read_INI_String("component_1_Var", "general", "15"))
- tmpTArmor.component_2_Var = Int16.Parse(Read_INI_String("component_2_Var", "general", "7"))
- tmpTArmor.component_3_Var = Int16.Parse(Read_INI_String("component_3_Var", "general", "0"))
- tmpTArmor.component_4_Var = Int16.Parse(Read_INI_String("component_4_Var", "general", "1"))
- tmpTArmor.component_5_Var = Int16.Parse(Read_INI_String("component_5_Var", "general", "5"))
- tmpTArmor.component_6_Var = Int16.Parse(Read_INI_String("component_6_Var", "general", "0"))
- tmpTArmor.component_7_Var = Int16.Parse(Read_INI_String("component_7_Var", "general", "0"))
- tmpTArmor.component_8_Var = Int16.Parse(Read_INI_String("component_8_Var", "general", "1"))
- tmpTArmor.component_9_Var = Int16.Parse(Read_INI_String("component_9_Var", "general", "0"))
- tmpTArmor.enemy = Read_INI_String("enemy", "general", "1") = "1"
- tmpTArmor.ally = Read_INI_String("ally", "general", "1") = "1"
- tmpTArmor.weaponSet = Read_INI_String("weaponSet", "general", "0")
- tmpTArmor.img_preview = Read_INI_String("img_preview", "general", "")
- tmpTArmor.drawTexture = File.Exists(".\Scripts\Iron Man Files\Armors\" & tmpTArmor.img_preview)
- tmpTArmor.AIM_Robot = Read_INI_String("AIM_Robot", "general", "0") = "1"
- tmpTArmor.superCannon = Read_INI_String("superCannon", "general", "0") = "1"
- 'hand cannon
- tmpTArmor.handCannon = Read_INI_String("handCannon", "Guns", "1") = "1"
- tmpTArmor.cannonHandOffset.X = Double.Parse(Read_INI_String("cannonHandOffset_x", "Guns", "0"))
- tmpTArmor.cannonHandOffset.Y = Double.Parse(Read_INI_String("cannonHandOffset_y", "Guns", "0"))
- tmpTArmor.cannonHandOffset.Z = Double.Parse(Read_INI_String("cannonHandOffset_z", "Guns", "0"))
- tmpTArmor.handCannon_ShootInterval = Double.Parse(Read_INI_String("handCannon_ShootInterval", "Guns", "20"))
- tmpTArmor.handCannon_Damage = Int16.Parse(Read_INI_String("handCannon_Damage", "Guns", "100"))
- 'shoulder cannon - warmachine
- tmpTArmor.shoulderCannon = Read_INI_String("shoulderCannon", "Guns", "0") = "1"
- tmpTArmor.cannonShoulderOffset.X = Double.Parse(Read_INI_String("cannonShoulderOffset_x", "Guns", "-0.15"))
- tmpTArmor.cannonShoulderOffset.Y = Double.Parse(Read_INI_String("cannonShoulderOffset_y", "Guns", "0.5"))
- tmpTArmor.cannonShoulderOffset.Z = Double.Parse(Read_INI_String("cannonShoulderOffset_z", "Guns", "0.85"))
- tmpTArmor.shoulderCannon_ShootInterval = Double.Parse(Read_INI_String("shoulderCannon_ShootInterval", "Guns", "10"))
- tmpTArmor.shoulderCannon_Damage = Int16.Parse(Read_INI_String("shoulderCannon_Damage", "Guns", "100"))
- 'super cannon - hammer drone
- tmpTArmor.superCannon = Read_INI_String("superCannon", "Guns", "0") = "1"
- tmpTArmor.superCannonShoulderOffset.X = Double.Parse(Read_INI_String("superCannonShoulderOffset_x", "Guns", "0.1"))
- tmpTArmor.superCannonShoulderOffset.Y = Double.Parse(Read_INI_String("superCannonShoulderOffset_y", "Guns", "0.7"))
- tmpTArmor.superCannonShoulderOffset.Z = Double.Parse(Read_INI_String("superCannonShoulderOffset_z", "Guns", "-0.3"))
- tmpTArmor.superCannon_ShootInterval = Double.Parse(Read_INI_String("superCannon_ShootInterval", "Guns", "100"))
- tmpTArmor.superCannon_Power = Int16.Parse(Read_INI_String("superCannon_Power", "Guns", "100"))
- 'thrusters config
- tmpTArmor.bHandThrusters = Read_INI_String("bHandThrusters", "Thrusters", "1") = "1"
- tmpTArmor.bFootThrusters = Read_INI_String("bFootThrusters", "Thrusters", "1") = "1"
- tmpTArmor.bBackThrusters = Read_INI_String("bBackThrusters", "Thrusters", "0") = "1"
- tmpTArmor.back_rep_x_off = Double.Parse(Read_INI_String("back_rep_x_off", "Thrusters", "0.15"))
- tmpTArmor.back_rep_y_off = Double.Parse(Read_INI_String("back_rep_y_off", "Thrusters", "-0.2"))
- tmpTArmor.back_rep_z_off = Double.Parse(Read_INI_String("back_rep_z_off", "Thrusters", "-0.16"))
- tmpTArmor.back_rep_x_rot_off = Double.Parse(Read_INI_String("back_rep_x_rot_off", "Thrusters", "0"))
- tmpTArmor.back_rep_y_rot_off = Double.Parse(Read_INI_String("back_rep_y_rot_off", "Thrusters", "0"))
- tmpTArmor.back_rep_z_rot_off = Double.Parse(Read_INI_String("back_rep_z_rot_off", "Thrusters", "192.0"))
- Try
- If tmpTArmor.drawTexture Then tmpTArmor.texMenu = New Texture(File.ReadAllBytes(".\Scripts\Iron Man Files\Armors\" & tmpTArmor.img_preview))
- Catch
- End Try
- If Not tmpTArmor.AIM_Robot Then _
- TArmorList.Add(tmpTArmor)
- TEnemyAllyArmorList.Add(tmpTArmor)
- Next
- If TArmorList.Count = 0 Then
- iniFile = ".\Scripts\Iron Man Files\Armors\armor_1.ini"
- checkIniExists()
- WriteINI("name", "general", "MK III")
- WriteINI("model", "general", "player")
- WriteINI("removeHead", "general", "1")
- WriteINI("removeHair", "general", "1")
- WriteINI("component_0_Var", "general", "0")
- WriteINI("component_1_Var", "general", "15")
- WriteINI("component_2_Var", "general", "7")
- WriteINI("component_3_Var", "general", "0")
- WriteINI("component_4_Var", "general", "1")
- WriteINI("component_5_Var", "general", "5")
- WriteINI("component_6_Var", "general", "0")
- WriteINI("component_7_Var", "general", "0")
- WriteINI("component_8_Var", "general", "1")
- WriteINI("component_9_Var", "general", "0")
- WriteINI("enemy", "general", "0")
- WriteINI("ally", "general", "0")
- WriteINI("weaponSet", "general", "0")
- WriteINI("img_preview", "general", "")
- WriteINI("AIM_Robot", "general", "0")
- playerArmor = New TArmor
- playerArmor.name = ReadINI("name", "general", "")
- playerArmor.model = ReadINI("model", "general", "player")
- playerArmor.removeHead = ReadINI("removeHead", "general", "0") = "1"
- playerArmor.removeHair = ReadINI("removeHair", "general", "1") = "1"
- playerArmor.component_0_Var = Int16.Parse(ReadINI("component_0_Var", "general", "0"))
- playerArmor.component_1_Var = Int16.Parse(ReadINI("component_1_Var", "general", "0"))
- playerArmor.component_2_Var = Int16.Parse(ReadINI("component_2_Var", "general", "0"))
- playerArmor.component_3_Var = Int16.Parse(ReadINI("component_3_Var", "general", "0"))
- playerArmor.component_4_Var = Int16.Parse(ReadINI("component_4_Var", "general", "0"))
- playerArmor.component_5_Var = Int16.Parse(ReadINI("component_5_Var", "general", "0"))
- playerArmor.component_6_Var = Int16.Parse(ReadINI("component_6_Var", "general", "0"))
- playerArmor.component_7_Var = Int16.Parse(ReadINI("component_7_Var", "general", "0"))
- playerArmor.component_8_Var = Int16.Parse(ReadINI("component_8_Var", "general", "0"))
- playerArmor.component_9_Var = Int16.Parse(ReadINI("component_9_Var", "general", "0"))
- playerArmor.enemy = ReadINI("enemy", "general", "1") = "1"
- playerArmor.ally = ReadINI("ally", "general", "0") = "1"
- playerArmor.weaponSet = ReadINI("weaponSet", "general", "0")
- playerArmor.img_preview = ReadINI("img_preview", "general", "mkiii.png")
- playerArmor.drawTexture = File.Exists(".\Scripts\Iron Man Files\Armors\" & playerArmor.img_preview)
- playerArmor.AIM_Robot = ReadINI("AIM_Robot", "general", "") = "1"
- Try
- If playerArmor.drawTexture Then playerArmor.texMenu = New Texture(File.ReadAllBytes(".\Scripts\Iron Man Files\Armors\" & playerArmor.img_preview))
- Catch
- End Try
- TArmorList.Add(playerArmor)
- End If
- tmpTArmor = New TArmor
- tmpTArmor.name = "No armor, no powers"
- TArmorList.Add(tmpTArmor)
- End Sub
- Private Sub saveArmorCFG(armor As TArmor)
- iniFile = armor.file_name
- If armor.handCannon Then WriteINI("handCannon", "Guns", "1") Else WriteINI("handCannon", "Guns", "0")
- If armor.shoulderCannon Then WriteINI("shoulderCannon", "Guns", "1") Else WriteINI("shoulderCannon", "Guns", "0")
- If armor.superCannon Then WriteINI("superCannon", "Guns", "1") Else WriteINI("superCannon", "Guns", "0")
- If armor.bHandThrusters Then WriteINI("bHandThrusters", "Thrusters", "1") Else WriteINI("bHandThrusters", "Thrusters", "0")
- If armor.bFootThrusters Then WriteINI("bFootThrusters", "Thrusters", "1") Else WriteINI("bFootThrusters", "Thrusters", "0")
- If armor.bBackThrusters Then WriteINI("bBackThrusters", "Thrusters", "1") Else WriteINI("bBackThrusters", "Thrusters", "0")
- WriteINI("back_rep_x_off", "Thrusters", armor.back_rep_x_off.ToString)
- WriteINI("back_rep_y_off", "Thrusters", armor.back_rep_y_off.ToString)
- WriteINI("back_rep_z_off", "Thrusters", armor.back_rep_z_off.ToString)
- WriteINI("back_rep_x_rot_off", "Thrusters", armor.back_rep_x_rot_off.ToString)
- WriteINI("back_rep_y_rot_off", "Thrusters", armor.back_rep_y_rot_off.ToString)
- WriteINI("back_rep_z_rot_off", "Thrusters", armor.back_rep_z_rot_off.ToString)
- End Sub
- Private Declare Auto Function GetPrivateProfileString Lib "Kernel32" _
- (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As StringBuilder, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
- Private Declare Auto Function WritePrivateProfileString Lib "Kernel32" _
- (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As Integer
- Private Function ReadINI(ByVal key_name As String, ByVal section_name As String, ByVal default_value As String) As String
- Const MAX_LENGTH As Integer = 500
- Dim string_builder As New StringBuilder(MAX_LENGTH)
- GetPrivateProfileString(section_name, key_name, default_value, string_builder, MAX_LENGTH, iniFile)
- Return string_builder.ToString()
- End Function
- Private Sub WriteINI(ByVal key_name As String, ByVal section_name As String, ByVal value As String)
- WritePrivateProfileString(section_name, key_name, value, iniFile)
- End Sub
- Private Sub checkIniExists()
- If Not File.Exists(iniFile) Then
- File.CreateText(iniFile).Dispose()
- Wait(100)
- End If
- End Sub
- Private Function Read_INI_String(opt As String, categoy As String, def As String) As String
- If ReadINI(opt, categoy, "") = "" Then WriteINI(opt, categoy, def)
- Return ReadINI(opt, categoy, def)
- End Function
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement