ffc script FFCChangesNPC{ void run(int n1, int n2) { npc a[2]; int q; Waitframes(5); while(true){ for ( q = 1; q <= Screen->NumNPCs(); q++ ) { n[0] = Screen->LoadNPC(q); if ( n[0]->ID == n1 ) { if ( Collision(n[0],this) ) { n[0]->DrawXOffset = -200; n[0]->HitXOffset = -200; n[1] = Screen->CreateNPC(n2); n[1]->X = n[0]->X; n[1]->Y = n[0]->Y; Remove(n[0]; } } } } } } ffc script ComboChangesNPC{ void run(int n1, int n2, int comboID) { npc a[2]; int q[2]; Waitframes(5); while(true){ for ( q[0] = 1; q[0] <= Screen->NumNPCs(); q[0]++ ) { n[0] = Screen->LoadNPC(q); if ( n[0]->ID == n1 ) { for ( q[1] = 0; q[1] < 176; q[1]++ ) { if ( ComboD[q[1]] == comboID ) { if ( ___Collision(q[1],n[0]) ) { n[0]->DrawXOffset = -200; n[0]->HitXOffset = -200; n[1] = Screen->CreateNPC(n2); n[1]->X = n[0]->X; n[1]->Y = n[0]->Y; Remove(n[0]; } } } } } } } //Check for collision between npc 'n' and a combo at location 'cmb'. bool Collision(int cmb, npc n){ int c[8]; c[0] = ComboX(cmb); c[1] = ComboY(cmb); c[2] = ComboX(cmb)+16; c[3] = ComboY(cmb)+16; c[4] = (n->X)+n->HitXOffset+n->DrawXOffset; c[5] = (n->Y)+n->HitYOffset+n->DrawYOffset; c[6] = c[4]+n->HitWidth; c[7] = c[5]+n->HitHeight; return RectCollision( c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7] ); } }