Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub EVENT_SAY {
- my @statlist = ("astr", "asta", "aagi", "adex", "acha", "aint", "awis", "hp", "mana", "endur", "ac",
- "damage", "haste", "heroic_str", "heroic_sta", "heroic_agi", "heroic_dex",
- "heroic_cha", "heroic_int", "REMOVE");
- my @statlist2 = ("astr2", "asta2", "aagi2", "adex2", "acha2", "aint2", "awis2", "hp2", "mana2", "endur2", "ac2",
- "damage2", "haste2", "heroic_str2", "heroic_sta2", "heroic_agi2", "heroic_dex2",
- "heroic_cha2", "heroic_int2", "REMOVE2");
- my @firststat = ();
- my @firststat2 = ();
- if($text=~/^hail/i)
- {
- plugin::Whisper("Hand me platinum if you wish to purchase items from the bazaar!");
- $client->Message(335, "["
- . quest::saylink("First stat", 1, "Primary Stat")
- . "] ["
- . quest::saylink("Second stat", 1, "Secondary Stat")
- . "]"
- );
- $client->Message(335, " ");
- $client->Message(335, "["
- . quest::saylink("#bazaar list", 1, "List Items")
- . "] - List bazaar items (If primary stat set it will narrow down the results)"
- );
- $client->Message(335, " ");
- $client->Message(335, "["
- . quest::saylink("#mybazaar", 1, "My Items")
- . "] - List items you have for sale. (Allows you to remove them as well)"
- );
- $client->Message(335, " ");
- $client->Message(335, "NOTE: Type #commandlist for a list of commands!");
- $client->Message(335, " ");
- }
- elsif($text=~/^First stat$/i)
- {
- plugin::Whisper("Choose a Primary stat if you wish to choose by stat!");
- foreach $L (@statlist)
- {
- if($statlist[$#statlist] eq $L)
- {
- push(@firststat,"" . quest::saylink("$L",1)."");
- }
- else
- {
- push(@firststat,"" . quest::saylink("$L",1).", ");
- }
- }
- $client->Message(335, "@firststat");
- }
- elsif($text=~/^Second stat$/i)
- {
- plugin::Whisper("Choose a Secondary stat if you wish to choose by stat!");
- foreach $L (@statlist2)
- {
- if($statlist2[$#statlist2] eq $L)
- {
- push(@firststat2,"" . quest::saylink("$L",1, STATFIX("$L"))."");
- }
- else
- {
- push(@firststat2,"" . quest::saylink("$L",1, STATFIX("$L")).", ");
- }
- }
- $client->Message(335, "@firststat2");
- }
- elsif( grep { $_ eq $text } @statlist )
- {
- plugin::Whisper("Primary search stat set to $text");
- $client->SetEntityVariable("STATONE", "$text");
- }
- elsif( grep { $_ eq $text } @statlist2 )
- {
- $text = STATFIX($text);
- plugin::Whisper("Secondary search stat set to $text");
- $client->SetEntityVariable("STATTWO", "$text");
- }
- }
- sub EVENT_ITEM {
- my $charid = $client->CharacterID();
- if($platinum > 0)
- {
- $dbh = DBI_CONNECT();
- $sth = $dbh->do("UPDATE auction_house_money SET platinum = platinum + $platinum WHERE charid = $charid");
- $sth = $dbh->prepare("SELECT platinum FROM auction_house_money WHERE charid = $charid");
- $sth->execute();
- my $money = $sth->fetchrow_array();
- $sth->finish();
- $dbh->disconnect();
- plugin::Whisper("You now have $money platinum!");
- }
- }
- sub DBI_CONNECT {
- use DBI;
- $database = "peq";
- $host = "localhost";
- $username = "root";
- $password = "PASSWORD";
- $dbh = DBI->connect("DBI:mysql:database=$database;host=$host", "$username", "$password", {RaiseError => 1});
- return $dbh;
- }
- sub STATFIX
- {
- local $_ = shift;
- s/[^A-Za-z_ ]+//g;
- return $_;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement