// GPC Online Library
// nba_2k18_Perfect_shot_release.gpc
/*
///////////////////////////////////////////////////////////////////////////////
INSTRUCTION
----------------------------------------------------------------------------
1. Script will automatically record the time when you shot
// Record the time of X press when it is more than 150 ms.
NOTE:
2. Set Recorded time to be time for Perfect Shot
A. Perform standing still shot and if your time is perfect save it ( press and hold D-pad UP + press X ).
B. Then perform running shot and if your time is perfect save it ( hold D-pad UP + press Y ).
3. Save Time to EEPROM memory
// hold D-pad UP + press XB1_MENU
4. Load Time from EEPROM memory
// hold D-pad UP + XB1 VIEW
5. Reset time for Perfect Shot
// hold D-pad UP + press CROSS / A
6. Perform Perfect Shot
// just hold Shot button until your player perform shot
- script will stop sending of the output to console of the button, when it reach the Perfect time.
***********************************************************************************************************************************************************//////////////////////////////////////////////////////////////////////////////////
//
// hold btn for choice A SKill
// Modifier Button to activate skill to the Left - Bank 1
// Modifier Button to activate skill to the Right- Bank 1
// Modifier Button to activate Skill with One Direction
// Time to Double click
//////////////////////////////////////////////////////////////////////////////////////////
//
//ms. to be able to record at either quick, normal or late shot.
//
//////////////////////////////////////////////////////////////////////////////////////////
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
// 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
// 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
// 97 98 99 100
//
// end of data
/////////////////////////////////////////////////////////////////////////////////
//
// IndR_L for LEFT ANALOG we use with dbyte(Ind+ ..);
// Ind we use with dbyte(Ind+ ..);
/////////////////////////////////////////////////////////////////////////////////
// INICIALIZATION
/////////////////////////////////////////////////////////////////////////////////
// MAIN BLOCK
//------------------------------------------------------------------------
// Zone 13
// Bank 1 run to the LEFT
//--------------------------------------------------------------
// if(event_press(XB1_RS)){RightON = 1;combo_run(DIRECTION_OF_L_ANALOG);}
//--------------------------------------------------------------
//
//--------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////
// Shot with recorded time when Standing / when Running
////////////////////////////////////////////////////////////////////////////
// Shot from Standing Still position
// Shot from running position
//Hands Up Defense + Double Team + Ball Pressure + Intense Defense when pressing L1/LB.
// !THE FOLLOWING SCRIPTS ARE MEANT TO BE USED WHILE STANDING STILL!
// However, they can also be used while moving to produce some "other" effects.
//Hold R3/ RS to rapidly cross behind the back, then choose a direction to blow past your defender. Must NOT be moving.
//Hold D-pad LEFT and press LT / L2 to rapidly cross the ball back and fourth between the legs (Ball in Left hand?)
//Hold D-pad DOWN and press LT / L2 to rapidly cross the ball back and fourth between the legs (Ball in Right hand?)
//Hold LT/L2 and D-pad UP to max rumble the screen during freethrows.
// Record the time of X / SQUARE press when it is more than 600 ms.
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// Set Recorded time to be time for Standing Still Shot hold D-pad UP +SQUARE/ X
// Set Recorded time to be time for Running Shot hold D-pad UP +TRIANGLE/ Y
//
// Save Time to EEPROM memory => hold D-pad UP + press PS4_OPTIONS / XB1_MENU
////////////////////////////////////////////////////////////////////////////
// press X set standing still position timing
//
// press Y set runing position timing
// Save Time to EEPROM memory => press START save timing for both shots
// Load Time from EEPROM memory =>press PS4 SHARE / XB1 VIEW
// Reset time for Perfect Shot
// press A/ CROSS
// press B/ CIRCLE
// Increase / Decrease Running shot time
// Increase / Decrease Standing Still shot time
//------------------------------------------------------------------------------
// Standing Still time
// Running time
// Zone 3
// Zone 7
//------------------------------------------------
// SPIN_MOVE
//if( SKill== 7) {dob=97; Elastico=FALSE;combo_run(TURNandSPIN_ELASTICO);} // Turn and Spin // 7. Turn and Spin
//if( SKill== 8) {combo_run(HOCUS_POCUS); } // Hocus Pocus // 8. Hocus Pocus
//if( SKill== 6) {dob=97; Elastico=TRUE;combo_run(TURNandSPIN_ELASTICO);} // Elastico_SKILL // 6. Elastico
// Default Skill
//if(SKill==13) {combo_run(DRAG_BACK);} //Drag Back // 13. Drag Back
//------------------------------------------------
///////////////////////////////////////////////////////////////////
// MIMIC CIRCLE //////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
//Wait times can be adjusted to better suit your latency if you are experiencing issues.
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
// LS==>1
// LS==>2
// LS==>2
// LS==>2
// LS==>2
// LS==>2
// LS==>2
// LS==>2
// LS==>2
// LS==>2
// LS==>2
// LS==>2
// LS==>2
// LS==>2
// LS==>2
// LS==>2
// func end
//mX=dbyte(IndL);
//mY=dbyte(IndL+1);
// func end
//Right Analog Functions
//--------------------------------------------------------------
// func end
//RB
//LB
//LT
// func end
define SHOT_BUTTON = XB1_X;
define DEFENSE = XB1_LB;
define BEHIND = XB1_RS;
define LEGCROSS = XB1_LT;
define holdBtnA = XB1_LT;
define Lbtn = XB1_LB;
define Rbtn = XB1_RB;
define OneDirectBtn = XB1_RS;
define timelimit = 300;
define HoldTime = 150;
define DOnotUSE = 0;
data(DOnotUSE,
0, - 100, 50, - 100, 100, - 100, 100, - 50, 100, 0, 100, 50, 100, 100, 50, 100, 0, 100, - 50, 100, - 100, 100, - 100, 50, - 100, 0, - 100, - 50, - 100, - 100, - 50, - 100,
0, - 100, 50, - 100, 100, - 100, 100, - 50, 100, 0, 100, 50, 100, 100, 50, 100, 0, 100, - 50, 100, - 100, 100, - 100, 50, - 100, 0, - 100, - 50, - 100, - 100, - 50, - 100,
0, - 100, 50, - 100, 100, - 100, 100, - 50, 100, 0, 100, 50, 100, 100, 50, 100, 0, 100, - 50, 100, - 100, 100, - 100, 50, - 100, 0, - 100, - 50, - 100, - 100, - 50, - 100,
4, 12, 6, 10
);
int SKill = 1;
int b_Zapis;
int w_StandingStill;
int w_RunningShot;
int w_recordedTime;
int w_delay;
int OnOff;
int LX, LY;
int ZX, ZY;
int b_Standing;
int Zone;
int temp_Zone;
int IndL;
int CanUse1, CanUse2;
int RightON = FALSE;
int time_to_DblClick_R = 0;
int time_to_DblClick_L = 0;
int IndR_L = 0;
int Ind = 0;
int mX, mY;
int b_Exit;
int Points = 0;
int OnOffMods = TRUE;
int w_delay1;
int w_delay2;
int Edit_On;
int Rumble_Tipe = RUMBLE_A;
int w_rumble = 200;
init {
w_StandingStill = get_pvar(SPVAR_1, 0, 4000, 0);
w_RunningShot = get_pvar(SPVAR_2, 0, 4000, 0);
}
main {
set_val(TRACE_1, w_StandingStill / 10);
set_val(TRACE_2, w_RunningShot / 10);
set_val(TRACE_3, w_recordedTime / 10);
set_val(TRACE_4, Zone);
set_val(TRACE_5, b_Standing);
set_val(TRACE_6, Edit_On);
if (abs(get_val(XB1_LX)) < 80 && abs(get_val(XB1_LY)) < 80) {
b_Standing = TRUE;
}
else {
LX = get_val(XB1_LX);
LY = get_val(XB1_LY);
b_Standing = FALSE;
f_get_Zone(LX, LY);
ZX = LY;
ZY = inv(LX);
}
if (event_press(XB1_LS)) {
RightON = 0;
combo_run(c_DIRECTION_OF_L_ANALOG);
}
if (b_Standing && CanUse1) {
if (w_StandingStill > HoldTime) {
if (get_val(XB1_X) && get_ptime(XB1_X) >= w_StandingStill) {
set_val(XB1_X, 0);
}
}
}
else if (!b_Standing && CanUse2) {
if (w_RunningShot > HoldTime) {
if (get_val(XB1_X) && get_ptime(XB1_X) >= w_RunningShot) {
set_val(XB1_X, 0);
}
}
}
if (get_val(DEFENSE)) {
set_val(XB1_LT, 100);
set_val(XB1_RY, 100);
if (get_val(XB1_RB)) {
set_val(XB1_LB, 0);
set_val(XB1_RB, 0);
set_val(XB1_RY, - 100);
}
}
if (get_val(BEHIND)) {
combo_run(c_Behind_back_dribble);
}
if (get_val(XB1_LEFT)) {
if (get_val(XB1_LT)) {
set_val(XB1_LT, 0);
combo_run(c_LEFTLEGCROSS);
}
}
if (get_val(XB1_DOWN)) {
if (get_val(XB1_LT)) {
set_val(XB1_LT, 0);
combo_run(c_RIGHTLEGCROSS);
}
}
if (get_val(XB1_UP)) {
if (get_val(XB1_LT)) {
set_val(XB1_LT, 0);
combo_run(c_DISTURB);
}
}
if (get_val(XB1_X) && get_ptime(XB1_X) > HoldTime) b_Zapis = TRUE;
if (b_Zapis) {
if (event_release(XB1_X)) {
b_Zapis = FALSE;
w_recordedTime = get_ptime(20);
}
}
if (get_val(XB1_UP)) {
if (event_press(SHOT_BUTTON)) {
w_StandingStill = w_recordedTime;
CanUse1 = TRUE;
}
if (event_press(XB1_Y)) {
w_RunningShot = w_recordedTime;
CanUse2 = TRUE;
}
if (event_press(XB1_MENU)) {
combo_run(c_Save_Timing);
}
if (event_press(XB1_VIEW)) {
if (w_StandingStill > HoldTime) CanUse1 = TRUE;
if (w_RunningShot > HoldTime) CanUse2 = TRUE;
}
if (event_press(XB1_A)) {
w_StandingStill = 0;
CanUse1 = FALSE;
}
if (event_press(XB1_B)) {
w_RunningShot = 0;
CanUse2 = FALSE;
}
set_val(XB1_A, 0);
set_val(XB1_B, 0);
set_val(XB1_VIEW, 0);
set_val(XB1_MENU, 0);
set_val(XB1_Y, 0);
set_val(SHOT_BUTTON, 0);
}
if (get_val(XB1_RS)) {
if (event_press(XB1_UP)) {
w_RunningShot = w_RunningShot + 5;
Edit_On = TRUE;
}
if (event_press(XB1_DOWN)) {
w_RunningShot = w_RunningShot - 5;
Edit_On = TRUE;
}
if (event_press(XB1_RIGHT)) {
w_StandingStill = w_StandingStill + 5;
Edit_On = TRUE;
}
if (event_press(XB1_LEFT)) {
w_StandingStill = w_StandingStill - 5;
Edit_On = TRUE;
}
}
else if (Edit_On) {
combo_run(c_Save_Timing);
}
}
combo c_Save_Timing {
if (w_StandingStill > HoldTime) set_pvar(SPVAR_1, w_StandingStill);
if (w_RunningShot > HoldTime) set_pvar(SPVAR_2, w_RunningShot);
Edit_On = FALSE;
}
/* combo c_RUMBLE_NOTIFY {
set_rumble(Rumble_Tipe, 100);
wait(w_rumble);
reset_rumble();
}
*/
combo c_DIRECTION_OF_L_ANALOG {
OnOff = FALSE;
if (RightON) {
ZX = inv(LY);
ZY = LX;
}
else {
ZX = LY;
ZY = inv(LX);
}
block(11, 1000);
block(12, 1000);
if (Zone > 0) {
if (SKill == 1) {
combo_run(c_SPIN_MOVE);
}
}
}
combo c_SPIN_MOVE {
RightON =! RightON;
if (RightON) {
Ind = (Zone + 12) * 2;
}
else {
Ind = ((Zone + 4) * 2) - 1;
}
Points = 5;
combo_run(c_MimicCircle);
}
combo c_MimicCircle {
if (Points >= 1) {
if (RightON) {
f_RA_CCW(dbyte(Ind - 0), dbyte(Ind - 1));
}
else {
f_RA_CW(dbyte(Ind + 0), dbyte(Ind + 1));
}
}
wait(30);
if (Points >= 2) {
if (RightON) {
f_RA_CCW(dbyte(Ind - 4), dbyte(Ind - 5));
}
else {
f_RA_CW(dbyte(Ind + 4), dbyte(Ind + 5));
}
}
wait(30);
if (Points >= 3) {
if (RightON) {
f_RA_CCW(dbyte(Ind - 8), dbyte(Ind - 9));
}
else {
f_RA_CW(dbyte(Ind + 8), dbyte(Ind + 9));
}
}
wait(30);
if (Points >= 4) {
w_delay1 = 30;
if (RightON) {
f_RA_CCW(dbyte(Ind - 12), dbyte(Ind - 13));
}
else {
f_RA_CW(dbyte(Ind + 12), dbyte(Ind + 13));
}
}
else {
w_delay1 = 10;
}
wait(w_delay1);
if (Points >= 5) {
w_delay1 = 30;
if (RightON) {
f_RA_CCW(dbyte(Ind - 16), dbyte(Ind - 17));
}
else {
f_RA_CW(dbyte(Ind + 16), dbyte(Ind + 17));
}
}
else {
w_delay1 = 10;
}
wait(w_delay1);
OnOff = TRUE;
}
combo c_Behind_back_dribble {
set_val(XB1_RY, 100);
wait(20);
set_val(XB1_RY, 0);
}
combo c_RIGHTLEGCROSS {
set_val(XB1_RY, 71);
set_val(XB1_RX, - 81);
wait(50);
set_val(XB1_RY, 0);
set_val(XB1_RX, 0);
wait(200);
set_val(XB1_RX, 100);
wait(50);
set_val(XB1_RX, 0);
wait(520);
}
combo c_LEFTLEGCROSS {
set_val(XB1_RY, 71);
set_val(XB1_RX, 81);
wait(50);
set_val(XB1_RY, 0);
set_val(XB1_RX, 0);
wait(200);
set_val(XB1_RX, - 100);
wait(50);
set_val(XB1_RX, 0);
set_val(XB1_RY, 0);
wait(520);
}
combo c_DISTURB {
set_val(XB1_LT, 100);
wait(35);
set_val(XB1_LT, 0);
set_val(XB1_RT, 100);
wait(35);
set_val(XB1_RT, 0);
}
function f_get_Zone(X, Y) {
if ((Y <- 80) && (X >= - 20 && X < 20)) {
Zone = 1;
}
else if ((Y <- 80) && (X >= 20 && X <= 70)) {
Zone = 2;
}
else if (Y <- 70 && X > 70) {
Zone = 3;
}
else if ((X > 80) && (Y >= - 70 && Y <= - 20)) {
Zone = 4;
}
else if ((X > 80) && (Y >- 20 && Y < 20)) {
Zone = 5;
}
else if ((X > 80) && (Y >= 20 && Y <= 70)) {
Zone = 6;
}
else if ((X > 70) && (Y > 70)) {
Zone = 7;
}
else if ((X < 70 && X > 20) && (Y == 100)) {
Zone = 8;
}
else if ((Y > 80) && (X >= - 20 && X <= 20)) {
Zone = 9;
}
else if ((Y > 80) && (X <- 20 && X >- 70)) {
Zone = 10;
}
else if ((Y > 70) && (X <- 70)) {
Zone = 11;
}
else if ((X <- 80) && (Y >= 20 && Y <= 70)) {
Zone = 12;
}
else if ((X <- 80) && (Y >- 20 && Y < 20)) {
Zone = 13;
}
else if ((X <- 80) && (Y <- 20 && Y >- 70)) {
Zone = 14;
}
else if ((X <- 70) && (Y <- 70)) {
Zone = 15;
}
else if ((Y <- 80) && (X <- 20 && X >- 70)) {
Zone = 16;
}
temp_Zone = Zone;
f_f_get_Dir(Zone);
}
function f_f_get_Dir(zona) {
IndL = (zona * 2) - 1;
}
function f_RA_CW(X, Y) {
set_val(9, X);
set_val(10, Y);
}
function f_RA_CCW(Y, X) {
set_val(10, Y);
set_val(9, X);
}
/* function f_LA_CW(X, Y) {
set_val(11, X);
set_val(12, Y);
}
*/
/* function f_f_RB_LB_LT(a, b, c) {
if (a) set_val(3, 100);
if (b) set_val(6, 100);
if (c) set_val(7, 100);
}
*/