User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17

Thread: Enemy Maker Scripts!

  1. #1
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,959
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.21%

    Enemy Maker Scripts!

    Version1. This script was written by DarkDragon! (give credit where credit is due)
    Code:
    //===============================================
    // FFC SCRIPT ENEMY MAKER 1(overworld/interiors)
    // D0-D7 Enemies that will spawn *check std.zh for values*
    //===============================================
    bool is_walkable(int x, int y)
    {
    	return Screen->ComboS[x+y*16]==0;
    }
    
    ffc script Enemymaker1 {
    	void run(int e1, int e2, int e3, int e4, int e5, int e6, int e7, int e8) {
    		putenemy(e1);
    		putenemy(e2);
    		putenemy(e3);
    		putenemy(e4);
    		putenemy(e5);
    		putenemy(e6);
    		putenemy(e7);
    		putenemy(e8);
    	}
    
    	void putenemy(int eid)
    	{
    		//to do this properly we really need priority queues in ZScript ;)
    		
    		int x = Rand(16);
    		int y = Rand(11);
    		while(!is_walkable(x,y))
    		{
    			x = Rand(16);
    			y = Rand(11);
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    }
    Use this for overworld/interior spawning, so as they don't get stuck in doorways....



    Code:
    //===============================================
    // FFC SCRIPT ENEMY MAKER 2(dungeons)
    // D0-D7 Enemies that will spawn *check std.zh for values*
    //===============================================
    bool is_walkable(int x, int y)
    {
    	return Screen->ComboS[x+y*16]==0;
    }
    
    ffc script Enemymaker2 {
    	void run(int e1, int e2, int e3, int e4, int e5, int e6, int e7, int e8) {
    		putenemy(e1);
    		putenemy(e2);
    		putenemy(e3);
    		putenemy(e4);
    		putenemy(e5);
    		putenemy(e6);
    		putenemy(e7);
    		putenemy(e8);
    	}
    
    	void putenemy(int eid)
    	{
    		//to do this properly we really need priority queues in ZScript ;)
    		
    		int x = Rand(12)+2;
    		int y = Rand(7)+2;
    		while(!is_walkable(x,y))
    		{
    			x = Rand(12)+2;
    			y = Rand(7)+2;
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    }

    Revision by Shadowmancer. Thanks!:) -Use this one for dungeons.

    and....


    Code:
    //====================================================
    // FFC SCRIPT ENEMY MAKER (dungeons)
    // D0-D6; Enemies that might spawn,
    // D7; Number of max enemies you want to spawn.
    // <in Addition to boss or any other enemies set to screen enemies> ;)
    // Thanks to DarkDragon! :=D
    //====================================================
    
    bool is_walkable(int x, int y)
    {
    	return Screen->ComboS[x+y*16]==0;
    }
    
    ffc script enemymaker {
            void run(int e1, int e2, int e3, int e4, int e5, int e6, int e7, int enemy_max) {
                    int RandNum = Rand(7);
                    int en_count = enemy_max;
                    while(en_count > 0){
    
                                   if (RandNum == 0){ 
    		                       putenemy(e1);
                                 } if (RandNum == 1){ 
    		                       putenemy(e2);
                                 } if (RandNum == 2){ 
    		                       putenemy(e3);
                                 } if (RandNum == 3){ 
    		                       putenemy(e4);
                                 } if (RandNum == 4){ 
    		                       putenemy(e5);
                                 } if (RandNum == 5){ 
    		                       putenemy(e6);
                                 } if (RandNum == 6){ 
    		                       putenemy(e7);
                                 } 
                                   en_count = en_count - 1;
                                   RandNum = Rand(7);
                                 
                       } 
    	       
    	}
    
    	void putenemy(int eid) 
    	{
    		//to do this properly we really need priority queues in ZScript ;)
    		
    		int x = Rand(12)+2;
    		int y = Rand(7)+2;
    		while(!is_walkable(x,y))
    		{
    			x = Rand(12)+2;
    			y = Rand(7)+2;
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    }
    ....here is my version. Big changes with this one, allow me to explain.

    D0-D6; Enemies that might spawn,
    D7; Number of max enemies you want to spawn.
    D0-D6 may or may not spawn, because......they're chosen at random! *Note the higher the number of D7, the greater chance any single one may appear.*

    D7: Here is the kicker; What happens when you set D7 to 100??? ...Well try it and find out...hehe.....

    You may want to give Link a potion before you try that though...

    ...And yes, it works with bosses.

    EDIT:

    Here's how it works:

    It will spawn enemies of your choice,(D0-D7) and spawn them in random locations on the screen if walkable. Just like normal enemies. As for what enemies will spawn, check the enemy data either in std.zh, or in you quest under the enemy editor. Any enemy you have made in the editor is an eligible candidate for this script. Have fun with these!
    Oh, almost forgot:
    Code:
    bool is_walkable(int x, int y)
    {
    	return Screen->ComboS[x+y*16]==0;
    }
    This part is a global bit, so I believe you only need it once.

    -Enjoy!
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  2. #2
    Quest Builder Anarchy_Balsac's Avatar
    Join Date
    Nov 2005
    Posts
    751
    Mentioned
    11 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    2,593
    Level
    16
    vBActivity - Bars
    Lv. Percent
    64.23%

    Re: Enemy Maker Scripts!

    So wait, are these custom enemies or just custom enemy spawn patterns? Or both?

  3. #3
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,959
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.21%

    Re: Enemy Maker Scripts!

    Quote Originally Posted by Anarchy_Balsac View Post
    So wait, are these custom enemies or just custom enemy spawn patterns? Or both?
    Oh shit! I left out a bunch of explanations.....sorry. :mad: Dammit...

    Here's how it works:

    It will spawn enemies of your choice,(D0-D7) and spawn them in random locations on the screen if walkabe. Just like normal enemies. As for what enemies will spawn, check the enemy data either in std.zh, or in you quest under the enemy editor. Any enemy you have made in the editor is an elegible candidate for this script. :) Have fun with these!
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  4. #4
    Quest Builder Anarchy_Balsac's Avatar
    Join Date
    Nov 2005
    Posts
    751
    Mentioned
    11 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    2,593
    Level
    16
    vBActivity - Bars
    Lv. Percent
    64.23%

    Re: Enemy Maker Scripts!

    *laughs maniacally", I wonder what would happen if a large number of manhandlas were spawned that way........... I'll be certain to use this for future quests.

  5. #5
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,959
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.21%

    Re: Enemy Maker Scripts!

    Quote Originally Posted by Anarchy_Balsac View Post
    *laughs maniacally", I wonder what would happen if a large number of manhandlas were spawned that way........... I'll be certain to use this for future quests.
    Aaaaahahahahahahahahahahaa!!!!!!!! I know, believe me I know...and trust me, you ain't seen nothing yet.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  6. #6
    Octorok
    Join Date
    Jan 2007
    Age
    36
    Posts
    259
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,410
    Level
    12
    vBActivity - Bars
    Lv. Percent
    73.59%

    Re: Enemy Maker Scripts!

    What happens if you try to summon strange enemies like Traps, Zoras, or Ganons with this? You said the position was random; how do Aquamentus, Gleeok, and Gohma like this?

  7. #7
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,959
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.21%

    Re: Enemy Maker Scripts!

    Quote Originally Posted by AmazingAmpharos View Post
    What happens if you try to summon strange enemies like Traps, Zoras, or Ganons with this? You said the position was random; how do Aquamentus, Gleeok, and Gohma like this?

    Ah! Yet another detail I neglected to mention....it's freakin sweetness how it works. OK, so things like...
    Traps are buggy, do not spawn those.
    Also Vire's are buggy for some reason...i dunno why. Instead use keese->tribble.
    Uh...one more, but I forgot..

    Bosses will spawn. If a boss can move, it will spawn randomly like other enemies. Yep, freeform Aquamentus!! also Gohma's.

    Gleeok on the other hand, will alway's spawn on the same place.

    Untested for zora's, and Ganon's.


    BUT!!! Note that you can use this script in cunjunction with normal screen enemies. :)
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  8. #8
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,959
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.21%

    Re: Enemy Maker Scripts!

    Some more fun stuff for the kidies.


    Code:
    ffc script leever_spawner{
    
            void run(int enemy_max){
    
    		bool init = false;
    		int en_count = 0;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++)
    					putenemy(26+Rand(2));
                			
    				init = true;
    			}
    			en_count = Screen->NumNPCs();
    			while(en_count > 0){
    				npc leever = Screen->LoadNPC(en_count);
    				if(leever->X > 272 || leever->Y > 192 ||
    					leever->X < -33 || leever->Y < -33){
    						leever->HP=0;
    						npc e = Screen->CreateNPC(26+Rand(2));
    						e->X = Rand(190)+30;
    						e->Y = Rand(100)+30;
    				}
    				en_count--;
    			}
    		Waitframe();	
    		}        
    	}
    	void putenemy(int eid) 
    	{
    		
    		int x = Rand(12)+2;
    		int y = Rand(7)+2;
    		while(!is_walkable(x,y))
    		{
    			x = Rand(12)+2;
    			y = Rand(7)+2;
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    	bool is_walkable(int x, int y)
    	{
    		return Screen->ComboS[x+y*16]==0;
    	}
    }

    Code:
    ffc script lanmola_spawner{
    
            void run(int enemy_max){
    
    		bool init = false;
    		int en_count = 0;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++)
    					putenemy(74+Rand(2));
                			
    				init = true;
    			}
    		Waitframe();	
    		}        
    	}
    	void putenemy(int eid) 
    	{
    		
    		int x = Rand(12)+2;
    		int y = Rand(7)+2;
    		while(!is_walkable(x,y))
    		{
    			x = Rand(12)+2;
    			y = Rand(7)+2;
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    	bool is_walkable(int x, int y)
    	{
    		return Screen->ComboS[x+y*16]==0;
    	}
    }
    Code:
    ffc script lynel_spawner{
    
            void run(int enemy_max){
    
    		bool init = false;
    		int en_count = 0;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++)
    					putenemy(30+Rand(2));
                			
    				init = true;
    			}
    		Waitframe();	
    		}        
    	}
    	void putenemy(int eid) 
    	{
    		
    		int x = Rand(12)+2;
    		int y = Rand(7)+2;
    		while(!is_walkable(x,y))
    		{
    			x = Rand(12)+2;
    			y = Rand(7)+2;
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    	bool is_walkable(int x, int y)
    	{
    		return Screen->ComboS[x+y*16]==0;
    	}
    }

    Code:
    ffc script goriya_spawner{
    
            void run(int enemy_max){
    
    		bool init = false;
    		int en_count = 0;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++)
    					putenemy(45+Rand(2));
                			
    				init = true;
    			}
    		Waitframe();	
    		}        
    	}
    	void putenemy(int eid) 
    	{
    		
    		int x = Rand(12)+2;
    		int y = Rand(7)+2;
    		while(!is_walkable(x,y))
    		{
    			x = Rand(12)+2;
    			y = Rand(7)+2;
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    	bool is_walkable(int x, int y)
    	{
    		return Screen->ComboS[x+y*16]==0;
    	}
    }

    Code:
    ffc script darknut_spawner{
    
            void run(int enemy_max){
    
    		bool init = false;
    		int en_count = 0;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++)
    					putenemy(49+Rand(2));
                			
    				init = true;
    			}
    		Waitframe();	
    		}        
    	}
    	void putenemy(int eid) 
    	{
    		
    		int x = Rand(12)+2;
    		int y = Rand(7)+2;
    		while(!is_walkable(x,y))
    		{
    			x = Rand(12)+2;
    			y = Rand(7)+2;
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    	bool is_walkable(int x, int y)
    	{
    		return Screen->ComboS[x+y*16]==0;
    	}
    }

    Code:
    ffc script keese_spawner{
    
            void run(int enemy_max){
    
    		bool init = false;
    		int en_count = 0;
    		int delay = 300;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++)
    					putenemy(38+Rand(3));
                			
    				init = true;
    			}
    			if(Screen->NumNPCs()==0){
    
    				if(delay > 0)delay--;
    				else{
    					npc e = Screen->CreateNPC(38+Rand(3));
    					delay = 200+Rand(200);
    				}
    			}		
    		Waitframe();	
    		}        
    	}
    	void putenemy(int eid) 
    	{
    		
    		int x = Rand(12)+2;
    		int y = Rand(7)+2;
    		while(!is_walkable(x,y))
    		{
    			x = Rand(12)+2;
    			y = Rand(7)+2;
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    	bool is_walkable(int x, int y)
    	{
    		return Screen->ComboS[x+y*16]==0;
    	}
    }

    Code:
    ffc script octo_spawner_1{
    
            void run(int enemy_max){
    
    		bool init = false;
    		int en_count = 0;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++)
    					putenemy(20+Rand(4));
                			
    				init = true;
    			}
    		Waitframe();	
    		}        
    	}
    	void putenemy(int eid) 
    	{
    		
    		int x = Rand(12)+2;
    		int y = Rand(7)+2;
    		while(!is_walkable(x,y))
    		{
    			x = Rand(12)+2;
    			y = Rand(7)+2;
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    	bool is_walkable(int x, int y)
    	{
    		return Screen->ComboS[x+y*16]==0;
    	}
    }

    Code:
    ffc script octo_spawner_2{
    
            void run(int enemy_max){
    
    		bool init = false;
    		int en_count = 0;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++)
    					putenemy(138+Rand(4));
                			
    				init = true;
    			}
    		Waitframe();	
    		}        
    	}
    	void putenemy(int eid) 
    	{
    		
    		int x = Rand(12)+2;
    		int y = Rand(7)+2;
    		while(!is_walkable(x,y))
    		{
    			x = Rand(12)+2;
    			y = Rand(7)+2;
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    	bool is_walkable(int x, int y)
    	{
    		return Screen->ComboS[x+y*16]==0;
    	}
    }

    Code:
    const int PHASE_WIZZROBE_2 = 56; // change these to your own created wizzrobe enemy ids.
    const int PHASE_WIZZROBE_3 = 56;
    
    ffc script wizzrobe_spawner_phaser{
    
            void run(int enemy_max){
    
    		bool init = false;
    		int en_count = 0;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++){
    
    					if(Rand(3)==0)npc e = Screen->CreateNPC(56);
    					else if(Rand(3) != 0)npc e = Screen->CreateNPC(PHASE_WIZZROBE_2);
    					else npc e = Screen->CreateNPC(PHASE_WIZZROBE_3);
    					int rand = Rand(9)+15;
    					Waitframes(rand);
    				}
    				init = true;
    			}
    		Waitframe();	
    		}        
    	}
    }


    And one more just for fun:


    Code:
    // =======================================================
    // ENEMY SPAWNER 4 - This script is used to spawn enemies.  The FFC running
    // the script will continue to spawn particular kinds of enemy at regular intervals
    // until there are too many on the screen, or the combo used by the spawner changes.
    // This version will always spawn at the location of the FFC running this script and
    // will always spawn enemies untill the ghosted enemy at the location of this ffc
    // is killed. currently uses enemy z255 as the ghosted enemy. Get used to using
    // enemy 255 as a dummy enemy for scripts. Set up this enemy in the enemy editor.
    //
    // D0 - D2 = enemy_id = The enemy to be spawned.  Check the table in std.zh to get values.
    // D3 = delay = The delay, in tics, between enemy spawns.
    // D4 = max = The maximum number of enemies that the spawner will put on the screen.
    // D5 - the HP of the ghosted enemy at this ffc.
    // ======================================================
    
    ffc script enemyspawner4{
    
    	void run(int enemy_id, int enemy_id2, int enemy_id3, int delay, int max, int enemyHP){	
    						
    
    		int original_combo = this->Data;	// Saves the original combo of this FFC.
    
    		int counter = delay;			// Used to count the tics until it is time to spawn.
    		int spawnX = this->X;
    		int spawnY = this->Y;
    		int random = Rand(3);
    
    		Waitframes(4);
    
    		npc enemy_life = Screen->CreateNPC(255);
    		enemy_life->HP = enemyHP;
    
    		while(enemy_life->isValid()){
    
    			enemy_life->X = this->X;
    			enemy_life->Y = this->Y;
    
    			if ( (this->Data == original_combo) && (Screen->NumNPCs() < max) ){
    
    
    				if ( counter == 0 && random == 0){
    
    					npc spawnee = Screen->CreateNPC(enemy_id);
    					spawnee->X = spawnX;
    					spawnee->Y = spawnY;
    					counter = delay;
    					random = Rand(3);
    				}
    				if ( counter == 0 && random == 1){
    
    					npc spawnee = Screen->CreateNPC(enemy_id2);
    					spawnee->X = spawnX;
    					spawnee->Y = spawnY;
    					counter = delay;
    					random = Rand(3);
    				}
    				if ( counter == 0 && random == 2){
    
    					npc spawnee = Screen->CreateNPC(enemy_id3);
    					spawnee->X = spawnX;
    					spawnee->Y = spawnY;
    					counter = delay;
    					random = Rand(3);				
    				}
    				else{
    					counter--;
    				} // end if
    			} // end if
    
    			spawnX = this->X;
    			spawnY = this->Y;
    
    			Waitframe();
    		} // end of while loop
    	} // end of void run
    } // end of FFC script
    Enjoy!
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  9. #9
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,611
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.9%

    Re: Enemy Maker Scripts!

    I've always used the Fire enemy as the ghosted enemy. Old habits die hard, I guess. Always used that one before scripting, too.

  10. #10
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,959
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.21%

    Re: Enemy Maker Scripts!

    Yeah, my enemy id 255 is basically a fire enemy. I erased the fire enemy in my other quest for a lv3 wizzrobe I think. I figure it's a safe bet to assume no one has made an enemy 255 for any other purpose but for script.


    Anyway, whoopsie! Some of the above that were acting odd are now fixed. Also the leever script should no longer flood fill the screen with 255 enemies. Not really sure why that happened at all though. Some new ones. I'm just going to copy/paste the entire section from my script file, just so you know you don't have to use all of them. Just highlight what you want.

    Enjoy.

    Code:
    //=======================================
    // 	 CONSTANT SPAWN SCRIPTS
    //D0- Number of enemies to spawn
    //=======================================
    
    
    ffc script E_leever_spawner{
    
            void run(int enemy_max){
    
    		bool init = false;
    		int en_count = 0;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++)
    					putenemy(26+Rand(2));
                			
    				init = true;
    			}
    			en_count = Screen->NumNPCs();
    			while(en_count > 0){
    				npc leever = Screen->LoadNPC(en_count);
    				if(leever->X > 272 || leever->Y > 192 ||
    					leever->X < -33 || leever->Y < -33){
    						leever->HP=0;
    						Waitframes(60);
    						putenemy(26+Rand(2));
    				}
    				en_count--;
    			}
    		Waitframe();	
    		}        
    	}
    	void putenemy(int eid) 
    	{
    		
    		int x = Rand(12)+2;
    		int y = Rand(7)+2;
    		while(!is_walkable(x,y))
    		{
    			x = Rand(12)+2;
    			y = Rand(7)+2;
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    	bool is_walkable(int x, int y)
    	{
    		return Screen->ComboS[x+y*16]==0;
    	}
    }
    
    
    
    ffc script E_lanmola_spawner{
    
            void run(int enemy_max){
    
    		bool init = false;
    		int en_count = 0;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++)
    					putenemy(74+Rand(2));
                			
    				init = true;
    			}
    		Waitframe();	
    		}        
    	}
    	void putenemy(int eid) 
    	{
    		
    		int x = Rand(12)+2;
    		int y = Rand(7)+2;
    		while(!is_walkable(x,y))
    		{
    			x = Rand(12)+2;
    			y = Rand(7)+2;
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    	bool is_walkable(int x, int y)
    	{
    		return Screen->ComboS[x+y*16]==0;
    	}
    }
    
    ffc script E_lynel_spawner{
    
            void run(int enemy_max){
    
    		bool init = false;
    		int en_count = 0;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++)
    					putenemy(30+Rand(2));
                			
    				init = true;
    			}
    		Waitframe();	
    		}        
    	}
    	void putenemy(int eid) 
    	{
    		
    		int x = Rand(12)+2;
    		int y = Rand(7)+2;
    		while(!is_walkable(x,y))
    		{
    			x = Rand(12)+2;
    			y = Rand(7)+2;
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    	bool is_walkable(int x, int y)
    	{
    		return Screen->ComboS[x+y*16]==0;
    	}
    }
    
    
    ffc script E_goriya_spawner{
    
            void run(int enemy_max){
    
    		bool init = false;
    		int en_count = 0;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++)
    					putenemy(45+Rand(2));
                			
    				init = true;
    			}
    		Waitframe();	
    		}        
    	}
    	void putenemy(int eid) 
    	{
    		
    		int x = Rand(12)+2;
    		int y = Rand(7)+2;
    		while(!is_walkable(x,y))
    		{
    			x = Rand(12)+2;
    			y = Rand(7)+2;
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    	bool is_walkable(int x, int y)
    	{
    		return Screen->ComboS[x+y*16]==0;
    	}
    }
    
    ffc script E_darknut_spawner{
    
            void run(int enemy_max){
    
    		bool init = false;
    		int en_count = 0;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++)
    					putenemy(49+Rand(2));
                			
    				init = true;
    			}
    		Waitframe();	
    		}        
    	}
    	void putenemy(int eid) 
    	{
    		
    		int x = Rand(12)+2;
    		int y = Rand(7)+2;
    		while(!is_walkable(x,y))
    		{
    			x = Rand(12)+2;
    			y = Rand(7)+2;
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    	bool is_walkable(int x, int y)
    	{
    		return Screen->ComboS[x+y*16]==0;
    	}
    }
    
    
    
    ffc script E_keese_spawner{
    
            void run(int enemy_max){
    
    		bool init = false;
    		int en_count = 0;
    		int delay = 300;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++)
    					putenemy(38+Rand(3));
                			
    				init = true;
    			}
    			if(Screen->NumNPCs()==0){
    
    				if(delay > 0)delay--;
    				else{
    					npc e = Screen->CreateNPC(38+Rand(3));
    					delay = 200+Rand(200);
    				}
    			}		
    		Waitframe();	
    		}        
    	}
    	void putenemy(int eid) 
    	{
    		
    		int x = Rand(12)+2;
    		int y = Rand(7)+2;
    		while(!is_walkable(x,y))
    		{
    			x = Rand(12)+2;
    			y = Rand(7)+2;
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    	bool is_walkable(int x, int y)
    	{
    		return Screen->ComboS[x+y*16]==0;
    	}
    }
    
    ffc script E_octo_spawner_1{
    
            void run(int enemy_max){
    
    		bool init = false;
    		int en_count = 0;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++)
    					putenemy(20+Rand(4));
                			
    				init = true;
    			}
    		Waitframe();	
    		}        
    	}
    	void putenemy(int eid) 
    	{
    		
    		int x = Rand(12)+2;
    		int y = Rand(7)+2;
    		while(!is_walkable(x,y))
    		{
    			x = Rand(12)+2;
    			y = Rand(7)+2;
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    	bool is_walkable(int x, int y)
    	{
    		return Screen->ComboS[x+y*16]==0;
    	}
    }
    
    
    ffc script E_octo_spawner_2{
    
            void run(int enemy_max){
    
    		bool init = false;
    		int en_count = 0;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++)
    					putenemy(138+Rand(4));
                			
    				init = true;
    			}
    		Waitframe();	
    		}        
    	}
    	void putenemy(int eid) 
    	{
    		
    		int x = Rand(12)+2;
    		int y = Rand(7)+2;
    		while(!is_walkable(x,y))
    		{
    			x = Rand(12)+2;
    			y = Rand(7)+2;
    		}
    		npc en = Screen->CreateNPC(eid);
    		if(en->isValid())
    		{
    			en->X = x*16;
    			en->Y = y*16;
    		}
    		//simulate staggered spawning
    		Waitframe();
    	}
    	bool is_walkable(int x, int y)
    	{
    		return Screen->ComboS[x+y*16]==0;
    	}
    }
    
    
    
    //=-=-=-=-=-=-=-=-WIZZROBE SPAWNER SCRIPTS-=-=-=-=-=-=-=-=-=
    // D0 - amount of wizzrobes to spawn
    // other D[] vars: offset(in ticks) and/or enemy HP. 
    //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    
    
    const int PHASE_WIZZROBE_2 = 188;
    const int PHASE_WIZZROBE_3 = 189;
    
    ffc script E_wizzrobe_spawner_phaser{
    
            void run(int enemy_max){
    
    		bool init = false;
    		int en_count = 0;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++){
    
    					npc e;
    					if(Rand(3)==0)e = Screen->CreateNPC(56);
    					else if(Rand(3) != 0) e = Screen->CreateNPC(PHASE_WIZZROBE_2);
    					else e = Screen->CreateNPC(PHASE_WIZZROBE_3);
    					int rand = Rand(9)+15;
    					Waitframes(rand);
    				}
    				init = true;
    			}
    		Waitframe();	
    		}        
    	}
    }
    
    
    ffc script E_wiz1_spawner_phaser{
    
            void run(int enemy_max, int offset){
    
    		bool init = false;
    		int en_count = 0;
    		if(offset == 0) offset = Rand(9)+15;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++){
    
    					npc e = Screen->CreateNPC(56);
    					Waitframes(offset);
    				}
    				init = true;
    			}
    		Waitframe();	
    		}        
    	}
    }
    
    
    ffc script E_wiz2_spawner_phaser{
    
            void run(int enemy_max, int offset){
    
    		bool init = false;
    		int en_count = 0;
    		if(offset == 0) offset = Rand(9)+15;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++){
    
    					npc e = Screen->CreateNPC(PHASE_WIZZROBE_2);
    					Waitframes(offset);
    				}
    				init = true;
    			}
    		Waitframe();	
    		}        
    	}
    }
    
    ffc script E_wiz3_spawner_phaser{
    
            void run(int enemy_max, int offset){
    
    		bool init = false;
    		int en_count = 0;
    		if(offset == 0) offset = Rand(9)+15;
    
                    while(true){
    
    			if(init == false){
    
    				for(int i; i < enemy_max; i++){
    
    					npc e = Screen->CreateNPC(PHASE_WIZZROBE_3);
    					Waitframes(offset);
    				}
    				init = true;
    			}
    		Waitframe();	
    		}        
    	}
    }
    
    
    
    ffc script splitter_spawner{
    
            void run(int eid, int e_max, int s1, int s2, int s3, int s4){
    
    		bool init = false;
    		npc e;
    
                    while(true){
    
    			if(init == false){
    
                			e = Screen->CreateNPC(eid);
    				init = true;
    			}
    			else if(!(e->isValid())){
    
    				if(s1>0){
    					for(int i; i < e_max; i++){
    						npc s = Screen->CreateNPC(s1);
    						s->X = this->X;s->Y = this->Y;
    					}
    				}
    				if(s2>0){
    					for(int i; i < e_max; i++){
    						npc s = Screen->CreateNPC(s2);
    						s->X = this->X;s->Y = this->Y;
    					}
    				}
    				if(s3>0){
    					for(int i; i < e_max; i++){
    						npc s = Screen->CreateNPC(s3);
    						s->X = this->X;s->Y = this->Y;
    					}
    				}
    				if(s4>0){
    					for(int i; i < e_max; i++){
    						npc s = Screen->CreateNPC(s4);
    						s->X = this->X;s->Y = this->Y;
    					}
    				}
    				Waitframe();
    				this->Data = 0;
    				Quit();
    			}
    			else{
    				this->X = e->X;
    				this->Y = e->Y;
    			}
    		Waitframe();	
    		}        
    	}
    }
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social