Advertisement
NatedogServer

GM commands

May 9th, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. if($status >= 250)
  2. {
  3. if($text=~/^#hate$/i)
  4. {
  5. my $n = 1;
  6. my $CTarg = $client->GetTarget();
  7. my $CTarget = $CTarg->CastToNPC();
  8. my $Targ_Name = $CTarget->GetCleanName();
  9. my @hatelist = $CTarget->GetHateList();
  10. my @hatetable = "<table><TR><TD>#<TD>$Yel NAME </c><TD>$Red DMG </c><TD>$orange HATE </c><TD>";
  11. foreach $ent (@hatelist)
  12. {
  13. my $h_ent = $ent->GetEnt();
  14. my $h_dmg = $ent->GetDamage();
  15. my $h_hate = $ent->GetHate();
  16. my $h_dmg2 = plugin::commify($h_dmg);
  17. my $h_hate2 = plugin::commify($h_hate);
  18.  
  19. if($h_ent && $n <= 15)
  20. {
  21. my $h_ent_name = $h_ent->GetName();
  22. push(@hatetable, "<TR><TD>$n<TD>$Yel $h_ent_name </c><TD>$Red $h_dmg2 </c><TD>$orange $h_hate2 </c><TD>");
  23. $n++;
  24. }
  25. }
  26. push(@hatetable, "</table>");
  27. quest::popup("$Targ_Name\'s Hatelist", "@hatetable");
  28. }
  29.  
  30. if($text=~/^find/i)
  31. {
  32. use DBI;
  33. my $find_char = substr($text,5);
  34. $client->Message(315,"$find_char\'s Instances");
  35. $database = "peq";
  36. $host = "localhost";
  37. $username = "root";
  38. $password = "PASSWORDHERE";
  39. $dbh = DBI->connect("DBI:mysql:database=$database;host=$host", "$username", "$password", {RaiseError => 1});
  40. $sth = $dbh->prepare("SELECT id FROM character_ WHERE name = '$find_char'");
  41. $sth->execute();
  42. my $play_id = $sth->fetchrow_array();
  43. $sth->finish ();
  44. if($play_id > 0)
  45. {
  46. #$sth = $dbh->prepare("SELECT id FROM instance_lockout_player WHERE charid = '$play_id'");
  47. $sth = $dbh->prepare("SELECT instance_lockout_player.id, zone.short_name FROM instance_lockout_player INNER JOIN instance_lockout ON instance_lockout_player.id = instance_lockout.id INNER JOIN zone ON zone.zoneidnumber = instance_lockout.zone WHERE instance_lockout_player.charid = '$play_id'");
  48. $sth->execute();
  49. while (my ($each_id, $z_sn) = $sth->fetchrow_array())
  50. {
  51. my $saylink = quest::saylink("#zoneinstance $each_id",0, "Join");
  52. $client->Message(315,"$saylink -$find_char - ID $each_id - $z_sn");
  53. quest::AssignToInstance($each_id);
  54. $client->Message(315,"_");
  55. }
  56. $sth->finish ();
  57.  
  58. $dbh->disconnect();
  59. }
  60.  
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement