ZoriaRPG

Magic Container Pieces

Mar 1st, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. int TotalMagicPIECES = 0;
  2. //For the subscreen. Four items, of one custom type, set as levels 1, 2, 3, 4
  3. const int I_MPIECE0 = 100; //none, L1; assign in Link Init Data
  4. const int I_MPIECE1 = 101; //L2
  5. const int I_MPIECE2 = 102; //L3
  6. const int I_MPIECE3 = 103; //L4
  7.  
  8. //item collect script
  9. item script magicpiece
  10. {
  11.     void run()
  12.     {
  13.         ++TotalMagicPIECES;
  14.         if ( TotalMagicPIECES >= 4 )
  15.         {
  16.             TotalMagicPIECES = 0;
  17.             Link->MaxMP += 32;
  18.             Link->MP += 32;
  19.             Link->Item[I_MPIECE1] = false;
  20.             Link->Item[I_MPIECE2] = false;
  21.             Link->Item[I_MPIECE3] = false;
  22.         }
  23.         else
  24.         {
  25.             if ( TotalMagicPIECES == 1 ) Link->Item[I_MPIECE1] = true;
  26.             if ( TotalMagicPIECES == 2 ) Link->Item[I_MPIECE2] = true;
  27.             if ( TotalMagicPIECES == 3 ) Link->Item[I_MPIECE3] = true;
  28.            
  29.         }
  30.     }
  31. }
Add Comment
Please, Sign In to add comment