Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Definitions
- #define WORLD_OPEN 640
- #define PLAYER_ENTER 641
- #define PLAYER_RETURN 642
- #define PLAYER_RESPAWN 643
- #define MODE_CHECK 650
- #define SET_WEAPONID 800
- #define CALL_RECOV_RATIO 820
- #define RECOIL_GENERIC 840
- #define RECOIL_SSG 841
- #Define RECOIL_DSG 842
- #define MESSAGE_WEAPON 880
- #define PLAYER_MAX 64
- // Semi-Global Values
- int WeaponID[PLAYER_MAX];
- // Semi-Global Arrays
- int StoredWeaponMessages[8][4][5] =
- {
- {
- { "Millitary Knife", "", "", "", "", },
- { "Axe", "Sledgehammer", "", "", "", },
- { "Bonecrackah 'P-LAH' Chainsaw", "", "", "", "Macuahuitl", },
- { "", "", "", "", "", },
- },
- {
- { "Dual Shofield .45 Colts","SOP 308 Pistol", "", "", "", },
- { "HK-417 DMR", "", "", "", "", },
- { "'RAPTOR' Sniper Rifle", "", "", "", "Atlatl", },
- { "", "", "", "", "", },
- },
- {
- { "12-Gauge Shotgun", "", "", "", "", },
- { "Double-Barreled Coach Gun", "", "", "", "Seismic Projector",},
- { "AA-12 Shotgun", "Power Shotgun","", "", "", },
- { "", "", "", "", "", },
- },
- {
- { "M29 Assault Rifle", "", "", "", "", },
- { "M1-A2 Thompson SMG", "", "", "", "Vorpal Driver",},
- { "XM-214-A Minigun", "", "", "", "", },
- { "", "", "", "", "", },
- },
- {
- { "M79 Grenade launcher", "", "", "", "", },
- { "MkIII Grenade Launcher", "XPML21 Rocket Launcher", "", "", "", },
- { "C-4 Demolition Charge", "", "", "", "Phoenix Firebolt", },
- { "", "", "", "", "", },
- },
- {
- { "", "", "", "", "", },
- { "XOP Flamethrower", "", "", "", "", },
- { "", "", "", "", "Enxeiridion Epiktetou",},
- { "XIA-B6 Pyro Cannon", "", "", "", "", },
- },
- {
- { "", "", "", "", "", },
- { "XL2 Lasergun", "", "", "", "Aqua Shredder",},
- { "XAMPL-32 'Tiamat'", "", "", "", "", },
- { "XM-BFG 'Ghost Buster'", "", "", "", "", },
- },
- {
- { "", "", "", "", "", },
- { "", "", "", "", "", },
- { "AS-24 'Devastator'", "", "", "", "", },
- { "SBC Cannon", "", "", "", "Codex Deorum", },
- }
- };
- int RecoilRecoveryRatios[8][4][5] =
- {
- {
- { 1.0,1.0,1.0,1.0,1.0,}, //Slot 1
- { 1.0,1.0,1.0,1.0,1.0,},
- { 1.0,1.0,1.0,1.0,1.0,},
- { 1.0,1.0,1.0,1.0,1.0,},
- },
- {
- { 1.0,1.0,1.0,1.0,1.0,}, //Slot 2
- { 1.0,1.0,1.0,1.0,1.0,},
- { 1.0,1.0,1.0,1.0,1.0,},
- { 1.0,1.0,1.0,1.0,1.0,},
- },
- {
- { 1.0,1.0,1.0,1.0,1.0,}, //Slot 3
- { 0.8,1.0,1.0,1.0,1.0,},
- { 1.0,1.0,1.0,1.0,1.0,},
- { 1.0,1.0,1.0,1.0,1.0,},
- },
- {
- { 1.0,1.0,1.0,1.0,1.0,}, //Slot 4
- { 1.0,1.0,1.0,1.0,1.0,},
- { 1.0,1.0,1.0,1.0,1.0,},
- { 1.0,1.0,1.0,1.0,1.0,},
- },
- {
- { 1.0,1.0,1.0,1.0,1.0,}, //Slot 5
- { 1.0,1.0,1.0,1.0,1.0,},
- { 1.0,1.0,1.0,1.0,1.0,},
- { 1.0,1.0,1.0,1.0,1.0,},
- },
- {
- { 1.0,1.0,1.0,1.0,1.0,}, //Slot 6
- { 1.0,1.0,1.0,1.0,1.0,},
- { 1.0,1.0,1.0,1.0,1.0,},
- { 1.0,1.0,1.0,1.0,1.0,},
- },
- {
- { 1.0,1.0,1.0,1.0,1.0,}, //Slot 7
- { 1.0,1.0,1.0,1.0,1.0,},
- { 1.0,1.0,1.0,1.0,1.0,},
- { 1.0,1.0,1.0,1.0,1.0,},
- },
- {
- { 1.0,1.0,1.0,1.0,1.0,}, //Slot 8
- { 1.0,1.0,1.0,1.0,1.0,},
- { 1.0,1.0,1.0,1.0,1.0,},
- { 1.0,1.0,1.0,1.0,1.0,},
- }
- };
- script SET_WEAPONID (int x)
- {
- WeaponID[PlayerNumber()] = x;
- // Hudmessage(s:"PlayerID : ", i:WeaponID[PlayerNumber()];
- // HUDMSG_FADEOUT,1,CR_WHITE,0.5,0.9,1.0,1.0);
- }
- script CALL_RECOV_RATIO (void)
- {
- int SlotNumber = (WeaponID[PlayerNumber()] / 100) - 1;
- int TierNumber = ((WeaponID[PlayerNumber()] % 100) / 10) - 1;
- int VarNumber = (WeaponID[PlayerNumber()] % 10) - 1;
- SetResultValue(RecoilRecoveryRatios[SlotNumber][TierNumber][VarNumber]);
- }
- script RECOIL_GENERIC (int Amplitude, int TransLength, int DecayLength) clientside
- {
- int RecPitch = (Amplitude * 128) + Random(-64,64);
- int SubPitch = 0;
- int ModPitch = 0;
- int PTDivisor = RecPitch * 2 / (TransLength * (TransLength + 1));
- int PTMod = RecPitch * 2 % (TransLength * (TransLength + 1));
- int DecRecov = ACS_ExecuteWithResult(820);
- int DecPitch = (RecPitch * DecRecov) >> 16;
- int PRDivisor = DecPitch / (DecayLength * (DecayLength + 1));
- int PRMod = DecPitch % (DecayLength * (DecayLength + 1));
- // int ActualDecay = 0;
- // int ActualPitch = 0;
- for (int a = 0; a < TransLength; a++) // Recoil Transient
- {
- ModPitch += (PTMod * (TransLength - a));
- SubPitch = ModPitch / (TransLength * (TransLength + 1));
- ModPitch = ModPitch % (TransLength * (TransLength + 1));
- SetActorPitch(0, GetActorPitch(0) - (PTDivisor * (TransLength - a) + SubPitch));
- // ActualPitch += (PTDivisor * (TransLength - a) + SubPitch);
- SubPitch = 0;
- Delay(1);
- }
- Delay(1);
- for (int b = 0; b < DecayLength; b++) // Recovery.
- {
- ModPitch += (PRMod * (b + 1));
- SubPitch = ModPitch / (DecayLength * (DecayLength + 1));
- ModPitch = ModPitch % (DecayLength * (DecayLength + 1));
- SetActorPitch(0, GetActorPitch(0) + (PRDivisor * (b + 1) + SubPitch));
- // ActualDecay += (PRDivisor * (b + 1) + SubPitch);
- SubPitch = 0;
- Delay(1);
- }
- for (int c = 0; c < DecayLength; c++)
- {
- ModPitch += (PRMod * (DecayLength - c));
- SubPitch = ModPitch / (DecayLength * (DecayLength + 1));
- ModPitch = ModPitch % (DecayLength * (DecayLength + 1));
- SetActorPitch(0, GetActorPitch(0) + (PRDivisor * (DecayLength - c) + SubPitch));
- // ActualDecay += (PRDivisor * (DecayLength - c) + SubPitch);
- SubPitch = 0;
- Delay(1);
- }
- // Hudmessage(s:"Recoil : ", i:RecPitch, s:" (", i:ActualPitch, s:") , Decay : ", i:DecPitch, s:" (", i:ActualDecay, s:")";
- // HUDMSG_FADEOUT,1,CR_WHITE,0.5,0.9,1.0,1.0);
- }
- script RECOIL_SSG (void) clientside // Single Shotgun Recoil
- {
- int f = Random(0,512);
- int g = Random(0,512);
- int h = Random(0,512);
- int i = Random(-72,72);
- int j = Random(-72,72);
- int k = Random(-72,72);
- int RecPitch = f + g + h;
- int RecSway = i + j + k;
- int SubPitch = 0;
- int SubSway = 0;
- int ModPitch = 0;
- int ModSway = 0;
- int PTDivisor = RecPitch / 6;
- int STDivisor = RecSway / 6;
- int PTMod = RecPitch % 6;
- int STMod = RecSway % 6;
- int PRDivisor = RecPitch / 72;
- int SRDivisor = RecSway / 72;
- int PRMod = RecPitch % 72;
- int SRMod = RecSway % 72;
- Radius_Quake(3,4,0,2,0);
- for (int m = 0; m < 3; m++) // Recoil Transient
- {
- ModPitch += (PTMod * (3 - m));
- SubPitch = ModPitch / 12;
- ModPitch = ModPitch % 12;
- ModSway += (STMod * (3 - m));
- SubSway = ModSway / 12;
- ModSway = ModSway % 12;
- SetActorPitch(0, GetActorPitch(0) - (PTDivisor * (3 - m) + SubPitch));
- SetActorAngle(0, GetActorAngle(0) - (STDivisor * (3 - m) + SubSway));
- SubPitch = 0;
- SubSway = 0;
- Delay(1);
- }
- Delay(1);
- for (int r = 0; r < 8; r++) // Recovery.
- {
- ModPitch += (PRMod * (r + 1));
- SubPitch = ModPitch / 72;
- ModPitch = ModPitch % 72;
- ModSway += (SRMod * (r + 1));
- SubSway = ModSway / 72;
- ModSway = ModSway % 72;
- SetActorPitch(0, GetActorPitch(0) + (PRDivisor * (r + 1) + SubPitch));
- SetActorAngle(0, GetActorAngle(0) + (SRDivisor * (r + 1) + SubSway));
- SubPitch = 0;
- SubSway = 0;
- Delay(1);
- }
- for (int s = 0; s < 8; s++)
- {
- ModPitch += (PRMod * (8 - s));
- SubPitch = ModPitch / 72;
- ModPitch = ModPitch % 72;
- ModSway += (SRMod * (8 - s));
- SubSway = ModSway / 72;
- ModSway = ModSway % 72;
- SetActorPitch(0, GetActorPitch(0) + (PRDivisor * (8 - s) + SubPitch));
- SetActorAngle(0, GetActorAngle(0) + (SRDivisor * (8 - s) + SubSway));
- SubPitch = 0;
- SubSway = 0;
- Delay(1);
- }
- }
- script RECOIL_DSG (int NumShots) clientside
- {
- switch (NumShots)
- {
- case 1:
- ACS_ExecuteAlways(840,0,8,2,4);
- Radius_Quake(3,3,0,2,0);
- break;
- case 2:
- ACS_ExecuteAlways(840,0,13,3,5);
- Radius_Quake(5,4,0,3,0);
- break;
- }
- int a = Random((-48 + (-48 * NumShots)),(48 + (48 * NumShots)));
- int b = Random((-48 + (-48 * NumShots)),(48 + (48 * NumShots)));
- int c = Random((-48 + (-48 * NumShots)),(48 + (48 * NumShots)));
- int TotalSway = a + b + c;
- int ModSway = 0;
- int SubSway = 0;
- int STDivisor = TotalSway / (3 * NumShots);
- int STMod = TotalSway % (3 * NumShots);
- int SRDivisor = TotalSway / (10 + (10 * NumShots));
- int SRMod = TotalSway % (10 + (10 * NumShots));
- for (int m = 0; m < (1 + NumShots); m++)
- {
- ModSway += (STMod * ((1 + NumShots) - m));
- SubSway = ModSway / (3 * NumShots);
- ModSway = ModSway % (3 * NumShots);
- SetActorAngle(0, GetActorAngle(0) - (STDivisor * ((1 + NumShots) - m) + SubSway) );
- SubSway = 0;
- Delay(1);
- }
- Delay(1);
- for (int r = 0; r < (3 + NumShots); r++)
- {
- ModSway += (SRMod * (r + 1));
- SubSway = ModSway / (10 + (10 * NumShots));
- ModSway = ModSway % (10 + (10 * NumShots));
- SetActorAngle(0, GetActorAngle(0) + (STDivisor * (r + 1) + SubSway) );
- SubSway = 0;
- Delay(1);
- }
- for (int s = 0; s < (3 + NumShots); s++)
- {
- ModSway += (SRMod * ((3 + NumShots) - s));
- SubSway = ModSway / (10 + (10 * NumShots));
- ModSway = ModSway % (10 + (10 * NumShots));
- SetActorAngle(0, GetActorAngle(0) - (STDivisor * ((3 + NumShots) - m) + SubSway) );
- SubSway = 0;
- Delay(1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement