Callmephil

Untitled

Jan 17th, 2015
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.62 KB | None | 0 0
  1.                     case 1715:
  2.                     {
  3.                         if ((caster->HasAura(12289) || caster->HasAura(12668))) //
  4.                         {
  5.                             QueryResult test = CharacterDatabase.PQuery("SELECT * FROM hamstring WHERE plrguid = '%u'", caster->GetGUIDLow());
  6.                             if (!test)
  7.                                 CharacterDatabase.PExecute("INSERT INTO `hamstring` (`plrguid`) VALUES ('%u')", caster->GetGUIDLow());
  8.                             else
  9.                                 CharacterDatabase.PExecute("UPDATE `hamstring` SET `stack` = (stack+1) WHERE plrguid = '%u'", caster->GetGUIDLow());
  10.                         }
  11.                         caster->ToPlayer()->AddSpellCooldown(23694, 0, uint32(time(NULL) + 0.1));
  12.                             sLog->outError(LOG_FILTER_SQL, "STACK +1 added ON caster ");
  13.                     case 23694:
  14.                     {
  15.                         QueryResult stackhack = CharacterDatabase.PQuery("SELECT stack FROM hamstring WHERE plrguid = '%u' AND stack >= 2", caster->GetGUIDLow());
  16.                         if (!stackhack) {
  17.                             sLog->outError(LOG_FILTER_SQL, "NOT FOUND ");
  18.                             return;
  19.                         }
  20.                         else
  21.                         //  if (!caster->ToPlayer()->HasSpellCooldown(23694))
  22.                             {// If he already has hamstring
  23.                                 sLog->outError(LOG_FILTER_SQL, "SPELL IS CASTED");
  24.                                 caster->CastSpell(target, 23694, true);
  25.                                 CharacterDatabase.PExecute("UPDATE `hamstring` SET `stack` = 0 WHERE plrguid = '%u'", caster->GetGUIDLow());
  26.                                 if (caster->HasAura(12289)) // Improved Hamstring rank 1
  27.                                     caster->ToPlayer()->AddSpellCooldown(23694, 0, uint32(time(NULL) + 60)); // Add 60 seconds cooldown
  28.                                 if (caster->HasAura(12668)) // Improved Hamstring rank 2
  29.                                     caster->ToPlayer()->AddSpellCooldown(23694, 0, uint32(time(NULL) + 30)); // Add 60 seconds cooldown
  30.                             }
  31.                         }
  32.                     }
  33.                     break;
Advertisement
Add Comment
Please, Sign In to add comment