Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //BobOmb for EotM - May 2017
- //By: ZoriaRPG
- //19th May, 2017
- //v0.1
- //Set all npc defences to Stun
- ffc script bombomb{
- void run(int enem_id, int misc_id, int misc_cset, int flash_cset){
- npc n; int q; int frame = 60;
- while(true){
- if ( frame > 0 ) frame--;
- else frame = 60;
- //find any bobomb npcs
- for ( q = Screen->NumNPCs(); q > 0; q-- ) {
- n = Screen->LoadNPC(q);
- if ( n->ID == enem_id ) {
- //found one, check its stun
- if ( n->Stun > 1 ) {
- //check its timer
- if ( n->Misc[misc_id] == 0 ) {
- //its not yet flashing, so set its timer.
- n->Misc[misc_id] = 60;
- n->Misc[misc_cset] = n->CSet;
- }
- if ( n->Misc[misc_id] > 0 ) {
- if ( n->Misc[misc_id] < 30 ) {
- //Make it flash
- n->CSet = flash_cset;
- }
- else n->CSet = n->Misc[misc_cset];
- }
- }
- if ( n->Stun == 1 ) {
- //time to explode
- n->Attributes[1] = NPCA2_EXPLODE;
- n->HP = 0;
- }
- }
- }
- Waitframe();
- }
- }
- }
- const int NPC_BOBOMB = 0;
- const int BOBOMB_FFC_SLOT = 30;
- const int BOBOMB_FFC_DATA = 1;
- const int BOBOMB_FFC_D_TIMER_SLOT = 14;
- const int BOBOMB_FFC_D_CSET_SLOT = 13;
- const int BOBOMB_FFC_FLASH_CSET = 6;
- global script test-bobomb{
- void run(){
- while(true){
- BobOmb(NPC_BOBOMB, BOBOMB_FFC_SLOT, BOBOMB_FFC_DATA, BOBOMB_FFC_D_TIMER_SLOT, BOBOMB_FFC_D_CSET_SLOT, BOBOMB_FFC_FLASH_CSET);
- Waitdraw();
- Waitframe();
- }
- }
- }
- //Globally find any bob ombs. If any are on the screen and the script is not running, run it.
- void BobOmb(int npc_id, int ffc_slot, int ffc_data, int misc_timer, int misc_cset_slot, int flash_cset){
- int ff="bobomb"; npc n; int fff = Game->GetFFCScript(ff);
- if ( fff < 1 ) return;
- ffc f = Screen->LoadFFC(ffc_slot);
- if ( f->Script == ffc ) return;
- for ( int q = Screen->NumNPCs(); q > 0; q-- ) {
- //check or bobombs
- n = Screen->LoadNPC(q);
- if ( n->ID == npc_id ) {
- if ( f->Script != fff ) {
- f->Data = ffc_data;
- f->InitD[0] = npc_id;
- f->InitD[1] = misc_timer;
- f->InitD[2] = misc_cset_slot;
- f->InitD[3] = flash_cset;
- f->Script = fff;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement