Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if($text=~/^#store/i)
- {
- my $qitem = $client->GetItemAt(30);
- my $itemid = $client->GetItemIDAt(30);
- if($qitem)
- {
- ## WE HAVE AN ITEM ZOMG NOW CHECK FOR NO DROP
- $dbh = DBI_CONNECT();
- $query = "SELECT nodrop FROM items WHERE id = $itemid";
- $sth = $dbh->prepare($query);
- $sth->execute();
- my $nodrop = $sth->fetchrow_array();
- if($nodrop == 0 || $qitem->IsAttuned())
- {
- $client->Message(335, "That item is No Trade!");
- $sth->finish();
- $dbh->disconnect();
- return;
- }
- #ITEM IS TRADEABLE CONTINUE!
- if($qitem->GetCharges() > 1)
- {
- $charges = $qitem->GetCharges();
- }
- else
- {
- $charges = 1;
- }
- my $accid = $client->AccountID();
- my $itemid = $qitem->GetID();
- my $itemname = $qitem->GetName();
- $sth = $dbh->prepare("SELECT max(slot) FROM storage
- WHERE accid = $accid
- ");
- $sth->execute();
- my $SLOT = $sth->fetchrow_array()+1;
- $query = "INSERT INTO storage VALUES ($accid, $SLOT, $itemid, $charges)";
- $sth = $dbh->do($query);
- $client->Message(335, "$charges - $itemname now in Storage!");
- $client->DeleteItemInInventory(30, 0, true);
- }
- $sth->finish();
- $dbh->disconnect();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement