Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ffc script klop_request //Not sure what else to call it this time.
- {
- void run(int target_enemy_id, int split, int num_splits, int msg)
- //There had better only be one enemy of this type on the screen!
- {
- int teloc[3]; //target enemy location
- npc n; teloc[1] = -1; teloc[2] = -1;
- while(1)
- {
- teloc[0] = 0; //wipe every frame
- for ( int q = Screen->NumNPCs(); q > 0; --q; )
- {
- n = Screen->LoadNPC(q);
- if ( n->ID == target_npc_id )
- {
- teloc[0] = q; teloc[1] = n->X; teloc[2] = n->Y;
- }
- }
- if ( !teloc[0] ) //no target npc, but we preserve its last coordinates.
- {
- break;
- }
- Waitframe();
- } //infinite loop ends here.
- if ( split )
- {
- if ( teloc[1] > -1 ) //only if there was a valid target with good coordinates.
- {
- if ( teloc[2] > -1 )
- {
- for ( ; num_splits > 0; --num_splits )
- {
- n = Screen->CreateNPC(split_into);
- n->X = teloc[1];
- n->Y = teloc[2];
- }
- }
- }
- }
- if ( msg )
- {
- Screen->Message(msg);
- }
- }
- this->Data = 0; Quit();
- } //runs out of scope
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement