Advertisement
ZoriaRPG

Hate Spell Item (Bane Weapon)

Sep 5th, 2019
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  1. item script hatespell
  2. {
  3.     void run(int errSfx, int affectedItemClass, int multiplier)
  4.     {
  5.         bool do_disable;
  6.         if ( Game->Counter[this->CostCounter] < this->Cost )
  7.         {
  8.             Audio->PlaySound(errSfx); Quit();
  9.         }
  10.        
  11.         int tempitmpower[256];
  12.         for ( int q = 0; q < 256; ++q )
  13.         {
  14.             itemdata theItem = Game->LoadItemData(q);
  15.             if ( theItem->Class == affectedItemClass )
  16.             {
  17.                 tempitmpower[q] = theItem->Power+1;
  18.                 theItem->Power *= multiplier;
  19.             }
  20.         }
  21.         while((Game->Counter[this->CostCounter] -= this->Cost) > 0)
  22.         {
  23.             if (( Hero->PressA && Hero->ItemA == this->ID ) ||( Hero->PressB && Hero->ItemB == this->ID ) )
  24.             {
  25.                 break;
  26.             }
  27.             Waitframe();
  28.         }
  29.         Audio->PlaySound(this->UseSound);
  30.         for ( int q = 0; q < 256; ++q )
  31.         {
  32.             itemdata theItem = Game->LoadItemData(q);
  33.             if ( theItem->Class == affectedItemClass )
  34.             {
  35.                 if ( tempitmpower[q] )
  36.                 {
  37.                     theItem->Power = tempitmpower[q]-1;
  38.                 }
  39.             }
  40.         }  
  41.         Quit();
  42.     }
  43.        
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement