const int NPC_TRIB_INDEX = 6; const int TRIB_BASE = 0; const int TRIB_INTO = 1; const int TRIB_LAST = 2; const int TRIB_Q = 0; const int TRIB_W = 1; const int TRIB_E = 2; const int TRIB_X = 5; const int TRIB_Y = 6; ffc script BasicTribble{ void run(int base_enemy, int tribbles_into, int num_tribbles, int tribbles_become, int waver, int trib_time){ int a[10]; //0 loop q, 1 loop w, 2 loop e, 3 timer npc n[255]; a[3] = trib_time; Waitframes(5); //for ( a[0] = 1; a[0] <= Screen->NumNPCs(); a[0]++ ){ //n[a[0]] = Screen->LoadNPC(a[0]); if ( n[a[TRIB_Q]]->ID == base_enemy ) n[TRIB_BASE]->Misc[NPC_TRIB_INDEX] = tribbles_into; while(true){ for ( a[0] = 1; a[0] <= Screen->NumNPCs(); a[0]++ ) { n[TRIB_BASE] = Screen->LoadNPC(a[0]); if ( n[TRIB_BASE]->Isvalid() { if ( n[TRIB_BASE]->HP <= 0 && n[TRIB_BASE]->ID == base_enemy && n[TRIB_BASE]->X != -32768 && n[TRIB_BASE]->Y != -32768){ n[1] = Screen->CreateNPC(tribbles_into); n[TRIB_BASE]->DrawXOffset = -200; n[TRIB_BASE]->DrawYOffset = -200; n[TRIB_BASE]->HitXOffset = -200; n[TRIB_BASE]->HitYOffset = -200; a[5] = n[TRIB_BASE]->X; a[6] = n[TRIB_BASE]->Y; a[TRIB_BASE]->HP = -9999; Waitframes(5); n[TRIB_INTO]->X = a[5] + ( Rand( (waver * -1),waver ) ); n[TRIB_INTO]->Y = a[6]->Y + ( Rand( (waver * -1),waver ) ); } if ( a[3] ) a[3]--; if ( !a[3] ){ a[3] = trib_time; for ( a[0] = 1; a[0] <= Screen->NumNPCs(); a[0]++){ n[TRIB_BASE] = Screen->LoadNPC(a[0]); if ( n[TRIB_BASE]->IsValid()){ if ( n[TRIB_BASE]->ID == tribbles_into ){ n[1] = Screen->CreatNPC(tribbles_become); n[TRIB_BASE]->DrawXOffset = -200; n[TRIB_BASE]->DrawYOffset = -200; n[TRIB_BASE]->HitXOffset = -200; n[TRIB_BASE]->HitYOffset = -200; a[5] = n[TRIB_BASE]->X; a[6] = n[TRIB_BASE]->Y; n[TRIB_BASE]->HP = -9999; Waitframes(5); n[1]->X = a[5] + ( Rand( (waver * -1),waver ) ); n[1]->Y = a[6]->Y + ( Rand( (waver * -1),waver ) ); } } } } Waitframe(); } }