ZoriaRPG

Wind NPCs to Dungeon Entrance

Mar 11th, 2018
94
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Wind removes enemies
  2.  
  3. void WindRemovesEnemies(){
  4.     if ( NumEWeaponsOf(EW_WIND) {
  5.         for ( int q = 1; q <= Screen->NumEWeapons(); q++ ) {
  6.             eweapon e = Screen->LoadEweapon(q);
  7.             for ( int w = 1; w <= Screen->NumNPCs(); q++ ) {
  8.                 npc n = Screen->LoadNPC(w);
  9.                 if ( Collision(e,n) ) remove(e);
  10.             }
  11.         }
  12.     }
  13. }
  14.  
  15. void WindRemovesEnemies(int list){
  16.     mool batch;
  17.     if ( NumEWeaponsOf(EW_WIND) {
  18.         for ( int q = 1; q <= Screen->NumEWeapons(); q++ ) {
  19.             eweapon e = Screen->LoadEweapon(q);
  20.             for ( int w = 1; w <= Screen->NumNPCs(); q++ ) {
  21.                 npc n = Screen->LoadNPC(w);
  22.                 for ( int r = 0; r < SizeOfArray(list); r++ ) {
  23.                     (if n->ID == list[r] ) match = true;
  24.                 }
  25.                 if ( Collision(e,n) && match ) remove(e);
  26.             }
  27.         }
  28.     }
  29. }
  30.  
  31. void WindSendsEnemyToStart(int list){
  32.     bool batch;
  33.     if ( NumEWeaponsOf(EW_WIND) {
  34.         for ( int q = 1; q <= Screen->NumEWeapons(); q++ ) {
  35.             eweapon e = Screen->LoadEweapon(q);
  36.             for ( int w = 1; w <= Screen->NumNPCs(); q++ ) {
  37.                 npc n = Screen->LoadNPC(w);
  38.                 for ( int r = 0; r < SizeOfArray(list); r++ ) {
  39.                     (if n->ID == list[r] ) match = true;
  40.                 }
  41.                 if ( Collision(e,n) && match ) {
  42.                     //find an empty slot in the array and store the enemy:
  43.                     for ( int t = 0; t < 254; t++ ) {
  44.                         if ( !EnemiesSentToStart[t] ) EnemiesSentToStart[t] = n->ID;
  45.                     }
  46.                     remove(e);
  47.                 }
  48.             }
  49.         }
  50.     }
  51. }
  52.  
  53. void WindSendsEnemyToStart(){
  54.     bool batch;
  55.     int EnemiesImmuneToWind[]={0}; //List all the enemy IDs *NOT* to affect by this.
  56.     if ( NumEWeaponsOf(EW_WIND) {
  57.         for ( int q = 1; q <= Screen->NumEWeapons(); q++ ) {
  58.             eweapon e = Screen->LoadEweapon(q);
  59.             for ( int w = 1; w <= Screen->NumNPCs(); q++ ) {
  60.                 npc n = Screen->LoadNPC(w);
  61.                 for ( int r = 0; r < SizeOfArray(EnemiesImmuneToWind); r++ ) {
  62.                     (if n->ID == EnemiesImmuneToWind[r] ) match = true;
  63.                 }
  64.                 if ( Collision(e,n) && !match ) {
  65.                     //find an empty slot in the array and store the enemy:
  66.                     for ( int t = 0; t < 254; t++ ) {
  67.                         if ( !EnemiesSentToStart[t] ) EnemiesSentToStart[t] = n->ID;
  68.                     }
  69.                     remove(e);
  70.                 }
  71.             }
  72.         }
  73.     }
  74. }
  75.  
  76. void WindSendsEnemyToStart(lweapon l){
  77.     bool batch;
  78.     int EnemiesImmuneToWind[]={0}; //List all the enemy IDs *NOT* to affect by this.
  79.     for ( int w = 1; w <= Screen->NumNPCs(); q++ ) {
  80.         npc n = Screen->LoadNPC(w);
  81.         for ( int r = 0; r < SizeOfArray(EnemiesImmuneToWind); r++ ) {
  82.             (if n->ID == EnemiesImmuneToWind[r] ) match = true;
  83.         }
  84.         if ( Collision(l,n) && !match ) {
  85.             //find an empty slot in the array and store the enemy:
  86.             for ( int t = 0; t < 254; t++ ) {
  87.                 if ( !EnemiesSentToStart[t] ) EnemiesSentToStart[t] = n->ID;
  88.             }
  89.             remove(e);
  90.         }
  91.     }
  92. }
  93.  
  94. void WindSendsEnemyToStart(eweapon l){
  95.     bool batch;
  96.     int EnemiesImmuneToWind[]={0}; //List all the enemy IDs *NOT* to affect by this.
  97.     for ( int w = 1; w <= Screen->NumNPCs(); q++ ) {
  98.         npc n = Screen->LoadNPC(w);
  99.         for ( int r = 0; r < SizeOfArray(EnemiesImmuneToWind); r++ ) {
  100.             (if n->ID == EnemiesImmuneToWind[r] ) match = true;
  101.         }
  102.         if ( Collision(l,n) && !match ) {
  103.             //find an empty slot in the array and store the enemy:
  104.             for ( int t = 0; t < 254; t++ ) {
  105.                 if ( !EnemiesSentToStart[t] ) EnemiesSentToStart[t] = n->ID;
  106.             }
  107.             remove(e);
  108.         }
  109.     }
  110. }
  111.  
  112. void WindSendsEnemyToStart(ffc l){
  113.     bool batch;
  114.     int EnemiesImmuneToWind[]={0}; //List all the enemy IDs *NOT* to affect by this.
  115.     for ( int w = 1; w <= Screen->NumNPCs(); q++ ) {
  116.         npc n = Screen->LoadNPC(w);
  117.         for ( int r = 0; r < SizeOfArray(EnemiesImmuneToWind); r++ ) {
  118.             (if n->ID == EnemiesImmuneToWind[r] ) match = true;
  119.         }
  120.         if ( Collision(l,n) && !match ) {
  121.             //find an empty slot in the array and store the enemy:
  122.             for ( int t = 0; t < 254; t++ ) {
  123.                 if ( !EnemiesSentToStart[t] ) EnemiesSentToStart[t] = n->ID;
  124.             }
  125.             remove(e);
  126.         }
  127.     }
  128. }
  129.  
  130. ffc script EnemiesWindedToStart{
  131.     void run(minX, int maxX, int minY, int maxY){
  132.         int enemX;
  133.         int enemY;
  134.         //bool done = false;
  135.         Waitframes(5);
  136.         //while ( !done ) {
  137.         for ( int q = 0; q < 254; q++ ) {
  138.             if ( EnemiesSentToStart[q] ) {
  139.                 do {
  140.                     enemX = Rand(minX, maxX);
  141.                     enemY = Rand(minY, maxY);
  142.                 } while ( ( ComboSolid(enemX) || ComboWater(enemX) ) && ComboSolid(enemX) || ComboWater(enemY) ) );
  143.                 npn n = ScreenCreateNPC(EnemiesSentToStart[q]);
  144.                 n->X = enemX;
  145.                 n->Y = enemY;
  146.             }
  147.             if ( !EnemiesSentToStart[q] ) break; //if we reach an empty slot, return.
  148.         }
  149.     }
  150. }
  151.  
  152. int EnemiesSentToStart[255]; //Holds the enemies sent back to the start by wind.
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×