Advertisement
ZoriaRPG

ZC Control over Wand Fire Damage

Nov 19th, 2016
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.22 KB | None | 0 0
  1. void WandFireDamage(int pow){
  2.     for ( int q = 1; q <= Screen->NumLWeapons(); q++ ) {
  3.         if ( !Screen->NumLWeapons ) break;
  4.         lweapon l = Screen->LoadLWeapon(q);
  5.         if ( l->isValid && l->Type == LW_FIRE && WandFire ) {
  6.             for ( int w = 1; w <= Screen->NumNPCs(); w++ )
  7.             npc n = Screen->LoadNPC(w);
  8.             if ( n->Type == NPCT_GUY ||  n->Type == NPCT_FAIRY ||  n->Type == NPCT_ROCK
  9.                 ||  n->Type == NPCT_PROJECTILE ||  n->Type == NPCT_NONE ) continue;
  10.             if ( Collision(l,n) l->Power = pow;
  11.         }
  12.     }
  13. }
  14.            
  15.        
  16. item script Wand{
  17.     void run(){
  18.         WandFire = true;
  19.     }
  20. }
  21.  
  22. bool WandFire;
  23.  
  24. void ClearWandFire(){
  25.     int itmA = GetEquipmentA();
  26.     int itmB = GetEquipmentB();
  27.     bool fireExists;
  28.     if ( itmA != I_WAND || itmB != I_WAND && WandFire ) WandFire = false;
  29.     if ( itmA == I_WAND || itmB == I_WAND && WandFire ) {
  30.         if ( !Screen->NumLWeapons() ) WandFire = false;
  31.         else {
  32.             for ( int q = 1; q <= Screen->NumLWeapons(); q++ ) {
  33.                 lweapon l = Screen->LoadLWeapon(q);
  34.                 if ( l=>Type == LW_FIRE ) continue;
  35.                 if ( l->Type != LW_FIRE && q == Screen->NumLWeapons ) WandFire = false;
  36.             }
  37.         }
  38.     }
  39. }
  40.            
  41.  
  42. global script active{
  43.     void run(){
  44.         WandFireDamage(6);
  45.         Waitdraw();
  46.         ClearWandFire();
  47.         Waitframe();
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement