ZoriaRPG

Scripted Din's Fire v0.1.1

Sep 8th, 2019
156
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Scriptd Din's Fire; v0.1.1; 8th September, 2019; ZoriaRPG
  2. item script dinsfire
  3. {
  4.     const int MAX_FIRES = 8;
  5.     const int POWER = 4;
  6.     const int STEP = 100;
  7.     void run(int firesfx)
  8.     {
  9.         int old_hyof = Hero->HitYOffset;
  10.         Hero->HitYOffset = -32768;
  11.         lweapon fires[MAX_FIRES];
  12.         int indx = 0;
  13.         for(int flamecounter=((-1)*(MAX_FIRES/2))+1; flamecounter<=((MAX_FIRES/2)+1); flamecounter++)
  14.         {
  15.             Audio->PlaySound(firesfx);
  16.             lweapon fl = Screen->CreateLWeapon(LW_FIRE);
  17.             fl->X = Link->Xl
  18.             fl->Y = Link->Y
  19.             fl->Power = POWER;
  20.             fl->Dir = (flamecounter<MAX_FIRES ? DIR_LEFT : DIR_RIGHT);
  21.             fl->Step = STEP;
  22.             fl->Angular = true;
  23.             fl->Angle = (flamecounter*PI/(MAX_FIRES/2.0));
  24.             fl->Misc[17] = 1;
  25.             fires[indx] = fl;
  26.             ++indx;
  27.         }
  28.         while(1)
  29.         {
  30.             int firesalive;
  31.             Hero->Action = LA_HOLD2LAND;
  32.             Hero->HeldItem = this->ID;
  33.             for ( int q = 0; q < MAX_FIRES; ++q )
  34.             {
  35.                 if ( fires[q]->isValid() ) { ++firesalive; }
  36.             }
  37.             if ( firesalive )
  38.             {
  39.                 Waitframe();
  40.             }
  41.             else break;
  42.         }
  43.         Hero->Action = LA_NONE;
  44.         Hero->HitYOffset = old_hyof;
  45.         Quit();
  46.     }
  47. }
RAW Paste Data