Advertisement
ZoriaRPG

ZC Hedge Clip Reward / Secret

Nov 18th, 2016
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.67 KB | None | 0 0
  1. //////////////////////////////////
  2. /// Hedge Clip Reward / Secret ///
  3. /// v0.1.2 - 19-Nov-2016       ///
  4. /// By: ZoriaRPG               ///
  5. //////////////////////////////////
  6.  
  7. ffc script HedgeClip{
  8.     void run(int cmb_bush, int itm, int sfx, int layer, int reg){
  9.         int q; bool bush;
  10.         if ( Screen->D[reg] || layer < 0 || layer > 6 || cmb_bush == 0 || itm < 0 ) { this->Data = 0; this->Script = 0; Quit(); }
  11.         if ( layer > 0 && layer < 7 && ( Screen->LayerMap(layer) < 0 || Screen->LayerScreen(layer) < 0 ) ) { this->Data = 0; this->Script = 0; Quit(); }
  12.  
  13.         while( !Screen->D[reg] ){
  14.             if ( cmb_bush > 0 ) {
  15.                 for ( q = 0; q < 176; q++ ) {
  16.                     if ( layer ==  0 ) {
  17.                         if ( ComboD[q] == cmb_bush ) { bush = true; break; }
  18.                     }
  19.                     if ( layer > 0 ) {
  20.                         if ( GetLayerComboD(layer,q) == cmb_bush ) { bush = true; break; }
  21.                     }
  22.                 }
  23.             }
  24.             if ( cmb_bush < 0 ) {
  25.                 for ( q = 0; q < 176; q++ ) {
  26.                     if ( layer == 0 ) {
  27.                         if ( ComboT[q] == CT_SLASHNEXT ) { bush = true; break; }
  28.                     }
  29.                     if ( layer > 0 ) {
  30.                         if ( GetlayerComboT(layer,q) == CT_SLASHNEXT ) { bush = true; break; }
  31.                     }
  32.                 }
  33.             }
  34.             if ( !bush ) {
  35.                 if ( sfx ) Game->PlaySound(sfx);
  36.                 item i = Screen->CreateItem(itm);
  37.                 i->X = this->X;
  38.                 i->Y = this->Y;
  39.                 Screen->D[reg] = 1;
  40.             }
  41.             Waitframe();
  42.         }
  43.         this->Data = 0; this->Script = 0; Quit();
  44.     }
  45. }
  46.  
  47. //For placing the reward on another screen.
  48.  
  49. ffc script HedgeClipRemote{
  50.     void run(int cmb_bush, int itm, int sfx, int layer, int reg, int dmap, int screen){
  51.         int q; bool bush;
  52.         if ( GetDMapScreenD(dmap,screen,reg) || layer < 0 || layer > 6 || cmb_bush == 0 || itm < 0 ) { this->Data = 0; this->Script = 0; Quit(); }
  53.         if ( layer > 0 && layer < 7 && ( Screen->LayerMap(layer) < 0 || Screen->LayerScreen(layer) < 0 ) ) { this->Data = 0; this->Script = 0; Quit(); }
  54.        
  55.         while( !GetDMapScreenD(dmap,screen,reg){
  56.             if ( cmb_bush > 0 ) {
  57.                 for ( q = 0; q < 176; q++ ) {
  58.                     if ( layer ==  0 ) {
  59.                         if ( ComboD[q] == cmb_bush ) { bush = true; break; }
  60.                     }
  61.                     if ( layer > 0 ) {
  62.                         if ( GetLayerComboD(layer,q) == cmb_bush ) { bush = true; break; }
  63.                     }
  64.                 }
  65.             }
  66.             if ( cmb_bush < 0 ) {
  67.                 for ( q = 0; q < 176; q++ ) {
  68.                     if ( layer == 0 ) {
  69.                         if ( ComboT[q] == CT_SLASHNEXT ) { bush = true; break; }
  70.                     }
  71.                     if ( layer > 0 ) {
  72.                         if ( GetlayerComboT(layer,q) == CT_SLASHNEXT ) { bush = true; break; }
  73.                     }
  74.                 }
  75.             }
  76.             if ( !bush ) {
  77.                 if ( sfx ) Game->PlaySound(sfx);
  78.                 item i = Screen->CreateItem(itm);
  79.                 i->X = this->X;
  80.                 i->Y = this->Y;
  81.                 SetDMapScreenD(dmap,screen,reg,1)
  82.             }
  83.             Waitframe();
  84.         }
  85.         this->Data = 0; this->Script = 0; Quit();
  86.     }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement