Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub EVENT_SAY {
- if ($text=~/#MemmedInfo/i) {
- MemmedCountList();
- }
- }
- sub MemmedCountList {
- my $client = plugin::val('client');
- my $memmed_count = $client->MemmedCount();
- my $message = "You currently have $memmed_count memmed spells.<br>
- <table>
- <tr>
- <td>" . plugin::PWColor("Slot", "Yellow") . "</td>
- <td>" . plugin::PWColor("Spell ID", "Royal Blue") . "</td>
- <td>" . plugin::PWColor("Spell Name", "Royal Blue") . "</td>
- </tr>";
- for (my $i = 0; $i < 13; $i++) {
- if ($client->FindMemmedSpellBySlot($i) != 0) {
- my $spell_id = $client->FindMemmedSpellBySlot($i);
- my $spell_name = plugin::GetSpellName($spell_id);
- $message .= "<tr>";
- $message .= "<td>" . plugin::PWColor($i, "Yellow") . "</td>";
- $message .= "<td>" . plugin::PWColor($spell_id, "Royal Blue") . "</td>";
- $message .= "<td>" . $spell_name . "</td>";
- $message .= "</tr>";
- }
- }
- $message .= "</table>";
- plugin::Popup("Memmed Info", $message, 0, 999);
- }
- sub GetSpellName {
- my $spell_id = shift;
- my $dbh = plugin::LoadMysql();
- my $sth = $dbh->prepare("SELECT `name` FROM `spells_new` WHERE `id` = '$spell_id'");
- $sth->execute();
- if ($sth->rows() > 0) {
- my @data = $sth->fetchrow_array();
- return plugin::PWColor($data["name"], "Light Blue");
- } else {
- return plugin::PWColor("INVALID SPELL", "Light Blue");
- }
- $sth->finish();
- $dbh->disconnect();
- }
Advertisement
Add Comment
Please, Sign In to add comment