Loading...
Field Name | Field Description | Field Type | Field Default Value |
name | The name you put in the book column in the items table. Items | varchar(30) | Empty String |
txtfile | The text in the book. ` Represents line spaces, `` is two line spaces, ``` is three line spaces, etc. (13 lines per book "page") | text(0) | Empty |
Note:
This is something best tested in game. Akkadius and Secrets have implemented the $client->ReadBook(Book Text, type) bit for our use. Here is an example of how it might be used from a dev perspective. Add this to a zone's player.pl and simply say "read VandV2" (VandV2 comes from the books table and is the name of a book relating to Varsoon).
if($text =~ /read /i && $status >= 200) { my $sth; my $book = substr($text, 5); # grab text after "read " my $connect = LoadMySQLConnection(); # Connect to DB subroutine my $query = "SELECT txtfile FROM books WHERE name = '$book' LIMIT 1"; my $sth = $connect->prepare($query); $sth->execute(); my $found = $sth->fetchrow(); $sth->finish(); $connect->disconnect(); if($found ne "") { # type 0 is scroll with ~25 line limit, type 1 is book with 13 line limit $client->ReadBook("$found", 1); } else { quest::gmsay("Book [$book] not found.", 18); } }