Guest User

Untitled

a guest
Jun 13th, 2019
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. sub EVENT_SAY {
  2. if ($text=~/#BuffInfo/i) {
  3. BuffCountList();
  4. }
  5. }
  6.  
  7. sub BuffCountList {
  8. my $buff_count = $client->BuffCount();
  9. my $message = "<table>
  10. <tr>
  11. <td>" . plugin::PWColor("Slot", "Yellow") . "</td>
  12. <td>" . plugin::PWColor("Spell ID", "Royal Blue") . "</td>
  13. <td>" . plugin::PWColor("Spell Name", "Royal Blue") . "</td>
  14. </tr>";
  15. for (my $i = 0; $i < 64; $i++) {
  16. if ($client->FindBuffBySlot($i) != 0) {
  17. my $spell_id = $client->FindBuffBySlot($i);
  18. my $spell_name = GetSpellName($spell_id);
  19. $message .= "<tr>";
  20. $message .= "<td>" . plugin::PWColor($i, "Yellow") . "</td>";
  21. $message .= "<td>" . plugin::PWColor($spell_id, "Royal Blue") . "</td>";
  22. $message .= "<td>" . $spell_name . "</td>";
  23. $message .= "</tr>";
  24. }
  25. }
  26. $message .= "</table>";
  27. quest::popup("Buff Info", $message);
  28. }
  29.  
  30. sub GetSpellName {
  31. my $spell_id = shift;
  32. my $dbh = plugin::LoadMysql();
  33. my $sth = $dbh->prepare("SELECT `name` FROM `spells_new` WHERE `id` = '$spell_id'");
  34. $sth->execute();
  35. if ($sth->rows() > 0) {
  36. my @data = $sth->fetchrow_array();
  37. return plugin::PWColor($data["name"], "Light Blue");
  38. } else {
  39. return plugin::PWColor("INVALID SPELL", "Light Blue");
  40. }
  41. $sth->finish();
  42. $dbh->disconnect();
  43. }
Advertisement
Add Comment
Please, Sign In to add comment